Fading out chores remain in playing state until they have completely faded out. Also using StopChore on a fading out chore will actually stop the chore, unlike in Grim where the chore will keep fading out.
Some chores need to stay active even after a call to
StopAllChores(). E.g. the hold chores should stay active
even after changing the set (which calls StopAllChores()).
It looks like that the previously unknown boolean paramter
of StopAllChores() controls that behavior. If set to TRUE,
stop only the non-looping chores.
This patch fixes:
- hold chore was lost when switching sets
- blue painting did not show the ultimate insult when opening
the inventory
- use the costumeName instead of a pointer to the costume object to
check, whether the current costume matches the requested one
- this fixes an uninitialized pointer read
- the costumes are handled on a stack per Actor
- the last costume is considered the current one
- currently, the costumes are never removed from from the stack
- this causes an issue when Guybrush is using its original
costume first, later the monkey robot costume for the final Monkey Kombat
and then again the standard costume (the robot costume will remain the last
on the stack and cosidered the current one - this causes a problem
when attaching the head actor since the robot has different joints
than guybrush with the standard costume)
- if a new wear chore is set and it uses a different costume than the
current one and neither of them is the shadow costume remove the old
costume before setting the new one
- additionally, this patch makes sure, that all active chores of all
costumes on the stack of an actor are stopped
- for solving the Monkey Kombat puzzle it is necessary that a kombat is
triggered when Guybrush runs into one of the monkeys on the map
- implement SetActorCollisionMode and SetActorCollisionScale
- add EMI-specific calculations for retrieving the sphere data for the
actors (and some minor refactoring for better readability)
The following changes may alter the behaviour in GRIM, too:
- in Actor::collisionHandlerCallback(), call the collision handler for
both affected objects (that is necessary since only one actor may have
a collision handler associated in lua but it may happen that the
character with the handler is standing still and the other one is run
into him)
- Actor::handleCollisionTo() did only update a given position to ensure
that there is no collision - so it is necessary to actually check for
collisions and execute the lua callback if necessary (via
Actor::handleCollisionWith())
- the order of the active actors is based on the effective sort order
which is based on the sortorder of actors itself but also on the
attached actors
- invalidate the sortorder also when detaching actors
- this fixes two glitches in the final end scene (guybrush is still
displayed after falling from the cliff and monkey robot is drawn in
the foreground)
IsActorChoring takes different parameters in EMI than it does in Grim,
the original code was prudent enough about checking it’s parameters that
it actually ran fine, however the problem was that the argument that
said whether we should ignore looping chores was moved. This lets the
intro play the cut scene on the docks.
The turn rate for the chair of the voodoo lady is set to 1 in the lua
code which makes the turn animation very slow (> 30s).
Since the rate value of 1 is not used otherwise in EMI, adjust the
turnrate in this case.