Commit Graph
176 Commits
Author SHA1 Message Date
Kaloyan Chehlarski b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +01:00
Kaloyan Chehlarski 4541d085ca NANCY: Disable buttons/save when a Movie is active
The original engine specifically disables exiting the Scene
when a SecondaryMovie is playing.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski 5695018cd3 NANCY: Implement InteractiveVideo
Implemented an action record type that adds hotspots
on top of a SecondaryMovie.
2024-02-11 00:41:30 +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 07a95628bb NANCY: Fix nancy1 crash
Fixed a crash caused by the recent changes to the way
the clock is accessed.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski 477006c8a9 NANCY: Add PopScene() failsafe
When trying to pop an item scene with none pushed,
PopScene will now attempt to pop a regular pushed scene.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski f5aef15d69 NANCY: Allow invalid item ids in some Scene functions
The addItemToInventory() and removeItemFromInventory()
were still using uints, which meant that if they were
somehow called with an id of -1 (which marks an invalid
item), they'd crash the engine. This shouldn't matter for
regular play, but may occur when debugging.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski d468406f25 Revert "NANCY: Fix fades in nancy7 dog scare sequence"
This reverts commit 1f5a3c64cc.

The changes in this commit break other fades in nancy7.
2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski 716041603d NANCY: Carry over unshown text to next scene
A couple of scenes in nancy7 draw to the textbox, then
immediately change the scene, which clears said text.
This commit adds a check for whether text was actually
drawn, and if it hasn't, makes sure it is shown in the next
scene. This is behavior not present in the original engine.
2024-02-06 20:32:27 +01:00
Kaloyan Chehlarski 1483cb1834 NANCY: Fix switching between item scenes
When inside an item's scene, opening another item's
scene no longer softlocks the game.
2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski 98c9291682 NANCY: Rename incorrectly named parameter 2024-01-31 22:55:57 +01:00
Kaloyan Chehlarski 13dde71233 NANCY: Completely disable nancy7 clock
Fixed the CLOK chunk reading, so the parameters that
indicate whether the clock is the day clock (nancy5), or
completely disabled (nancy7) now get read correctly.
2024-01-27 23:50:10 +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 2cef013209 NANCY: Sync missing SceneState member
Fixed an oversight with syncing nancy7 savefiles where
the inventory ID of an inventory scene would not get saved,
and cause a crash when attempting to exit said scene after
loading.
2024-01-16 22:26:55 +01:00
Kaloyan Chehlarski 1f5a3c64cc NANCY: Fix fades in nancy7 dog scare sequence
Some fades to black were not being shown correctly,
since from nancy7 on ActionRecords seem to start executing
only after SpecialEffects were done animating.
2024-01-14 22:30:00 +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 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 a97ee89118 NANCY: Clear generic flags when loading save
This fixes some weird behavior in scenes that use the
kSound dependency type. When the player clicks a trigger
that plays a sound, but saves the game while the sound
is being played, that trigger may end up disabled on load,
breaking the game.
2023-11-28 11:50:55 +02:00
Kaloyan Chehlarski e26b8a50a4 NANCY: Fix mouse warping in TVD during conversations
Since we don't adjust TVD's cursor hotspot, we need to make
sure that the cursor warping during conversations does
not go above the line at the bottom of the Viewport
2023-11-21 01:05:49 +02:00
Kaloyan Chehlarski 649e0ebf8b NANCY: Fix hasItem() for nancy2 and earlier
Fixed an error in Scene::hasItem() caused by earlier games'
usage of 1 as false and 2 as true.
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 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 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 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 67d36e46b7 NANCY: Add support for nancy7 special effects
The SpecialEffect action record got some significant changes
in nancy7, including a new type of fade, and the removal
of the predefined number of frames to fade. Testing with the
original is tough, since it runs way too fast on modern PCs,
and the new fade type is never actually used properly, so
the current implementation is only an approximation. Also,
I've discovered that prior to these changes the entire screen
got crossfaded, so the screenshotViewport() function is now
entirely removed.
2023-10-07 14:45:22 +03:00
Kaloyan Chehlarski 7f16ac517d NANCY: Define kNoScene constant 2023-10-07 14:45:21 +03:00
Kaloyan Chehlarski 57c9f5f203 NANCY: Implement EnableDisableInventory
Implemented an action record type responsible for making
a specific item temporarily unusable.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski b0bd3f1c3f NANCY: Implement viewable items in nancy7
Added support for the new type of item introduced in nancy7,
which, instead of getting picked up, transports the player to
a new scene with a close-up view of the item.
2023-10-03 17:58:28 +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 dbdb30e5cc NANCY: Implement terse PlaySound variants
Added support for PlaySoundTerse and
PlayRandomSoundTerse, as introduced in nancy7. Also
implemented the new functionality for reading closed
captioning text from the Autotext chunk.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski 7e6d37276b NANCY: Add support for nancy7's "More Nancy Drew!"
Made changes to BSUM reading, MainMenu and Scene states
needed to support the promo button in nancy7's main menu.
2023-10-02 12:19:31 +03:00
Kaloyan Chehlarski 5ecfef2a2e NANCY: Add support for TSUM chunks
Added support for the short variant of a scene summary,
as introduced in nancy7.
2023-10-02 12:19:31 +03:00
Kaloyan Chehlarski 7e4c4f3287 NANCY: Improve support for nancy6 TOD dependency
The time of day in nancy6 now depends on values for day
start and end found inside BSUM. We now correctly read
and use those.
2023-10-01 13:30:05 +03:00
Kaloyan Chehlarski f3fe8f251f NANCY: Increment scene counts on scene exit
The counters for how many times a scene has been
visited now get incremented only when we exit it. This
makes sure the counter is not incremented when loading a
save, and makes sure dependencies that require the
sceneCount to be equal to 0 can actually execute
(e.g. nancy6 scene 2319)
2023-09-30 17:56:27 +03:00
Kaloyan Chehlarski 4e20ddd030 NANCY: Do not add a single item multiple times
Fixed a silly bug in TVD where a cutscene can give the player
multiple copies of the same item.
2023-09-24 17:43:28 +03:00
Kaloyan Chehlarski c20f765032 NANCY: Add console command to display hotspots 2023-09-24 17:43:28 +03:00
Kaloyan Chehlarski 48de468c09 NANCY: Remove held item when entering puzzles
Pretty much all puzzles (except the telephone and alarm
clock, which aren't actually puzzles) force the currently
held item back into the inventory when they start, which is
now implemented.
2023-09-21 14:46:16 +03:00
Kaloyan Chehlarski 1d07ef258b NANCY: Remove items from inventory when held
Fixed an issue where RemoveInventoryNotHS would not
work correctly if the item was currently being held by the
player. This fixes the fire extinguisher in nancy3 remaining
in the inventory all the way until the end.
2023-09-20 16:16:21 +03:00
Kaloyan Chehlarski 78f82c9ab9 NANCY: Do not repeat "can't" sound caption
Clicking on a hotspot that triggers a "can't" sound will now
clear the textbox before pushing the caption. This makes
sure that the caption won't be displayed twice.
2023-09-19 17:38:25 +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 73c6d2087d NANCY: Avoid immediate crash when an error is thrown
Fixed an edge case where an error being thrown during
the very first time a Scene is loaded would result in a
chain reaction that would crash ScummVM while trying to
draw invalid data on screen. Instead, the error is now
properly shown on screen before quitting.
Also made changes to the savegame screenshot code to make
sure this change does not impact second chance saves.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski b3c81e7074 NANCY: Auto-clear inventory item captions
Item "can't" sounds' captions get automatically cleared after
a certain time delay, which is now implemented.
2023-09-16 17:04:37 +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 abc4168433 NANCY: Properly pause all scene sounds
Fixed an issue where certain sound channels wouldn't get
paused when changing state. Collapsed the pause/unpause
functions inside Scene into a single function, and placed it
inside SoundManager.
2023-09-16 13:14:52 +03:00
Kaloyan Chehlarski 6f0e74c620 NANCY: Play correct sfx when getting/losing item 2023-09-12 19:43:30 +03:00
Kaloyan Chehlarski 7f8d6a47d3 NANCY: Avoid flashing cursor when changing scene
In cases where the mouse falls inside a hotspot with the
same cursor type in both the previous and next scenes,
we now avoid a single frame where the cursor flashes to
the default and then back.
2023-09-12 19:43:30 +03:00
Kaloyan Chehlarski 52b66621fa NANCY: Skip drawing first frame after loading save 2023-09-12 19:43:30 +03:00