Skip to content

Commit

Permalink
Minor cleanup. Add Finder locations for Grubfather and Seer, and make…
Browse files Browse the repository at this point in the history
… PreventGrimmTroupeLeave default.
  • Loading branch information
homothetyhk committed Jan 8, 2022
1 parent c0f4c3a commit 3a3a231
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 48 deletions.
2 changes: 2 additions & 0 deletions ItemChanger/LocationNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public static string[] ToArray()
public const string Iselda = "Iselda";
public const string Salubra = "Salubra";
public const string Leg_Eater = "Leg_Eater";
public const string Grubfather = "Grubfather";
public const string Seer = "Seer";
public const string Lurien = "Lurien";
public const string Monomon = "Monomon";
public const string Herrah = "Herrah";
Expand Down
14 changes: 1 addition & 13 deletions ItemChanger/Locations/SpecialLocations/ColosseumLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,16 @@ protected override void OnLoad()
{
base.OnLoad();
Events.AddFsmEdit(sceneName, new("Colosseum Manager", "Geo Pool"), ChangeColoEnd);
//Events.AddFsmEdit(sceneName, new("Colosseum Manager", "Battle Control"), SkipColoForTesting);
Events.AddLanguageEdit(new("Prompts", GetTrialBoardConvo()), OnLanguageGet);
}

protected override void OnUnload()
{
base.OnUnload();
Events.RemoveFsmEdit(sceneName, new("Colosseum Manager", "Geo Pool"), ChangeColoEnd);
//Events.RemoveFsmEdit(sceneName, new("Colosseum Manager", "Battle Control"), SkipColoForTesting);
Events.RemoveLanguageEdit(new("Prompts", GetTrialBoardConvo()), OnLanguageGet);
}

/*
private void SkipColoForTesting(PlayMakerFSM fsm)
{
// For testing only! Skip to end after first wave.
FsmState wave1 = fsm.GetState("Wave 1");
wave1.ClearTransitions();
wave1.AddTransition("WAVE END", "End");
}
*/

