Commit graph

1252 commits

Author SHA1 Message Date
Matthew Duggan
a8e83a86b0 ULTIMA8: Call full code for enterFastArea from intrinsic
Previously we just spawned the usecode event, but to be faithful to the
original the intrinsic should do everything in Item::enterFastArea.

This also adds a workaround for a bug that was occasionally triggered when
returning to the rebel base in Crusader: No Remorse, and fixes an original game
bug in the process.
2021-06-11 22:12:11 +09:00
Matthew Duggan
f31b963302 ULTIMA8: Update fire table sprites and sounds for No Regret 2021-06-09 17:24:08 +09:00
Matthew Duggan
e0cc5c6156 ULTIMA8: Correct egg z range for Crusader
My previous disassembly incorrectly thought that the z range was 96 for
Crusader, but it's actually 48 either side of the egg, just like U8.
2021-06-08 17:24:25 +09:00
D G Turner
486507f92c ULTIMA8: Fix GCC Fallthrough Warnings 2021-06-08 04:14:58 +01:00
Matthew Duggan
42f6d22fdf ULTIMA8: Avoid crash if avatar gone
This can sometimes happen in Remorse after avatar death
if the avatar got blown up
2021-06-07 15:03:06 +09:00
Matthew Duggan
5cb1c555aa ULTIMA8: Only restore Crusader music on load if saved track exists
When saving directly from the save menu, we don't play the menu
music, so there is no need to restore the saved track on load.
2021-06-07 15:03:06 +09:00
Matthew Duggan
086436374a ULTIMA8: Fixes for Crusader attack process 2021-06-07 15:03:06 +09:00
Matthew Duggan
7136d569f1 ULTIMA8: Add frame data for No Regret firetypes 2021-06-07 10:26:23 +09:00
Matthew Duggan
99935cebbd ULTIMA8: JANITORIAL: Remove incorrect comment 2021-06-07 10:26:23 +09:00
Matthew Duggan
9a37bf5b3b ULTIMA8: Implement No Regret's Rolling Thunder process 2021-06-04 19:37:12 +09:00
Matthew Duggan
e749fb56c8 ULTIMA8: Wire up one No Regret intrinsic (isSfxPlayingForObject) 2021-05-31 20:52:06 +09:00
Matthew Duggan
f49f2dfde7 ULTIMA8: Add BoboBoomer and RollingThunder processes from No Regret
Also add the customizations to the tookHit function that exist in No Regret -
particularly, different SFX that get played depending on the NPC shape.

RollingThunder is just a stub process for now - needs implementing.
2021-05-31 20:51:46 +09:00
Matthew Duggan
d4e5b427dc ULTIMA8: JANITORIAL: Comments 2021-05-31 20:44:23 +09:00
Matthew Duggan
58ab4d42a0 ULTIMA8: Still play Cruader cutscene on invalid object
In Mission 5, one cutscene passes an invalid object.
2021-05-31 20:44:23 +09:00
Matthew Duggan
b82669a7ad ULTIMA8: Don't destroy and recreate camera on map switch
This bug was a bit complex.

This change ensures that cacheIn events get called before enterFastArea.  In
Ultima 8 only a couple of classes have cacheIn events, so it makes no real
difference. In Crusader, this bug caused extra people in the rebel base because
they got the wrong mission number during enterFastArea (the mission number is
updated in a cacheIn event).

The previous map switch code was re-making the CameraProcess as needed, but
after the cacheIn usecode processes were created - so the new camera went to
the front of the process queue.  The first execution of the camera process then
updates the fast area, and enterFastArea processes get added to the front of
the queue again (in front of the cacheIn events).  Switch to only updating the
existing camera process where possible instead of creating a new one, so the
execution order does not change.
2021-05-29 21:31:55 +09:00
Matthew Duggan
08ae7420c3 ULTIMA8: Fix Crusader new battery type order 2021-05-29 21:31:55 +09:00
Matthew Duggan
57e13c641e ULTIMA8: Don't abort unstoppable animations on fall
This caused death animations to stop half way if the NPC also fell while dying.
2021-05-28 21:32:56 +09:00
Matthew Duggan
dce0e34485 ULTIMA8: Avoid assert from proc loop workaround 2021-05-28 21:32:56 +09:00
Matthew Duggan
6a36460e6e ULTIMA8: Make max stats cheat good for Cruasder too 2021-05-28 21:32:56 +09:00
Matthew Duggan
766dbca6ef ULTIMA8: Fix ammo mode for Crusader Weasel
The ammo data is stored in shop data 1, and is always the same.  Items and
weapons should all be shown in "weapons" mode.

This is still not exact to original - it seems the ammo needs filtering based
on something, probably the unknown data field in stuff.dat.
2021-05-28 21:32:56 +09:00
Matthew Duggan
cbcebce55d ULTIMA8: Fix I_legalMoveToPoint to match original games
Inspecting the disassembly more closely and trying to fix the usecode for the
Crusader spider bombs (CRU_SPID::ordinal20), the parameter for this intrinsic
is not "force", but more like "move until blocked", and when it's false the
item should not move at all if there is a block.

The spider bomb usecode tries to move the bomb down every now and then to check
for a fall, but if it meant "force" then the bomb would go into the floor.  It
would also never explode because it was always forced into the new position and
never fails.

