-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using HutongGames.PlayMaker; | ||
using HutongGames.PlayMaker.Actions; | ||
using Pet.Utils; | ||
using SFCore.Utils; | ||
using static HutongGames.PlayMaker.FsmEventTarget; | ||
|
||
namespace Pet.Modules; | ||
|
||
internal class Kingsoul | ||
{ | ||
internal bool IsLoaded { get; set; } | ||
|
||
internal void Load() | ||
{ | ||
this.LogMod("Load()"); | ||
IsLoaded = true; | ||
|
||
// set up as if hero has lantern | ||
KingsoulCharmFsm.GetState("Check").Insert(new FsmUtils.InsertParam | ||
{ | ||
Action = new SendEvent | ||
{ | ||
eventTarget = Self, | ||
sendEvent = FsmEvent.GetFsmEvent("ACTIVE"), | ||
delay = 0f, | ||
}, | ||
Named = "Pet Has Kingsoul", | ||
Before = typeof(PlayerDataBoolTest), | ||
}); | ||
KingsoulCharmFsm.SetState("Check"); | ||
} | ||
|
||
internal void Unload() | ||
{ | ||
if (!IsLoaded) return; | ||
|
||
this.LogMod("Unload()"); | ||
IsLoaded = false; | ||
|
||
// recover setup | ||
KingsoulCharmFsm.GetState("Check").RemoveActionByName("Pet Has Kingsoul"); | ||
KingsoulCharmFsm.SetState("Check"); | ||
} | ||
|
||
private PlayMakerFSM KingsoulCharmFsm => HeroController.instance.gameObject.Find("Charm Effects").GetComponent<PlayMakerFSM>(fsm => fsm.FsmName == "White Charm"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters