Skip to content

Commit

Permalink
Added Flukemunga dive. Visual fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nerthul11 committed Jul 31, 2024
1 parent b323b64 commit 86a476e
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 37 deletions.
2 changes: 1 addition & 1 deletion BreakableWallRandomizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace BreakableWallRandomizer
public class BreakableWallRandomizer : Mod, IGlobalSettings<BWR_Settings>
{
new public string GetName() => "Breakable Wall Randomizer";
public override string GetVersion() => "3.0.1.2";
public override string GetVersion() => "3.0.2.0";
public BWR_Settings GS { get; set; } = new();
private static BreakableWallRandomizer _instance;
public BreakableWallRandomizer() : base()
Expand Down
4 changes: 2 additions & 2 deletions BreakableWallRandomizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Product>BreakableWallRandomizer</Product>
<Description>A Randomizer add-on for wall and floor objects.</Description>
<Copyright>Copyright ©2023</Copyright>
<AssemblyVersion>3.0.1.2</AssemblyVersion>
<FileVersion>3.0.1.2</FileVersion>
<AssemblyVersion>3.0.2.0</AssemblyVersion>
<FileVersion>3.0.2.0</FileVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
37 changes: 12 additions & 25 deletions IC/BreakableWallLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ private void MakeWallPassable(GameObject go, bool destroy)
{
var obj = GameObject.Find(objectName);
GameObject.Destroy(obj);
} catch { }
} catch
{
BreakableWallRandomizer.Instance.LogWarn($"{objectName} not found.");
}
}
Recursive_MakeWallPassable(go, destroy);
}
Expand Down Expand Up @@ -154,8 +157,7 @@ private void Recursive_MakeWallPassable(GameObject go, bool destroy)
sprite.enabled = false;
}
}

if (go.name.Contains("Camera"))
if (go.name.Contains("Camera") || go.name.Contains("Mask"))
{
GameObject.Destroy(go);
}
Expand Down Expand Up @@ -252,7 +254,10 @@ private void ModifyWallBehaviour(PlayMakerFSM fsm)
// If the wall item had been obtained when calling GiveItem, destroy the wall on trigger.
fsm.AddState("DeleteWall");
fsm.AddCustomAction("DeleteWall", () => MakeWallPassable(fsm.gameObject, true));
fsm.AddTransition("DeleteWall", "FINISHED", originalBreakStateName);
if (fsm.GetTransition(originalBreakStateName, "FINISHED") is not null)
fsm.ChangeTransition(originalBreakStateName, "FINISHED", "DeleteWall");
else
fsm.AddTransition(originalBreakStateName, "FINISHED", "DeleteWall");

// Add GiveItem state
fsm.AddState("GiveItem");
Expand All @@ -269,30 +274,12 @@ private void ModifyWallBehaviour(PlayMakerFSM fsm)
fsm.AddAction("GiveItem", new CustomFsmBooleanCheck(
BreakableWallModule.Instance.UnlockedBreakableWalls.Contains(wall.name), "OBTAINED", ""
));
fsm.AddTransition("GiveItem", "OBTAINED", "DeleteWall");
fsm.AddTransition("GiveItem", "OBTAINED", originalBreakStateName);

