Commit Graph
451 Commits
Author SHA1 Message Date
Joel Teichroeb 7cf3f2f99c GRIM: Add a constructor for Shadow
This lets us get rid of the loop in Actor and lets us ensure
that Shadow is initizlied even if constructed elsewhere.
2014-01-23 10:22:44 -08:00
Christian Krause 71a44ba28a Merge pull request #797 from chkr-private/collision-fixes
Collision fixes
2014-01-14 14:48:52 -08:00
Christian Krause 5a65ffd470 EMI: Unload the active costume once a different is set
- 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
2014-01-08 23:19:46 +01:00
Christian Krause ce9239412d EMI/GRIM: Implement collision handling for EMI
- 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())
2014-01-07 03:21:52 +01:00
Einar Johan Trøan Sømåen c66b1b4c27 Merge pull request #794 from inguin/emi-walkto
GRIM/EMI: Ignore Actor:walkTo() if destination is unreachable
2013-12-29 08:26:43 -08:00
Ingo van Lil 82b3aa7a81 EMI: Ignore Actor:walkTo() if destination is unreachable
The path to the Curch of LeChuck has bogus coordinates as out point, so
the game will walk Guybrush to an invalid position when entering that
set. This patch will detect when no path can be found to the destination
position and ignore the walkTo() request in that case.

The behavior for Grim is unchanged in order to avoid the risk of breaking
the game. If the warning is never triggered the distinction can be removed.
2013-12-28 16:18:53 +01:00
Ingo van Lil c5a20438ce EMI: Fix rotation of overworld actors 2013-12-22 22:49:50 +01:00
Ingo van Lil a153d6d0e6 EMI: Save/restore Actor::_lastWearChore 2013-12-10 01:21:00 +01:00
Ingo van Lil 38342e423e EMI: Correct sign error when walking on slopes
Due to a sign error in Actor::walkForward() it is frequently difficult or
impossible to walk on sloped sectors (stairs or ramps), e.g. in Meathook's
place or in front of Pegnose's house.
2013-12-08 20:13:53 +01:00
Joel Teichroeb ff45f66410 Merge pull request #774 from chkr-private/swamp-fixes
EMI: make time paradox solvable
2013-12-06 16:56:12 -08:00
Dries Harnie b1a910c800 GRIM/EMI: Refactor GfxBase::startActorDraw 2013-12-04 14:31:06 +01:00
Christian Krause 4eaa840613 EMI: fix attached actor handling in swamp
Time paradox is now playable.

- local _pos and _yaw values seem to be relative
to the actor where the current actor is attached to

- to accomodate this, Lua_V1::GetVisibleThings,
Actor::getYawTo and Actor::getSimplePuckVector should use
world coordinates
2013-12-02 22:30:51 +01:00
Ingo van Lil 0f95b574b6 EMI: Restart turn chore when changed mid-turn
When the turn chores are changed while an actor is turning the current
chores will be stopped but the new ones won't be started until the turn
direction changes. This can be seen when hitting the run key while
Guybrush is turning.
2013-12-01 00:36:42 +01:00
Ingo van Lil 14e268d7cd EMI: Select the correct turn chore
In EMI's coordinate system, other than in Grim, actors turn right when
the yaw angle is increasing. Select the correct turn chore for the turn
direction.
2013-11-30 10:19:37 +01:00
Joel Teichroeb 58b0bed9ad EMI: Make attached objects use their parents sort order 2013-11-29 16:05:08 -08:00
Ingo van Lil 33005ce43d EMI: Fix actor orientation
EMI uses a different coordinate system than Grim, so we have to switch
dimensions in various places to share common code for walking and turning
actors. This patch fixes several yaw angle sign errors causing actors to
look into wrong directions.
2013-11-27 23:28:54 +01:00
Ingo van Lil 5c4fe71ed2 EMI: Use uint32 to store actor alpha mode
Storing the actor's alpha mode in a byte does not work when the value is
negative (AlphaOff == -1).
2013-11-26 20:37:31 +01:00
Ingo van Lil 4509e4ff34 EMI: Return to original sort order when no sort plane is available
The floor in the Hall of Justice is hidden by a solid gray actor named
"trap plane". This actor is originally positioned far in the background
but moved to the foreground because we can't find a sort plane in the
sector.

