tr2/data: convert Catacombs music triggers to pads

This converts some music triggers at the start of Catacombs to pads to
retain the element of surprise when the yeti spawns.

Resolves #1962.
This commit is contained in:
lahm86 2024-11-30 09:59:01 +00:00
parent ae24a693ee
commit 97ac10f7b2
4 changed files with 20 additions and 1 deletions

View file

@ -16,6 +16,7 @@
- fixed one of the collapsible tiles in Opera House room 184 not triggering (#1902)
- fixed being unable to use the drawbridge key in Tibetan Foothills after the flipmap (#1744)
- fixed missing triggers and ladder in Catacombs of the Talion after the flipmap (#1960)
- fixed incorrect music trigger types at the beginning of Catacombs of the Talion (#1962)
- fixed missing death tiles in Temple of Xian room 91 (#1920)
- fixed broken final stats screen in software rendering mode (#1915, regression from 0.6)
- fixed screenshots not capturing level stats (#1925, regression from 0.6)

View file

@ -44,7 +44,7 @@ decompilation process. We recognize that there is much work to be done.
- **Opera House**: fixed the trigger under item 203 to trigger it rather than item 204
- **Wreck of the Maria Doria**: fixed room 98 not having water
- **Tibetan Foothills**: added missing triggers for the drawbridge in room 96 (after the flipmap)
- **Catacombs of the Talion**: added missing triggers and ladder in room 116 (after the flipmap)
- **Catacombs of the Talion**: changed some music triggers to pads near the first yeti, and added missing triggers and ladder in room 116 (after the flipmap)
- **Ice Palace**: fixed door 143's position to resolve the invisible wall in front of it, and added an extra pickup trigger beside the Gong Hammer in room 29
- **Temple of Xian**: fixed missing death tiles in room 91
- **Floating Islands**: fixed door 72's position to resolve the invisible wall in front of it

View file

@ -31,6 +31,7 @@ typedef enum {
FET_ROOM_SHIFT = 3,
FET_TRIGGER_ITEM = 4,
FET_ROOM_PROPERTIES = 5,
FET_TRIGGER_TYPE = 6,
} FLOOR_EDIT_TYPE;
typedef struct {
@ -47,6 +48,8 @@ static int32_t m_DataCounts[IDT_NUMBER_OF] = { 0 };
static void M_LoadFromFile(INJECTION *injection, const char *filename);
static void M_FloorDataEdits(const INJECTION *injection, int32_t data_count);
static void M_TriggerTypeChange(
const INJECTION *injection, const SECTOR *sector);
static void M_TriggerParameterChange(
const INJECTION *injection, const SECTOR *sector);
static void M_SetMusicOneShot(const SECTOR *sector);
@ -151,6 +154,9 @@ static void M_FloorDataEdits(
for (int32_t j = 0; j < fd_edit_count; j++) {
const FLOOR_EDIT_TYPE edit_type = VFile_ReadS32(fp);
switch (edit_type) {
case FET_TRIGGER_TYPE:
M_TriggerTypeChange(injection, sector);
break;
case FET_TRIGGER_PARAM:
M_TriggerParameterChange(injection, sector);
break;
@ -179,6 +185,18 @@ static void M_FloorDataEdits(
Benchmark_End(benchmark, NULL);
}
static void M_TriggerTypeChange(
const INJECTION *const injection, const SECTOR *const sector)
{
const uint8_t new_type = VFile_ReadU8(injection->fp);
if (sector == NULL || sector->trigger == NULL) {
return;
}
sector->trigger->type = new_type;
}
static void M_TriggerParameterChange(
const INJECTION *const injection, const SECTOR *const sector)
{