Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore TR2R skidoo belt #725

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased](https://github.com/LostArtefacts/TR-Rando/compare/V1.9.1...master) - xxxx-xx-xx
- fixed docile bird monsters causing multiple Laras to spawn in remastered levels (#723)
- fixed the incomplete skidoo model in TR2R when it appears anywhere other than Tibetan Foothills (#721)
- improved data integrity checks when opening a folder and prior to randomization (#719)

## [V1.9.1](https://github.com/LostArtefacts/TR-Rando/compare/V1.9.0...V1.9.1) - 2024-06-23
Expand Down
11 changes: 11 additions & 0 deletions TRDataControl/Data/Remastered/BaseTRRDataCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ public void SetPDPData(TRDictionary<TKey, TRModel> pdpData, TKey sourceType, TKe
public void SetMapData(Dictionary<TKey, TAlias> mapData, TKey sourceType, TKey destinationType)
{
TAlias alias = GetAlias(sourceType);
Dictionary<TKey, TAlias> dependencies = GetMapDependencies(sourceType);
if (dependencies != null)
{
foreach (var (depKey, depAlias) in dependencies)
{
mapData[depKey] = depAlias;
}
}

if (EqualityComparer<TAlias>.Default.Equals(alias, default))
{
return;
Expand All @@ -86,4 +95,6 @@ public void SetMapData(Dictionary<TKey, TAlias> mapData, TKey sourceType, TKey d
public abstract TKey TranslateKey(TKey key);
public abstract TKey TranslateAlias(TKey alias);
public abstract TAlias GetAlias(TKey key);
protected virtual Dictionary<TKey, TAlias> GetMapDependencies(TKey key)
=> null;
}
10 changes: 10 additions & 0 deletions TRDataControl/Data/Remastered/TR2RDataCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ public override string GetSourceLevel(TR2Type key)
public override TR2RAlias GetAlias(TR2Type key)
=> _mapAliases.ContainsKey(key) ? _mapAliases[key] : default;

protected override Dictionary<TR2Type, TR2RAlias> GetMapDependencies(TR2Type key)
=> key == TR2Type.RedSnowmobile ? _skidooDependencies : null;

private static readonly Dictionary<TR2Type, TR2RAlias> _skidooDependencies = new()
{
[TR2Type.CutsceneActor4] = TR2RAlias.SKIDOO_TRACK_1,
[TR2Type.CutsceneActor5] = TR2RAlias.SKIDOO_TRACK_2,
[TR2Type.CutsceneActor6] = TR2RAlias.SKIDOO_TRACK_3,
};

private static readonly Dictionary<TR2Type, string> _sourceLevels = new()
{
[TR2Type.Crow] = TR2LevelNames.GW,
Expand Down
Loading