This patch stores returns an actor to the original sort order set by
the game script when entering a sector that has no sort information.
2013-11-25 21:16:45 +01:00
Dries Harnie 1927693d4c EMI: Keep actor position after detaching 2013-11-25 19:11:08 +01:00
Ingo van Lil 821cb283fe EMI: Fix crash when talking to Voodoo lady
When asking the Voodoo lady why the island is so empty the engine
quits because the script calls Actor:say_line() with an empty
message.
2013-11-24 15:24:04 +01:00
Joel Teichroeb df6aaee2ef GRIM: Do not shadow setName 2013-10-25 07:53:33 -07:00
Joel Teichroeb 92c48e6637 GRIM: const more paramiters 2013-10-25 07:48:27 -07:00
Joel Teichroeb bd70520832 GRIM: Fix typo (speach -> speech) 2013-10-25 06:41:29 -07:00
Joel Teichroeb c186bc9b80 GRIM: Reduce calls to getNormal 2013-10-24 19:16:06 -07:00
Joel Teichroeb b76ba199b5 GRIM: Reduce calls to getCurrSet 2013-10-24 19:14:22 -07:00
Joel Teichroeb aab084c989 GRIM: Make Actor only use one constructor and initialize all members 2013-10-24 18:59:50 -07:00
Joel Teichroeb b573f35e43 GRIM: Remove unneeded TextObject constructor 2013-10-24 17:52:28 -07:00
Dries Harnie 875cfe12a2 EMI: Restore wear chore upon entering a new set 2013-08-19 21:10:42 +02:00
Dries Harnie 799652e442 EMI: Rotate overworld actors in the right direction 2013-08-07 20:23:07 +02:00
Dries Harnie 92f5deadc5 EMI: Allow sprites to rotate
The clock in mot.set depends on rotating sprites.
2013-08-07 20:05:48 +02:00
Dries Harnie cfd580bbfa EMI: Draw attached actors w/ joint-relative rotation 2013-08-04 15:15:41 +02:00
Dries Harnie b3e406d6f0 EMI: Return an absolute angle from calculateOrientation 2013-07-30 20:02:43 +02:00
Dries Harnie c2f4288680 EMI: Use GetWorldPos recursively 2013-07-30 19:59:00 +02:00
Dries Harnie a5038cd57f EMI: Remember last wear chore, restore it upon entering overworld 2013-07-29 22:02:03 +02:00
Joel Teichroeb 7e87286cb8 EMI: Sort actors seperatly from invalidating the active actors list 2013-07-14 10:16:27 -07:00
Joel Teichroeb 041537a604 EMI: Draw all the Costumes in an Actor's stack 2013-07-10 14:05:14 -07:00
Joel Teichroeb 7399fc6798 EMI: Implement setting actor sort order based on sector sort planes 2013-07-10 09:13:21 -07:00
Einar Johan Trøan Sømåen 52ce315300 GRIM: Replace , with ; 2013-07-09 21:14:11 +02:00
Einar Johan Trøan Sømåen fe3883cecd GRIM: Reformat code to be closer to convention. 2013-07-09 21:12:55 +02:00
Joel Teichroeb 3253b9ba76 GRIM: Remove some redundant code 2013-07-07 21:00:08 -07:00
Dries Harnie 3196c0a0fb EMI: Draw to depth buffer if sortorder >= 100 2013-07-02 00:22:58 +02:00
Dries Harnie 1fd6ca43e6 JANITORIAL: Factor out alpha calculation in Actor::draw 2013-07-02 00:22:58 +02:00
Giulio Camuffo 4aa1296098 GRIM: Don't overshoot walk nodes. Fix #699 2013-02-11 15:47:32 +01:00
Giulio Camuffo 4c356771b3 GRIM: Fix the collision with the rocks in lb and bv 2013-01-27 22:02:17 +01:00
Giulio Camuffo 941813522b GRIM: Fix background talking behaviour with Toto and Naranja in set si. 2013-01-24 16:16:54 +01:00
Giulio Camuffo 1d46a8190c GRIM: Move back the call to set the head lookat after animating the model.
That broke Glottis when he sings the tusty anchor.
2013-01-18 16:56:17 +01:00
Giulio Camuffo 3faeb22088 GRIM: Save and restore some forgotten Actor's turn related fields. Bump to 22.7 2013-01-17 21:32:09 +01:00
Giulio Camuffo 19a6d600a7 GRIM: Don't check for collisions with actors without a costume. Fix #453 2013-01-17 21:14:02 +01:00
Giulio Camuffo 4f2aa54f48 GRIM: Avoid/reduce flicker when changing costume 2013-01-16 15:59:43 +01:00
Giulio Camuffo 5268dbb473 GRIM: Cleanup PointActorAt(). 2013-01-16 12:22:09 +01:00