The return value is whether the move completed.
2021-05-26 12:27:44 +09:00
Matthew Duggan
a5d0a27286 ULTIMA8: Only find blockers for Crusader mover sweep 2021-05-26 12:27:44 +09:00
Matthew Duggan
587a2bfb05 ULTIMA8: Remove outdated comment 2021-05-26 12:27:44 +09:00
Matthew Duggan
2f168d3581 ULTIMA8: Check for decoding errors in AVI stream
The movies at the end of No Remorse mission 3 have some decoding errors. Check
and handle it gracefully.
2021-05-24 22:09:43 +09:00
Matthew Duggan
72ed6c16d2 ULTIMA8: Add workaround for Crusader lockup 2021-05-24 22:09:43 +09:00
Matthew Duggan
210b4c9102 ULTIMA8: JANITORIAL: Whitespace 2021-05-24 22:09:43 +09:00
Matthew Duggan
7d4044cbc6 ULTIMA8: Mark emptystring as const 2021-05-24 22:09:43 +09:00
Matthew Duggan
4500cc8451 ULTIMA8: Fix int16 casts in 32 bit usecode operands
These opcodes are all unused in Ultima8, so this bug probably only affects
Crusader games.
2021-05-23 16:23:17 +09:00
Matthew Duggan
c74ae95508 ULTIMA8: Avoid confman call on every animation 2021-05-23 16:23:17 +09:00
Matthew Duggan
b9ddaf64f2 ULTIMA8: Remove some dead code
Code that has been #if 0 for a long time, and some default setting for Crusader
which is not used.
2021-05-23 16:23:17 +09:00
Matthew Duggan
95670203d9 ULTIMA8: Avoid OOB access in Crusader weapon shape list
Updated list for No Regret, and check value which gets loaded from data file.
Identified by Coverity.
2021-05-19 17:18:21 +09:00
Matthew Duggan
bc4e1eeefb ULTIMA8: Scan more pixel offsets in Crusader
The list before had some omissions so the avatar would still fall a bit.  This
should remove the last places we see pausing while walking around on elevated
platforms etc.
2021-05-19 17:18:20 +09:00
Matthew Duggan
345537c519 ULTIMA8: Improve test for Crusader slide movements
The previous code made it possible to accidentally jump through thin objects
like laser barriers because it was not testing that the avatar could get to the
start point of the adjusted move.  Added a sweep test to ensure the start point
is also valid.
2021-05-16 22:19:45 +09:00
Matthew Duggan
c40477ef67 ULTIMA8: Don't pause crusader turn while firing 2021-05-16 22:19:45 +09:00
Matthew Duggan
3e0c3089e9 ULTIMA8: Remove outdated FIXME and TODO comments 2021-05-16 20:36:58 +09:00
Matthew Duggan
ccc91e43ca ULTIMA8: Fix a TODO in Crusader attack, add another one for Regret 2021-05-16 20:36:57 +09:00
Matthew Duggan
d5a5b5c5ed ULTIMA8: Add comments 2021-05-16 20:36:57 +09:00
Matthew Duggan
8d3e556e97 ULTIMA8: Clean up a Crusader TODO. 2021-05-16 20:36:57 +09:00
Matthew Duggan
0ee35a1e1f ULTIMA8: Get Crusader default HP from data table 2021-05-16 18:21:38 +09:00
Matthew Duggan
46982981f5 ULTIMA8: Update Crusader random weapon table for No Regret 2021-05-16 18:21:38 +09:00
Matthew Duggan
f5d4a91576 ULTIMA8: Use bool type for two firetype flags 2021-05-16 18:21:38 +09:00
Matthew Duggan
07dee61a72 ULTIMA8: Add No Remorse data to FireTypeTable 2021-05-16 18:21:38 +09:00
Matthew Duggan
07d7e335d7 ULTIMA8: Add repeating firing in Crusader 2021-05-16 18:21:38 +09:00
Matthew Duggan
dce361bf3b ULTIMA8: Turn Crusader immediately while moving
Crusader games allow the avatar to turn once immediately while walking/running.
2021-05-16 18:21:38 +09:00
Matthew Duggan
f3eb0a978e ULTMA8: JANITORIAL: Remove incorrect commented-out code 2021-05-16 18:21:38 +09:00
Matthew Duggan
15b265abdc ULTIMA8: Use readSByte to eliminate casts 2021-05-16 18:21:38 +09:00
D G Turner
82b1f3603a ULTIMA8: Fix GCC Shadowing Warning 2021-05-15 20:17:38 +01:00
Matthew Duggan
4384d75d8c ULTIMA8: Usecode push-byte-indirect should sign-extend
Opcode 0x3E pushes a byte on to the stack as a 16-bit value. Previously we
assumed it should be treated as an unsigned value, but the code for conveyors
in Crusader clearly treats it as a signed value - they move at +3 or -3 per
tick.  Confirmed in the disasm that both U8 and Cru use CBW to sign-extend
value in AL, so this may fix some things in U8 too.
2021-05-15 22:13:59 +09:00
Matthew Duggan
9d34f7b680 ULTIMA8: Crusader rolls should end kneeling
Even when they started standing.  Match the original behavior.
2021-05-15 17:17:39 +09:00
Matthew Duggan
6d71176b8f ULTIMA8: Improve debug message in ActorAnimProcess 2021-05-15 17:06:36 +09:00