Skip to content

Commit b276e22

Browse files
committed
Fix TR3R Madubu secret
Removes the death tile re-added in TR3R Madubu Gorge to allow the secret here to be collected like OG. Resolves LostArtefacts#819.
1 parent 7be2d1d commit b276e22

3 files changed

Lines changed: 49 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- fixed a potential key softlock in City of Khamoon if "large" range is selected and either return paths are disabled in classic, or playing remastered (#820)
66
- fixed the raptor spawns in Crash Site when enemies are randomized to guarantee that some appear when using the turrent (#818)
77
- fixed enemy 211 in Area 51 potentially being untriggerable, and hence a potential softlock if carrying a key item (#816)
8+
- fixed an unreachable secret in TR3R Madubu Gorge (#819)
89

910
## [V1.10.2](https://github.com/LostArtefacts/TR-Rando/compare/V1.10.1...V1.10.2) - 2024-12-06
1011
- added support for TR1X 4.6 (#796)

TRDataControl/Environment/Model/Types/Triggers/EMKillLaraFunction.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace TRDataControl.Environment;
55
public class EMKillLaraFunction : BaseEMFunction
66
{
77
public List<EMLocation> Locations { get; set; }
8+
public bool Remove { get; set; }
89

910
public override void ApplyToLevel(TR1Level level)
1011
{
@@ -13,7 +14,7 @@ public override void ApplyToLevel(TR1Level level)
1314
foreach (EMLocation location in Locations)
1415
{
1516
TRRoomSector sector = level.GetRoomSector(data.ConvertLocation(location));
16-
CreateTrigger(sector, level.FloorData);
17+
AlterDeathTile(sector, level.FloorData);
1718
}
1819
}
1920

@@ -24,7 +25,7 @@ public override void ApplyToLevel(TR2Level level)
2425
foreach (EMLocation location in Locations)
2526
{
2627
TRRoomSector sector = level.GetRoomSector(data.ConvertLocation(location));
27-
CreateTrigger(sector, level.FloorData);
28+
AlterDeathTile(sector, level.FloorData);
2829
}
2930
}
3031

@@ -35,20 +36,32 @@ public override void ApplyToLevel(TR3Level level)
3536
foreach (EMLocation location in Locations)
3637
{
3738
TRRoomSector sector = level.GetRoomSector(data.ConvertLocation(location));
38-
CreateTrigger(sector, level.FloorData);
39+
AlterDeathTile(sector, level.FloorData);
3940
}
4041
}
4142

42-
private static void CreateTrigger(TRRoomSector sector, FDControl control)
43+
private void AlterDeathTile(TRRoomSector sector, FDControl control)
4344
{
44-
// If there is no floor data create the FD to begin with.
45-
if (sector.FDIndex == 0)
45+
if (sector.FDIndex == 0 && !Remove)
4646
{
4747
control.CreateFloorData(sector);
4848
}
4949

50-
List<FDEntry> entries = control[sector.FDIndex];
51-
if (entries.FindIndex(e => e is FDKillLaraEntry) == -1)
50+
if (sector.FDIndex == 0)
51+
{
52+
return;
53+
}
54+
55+
var entries = control[sector.FDIndex];
56+
var deathEntry = entries.FirstOrDefault(e => e is FDKillLaraEntry);
57+
if (Remove)
58+
{
59+
if (deathEntry != null)
60+
{
61+
entries.Remove(deathEntry);
62+
}
63+
}
64+
else if (deathEntry == null)
5265
{
5366
entries.Add(new FDKillLaraEntry());
5467
}

TRRandomizerCore/Resources/TR3/Environment/RAPIDS.TR2-Environment.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,33 @@
44
"AllWithin": [],
55
"OneOf": [],
66
"ConditionalAllWithin": [],
7-
"ConditionalAll": [],
7+
"ConditionalAll": [
8+
{
9+
"Condition": {
10+
"ConditionType": 22,
11+
"Location": {
12+
"X": 68100,
13+
"Y": -20736,
14+
"Z": 39457,
15+
"Room": 49
16+
}
17+
},
18+
"OnTrue": [
19+
{
20+
"EMType": 70,
21+
"Locations": [
22+
{
23+
"X": 68100,
24+
"Y": -20736,
25+
"Z": 39457,
26+
"Room": 49
27+
}
28+
],
29+
"Remove": true
30+
}
31+
]
32+
}
33+
],
834
"ConditionalOneOf": [],
935
"Mirrored": []
1036
}

0 commit comments

Comments
 (0)