// If we already unlocked this wall, and items are still left there, make it passable.
// If we already unlocked this wall, make it passable or destroy it.
if (BreakableWallModule.Instance.UnlockedBreakableWalls.Contains(wall.name))
{
// If items are left, make wall semi-transparent and passable.
if (!Placement.AllObtained())
MakeWallPassable(fsm.gameObject, false);
else
{
// Ensure the wall deletes on-load.
if (wall.fsmType == "quake_floor")
{
fsm.ChangeTransition("Init", "FINISHED", "Activate");
fsm.ChangeTransition("Init", "ACTIVATE", "Activate");
} else if (wall.fsmType == "Detect Quake") {
fsm.ChangeTransition("Init", "ACTIVATE", "Activate !!!");
fsm.ChangeTransition("Init", "FINISHED", "Activate !!!");
} else
{
fsm.ChangeTransition("Initiate", "FINISHED", "Activated");
fsm.ChangeTransition("Initiate", "ACTIVATE", "Activated");
}
}
MakeWallPassable(fsm.gameObject, Placement.AllObtained());
}
else
// If we didn't unlock this door yet...
Expand Down
2 changes: 1 addition & 1 deletion Manager/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class BWR_Manager
public static BWR_Settings Settings => BreakableWallRandomizer.Instance.GS;
public static int TotalWalls = 55;
public static int TotalPlanks = 49;
public static int TotalDives = 44;
public static int TotalDives = 45;
public static void Hook()
{
DefineObjects();
Expand Down
40 changes: 33 additions & 7 deletions Resources/Data/BreakableWallObjects.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@
"logicSubstitutions": {
"Deepnest_01b": {
"Deepnest_01b[right1]": "Deepnest_01b[right1] + Plank-Upper_Deepnest"
},
"Deepnest_01b[top1]": {
"Deepnest_01b[right1]": "Deepnest_01b[right1] + Plank-Upper_Deepnest"
}
}
},
Expand Down Expand Up @@ -579,7 +582,9 @@
"persistentBool": "",
"sprite": "deep_crumble_floor_270deg",
"alsoDestroy": [
"Secret Mask"
"Secret Mask",
"Secret Mask (1)",
"Secret Mask (2)"
],
"exit": false,
"groupWalls": [],
Expand All @@ -598,7 +603,9 @@
"persistentBool": "",
"sprite": "break_wall_deepnest_0deg",
"alsoDestroy": [
"Secret Mask"
"Secret Mask",
"Secret Mask (1)",
"Secret Mask (2)"
],
"exit": false,
"groupWalls": [],
Expand All @@ -617,7 +624,9 @@
"persistentBool": "",
"sprite": "break_wall_deepnest_0deg",
"alsoDestroy": [
"Secret Mask"
"Secret Mask",
"Secret Mask (1)",
"Secret Mask (2)"
],
"exit": false,
"groupWalls": [],
Expand Down Expand Up @@ -1913,8 +1922,8 @@
"gameObject": "/Breakable Wall",
"fsmType": "breakable_wall_v2",
"sceneName": "Ruins2_03",
"x": 0.0,
"y": 0.0,
"x": -0.5,
"y": 0.8,
"persistentBool": "",
"sprite": "ruin_break_roof_90deg",
"alsoDestroy": [],
Expand Down Expand Up @@ -2104,7 +2113,7 @@
"exit": false,
"groupWalls": [],
"group": "",
"logic": "Waterways_08[left2] + Wall-Junk_Pit_Entrance | (Waterways_08[top1] | Bench-Fort_Flukefey?NONE + (WINGS + ENEMYPOGOS | WINGS + ANYCLAW | SWIM + ENEMYPOGOS + LEFTCLAW)) + Plank-Junk_Pit_Exit",
"logic": "Waterways_08[left2] + Wall-Junk_Pit_Entrance | Waterways_08[left1] + (LEFTCLAW | WINGS) | Waterways_08[top1] + (Plank-Junk_Pit_Exit | WINGS + ENEMYPOGOS | WINGS + ANYCLAW | FULLCLAW)",
"logicOverrides": {},
"logicSubstitutions": {}
},
Expand All @@ -2121,7 +2130,7 @@
"exit": false,
"groupWalls": [],
"group": "",
"logic": "Waterways_08[left2] | (Waterways_08[top1] | Bench-Fort_Flukefey?NONE + (WINGS + ENEMYPOGOS | WINGS + ANYCLAW | SWIM + ENEMYPOGOS + LEFTCLAW)) + Plank-Junk_Pit_Exit",
"logic": "Waterways_08[left2] | Waterways_08[left1] + (LEFTCLAW | WINGS) + UPWALLBREAK | Waterways_08[top1] + (Plank-Junk_Pit_Exit | WINGS + ENEMYPOGOS | WINGS + ANYCLAW | FULLCLAW) + UPWALLBREAK",
"logicOverrides": {
"Waterways_08[left2]": "(ORIG) + Wall-Junk_Pit_Entrance"
},
Expand Down Expand Up @@ -3049,5 +3058,22 @@
"logic": "GG_Workshop + Wall-Godhome_Workshop + RIGHTCLAW + WINGS + (LEFTSUPERDASH | LEFTSHARPSHADOW)",
"logicOverrides": {},
"logicSubstitutions": {}
},
{
"name": "Dive_Floor-Flukemungas",
"gameObject": "/Quake Floor",
"fsmType": "quake_floor",
"sceneName": "GG_Pipeway",
"x": 0.8,
"y": 0.0,
"persistentBool": "",
"sprite": "break_floor",
"alsoDestroy": [],
"exit": false,
"groupWalls": [],
"group": "",
"logic": "(GG_Pipeway[left1] | GG_Pipeway[right1]) + (ANYCLAW | WINGS) + QUAKE + $CASTSPELL",
"logicOverrides": {},
"logicSubstitutions": {}
}
]
4 changes: 3 additions & 1 deletion Resources/Data/WallGroups.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
"persistentBool": "",
"sprite": "break_wall_deepnest_0deg",
"alsoDestroy": [
"Secret Mask"
"Secret Mask",
"Secret Mask (1)",
"Secret Mask (2)"
],
"exit": false,
"groupWalls": [],
Expand Down

0 comments on commit 86a476e

Please sign in to comment.