Skip to content

Commit

Permalink
Updating dependencies and shortening Hatchling code
Browse files Browse the repository at this point in the history
  • Loading branch information
Exempt-Medic committed Nov 30, 2022
1 parent fb89b58 commit c23eba4
Show file tree
Hide file tree
Showing 5 changed files with 339 additions and 377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: BadMagic100/setup-hk@v1
with:
apiPath: API
#dependencyFilePath: HiveKin/ModDependencies.txt
dependencyFilePath: HiveKin/ModDependencies.txt

- name: Setup .NET
uses: actions/setup-dotnet@v3
Expand Down
40 changes: 3 additions & 37 deletions HiveKin/HiveKin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public HiveKinMod() : base("HiveKin")
_instance = this;
}


public override void Initialize()
{
Log("Initializing");
Expand Down Expand Up @@ -59,45 +58,12 @@ private void OnSetVelocity2dAction(On.HutongGames.PlayMaker.Actions.SetVelocity2
{
orig(self);

if (self.Fsm.GameObject.name == "Knight" && self.Fsm.Name == "Spell Control" && self.State.Name == "Spell End" && PlayerDataAccess.equippedCharm_29)
if (self.Fsm.GameObject.name == "Knight" && self.Fsm.Name == "Spell Control" && self.State.Name == "Spell End" && PlayerDataAccess.equippedCharm_29 && self.Fsm.PreviousActiveState.Name != "Send Event")
{
int spellLevel = self.Fsm.FsmComponent.GetFsmIntVariable("Spell Level").Value;

if (self.Fsm.PreviousActiveState.Name == "Fireball Recoil")
{
if (spellLevel == 1)
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}

else
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}
}
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);

else if (self.Fsm.PreviousActiveState.Name == "Quake Finish")
if (self.Fsm.FsmComponent.GetFsmIntVariable("Spell Level").Value == 2)
{
if (spellLevel == 1)
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}
else
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}
}

else if (self.Fsm.PreviousActiveState.Name == "Scream End")
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}

else if (self.Fsm.PreviousActiveState.Name == "Scream End 2")
{
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
HeroController.instance.gameObject.transform.Find("Charm Effects").gameObject.LocateMyFSM("Hatchling Spawn").GetFsmAction<SpawnObjectFromGlobalPool>("Hatch", 2).gameObject.Value.gameObject.Spawn(HeroController.instance.gameObject.transform.position);
}
}
Expand Down
Loading

0 comments on commit c23eba4

Please sign in to comment.