Commit graph

430 commits

Author SHA1 Message Date
Kaloyan Chehlarski
722e2b202a NANCY: Clean up RaycastPuzzle floor/ceiling drawing
This makes the floor/ceiling drawing more readable and
more accurate to the original engine.
2024-01-21 14:25:59 +01:00
Kaloyan Chehlarski
78ad16fc46 NANCY: Consistently show/hide virtual keyboard
Fixed edge cases where the mobile virtual keyboard
wouldn't show/hide properly when it should.
2024-01-21 14:22:06 +01:00
Kaloyan Chehlarski
9940a63fc6 NANCY: Improve keymap disabling behavior
Changed the way keymaps are disabled/enabled to reduce
calls to the InputManager, and make sure secondary
keymaps are only enabled when needed, and kept disabled
the rest of the time.
2024-01-21 13:58:48 +01:00
Kaloyan Chehlarski
62a177523f NANCY: Fix RaycastPuzzle crash in movement code
Added better clipping of the cell ids used when checking
for walls and other obstacles. Also made some of the
formatting in the function prettier.
2024-01-21 13:58:47 +01:00
Kaloyan Chehlarski
a73d5d8106 NANCY: Implement win game event flag
Added a feature that stores whether the player has won
the game at least once, and activates a specific event flag
if so. This may or may not enable easter eggs in the
game data, but definitely affects the (still unimplemented)
quotes easter egg in the version screen.
2024-01-16 22:26:55 +01:00
Kaloyan Chehlarski
9ee549edd2 NANCY: Remove unnecessary ConfMan instance calls
Removed occurences of the ConfMan macro being used
to get the transient domain name. This makes sure we don't
generate unnecessary calls to ConfigManager::getInstance().
2024-01-11 23:04:14 +01:00
Kaloyan Chehlarski
0ddf8d0549 NANCY: JANITORIAL: Clean up triple newlines 2024-01-11 23:04:14 +01:00
Kaloyan Chehlarski
40fb2f8f60 NANCY: Ad button fixes
Fixed several issues with the nancy7 ad button:
- the sound in the main menu no longer cuts out when
returning from the ad
- an ad scene now never ends up in a second chance save
- going to the ad 2 times in a row does no longer continues
the game instead.
Also, the GotoMenu record now always forces the player
back to the menu, even when original menus have been
disabled; the old behavior never made sense.
2024-01-11 23:04:14 +01:00
Kaloyan Chehlarski
4bc0670f98 NANCY: Make sure TurningPuzzle triggers flag
Solving a TurningPuzzle without an animation (e.g. the
crossed eyes box in nancy6) would previously not trigger
the solve flag, rendering the puzzle unsolveable. This has
now been fixed.
2024-01-07 00:44:39 +01:00
Kaloyan Chehlarski
eb5c5e72c6 NANCY: Fix PasswordPuzzle max input length
This fixes the level 2 quiz in nancy6.
2024-01-07 00:44:39 +01:00
Kaloyan Chehlarski
d40e408fc8 NANCY: Fix nancy6 caption
Changed the execution of Conversation records in nancy6
and up, so that the kBegin state falls through to the kRun
one and submits its caption to the Textbox immediately.
This fixes the text displayed in nancy6 scene 1299, where
a subsequent TextboxWrite record overwrites the
Conversation caption with a longer one.
2024-01-05 23:42:22 +01:00
Kaloyan Chehlarski
a5ebc7cb8a NANCY: Fix AddInventoryNoHS record
Fixed an issue where AddInventoryNoHS would force an
item to be forever held by the player, if it is already in
the player's inventory prior to the record's execution.
2024-01-05 23:42:03 +01:00
Kaloyan Chehlarski
22bdbbfd50 NANCY: Split maze map key into separate Keymap
The "Open map" action used in nancy3/nancy6's
RaycastPuzzle interfered with general keyboard input,
causing whichever key was bound to it to not fire.
Effectively, this meant that inputting the letter 'm' was
impossible. This commit makes sure the binding is
deactivated whenever text input is needed.
2023-12-30 00:16:14 +02:00
Kaloyan Chehlarski
0df1785eb3 NANCY: Implement HamRadioPuzzle
Implemented the action record type responsible for nancy6's
ham radio puzzle sequence.
2023-12-30 00:16:14 +02:00
D G Turner
6ff49a0c86 NANCY: Fix Mismatched Class vs. Struct GCC Compiler Warning 2023-12-29 02:24:10 +00:00
Kaloyan Chehlarski
71558e8503 NANCY: Fix nancy1 telephone hints
A fix for some broken nancy3 phone calls resulted in
the nancy1 hint system not working. This commit makes
sure the fix only applies to later games, which do not use
the HintSystem action record.
2023-12-28 23:58:17 +02:00
Kaloyan Chehlarski
caf29003bd NANCY: Retain AssemblyPuzzle solve state
Added a PuzzleData struct for AssemblyPuzzle, which ensures
that loading the puzzle again after it's solved will show the
assembled state, instead of restarting the puzzle.
2023-12-28 23:58:17 +02:00
Kaloyan Chehlarski
586225d614 NANCY: JANITORIAL: Spaces to tabs / double spaces
Fixed all cases where spaces were used instead of tabs, and
all cases where a space was erroneously doubled.
2023-12-28 23:58:17 +02:00
Le Philousophe
1c2d757dbd NANCY: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Kaloyan Chehlarski
6b8d3cd2b5 NANCY: Implement BulPuzzle
Implemented the puzzle based on the Mayan game Bul
found in nancy6.
2023-12-04 14:02:24 +02:00
Kaloyan Chehlarski
2bd6092738 NANCY: Use numpad enter key
In places where the engine expects text input, using the
numpad enter key now acts the same as using the return key
2023-11-28 11:50:55 +02:00
Kaloyan Chehlarski
76c1af242f NANCY: Fix crash when loading nancy3 safe
Fixed a typo that would cause a crash when loading the
SafeDialPuzzle in nancy3.
2023-11-27 18:57:58 +02:00
Kaloyan Chehlarski
f6480a4717 NANCY: Fix for overlapping records in nancy2
Modified the special case input handling in Overlay so that
it no longer gets triggered at all for nancy2 and older games.
This fixes an issue with the TV in nancy2, which will get
turned off even when not holding the remote.
2023-11-26 23:03:57 +02:00
Kaloyan Chehlarski
d64c94c6dd NANCY: Stop multiple keys at the same time in PianoPuzzle
This fixes an issue in PianoPuzzle that could produce
graphical glitches when clicking adjacent keys
2023-11-25 00:09:19 +02:00
Kaloyan Chehlarski
30c9816a7a NANCY: Fix for getting stuck in Telephone scene
Nancy3 has a bugged Telephone instance that can get the
player stuck forever in the same scene (this happens in the
original game). This commit makes sure to avoid such cases.
Also, players can now exit a Telephone scene while ringing.
2023-11-23 14:21:44 +02:00
Kaloyan Chehlarski
7303fa4a44 NANCY: Extend Overlay looping behavior to nancy2
It seems nancy2 shares the weird looping behavior when
a sound is present inside an Overlay - it keeps looping
until after the sound is done, even when looping is disabled.
This fixes nancy2 scene 1562.
2023-11-05 23:15:47 +02:00
Kaloyan Chehlarski
732abddabe NANCY: Improve reading of Overlays
A source parameter that was previously erroneously
skipped is now read correctly, resulting in a lot of the
static mode code being no longer needed.
2023-11-05 23:15:46 +02:00
Kaloyan Chehlarski
0260875821 NANCY: Fix Overlay crash
Fixed a divide by 0 crash in nancy2 caused by bad data
in an Overlay action record
2023-11-04 14:31:37 +02:00
Kaloyan Chehlarski
172b87ebf7 NANCY: Synchronize nancy2 movies with sound
It seems earlier games were aware of the engine bug that
slows down all videos, and their movies were correctly synced
in the original engine. This commit duplicates that bug,
but only in the cases where a movie has an embedded sound
(e.g. the nancy2 cutscenes)
2023-11-02 11:41:21 +02:00
Kaloyan Chehlarski
6f2edd92aa NANCY: Fix Overlay with hotspot triggering
Fixed an issue where an Overlay with a hotspot would
actually never have it activated. Also, added a check for game
type to make sure other action records _do_ get activated
alongside an Overlay in nancy2 and lower. Both of these
fixes target nancy2 scene 2541.
2023-10-28 16:19:34 +03:00
Kaloyan Chehlarski
1bc3940e6b NANCY: Cursor fixes
With the adjustments made to the regular cursor, the
inactive zone during conversations was rendered a few
pixels shorter than it should be; now the cursor can be moved
up right up to the edge of the viewport.

