Commit Graph
74 Commits
Author SHA1 Message Date
Kaloyan Chehlarski b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +01:00
Kaloyan Chehlarski 4d5c4fcfcc NANCY: Rename graphics and cursor managers
Changed the names of the pointers to GraphicsManager
and CursorManager to be shorter, since they were
inconsistent with the rest of the managers, and typing
them out is a chore.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski 80d351969d NANCY: Implement TextScroll and AutotextEntryList
Added support for the record types that replaced the bare
Autotext, and combined it with a PeepholePuzzle. This
necessitates some ugly, diamond-shaped multiple
inheritance, but the original engine's solution of replacing
the current record with a different type one at runtime
is even uglier. Also, made changes to Autotext to correctly
support LIFO ordering.
2024-02-08 23:12:14 +01:00
Kaloyan Chehlarski a6e9cd3424 NANCY: Fix resource leak when shutting engine down
ActionRecords weren't being deleted, which resulted in
memory leaks and files being kept open.
2024-01-30 23:13:12 +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 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 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 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 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
Kaloyan Chehlarski f126ac3d5f NANCY: Fix intro sound in nancy3
It seems a scene change only interrupts the execution of
the rest of the ActionRecords in a scene starting from nancy4.
Adding the version check fixes the intro of nancy3, where
the narration wouldn't start playing.
2023-10-07 14:45:22 +03:00
Kaloyan Chehlarski 6ed79ba757 NANCY: Add support for Bink video
nancy7 started using Bink videos for some SecondaryMovies
2023-10-07 14:45:21 +03:00
Kaloyan Chehlarski 85b1332ab7 NANCY: Do not retain satisfied status for dependencies
Fixed all instances of dependencies that, once satisfied, stay
that way forever. This fixes more complex event flag
dependency like the one in nancy7 scene 2805.
2023-10-07 14:45:21 +03:00
Kaloyan Chehlarski 7f16ac517d NANCY: Define kNoScene constant 2023-10-07 14:45:21 +03:00
Kaloyan Chehlarski cb526a5eb3 NANCY: Fix kSceneCount dependency
It seems the kSceneCount dependency type has been
broken pretty much always, and the last attempt at fixing it
was a fluke. Also added checks for nancy7, since the devs
decided that, for whatever reason, the conditions need to
be flipped, and what was before a less-than check is now a
greater-than one, and vice versa.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski 634b1eb260 NANCY: Rename sound ARs 2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski 8b473098aa NANCY: Implement HotSceneChangeTerse
Added support for a short variant of Hot1FrSceneChange,
which combines all the directional scene changes into one.
Due to the weird way the data is combined, significant
changes to the way ActionRecords are created had to be made.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski 1ca8ee3799 NANCY: Do not handle hotspots when record is done
Fixed an edge case where a hotspot would still be evaluated,
even when its host ActionRecord is done.
2023-09-29 15:13:43 +03:00
Kaloyan Chehlarski a07b8ee54f NANCY: Fix for records with multiple cursor dependencies
Fixed the Dependency processing code so the rare cases
where a single ActionRecord has multiple CursorType
dependencies works correctly (plays the right "can't" sound,
removes/re-adds held items as indended). This fixes the
keymaker's return slot in nancy5.
2023-09-29 15:13:42 +03:00
Kaloyan Chehlarski 52b5d5fa62 NANCY: Fix record processing flow
Changed the ActionRecord processing logic so that
dependencies are evaluated regardless of whether the
record is active or not. This fixes nancy5 scene 3008, where
at the beginning of the game one would be unable to
get the phone call, and would instead hear the general
"can't" sound (which should never play).
2023-09-27 21:08:07 +03:00
Kaloyan Chehlarski fdbd8b248d NANCY: Stop record processing after changing scene
Further ActionRecords now stop being processed as soon as
changeScene() is called, instead of getting one last frame
of processing. This fixes nancy4 scene 5708, where clicking
the gate circle would previously activate a sound effect
that it shouldn't
2023-09-25 14:37:37 +03:00
Kaloyan Chehlarski 60ffa2ee81 NANCY: Adjust SecondaryMovie timing
Added an improvement to the ActionRecord processing
code that fixes timing-related issues with secondary movies.
As a result, movies are now better-synchronized than they
ever were in the original engine.
2023-09-25 14:37:37 +03:00
Kaloyan Chehlarski c20f765032 NANCY: Add console command to display hotspots 2023-09-24 17:43:28 +03:00
Kaloyan Chehlarski f9ccd48a8e NANCY: Handle Overlay input as special case
Added a workaround for a bug in nancy3 where the engine
would move to an incorrect scene, because Overlay input
wasn't being handled with priority like it was in the original
engine.
2023-09-19 17:40:49 +03:00
Kaloyan Chehlarski b0c84deb2b NANCY: Do not exit when reaching unknown AR type
Changed the ActionRecord loading code so that reaching
an unknown/changed record type just shows a warning
and continues, instead of throwing an error and quitting.
2023-09-19 17:38:25 +03:00
Kaloyan Chehlarski ee42466559 NANCY: Print additional info alongside errors
Added an override to the errorString() method, allowing
the engine to print additional data when an error is thrown.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski ba5696786f NANCY: Implement InventorySoundOverride
Implemented the action record type responsible for
overriding the default "I can't" sound for a specific item.
Also implemented closed captioning for the same use
case, since it had previously been overlooked.
2023-09-16 17:04:37 +03:00
Kaloyan Chehlarski 03d4791ed2 NANCY: Implement standard way to access boot chunks
Previously, the NancyEngine class was responsible for
handling creation and destruction of many naked pointers
to engine data, which led to several instances of memory
leaks that needed to be fixed. These changes introduce a
standard way of handling that same data, similar to the
one already used by PuzzleData inside Scene. Unfortunately,
this does add the need for relevant data to be casted to
the proper type before it is handled.
2023-08-31 12:20:39 +03:00
Kaloyan Chehlarski 452e259281 NANCY: Implement kRandom dependency type
Implemented the random dependency type, which evaluates
to true or false based on random chance.
2023-08-24 12:47:50 +03:00
Kaloyan Chehlarski b6ae5b4cd1 NANCY: Allow chained orFlag dependencies
Fixed the dependency code so dependencies marked with
an orFlag can be chained (that is, we can have more than
two of them at a time). This makes the chiming clock in
nancy3 actually work.
2023-08-22 12:15:26 +03:00
Kaloyan Chehlarski a6e5c8c83a NANCY: Implement nancy3 object use flags
nancy3 changed the way the kKeepAlways inventory flag
worked, and added a third flag with the old behavior. As
a result of this change, the suitcase key in nancy3 no longer
disappears after being used.
2023-08-11 01:02:10 +03:00
Kaloyan Chehlarski 71bbbea4a8 NANCY: Fix incorrect cursor when hotspots overlap
Overlapping hotspots with different hover cursors now
work correctly (only the first one is respected). This fixes the
stairs in nancy3.
2023-08-10 14:28:49 +03:00
Eugene Sandulenko f94464ecb1 NANCY: JANITORIAL: Remove trailing spaces 2023-08-07 10:47:50 +02:00
Kaloyan Chehlarski 1bfb6f8d98 NANCY: Ignore invalid hotspots
Added a check for action record hotspot validity. This
fixes a broken frame in nancy2 scene 1600.
2023-07-13 14:32:46 +03:00
Kaloyan Chehlarski eda2ee947c NANCY: Fix use-then-lose items
Items marked as single-use are now correctly removed from
the inventory. Also extended the get_inventory console
command to show if an item is single-use or not.
2023-07-13 14:32:46 +03:00
Kaloyan Chehlarski 01519d79e5 NANCY: Properly clear kCloseParenthesis dependencies 2023-05-12 12:42:31 +03:00
Kaloyan Chehlarski 8655830780 NANCY: Make action record error more descriptive 2023-05-12 12:42:30 +03:00
Kaloyan Chehlarski dff9cbe272 NANCY: Use correct values for nancy3's flags
Nancy3 did away with earlier versions of the engine's usage
of 1 and 2 as false/true values. This commit adds two
new values to NancyEngine: _true and _false, which hold
the correct values used by different versions of the engine.
2023-05-10 16:57:33 +03:00
Kaloyan Chehlarski 130209f89d NANCY: Implement nancy3 dependency tree
Nancy3 introduced the kOpenParenthesis and
kCloseParenthesis dependency types, which allow for
more complicated dependency logic. This commit changes
the structure of the DependencyRecord type to support
parent-child relationships similar to the ones found
inside the original implementation's code. Also introduced
is the static canHaveHotspot() function in ActionRecord,
which is used to correctly implement cursor dependencies.
2023-05-10 16:57:32 +03:00
Kaloyan Chehlarski cb23c11061 NANCY: Fix kElapsedPlayerTime dependency
Fixed the way the kElapsedPlayerTime dependency is handled,
so it ignores days and milliseconds. Also added support for
the conditions added in nancy3.
2023-05-10 16:57:32 +03:00
Kaloyan Chehlarski 95f4158697 NANCY: Implement kSound dependency
Implemented the Sound dependency type, which checks
if a given sound channel is currently playing.
2023-05-10 16:57:31 +03:00
Kaloyan Chehlarski 0919ee559f NANCY: Implement scene counts
The counters for how many times each scene has been hit
now actually work, instead of always being 0. The data type
storing them has been changed to a HashMap to save
on memory.
2023-05-10 16:57:31 +03:00
Kaloyan Chehlarski ac81086665 NANCY: Correct dependency reading for nancy3 2023-05-07 11:46:34 +03:00
Kaloyan Chehlarski c578321578 NANCY: Play correct "can't" sounds in nancy2
Added code to play the correct sound when an action
record requires a held item.
2023-04-15 14:46:22 +03:00
Kaloyan Chehlarski 50a08027ab NANCY: Implement ClosedCaptioning dependency
Implemented the ClosedCaptioning action record
dependency type introduced in nancy2.
2023-04-13 21:20:36 +03:00
Kaloyan Chehlarski e0f74000ef NANCY: Implement structs for some BOOT chunks
Boot chunks BSUM, VIEW, INV, and TBOX are now read only at startup,
and their data is kept permanently inside NancyEngine. This removes the
need for the chunks to be read by multiple classes and always kept
in memory.
2023-03-30 20:21:36 +03:00
Kaloyan Chehlarski 160910cb0d NANCY: Correctly add item back to inventory after use
Fixed an issue where a used item would be visibly added to the
inventory, but not to the underlying flag array.
2023-03-26 11:43:58 +03:00
Kaloyan Chehlarski b0c7e3f4c1 NANCY: Clean up TODOs 2023-03-22 20:07:37 +02:00
Kaloyan Chehlarski 87c7cdb577 NANCY: Don't store time of day
Removed the timeOfDay property, since it is much simpler for
it to be calculated on the fly when needed.
2023-03-15 18:25:01 +02:00
Kaloyan Chehlarski 1fa1de39b6 NANCY: Rename action record dependency types
Renamed the dependency types for ActionRecords to match their
official ones. Also added the dependency types found in nancy3.
2023-03-07 21:19:22 +02:00