private void ChangeColoEnd(PlayMakerFSM fsm)
{
FsmState openGates = fsm.GetState("Open Gates");
Expand Down Expand Up @@ -89,7 +77,7 @@ private string GetTrialBoardConvo()

private string GetTrialBoardHint(string itemText)
{
StringBuilder sb = new StringBuilder();
StringBuilder sb = new();
switch (sceneName)
{
default:
Expand Down
32 changes: 32 additions & 0 deletions ItemChanger/Locations/SpecialLocations/CostChestLocation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using ItemChanger.Placements;

namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// Wrapper location to allow converting a ContainerLocation, PlaceableLocation pair to a CostChestPlacement.
/// </summary>
public class CostChestLocation : AbstractLocation
{
public ContainerLocation chestLocation;
public PlaceableLocation tabletLocation;

public override AbstractPlacement Wrap()
{
return new CostChestPlacement(name)
{
chestLocation = chestLocation,
tabletLocation = tabletLocation,
};
}

protected override void OnLoad()
{
throw new NotImplementedException();
}

protected override void OnUnload()
{
throw new NotImplementedException();
}
}
}
8 changes: 3 additions & 5 deletions ItemChanger/Locations/SpecialLocations/DivineLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
using ItemChanger.FsmStateActions;
using ItemChanger.Internal;
using ItemChanger.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// Location which replaces the shinies inside Divine's room. Each of the 3 shinies requires its own location with this implementation.
/// </summary>
public class DivineLocation : ExistingFsmContainerLocation
{
public enum DivineShopSlot
Expand Down
17 changes: 1 addition & 16 deletions ItemChanger/Locations/SpecialLocations/DreamNailLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,25 @@
namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// ObjectLocation which places a shiny at the end of the Dream Nail sequence that triggers a scene change to the Seer's room. Expects that no other shinies are placed in the Dream Nail sequence.
/// ObjectLocation which makes a minor change to the Dream Nail sequence to prevent Unity error logs.
/// </summary>
public class DreamNailLocation : ObjectLocation
{
protected override void OnLoad()
{
base.OnLoad();
Events.AddFsmEdit(sceneName, new("Witch Control", "Control"), RemoveSetCollider);
//Events.AddFsmEdit(sceneName, new("Shiny Control"), EditShiny);
}

protected override void OnUnload()
{
base.OnUnload();
Events.RemoveFsmEdit(sceneName, new("Witch Control", "Control"), RemoveSetCollider);
//Events.RemoveFsmEdit(sceneName, new("Shiny Control"), EditShiny);
}

private void RemoveSetCollider(PlayMakerFSM fsm)
{
fsm.GetState("Convo Ready").RemoveActionsOfType<SetCollider>(); // not important, but prevents null ref unity logs after destroying Moth NPC object
}

/*
* Moved to tag
private void EditShiny(PlayMakerFSM fsm)
{
fsm.FsmVariables.FindFsmBool("Exit Dream").Value = true;
fsm.GetState("Fade Pause").AddFirstAction(new Lambda(() =>
{
PlayerData.instance.dreamReturnScene = "RestingGrounds_07";
HeroController.instance.proxyFSM.FsmVariables.GetFsmBool("No Charms").Value = false;
}));
}
*/
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using HutongGames.PlayMaker.Actions;
using ItemChanger.FsmStateActions;
using ItemChanger.Extensions;

namespace ItemChanger.Locations.SpecialLocations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ItemChanger.Locations.SpecialLocations
namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// Boss Essence Location which supports a hint from reading Bretta's Diary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// ObjectLocation which modifies an additional shiny holder fsm related to the Queen Fragment.
/// </summary>
public class QueenFragmentLocation : ObjectLocation
{
protected override void OnLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace ItemChanger.Locations.SpecialLocations
{
/// <summary>
/// AutoLocation which modifies Tuk to give items through a flung shiny when the player has a certain charm equipped (by default, Defender's Crest).
/// </summary>
public class TukDefendersCrestLocation : AutoLocation
{
public int requiredCharmID = 10;
Expand Down
3 changes: 3 additions & 0 deletions ItemChanger/Modules/LeftCityChandelier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace ItemChanger.Modules
{
/// <summary>
/// Module which makes a chandelier in left City of Tears pogoable, restoring a skip that was removed when Ruins1_05 was split into two rooms in the Lifeblood update.
/// </summary>
[DefaultModule]
public class LeftCityChandelier : Module
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using HutongGames.PlayMaker.Actions;
using Modding;
using ItemChanger.Extensions;
using ItemChanger.FsmStateActions;
using Modding;

namespace ItemChanger.Modules
{
/// <summary>
/// Module which prevents the Grimm and Divine tents from leaving Dirtmouth.
/// </summary>
public class GrimmTroupeTentUnlock : Module
[DefaultModule]
public class PreventGrimmTroupeLeave : Module
{
public override void Initialize()
{
Expand Down
3 changes: 3 additions & 0 deletions ItemChanger/Modules/RightCityPlatform.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace ItemChanger.Modules
{
/// <summary>
/// Module which adds a platform to Right City, replacing a Great Husk Sentry pogo that was removed when its patrol range was changed in the Lifeblood update.
/// </summary>
[DefaultModule]
public class RightCityPlatform : Module
{
Expand Down
3 changes: 3 additions & 0 deletions ItemChanger/Modules/SplitSuperdash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace ItemChanger.Modules
{
/// <summary>
/// Module which implements the split superdash custom skills.
/// </summary>
public class SplitSuperdash : Module
{
public bool hasSuperdashLeft { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion ItemChanger/Modules/SwimSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace ItemChanger.Modules
{
/// <summary>
/// Module which implements the split swim custom skill.
/// Module which implements the swim custom skill.
/// </summary>
public class SwimSkill : Module
{
Expand Down
62 changes: 62 additions & 0 deletions ItemChanger/Resources/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,68 @@
"flingType": "DirectDeposit",
"tags": null
},
"Grubfather": {
"$type": "ItemChanger.Locations.SpecialLocations.CostChestLocation, ItemChanger",
"chestLocation": {
"$type": "ItemChanger.Locations.CoordinateLocation, ItemChanger",
"x": 36.0,
"y": 4.0,
"elevation": 0.0,
"managed": false,
"forceShiny": false,
"name": "Grubfather",
"sceneName": "Crossroads_38",
"flingType": "Everywhere",
"tags": null
},
"tabletLocation": {
"$type": "ItemChanger.Locations.CoordinateLocation, ItemChanger",
"x": 54.0,
"y": 4.0,
"elevation": 0.0,
"managed": false,
"forceShiny": false,
"name": "Grubfather",
"sceneName": "Crossroads_38",
"flingType": "Everywhere",
"tags": null
},
"name": "Grubfather",
"sceneName": "Crossroads_38",
"flingType": "Everywhere",
"tags": null
},
"Seer": {
"$type": "ItemChanger.Locations.SpecialLocations.CostChestLocation, ItemChanger",
"chestLocation": {
"$type": "ItemChanger.Locations.CoordinateLocation, ItemChanger",
"x": 33.0,
"y": 10.0,
"elevation": 0.0,
"managed": false,
"forceShiny": false,
"name": "Seer",
"sceneName": "RestingGrounds_07",
"flingType": "Everywhere",
"tags": null
},
"tabletLocation": {
"$type": "ItemChanger.Locations.CoordinateLocation, ItemChanger",
"x": 42.0,
"y": 10.0,
"elevation": 0.0,
"managed": false,
"forceShiny": false,
"name": "Seer",
"sceneName": "RestingGrounds_07",
"flingType": "Everywhere",
"tags": null
},
"name": "Seer",
"sceneName": "RestingGrounds_07",
"flingType": "Everywhere",
"tags": null
},
"Lurien": {
"$type": "ItemChanger.Locations.SpecialLocations.DreamerLocation, ItemChanger",
"previousScene": "Ruins2_Watcher_Room",
Expand Down

0 comments on commit 3a3a231

Please sign in to comment.