Also, when entering a conversation, the mouse cursor would previously warp immediately, but its graphic would only change
a frame later; this has also been fixed
2023-10-28 16:19:34 +03:00
Kaloyan Chehlarski
b9cd9b7169 NANCY: Implement kDefaultAR dependency
This dependency will be satisfied only if no action records
have been executed yet. Introduced in nancy7
2023-10-28 16:19:33 +03:00
Kaloyan Chehlarski
898068b951 NANCY: Cursor dependency improvements
Implemented the correct logic for a cursor dependency
that specifies _not_ holding an item, though I'm still not
sure that functionality is actually ever used. The "can't"
sounds for such a dependency will now also play correctly.

The "standard" cursor dependency (which will activate
only if the player is not holding anything) will now actually
activate; previously it had no chance of doing so, due to
incorrect int signedness. Again, it is unclear if this ever
actually gets used.
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
c86abc68a0 NANCY: Implement nancy7 LIFO autotext entries
Nancy7 added last-in-first-out ordering to journal entries,
which is now implemented and no longer causes a crash.
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
be0feffb55 NANCY: Load Autotext surfaces from ResourceManager
Added checks to loadImage() for the special strings used
to indicate an autotext surface instead of an image file
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
97f4938bb2 NANCY: Add keymap for displaying raycast maze map
It seems the raycast puzzle map wasn't actually a debug
feature in the original engine, and was actually toggleable
even outside god mode. This commit adds a keymap for
displaying it, and makes sure that keymap only appears in
nancy3 and nancy6 (since other games do not have
this puzzle)
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
172984be7b NANCY: Fix nancy2 dialogue freeze
Fixed an issue in nancy2 where in the very first conversation
the scene wouldn't change after Nancy is done talking.
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
74307deca6 NANCY: Rewrite resource handling
CifFile/CifTree classes have been completely rewritten and
moved to their own header file. ResourceManager is now
exclusively responsible for loading IFF files, making sure
loose .iff/.cif files take precedence before ones embedded
in a ciftree.
Also, completed work on the cif/ciftree exporting functions.
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
ce9a9a2c0f NANCY: Fix rendering of Autotext Overlays
It appears that an Overlay's _srcRects are junk data when
the overlay is in Autotext mode. This commit makes sure
they're rendered correctly.
2023-10-23 22:32:39 +03:00
Kaloyan Chehlarski
faaba2aae8 NANCY: Forcefully reactivate Autotext records when loading save
Autotext records generate surfaces that are used by other
action records. When loading from a save, the Autotext
will already be marked as "done", and thus wouldn't generate anything, resulting in a crash. This commit makes
sure this doesn't happen.
2023-10-23 22:32:39 +03:00
Kaloyan Chehlarski
e23b573e7a NANCY: Implement BBallPuzzle
Implemented the action record type responsible for
nancy6's basketball minigame.
2023-10-23 22:32:39 +03:00
Kaloyan Chehlarski
1da8f422d2 NANCY: Prevent crash when destroying movie 2023-10-23 22:32:39 +03:00
Kaloyan Chehlarski
13d95f7bc6 NANCY: Fix SecondaryMovie reading
A recent addition to the class was missing a game version
check, ensuring nancy6 and earlier movies would always crash
2023-10-23 22:32:39 +03:00
Kaloyan Chehlarski
cf188ca8fb NANCY: Implement CubePuzzle
Implemented the record type responsible for nancy6's
cube assembly minigame (not to be confused with the
pottery assembly one, which uses a different AR type)
2023-10-17 18:31:08 +03:00
Kaloyan Chehlarski
489b9c696d NANCY: Fix Coverity issues 2023-10-17 18:31:08 +03:00
Kaloyan Chehlarski
3551db675d NANCY: Implement AssemblyPuzzle
Implemented the record type responsible for nancy6's
broken pottery assembly minigame.
2023-10-17 18:31:08 +03:00
Kaloyan Chehlarski
dc3e14d4fc NANCY: Add MouseFollowObject class
Added a class that combines a certain behavior used by
several puzzles: that of an object that follows the mouse
cursor, but stays within the Viewport's bounds.
2023-10-12 12:42:28 +03:00
Kaloyan Chehlarski
56b48f6186 NANCY: Add GetEngineData macro
Added a macro that hides away the ugly casts whenever
an EngineData object is requested.
2023-10-12 12:42:28 +03:00
Eugene Sandulenko
17a480f1c5
NANCY: Fix potentially uninitialized variable 2023-10-10 23:55:06 +02:00
Kaloyan Chehlarski
151561e6ee NANCY: Implement KeypadTersePuzzle
Implemented the short variant of KeypadPuzzle introduced
in nancy7. Also added the new flag that marks whether
we need to check the order the buttons were pressed in.
2023-10-07 14:45:22 +03:00