diff --git a/TRLevelReader/Model/TR2/Enums/TR2Entities.cs b/TRLevelReader/Model/TR2/Enums/TR2Entities.cs index 15a7c0411..e50f6acc5 100644 --- a/TRLevelReader/Model/TR2/Enums/TR2Entities.cs +++ b/TRLevelReader/Model/TR2/Enums/TR2Entities.cs @@ -291,6 +291,7 @@ public enum TR2Entities LaraMiscAnim_H_Xian, // Death-by-Guard, inspecting dagger LaraMiscAnim_H_Wall, // Death-by-Barney LaraMiscAnim_H_HSH, // Inspecting dagger at home + LaraMiscAnim_H_Venice, // Bartoli's detonator // Split Lara's outfits and weapon animations LaraSun = 3000, diff --git a/TRModelTransporter/Data/TR2DefaultDataProvider.cs b/TRModelTransporter/Data/TR2DefaultDataProvider.cs index 5eb1f5a49..6c3c35720 100644 --- a/TRModelTransporter/Data/TR2DefaultDataProvider.cs +++ b/TRModelTransporter/Data/TR2DefaultDataProvider.cs @@ -223,7 +223,7 @@ public IEnumerable GetIgnorableTextureIndices(TR2Entities entity) [TR2Entities.LaraMiscAnim_H] = new List { - TR2Entities.LaraMiscAnim_H_Wall, TR2Entities.LaraMiscAnim_H_Unwater, TR2Entities.LaraMiscAnim_H_Ice, TR2Entities.LaraMiscAnim_H_Xian, TR2Entities.LaraMiscAnim_H_HSH + TR2Entities.LaraMiscAnim_H_Wall, TR2Entities.LaraMiscAnim_H_Unwater, TR2Entities.LaraMiscAnim_H_Ice, TR2Entities.LaraMiscAnim_H_Xian, TR2Entities.LaraMiscAnim_H_HSH, TR2Entities.LaraMiscAnim_H_Venice }, [TR2Entities.TigerOrSnowLeopard] = new List diff --git a/TRRandomizerCore/Randomizers/TR2/TR2EnemyRandomizer.cs b/TRRandomizerCore/Randomizers/TR2/TR2EnemyRandomizer.cs index 6dae78038..c1b17b5ec 100644 --- a/TRRandomizerCore/Randomizers/TR2/TR2EnemyRandomizer.cs +++ b/TRRandomizerCore/Randomizers/TR2/TR2EnemyRandomizer.cs @@ -680,20 +680,42 @@ private void RandomizeEnemies(TR2CombinedLevel level, EnemyRandomizationCollecti private void RandomizeEnemyMeshes(TR2CombinedLevel level, EnemyRandomizationCollection enemies) { - // #314 A very primitive start to mixing-up enemy meshes - if we have both monk types, and we're - // not using docile chickens, make one set of monks become Lara. - if (Settings.CrossLevelEnemies - && !Settings.DocileBirdMonsters - && enemies.Available.Contains(TR2Entities.MonkWithKnifeStick) - && enemies.Available.Contains(TR2Entities.MonkWithLongStick)) - { - TR2Entities monkType = _generator.Next(0, 2) == 0 ? TR2Entities.MonkWithKnifeStick : TR2Entities.MonkWithLongStick; - List models = level.Data.Models.ToList(); - TRModel laraModel = models.Find(m => m.ID == (uint)TR2Entities.Lara); - TRModel monkModel = models.Find(m => m.ID == (uint)monkType); - monkModel.MeshTree = laraModel.MeshTree; - monkModel.StartingMesh = laraModel.StartingMesh; - monkModel.NumMeshes = laraModel.NumMeshes; + // #314 A very primitive start to mixing-up enemy meshes - monks and yetis can take on Lara's meshes + // without manipulation, so add a random chance of this happening if any of these models are in place. + if (!Settings.CrossLevelEnemies) + { + return; + } + + List laraClones = new List(); + const int chance = 2; + if (!Settings.DocileBirdMonsters) + { + AddRandomLaraClone(enemies, TR2Entities.MonkWithKnifeStick, laraClones, chance); + AddRandomLaraClone(enemies, TR2Entities.MonkWithLongStick, laraClones, chance); + } + + AddRandomLaraClone(enemies, TR2Entities.Yeti, laraClones, chance); + + if (laraClones.Count > 0) + { + List levelModels = level.Data.Models.ToList(); + TRModel laraModel = levelModels.Find(m => m.ID == (uint)TR2Entities.Lara); + foreach (TR2Entities enemyType in laraClones) + { + TRModel enemyModel = levelModels.Find(m => m.ID == (uint)enemyType); + enemyModel.MeshTree = laraModel.MeshTree; + enemyModel.StartingMesh = laraModel.StartingMesh; + enemyModel.NumMeshes = laraModel.NumMeshes; + } + } + } + + private void AddRandomLaraClone(EnemyRandomizationCollection enemies, TR2Entities enemyType, List cloneCollection, int chance) + { + if (enemies.Available.Contains(enemyType) && _generator.Next(0, chance) == 0) + { + cloneCollection.Add(enemyType); } } diff --git a/TRRandomizerCore/Resources/TR3/Environment/AREA51.TR2-Environment.json b/TRRandomizerCore/Resources/TR3/Environment/AREA51.TR2-Environment.json index 25db343ad..904a37d8a 100644 --- a/TRRandomizerCore/Resources/TR3/Environment/AREA51.TR2-Environment.json +++ b/TRRandomizerCore/Resources/TR3/Environment/AREA51.TR2-Environment.json @@ -332,6 +332,81 @@ "EMType": 45, "EntityIndex": 182, "NewEntityType": 137 + }, + + { + "Comments": "There are hard-coded shenanigans for the missile blast, meaning it won't work in mirrored. So make it a dramatic medi pack instead, and make the beams other pickups.", + "EMType": 45, + "EntityIndex": 70, + "NewEntityType": 177 + }, + { + "EMType": 45, + "EntityIndex": 72, + "NewEntityType": 178 + }, + { + "EMType": 45, + "EntityIndex": 77, + "NewEntityType": 169 + }, + { + "Comments": "Move the items to the floor.", + "EMType": 44, + "EntityIndex": 70, + "TargetLocation": { + "X": 44038, + "Y": 6400, + "Z": 64500, + "Room": 52, + "Angle": -32768 + } + }, + { + "EMType": 44, + "EntityIndex": 72, + "TargetLocation": { + "X": 55808, + "Y": 5632, + "Z": 65024, + "Room": 57, + "Angle": -16384 + } + }, + { + "EMType": 44, + "EntityIndex": 77, + "TargetLocation": { + "X": 55808, + "Y": 5632, + "Z": 62976, + "Room": 57, + "Angle": -16384 + } + }, + { + "Comments": "Get rid of the missile static meshes.", + "EMType": 25, + "ClearFromRooms": { + "17": [ 49, 51, 53 ], + "18": [ 147, 148 ], + "19": [ 49, 51, 53 ], + "20": [ 49, 51, 53 ] + } + }, + { + "Comments": "Make the camera look at the medi pack.", + "EMType": 66, + "TrigAction": 6, + "NewParameter": 70, + "Locations": [ + { + "X": 47616, + "Y": 5888, + "Z": 62976, + "Room": 109 + } + ] } ] } \ No newline at end of file diff --git a/TRRandomizerCore/Utilities/TR2EnemyUtilities.cs b/TRRandomizerCore/Utilities/TR2EnemyUtilities.cs index 466156280..f8a033804 100644 --- a/TRRandomizerCore/Utilities/TR2EnemyUtilities.cs +++ b/TRRandomizerCore/Utilities/TR2EnemyUtilities.cs @@ -493,6 +493,9 @@ public static Dictionary GetAliasPriority(string lvlNa { switch (lvlName) { + case TR2LevelNames.BARTOLI: + priorities[TR2Entities.LaraMiscAnim_H] = TR2Entities.LaraMiscAnim_H_Venice; + break; case TR2LevelNames.RIG: case TR2LevelNames.DA: case TR2LevelNames.DORIA: