public AddTransition ( FsmTransitionId trans, FsmStateId id ) : void | ||
trans | FsmTransitionId | |
id | FsmStateId | |
Résultat | void |
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState bigItem = fsm.GetState("Big Item?"); FsmState bigGetFlash = fsm.GetState("Big Get Flash"); FsmState trinkFlash = fsm.GetState("Trink Flash"); FsmState giveTrinket = fsm.GetState("Store Key"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <StringCompare>(); // Change pd bool test to our new bool pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.AddAction( new RandomizerExecuteLambda(() => fsm.SendEvent( ItemChanger.instance.Settings.CheckObtained(_ilp.id) ? "COLLECTED" : null ))); // Charm must be preserved as the entry point for AddYNDialogueToShiny charm.ClearTransitions(); charm.AddTransition("FINISHED", "Big Item?"); // Check whether next item should be normal or big popup bigItem.ClearTransitions(); bigItem.AddFirstAction(new RandomizerExecuteLambda(() => bigItem.AddTransition("FINISHED", GetNextAdditiveItem(_ilp).item.type != _Item.ItemType.Big ? "Trink Flash" : "Big Get Flash"))); // normal path trinkFlash.ClearTransitions(); trinkFlash.AddTransition("FINISHED", "Store Key"); fsm.GetState("Trinket Type").ClearTransitions(); trinkFlash.AddTransition("FINISHED", "Store Key"); giveTrinket.RemoveActionsOfType <SetPlayerDataBool>(); giveTrinket.AddAction(new RandomizerExecuteLambda(() => GiveItem(_ilp))); giveTrinket.AddFirstAction(new RandomizerExecuteLambda( () => { giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = GetNextAdditiveItem(_ilp).item.nameKey; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = GetNextAdditiveItem(_ilp).item.sprite; })); // Normal path for big items. Set bool and show the popup after the flash bigGetFlash.AddAction(new RandomizerExecuteLambda(() => BigItemPopup.Show(GetNextAdditiveItem(_ilp).item, fsm.gameObject, "GET ITEM MSG END"))); // set the pickup bigGetFlash.AddAction(new RandomizerExecuteLambda(() => GiveItem(_ilp))); // Exit the fsm after the popup bigGetFlash.ClearTransitions(); bigGetFlash.AddTransition("GET ITEM MSG END", "Hero Up"); bigGetFlash.AddTransition("HERO DAMAGED", "Finish"); }
/// <summary> /// Call after ModifyShiny to add cost. /// </summary> public static void AddYNDialogueToShiny(PlayMakerFSM shinyFsm, Cost cost, IEnumerable <AbstractItem> items) { FsmState charm = shinyFsm.GetState("Charm?"); FsmState yesState = shinyFsm.GetState(charm.Transitions[0].ToState); FsmState noState = new FsmState(shinyFsm.GetState("Idle")) { Name = "YN No" }; FsmState giveControl = new FsmState(shinyFsm.GetState("Idle")) { Name = "Give Control" }; FsmStateAction closeYNDialogue = new RandomizerExecuteLambda(() => CloseYNDialogue()); noState.ClearTransitions(); noState.RemoveActionsOfType <FsmStateAction>(); noState.AddTransition("FINISHED", "Give Control"); Tk2dPlayAnimationWithEvents heroUp = new Tk2dPlayAnimationWithEvents { gameObject = new FsmOwnerDefault { OwnerOption = OwnerDefaultOption.SpecifyGameObject, GameObject = SereCore.Ref.Hero.gameObject }, clipName = "Collect Normal 3", animationTriggerEvent = null, animationCompleteEvent = FsmEvent.GetFsmEvent("FINISHED") }; noState.AddAction(closeYNDialogue); noState.AddAction(heroUp); giveControl.ClearTransitions(); giveControl.RemoveActionsOfType <FsmStateAction>(); giveControl.AddTransition("FINISHED", "Idle"); giveControl.AddAction(new RandomizerExecuteLambda(() => PlayMakerFSM.BroadcastEvent("END INSPECT"))); shinyFsm.AddState(noState); shinyFsm.AddState(giveControl); charm.ClearTransitions(); charm.AddTransition("HERO DAMAGED", noState.Name); charm.AddTransition("NO", noState.Name); charm.AddTransition("YES", yesState.Name); yesState.AddFirstAction(new RandomizerExecuteLambda(() => cost.Pay())); yesState.AddFirstAction(closeYNDialogue); charm.AddFirstAction(new RandomizerExecuteLambda(() => OpenYNDialogue(shinyFsm.gameObject, items, cost))); }
public static void AddToShiny(PlayMakerFSM fsm, string text, Func <bool> canBuy) { FsmState noState = new FsmState(fsm.GetState("Idle")) { Name = "YN No" }; noState.ClearTransitions(); noState.RemoveActionsOfType <FsmStateAction>(); noState.AddTransition("FINISHED", "Give Control"); Tk2dPlayAnimationWithEvents heroUp = new Tk2dPlayAnimationWithEvents { gameObject = new FsmOwnerDefault { OwnerOption = OwnerDefaultOption.SpecifyGameObject, GameObject = HeroController.instance.gameObject }, clipName = "Collect Normal 3", animationTriggerEvent = null, animationCompleteEvent = FsmEvent.GetFsmEvent("FINISHED") }; noState.AddAction(new ExecuteLambda(CloseYNDialogue)); noState.AddAction(heroUp); FsmState giveControl = new FsmState(fsm.GetState("Idle")) { Name = "Give Control" }; giveControl.ClearTransitions(); giveControl.RemoveActionsOfType <FsmStateAction>(); giveControl.AddTransition("FINISHED", "Idle"); giveControl.AddAction(new ExecuteLambda(() => PlayMakerFSM.BroadcastEvent("END INSPECT"))); fsm.AddState(noState); fsm.AddState(giveControl); FsmState charm = fsm.GetState("Charm?"); string yesState = charm.Transitions[0].ToState; charm.ClearTransitions(); charm.AddTransition("HERO DAMAGED", noState.Name); charm.AddTransition("NO", noState.Name); charm.AddTransition("YES", yesState); fsm.GetState(yesState).AddAction(new ExecuteLambda(CloseYNDialogue)); charm.AddFirstAction(new ExecuteLambda(() => OpenYNDialogue(fsm.gameObject, text, canBuy))); }
public static void ModifyGeoRock(PlayMakerFSM rockFsm, FlingType flingType, AbstractPlacement location, IEnumerable <AbstractItem> items) { GameObject rock = rockFsm.gameObject; FsmState init = rockFsm.GetState("Initiate"); FsmState hit = rockFsm.GetState("Hit"); FsmState payout = rockFsm.GetState("Destroy"); FsmState broken = rockFsm.GetState("Broken"); FsmStateAction checkAction = new RandomizerExecuteLambda(() => rockFsm.SendEvent(location.HasVisited() ? "BROKEN" : null)); init.RemoveActionsOfType <IntCompare>(); init.AddAction(checkAction); hit.ClearTransitions(); hit.AddTransition("HIT", "Pause Frame"); hit.AddTransition("FINISHED", "Pause Frame"); hit.RemoveActionsOfType <FlingObjectsFromGlobalPool>(); var payoutAction = payout.GetActionOfType <FlingObjectsFromGlobalPool>(); payoutAction.spawnMin.Value = 0; payoutAction.spawnMax.Value = 0; GameObject itemParent = new GameObject("item"); itemParent.transform.SetParent(rock.transform); itemParent.transform.position = rock.transform.position; itemParent.transform.localPosition = Vector3.zero; itemParent.SetActive(true); FsmStateAction spawnShinies = new ActivateAllChildren { gameObject = new FsmGameObject { Value = itemParent, }, activate = true }; payout.AddAction(spawnShinies); broken.AddAction(spawnShinies); foreach (AbstractItem item in items) { if (item.GiveEarly(Container.GeoRock)) { FsmStateAction giveAction = new RandomizerExecuteLambda(() => item.Give(location, Container.GeoRock, flingType, rockFsm.gameObject.transform, message: MessageType.None)); payout.AddAction(giveAction); } else { GameObject shiny = ShinyUtility.MakeNewShiny(location, item); ShinyUtility.PutShinyInContainer(itemParent, shiny); } } }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState bigGetFlash = fsm.GetState("Big Get Flash"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <StringCompare>(); // Change pd bool test to our new bool PlayerDataBoolTest boolTest = pdBool.GetActionsOfType <PlayerDataBoolTest>()[0]; if (_playerdata) { boolTest.boolName = _boolName; } else { RandomizerBoolTest randBoolTest = new RandomizerBoolTest(_boolName, boolTest.isFalse, boolTest.isTrue); pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.AddFirstAction(randBoolTest); } // Force the FSM to show the big item flash charm.ClearTransitions(); charm.AddTransition("FINISHED", "Big Get Flash"); // Set bool and show the popup after the flash bigGetFlash.AddAction(new RandomizerCallStaticMethod( typeof(BigItemPopup), nameof(BigItemPopup.ShowAdditive), _itemDefs, fsm.gameObject, "GET ITEM MSG END")); // Don't actually need to set the skill here, that happens in BigItemPopup // Maybe change that at some point, it's not where it should happen if (!_playerdata) { bigGetFlash.AddAction(new RandomizerSetBool(_boolName, true)); } // Exit the fsm after the popup bigGetFlash.ClearTransitions(); bigGetFlash.AddTransition("GET ITEM MSG END", "Hero Up"); bigGetFlash.AddTransition("HERO DAMAGED", "Finish"); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName) { return; } // Put a shiny in the same location as the original GameObject shiny = ObjectCache.ShinyItem; shiny.name = _newShinyName; shiny.transform.position = new Vector3(_x, _y, shiny.transform.position.z); shiny.SetActive(true); // Force the new shiny to fall straight downwards PlayMakerFSM fsm = FSMUtility.LocateFSM(shiny, "Shiny Control"); FsmState fling = fsm.GetState("Fling?"); fling.ClearTransitions(); fling.AddTransition("FINISHED", "Fling R"); FlingObject flingObj = fsm.GetState("Fling R").GetActionsOfType <FlingObject>()[0]; flingObj.angleMin = flingObj.angleMax = 270; // For some reason not setting speed manually messes with the object position flingObj.speedMin = flingObj.speedMax = 0.1f; }
public override void Process(string scene, UnityEngine.Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState trinkFlash = fsm.GetState("Trink Flash"); FsmState giveTrinket = fsm.GetState("Store Key"); // This path works well for our changes // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction(new RandomizerBoolTest(_item, null, "COLLECTED", true)); // Force the FSM to follow the path for the correct trinket charm.ClearTransitions(); charm.AddTransition("FINISHED", "Trink Flash"); trinkFlash.ClearTransitions(); fsm.GetState("Trinket Type").ClearTransitions(); trinkFlash.AddTransition("FINISHED", "Store Key"); giveTrinket.RemoveActionsOfType <SetPlayerDataBool>(); giveTrinket.AddAction(new RandomizerExecuteLambda(() => GiveItem(_action, _item, _location))); // Makes sure the correct icon and text appear giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = _nameKey; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = RandomizerMod.GetSprite(_spriteName); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState getCharm = fsm.GetState("Get Charm"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction( new RandomizerExecuteLambda(() => fsm.SendEvent( RandomizerMod.Instance.Settings.CheckLocationFound(_location) ? "COLLECTED" : null ))); // Mimic the way geo spawns work. charm.ClearTransitions(); charm.AddTransition("FINISHED", "Get Charm"); getCharm.RemoveActionsOfType <SetPlayerDataBool>(); getCharm.RemoveActionsOfType <IncrementPlayerDataInt>(); getCharm.RemoveActionsOfType <SendMessage>(); getCharm.AddAction(new RandomizerExecuteLambda(() => GiveItemActions.GiveItem(GiveItemActions.GiveAction.None, _item, _location))); getCharm.AddAction(new RandomizerAddLifeblood(_masksAmount)); getCharm.ClearTransitions(); getCharm.AddTransition("FINISHED", "Flash"); }
// Enable Jiji hints when the player does not have a shade public static void EnableJijiHints() { if (PlayerData.instance.shadeScene != "None") { PlayMakerFSM jijiFsm = GameObject.Find("Jiji NPC").LocateMyFSM("Conversation Control"); FsmState HasShade = jijiFsm.GetState("Has Shade?"); HasShade.RemoveTransitionsTo("Check Location"); HasShade.AddTransition("YES", "Offer"); } else if (RandomizerMod.Instance.Settings.Jiji) { PlayerData.instance.SetString("shadeMapZone", "HIVE"); PlayMakerFSM jijiFsm = GameObject.Find("Jiji NPC").LocateMyFSM("Conversation Control"); FsmState BoxUp = jijiFsm.GetState("Box Up"); BoxUp.ClearTransitions(); BoxUp.AddFirstAction(jijiFsm.GetState("Convo Choice").GetActionsOfType <GetPlayerDataInt>()[0]); BoxUp.AddTransition("FINISHED", "Offer"); FsmState SendText = jijiFsm.GetState("Send Text"); SendText.RemoveTransitionsTo("Yes"); SendText.AddTransition("YES", "Check Location"); FsmState CheckLocation = jijiFsm.GetState("Check Location"); CheckLocation.AddFirstAction(BoxUp.GetActionsOfType <SendEventByName>()[0]); CheckLocation.AddFirstAction(jijiFsm.GetState("Convo Choice").GetActionsOfType <GetPlayerDataInt>()[0]); CheckLocation.AddFirstAction(jijiFsm.GetState("Yes").GetActionsOfType <PlayerDataIntAdd>()[0]); CheckLocation.AddFirstAction(jijiFsm.GetState("Yes").GetActionsOfType <SendEventByName>()[0]); } }
public static void EnableEggShop(PlayMakerFSM jijiFsm) { #region Convo management FsmState convoChoice = jijiFsm.GetState("Convo Choice"); convoChoice.RemoveActionsOfType <PlayerDataBoolTest>(); convoChoice.RemoveActionsOfType <BoolTest>(); convoChoice.RemoveActionsOfType <PlayerDataBoolTrueAndFalse>(); convoChoice.RemoveActionsOfType <SendEvent>(); convoChoice.AddTransition("FINISHED", "Greet"); // Always display the Jiji:GREET convo FsmState greet = jijiFsm.GetState("Greet"); greet.ClearTransitions(); greet.AddTransition("CONVO_FINISH", "Offer"); // Always display the Jiji:SHADE_OFFER convo // Display the Prompts:JIJI_OFFER YN prompt // No: Jiji:DECLINE FsmState yesState = jijiFsm.GetState("Yes"); yesState.RemoveActionsOfType <SetPlayerDataString>(); yesState.RemoveActionsOfType <SetPlayerDataInt>(); yesState.RemoveActionsOfType <SetPlayerDataFloat>(); yesState.RemoveActionsOfType <PlayerDataIntAdd>(); yesState.AddFirstAction(new RandomizerExecuteLambda(() => { int eggs = Ref.PD.GetInt(nameof(PlayerData.rancidEggs)); if (eggs > RandomizerMod.Instance.Settings.MaxEggCost - Ref.PD.jinnEggsSold) { eggs = RandomizerMod.Instance.Settings.MaxEggCost - Ref.PD.jinnEggsSold; } Ref.PD.IntAdd(nameof(PlayerData.rancidEggs), -eggs); Ref.PD.IntAdd(nameof(PlayerData.jinnEggsSold), eggs); })); // Jiji:RITUAL_BEGIN #endregion #region Shiny Spawning FsmState spawn = jijiFsm.GetState("Spawn"); spawn.RemoveActionsOfType <CreateObject>(); spawn.AddAction(new RandomizerExecuteLambda(() => { foreach (Transform shinytransform in GameObject.Find("Spawn Point").transform) { GameObject shiny = shinytransform.gameObject; if (!shiny.name.StartsWith("Randomizer Shiny ")) { continue; } string location = shiny.name.Substring(17); if (Ref.PD.jinnEggsSold >= RandomizerMod.Instance.Settings.GetVariableCost(location)) { shiny.SetActive(true); } } })); #endregion }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState getCharm = fsm.GetState("Get Charm"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add action to potentially despawn the object pdBool.AddAction(new RandomizerBoolTest(_boolName, null, "COLLECTED", true)); // Force the FSM into the charm state, set it to the correct charm charm.ClearTransitions(); charm.AddTransition("FINISHED", "Get Charm"); getCharm.RemoveActionsOfType <SetPlayerDataBool>(); getCharm.AddAction(new RandomizerSetBool(_boolName, true, true)); getCharm.AddFirstAction(new RandomizerExecuteLambda(() => RandomizerMod.Instance.Settings.UpdateObtainedProgressionByBoolName(_boolName))); getCharm.AddAction(new RandomizerExecuteLambda(() => RandoLogger.UpdateHelperLog())); getCharm.AddAction(new RandomizerExecuteLambda(() => RandoLogger.LogItemToTrackerByBoolName(_boolName, _location))); fsm.GetState("Normal Msg").GetActionsOfType <SetFsmInt>()[0].setValue = _charmNum; }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction(new RandomizerBoolTest(_boolName, null, "COLLECTED")); // The "Charm?" state is a good entry point for our geo spawning charm.AddAction(new RandomizerSetBool(_boolName, true)); charm.AddAction(new RandomizerAddGeo(fsm.gameObject, _geoAmount)); // Skip all the other type checks charm.ClearTransitions(); charm.AddTransition("FINISHED", "Flash"); }
public static void ModifyShiny(PlayMakerFSM shinyFsm, FlingType flingType, AbstractPlacement location, AbstractItem item) { FsmState pdBool = shinyFsm.GetState("PD Bool?"); FsmState charm = shinyFsm.GetState("Charm?"); FsmState trinkFlash = shinyFsm.GetState("Trink Flash"); FsmStateAction checkAction = new RandomizerExecuteLambda(() => shinyFsm.SendEvent(item.IsObtained() ? "COLLECTED" : null)); FsmStateAction giveAction = new RandomizerExecuteLambda(() => item.Give(location, Container.Shiny, flingType, shinyFsm.gameObject.transform, message: MessageType.Any, callback: (_) => shinyFsm.SendEvent("GAVE ITEM"))); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <StringCompare>(); // Change pd bool test to our new bool pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.AddAction(checkAction); // Charm must be preserved as the entry point for AddYNDialogueToShiny charm.ClearTransitions(); charm.AddTransition("FINISHED", "Trink Flash"); trinkFlash.ClearTransitions(); trinkFlash.Actions = new FsmStateAction[] { trinkFlash.Actions[0], // Audio trinkFlash.Actions[1], // Audio trinkFlash.Actions[2], // visual effect trinkFlash.Actions[3], // hide shiny trinkFlash.Actions[4], // pickup animation // [5] -- spawn message // [6] -- store message text // [7] -- store message icon giveAction, // give item and await callback }; trinkFlash.AddTransition("GAVE ITEM", "Hero Up"); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState getCharm = fsm.GetState("Get Charm"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction(new RandomizerBoolTest(_item, null, "COLLECTED")); // The "Charm?" state is a bad entry point for our geo spawning charm.ClearTransitions(); charm.AddTransition("FINISHED", "Get Charm"); // The "Get Charm" state is a good entry point for our geo spawning getCharm.RemoveActionsOfType <SetPlayerDataBool>(); getCharm.RemoveActionsOfType <IncrementPlayerDataInt>(); getCharm.RemoveActionsOfType <SendMessage>(); getCharm.AddAction(new RandomizerExecuteLambda(() => GiveItemActions.GiveItem(GiveItemActions.GiveAction.None, _item, _location))); getCharm.AddAction(new RandomizerAddGeo(fsm.gameObject, _geoAmount)); // Skip all the other type checks getCharm.ClearTransitions(); getCharm.AddTransition("FINISHED", "Flash"); }
private static void CheckFireball(On.PlayMakerFSM.orig_OnEnable orig, PlayMakerFSM self) { // Wall Impact state doesn't exist in shade soul control // Fireballs get recycled so we've gotta check for the state this method adds as well if (self.FsmName != "Fireball Control" || self.GetState("Wall Impact") == null || self.GetState("Idle (No Collision)") != null) { orig(self); return; } // Store the terrain checker reference, prevent it from being enabled GameObject terrainChecker = self.GetAction <ActivateGameObject>("Pause", 3).gameObject.GameObject.Value; self.GetState("Pause").RemoveAction(3); // Create a new state before the regular idle FsmState idleNoCol = self.CopyState("R", "Idle (No Collision)"); idleNoCol.RemoveAction(0); self.GetState("L").ChangeTransition("FINISHED", "Idle (No Collision)"); self.GetState("R").ChangeTransition("FINISHED", "Idle (No Collision)"); idleNoCol.AddTransition("FINISHED", "Idle"); // New state needs to start the fireball moving idleNoCol.AddAction(new SetVelocity2d { gameObject = new FsmOwnerDefault(), vector = Vector2.zero, x = self.FsmVariables.FindFsmFloat("Velocity"), y = 0, everyFrame = false }); // Small waiting period before proceeding to the old idle state idleNoCol.AddAction(new Wait { time = NO_COLLISION_TIME, finishEvent = FsmEvent.FindEvent("FINISHED"), realTime = false }); FsmState idle = self.GetState("Idle"); // Idle state needs to activate the collision now idle.InsertAction(0, new ActivateGameObject { gameObject = new FsmOwnerDefault { GameObject = terrainChecker, OwnerOption = OwnerDefaultOption.SpecifyGameObject }, activate = true, recursive = false, resetOnExit = false, everyFrame = false }); // Account for the additional waiting time before Idle idle.GetAction <Wait>(8).time.Value -= NO_COLLISION_TIME; orig(self); }
private static void DisableSwim(On.PlayMakerFSM.orig_OnEnable orig, PlayMakerFSM self) { orig(self); if (RandomizerMod.Instance.Settings.RandomizeSwim && self.FsmName == "Surface Water Region") { if (self.gameObject.LocateFSM("Acid Armour Check") != null) { return; // acid } FsmState splash = self.GetState("Big Splash?"); FsmStateAction acidDeath = new FsmStateActions.RandomizerExecuteLambda(() => { if (!RandomizerMod.Instance.Settings.GetBool(name: "canSwim")) { // this is actually the spike death despite the enum, because the acid death splashes green stuff HeroController.instance.TakeDamage(self.gameObject, CollisionSide.other, 1, (int)HazardType.ACID); PlayMakerFSM.BroadcastEvent("SWIM DEATH"); } }); splash.AddFirstAction(acidDeath); splash.AddTransition("SWIM DEATH", "Idle"); } }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState bigGetFlash = fsm.GetState("Big Get Flash"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <StringCompare>(); // Change pd bool test to our new bool PlayerDataBoolTest boolTest = pdBool.GetActionsOfType <PlayerDataBoolTest>()[0]; RandomizerBoolTest randBoolTest = new RandomizerBoolTest(_item, boolTest.isFalse, boolTest.isTrue); pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.AddFirstAction(randBoolTest); // Force the FSM to show the big item flash charm.ClearTransitions(); charm.AddTransition("FINISHED", "Big Get Flash"); //bigGetFlash.AddAction(new RandomizerExecuteLambda(() => RandoLogger.LogItemToTrackerByBoolName(logBoolName, _location))); //bigGetFlash.AddAction(new RandomizerExecuteLambda(() => RandoLogger.UpdateHelperLog())); //bigGetFlash.AddFirstAction(new RandomizerExecuteLambda(() => RandomizerMod.Instance.Settings.UpdateObtainedProgressionByBoolName(logBoolName))); // Set bool and show the popup after the flash bigGetFlash.AddAction(new RandomizerCallStaticMethod( typeof(BigItemPopup), nameof(BigItemPopup.ShowAdditive), _itemDefs, fsm.gameObject, "GET ITEM MSG END")); // Don't actually need to set the skill here, that happens in BigItemPopup // Maybe change that at some point, it's not where it should happen bigGetFlash.AddAction(new RandomizerExecuteLambda(() => GiveItem(_action, _item, _location))); // Exit the fsm after the popup bigGetFlash.ClearTransitions(); bigGetFlash.AddTransition("GET ITEM MSG END", "Hero Up"); bigGetFlash.AddTransition("HERO DAMAGED", "Finish"); }
public static void ForceTransitions(this PlayMakerFSM self, params string[] stateNames) { for (int i = 0; i < stateNames.Length - 1; i++) { FsmState state = self.GetState(stateNames[i]); state.ClearTransitions(); state.AddTransition("FINISHED", stateNames[i + 1]); } }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState bigGetFlash = fsm.GetState("Big Get Flash"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <StringCompare>(); // Change pd bool test to our new bool pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.AddAction( new RandomizerExecuteLambda(() => fsm.SendEvent( RandomizerMod.Instance.Settings.CheckLocationFound(_location) ? "COLLECTED" : null ))); // Force the FSM to show the big item flash charm.ClearTransitions(); charm.AddTransition("FINISHED", "Big Get Flash"); // Set bool and show the popup after the flash bigGetFlash.AddAction(new RandomizerCallStaticMethod( typeof(BigItemPopup), nameof(BigItemPopup.ShowAdditive), _itemDefs, fsm.gameObject, "GET ITEM MSG END")); // Don't actually need to set the skill here, that happens in BigItemPopup // Maybe change that at some point, it's not where it should happen bigGetFlash.AddAction(new RandomizerExecuteLambda(() => GiveItem(_action, _item, _location))); // Exit the fsm after the popup bigGetFlash.ClearTransitions(); bigGetFlash.AddTransition("GET ITEM MSG END", "Hero Up"); bigGetFlash.AddTransition("HERO DAMAGED", "Finish"); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName) { return; } GameObject shiny = ObjectCache.ShinyItem; shiny.name = _newShinyName; if (_activeCheck.Invoke()) { // Simply create the shiny to be active, as in CreateNewShiny shiny.transform.position = new Vector3(_x, _y, shiny.transform.position.z); shiny.SetActive(true); // Force the new shiny to fall straight downwards PlayMakerFSM fsm = FSMUtility.LocateFSM(shiny, "Shiny Control"); FsmState fling = fsm.GetState("Fling?"); fling.ClearTransitions(); fling.AddTransition("FINISHED", "Fling R"); FlingObject flingObj = fsm.GetState("Fling R").GetActionsOfType <FlingObject>()[0]; flingObj.angleMin = flingObj.angleMax = 270; // For some reason not setting speed manually messes with the object position flingObj.speedMin = flingObj.speedMax = 0.1f; } else { // Inactive shiny needs a parent so we can find it later, so create a dummy object if necessary string parentName = string.IsNullOrEmpty(_parent) ? _newShinyName + " Parent" : _parent; if (GameObject.Find(parentName) is GameObject go) { shiny.transform.SetParent(go.transform); shiny.transform.localPosition = new Vector3(0, 0, shiny.transform.position.z); } else { GameObject go2 = new GameObject() { name = parentName }; go2.SetActive(true); shiny.transform.SetParent(go2.transform); shiny.SetActive(false); } } }
public static void FlingShinyDown(PlayMakerFSM shinyFsm) { FsmState fling = shinyFsm.GetState("Fling?"); fling.ClearTransitions(); fling.AddTransition("FINISHED", "Fling R"); FlingObject flingObj = shinyFsm.GetState("Fling R").GetActionsOfType <FlingObject>()[0]; flingObj.angleMin = flingObj.angleMax = 270; flingObj.speedMin = flingObj.speedMax = 0.1f; }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName) { return; } Scene currentScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); string[] objectHierarchy = _objectName.Split('\\'); int i = 1; GameObject obj = currentScene.FindGameObject(objectHierarchy[0]); while (i < objectHierarchy.Length) { obj = obj.FindGameObjectInChildren(objectHierarchy[i++]); } if (obj == null) { return; } // Put a shiny in the same location as the original GameObject shiny = ObjectCache.ShinyItem; shiny.name = _newShinyName; if (obj.transform.parent != null) { shiny.transform.SetParent(obj.transform.parent); } shiny.transform.position = obj.transform.position; shiny.transform.localPosition = obj.transform.localPosition; shiny.SetActive(obj.activeSelf); // Force the new shiny to fall straight downwards PlayMakerFSM fsm = FSMUtility.LocateFSM(shiny, "Shiny Control"); FsmState fling = fsm.GetState("Fling?"); fling.ClearTransitions(); fling.AddTransition("FINISHED", "Fling R"); FlingObject flingObj = fsm.GetState("Fling R").GetActionsOfType <FlingObject>()[0]; flingObj.angleMin = flingObj.angleMax = 270; // For some reason not setting speed manually messes with the object position flingObj.speedMin = flingObj.speedMax = 0.1f; // Destroy the original Object.Destroy(obj); }
private void Awake() { FsmState wander = new FsmState(); FsmState flee = new FsmState(); FsmTransition t1 = new FsmTransition(PlayerNear); FsmTransition t2 = new FsmTransition(PlayerFar); wander.AddTransition(t1, flee); flee.AddTransition(t2, wander); wander.enterActions.Add(() => onWanderEnter.Notify(transform.root)); wander.exitActions.Add(() => onWanderExit.Notify(transform.root)); flee.enterActions.Add(() => onFleeEnter.Notify(transform.root)); flee.exitActions.Add(() => onFleeExit.Notify(transform.root)); _fsm = new Fsm(wander); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState spawnItems = fsm.GetState("Spawn Items"); // Remove geo from chest foreach (FlingObjectsFromGlobalPool fling in spawnItems.GetActionsOfType <FlingObjectsFromGlobalPool>()) { fling.spawnMin = 0; fling.spawnMax = 0; } // Need to check SpawnFromPool action too because of Mantis Lords chest foreach (SpawnFromPool spawn in spawnItems.GetActionsOfType <SpawnFromPool>()) { spawn.spawnMin = 0; spawn.spawnMax = 0; } // Instantiate a new shiny and set the chest as its parent GameObject item = fsm.gameObject.transform.Find("Item").gameObject; GameObject shiny = ObjectCache.ShinyItem; shiny.SetActive(false); shiny.transform.SetParent(item.transform); shiny.transform.position = item.transform.position; shiny.name = _newShinyName; // Force the new shiny to fling out of the chest PlayMakerFSM shinyControl = FSMUtility.LocateFSM(shiny, "Shiny Control"); FsmState shinyFling = shinyControl.GetState("Fling?"); shinyFling.ClearTransitions(); shinyFling.AddTransition("FINISHED", "Fling R"); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState trinkFlash = fsm.GetState("Trink Flash"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Force the FSM to follow the path for the correct trinket charm.ClearTransitions(); charm.AddTransition("FINISHED", "Trink Flash"); trinkFlash.ClearTransitions(); trinkFlash.AddTransition("FINISHED", $"Trink {_trinketNum}"); }
// Gruz Mother needs a special case because her geo is special public static void DestroyGruzmomGeo(PlayMakerFSM fsm) { if (!RandomizerMod.Instance.Settings.RandomizeBossGeo) { return; } if (fsm.gameObject.name.StartsWith("Corpse Big Fly Burster") && fsm.FsmName == "burster" && GameManager.instance.sceneName == SceneNames.Crossroads_04) { FsmState geoState = fsm.GetState("Initiate"); geoState.RemoveActionsOfType <FlingObjectsFromGlobalPool>(); geoState.AddAction( new RandomizerExecuteLambda(() => GameObject.Find("New Shiny Boss Geo").transform.SetPosition2D( fsm.gameObject.transform.position ))); FsmState initState = fsm.GetState("Initiate"); initState.ClearTransitions(); initState.AddTransition("FINISHED", "In Air"); } }
public void SetUp() { BoxObject = gameObject.LocateMyFSM("Conversation Control").GetState("Repeat").GetAction <CallMethodProper>(0).gameObject.GameObject.Value; gameObject.LocateMyFSM("Conversation Control").GetState("Convo Choice").RemoveAction(6); gameObject.LocateMyFSM("Conversation Control").GetState("Convo Choice").GetAction <SetFsmString>().setValue = NPC_TITLE; FsmState state = gameObject.LocateMyFSM("Conversation Control").GetState("Precept"); transform.Find("Dream Dialogue").gameObject.LocateMyFSM("npc_dream_dialogue").FsmVariables.FindFsmString("Convo Name").Value = NPC_DREAM_KEY; gameObject.GetComponent <AudioSource>().Stop(); gameObject.GetComponent <AudioSource>().loop = false; state.Actions = new FsmStateAction[] { new CustomCallMethod(SelectDialogue) }; FsmState state2 = gameObject.LocateMyFSM("Conversation Control").CreateState("More"); state2.Actions = new FsmStateAction[] { new CustomCallCoroutine(ContinueConvo) }; state.ChangeTransition("CONVO_FINISH", state2); state2.AddTransition("CONVO_FINISH", state2); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState noState = new FsmState(fsm.GetState("Idle")) { Name = "YN No" }; noState.ClearTransitions(); noState.RemoveActionsOfType <FsmStateAction>(); noState.AddTransition("FINISHED", "Give Control"); Tk2dPlayAnimationWithEvents heroUp = new Tk2dPlayAnimationWithEvents { gameObject = new FsmOwnerDefault { OwnerOption = OwnerDefaultOption.SpecifyGameObject, GameObject = Ref.Hero.gameObject }, clipName = "Collect Normal 3", animationTriggerEvent = null, animationCompleteEvent = FsmEvent.GetFsmEvent("FINISHED") }; noState.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(CloseYNDialogue))); noState.AddAction(heroUp); // For some reason playing the animation doesn't work if we come here from being damaged, locking us in the // YN No state. I think just having a separate state to come from if we were damaged is the simplest fix. FsmState damageState = new FsmState(fsm.GetState("Idle")) { Name = "YN Damaged" }; damageState.ClearTransitions(); damageState.RemoveActionsOfType <FsmStateAction>(); damageState.AddTransition("FINISHED", "Give Control"); damageState.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(CloseYNDialogue))); FsmState giveControl = new FsmState(fsm.GetState("Idle")) { Name = "Give Control" }; giveControl.ClearTransitions(); giveControl.RemoveActionsOfType <FsmStateAction>(); giveControl.AddTransition("FINISHED", "Idle"); giveControl.AddAction(new RandomizerExecuteLambda(() => PlayMakerFSM.BroadcastEvent("END INSPECT"))); fsm.AddState(noState); fsm.AddState(damageState); fsm.AddState(giveControl); FsmState charm = fsm.GetState("Charm?"); string yesState = charm.Transitions[0].ToState; charm.ClearTransitions(); charm.AddTransition("HERO DAMAGED", damageState.Name); charm.AddTransition("NO", noState.Name); charm.AddTransition("YES", yesState); // Here is a good place to remove the spent simple key if (_type == CostType.Simple) { fsm.GetState(yesState).AddFirstAction(new RandomizerExecuteLambda(() => PlayerData.instance.DecrementInt("simpleKeys"))); } fsm.GetState(yesState).AddAction(new RandomizerCallStaticMethod(GetType(), nameof(CloseYNDialogue))); charm.AddFirstAction(new RandomizerCallStaticMethod(GetType(), nameof(OpenYNDialogue), fsm.gameObject, _itemName, _cost, _type)); }
public override void Process(string scene, Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState getCharm = fsm.GetState("Get Charm"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction( new RandomizerExecuteLambda(() => fsm.SendEvent( RandomizerMod.Instance.Settings.CheckLocationFound(_location) ? "COLLECTED" : null ))); // The "Charm?" state is a bad entry point for our lore showing charm.ClearTransitions(); charm.AddTransition("FINISHED", "Get Charm"); // The "Get Charm" state is a good entry point for our lore showing getCharm.RemoveActionsOfType <SetPlayerDataBool>(); getCharm.RemoveActionsOfType <IncrementPlayerDataInt>(); getCharm.RemoveActionsOfType <SendMessage>(); getCharm.AddAction(new RandomizerExecuteLambda(() => GiveItemActions.GiveItem(GiveItemActions.GiveAction.None, _item, _location))); getCharm.ClearTransitions(); // Begin showing lore state FsmState startReading = new FsmState(fsm.GetState("Idle")) { Name = "Lore Start Reading" }; startReading.ClearTransitions(); startReading.RemoveActionsOfType <FsmStateAction>(); if (_textType == TextType.MajorLore) { startReading.AddAction(new RandomizerExecuteLambda(() => { AudioSource audio = fsm.gameObject.GetComponent <AudioSource>(); audio.PlayOneShot(ObjectCache.LoreSound); })); startReading.AddAction(new RandomizerExecuteLambda(() => PlayMakerFSM.BroadcastEvent("LORE PROMPT UP"))); } else { startReading.AddAction(new RandomizerExecuteLambda(() => GameObject.Find("DialogueManager") .LocateMyFSM("Box Open").SendEvent("BOX UP"))); } startReading.AddAction(new Wait() { time = _textType == TextType.MajorLore ? 0.85f : 0.3f, finishEvent = FsmEvent.Finished }); // Reading FsmState loreReading = new FsmState(fsm.GetState("Idle")) { Name = "Lore Reading" }; loreReading.ClearTransitions(); loreReading.RemoveActionsOfType <FsmStateAction>(); loreReading.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(ShowLoreDialogue), fsm.gameObject, _key, _sheetTitle, _textType)); // Finished Reading FsmState finishReading = new FsmState(fsm.GetState("Idle")) { Name = "Lore Finish Reading" }; finishReading.ClearTransitions(); finishReading.RemoveActionsOfType <FsmStateAction>(); finishReading.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(HideLoreDialogue), _textType)); if (_textType == TextType.MajorLore) { finishReading.AddAction(new Wait() { time = 0.5f, finishEvent = FsmEvent.Finished }); } // Once we're done we have to reset the text box fsm.GetState("Flash").AddFirstAction(new RandomizerCallStaticMethod(GetType(), nameof(ResetTextBox))); // Cancel Reading (Hero Damaged) FsmState cancelReading = new FsmState(fsm.GetState("Idle")) { Name = "Lore Cancel Reading" }; cancelReading.ClearTransitions(); cancelReading.RemoveActionsOfType <FsmStateAction>(); cancelReading.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(HideLoreDialogue), _textType)); cancelReading.AddAction(new RandomizerCallStaticMethod(GetType(), nameof(ResetTextBox))); // The code in "Finish" doesn't yeet the inspect region - we can do it here just by doing this cancelReading.AddAction(new RandomizerExecuteLambda(() => Object.Destroy(fsm.gameObject))); // Adding states getCharm.AddTransition("FINISHED", startReading.Name); startReading.AddTransition("FINISHED", loreReading.Name); startReading.AddTransition("HERO DAMAGED", cancelReading.Name); loreReading.AddTransition("CONVO_FINISH", finishReading.Name); loreReading.AddTransition("HERO DAMAGED", cancelReading.Name); finishReading.AddTransition("FINISHED", "Flash"); finishReading.AddTransition("HERO DAMAGED", cancelReading.Name); cancelReading.AddTransition("FINISHED", "Finish"); fsm.AddState(startReading); fsm.AddState(loreReading); fsm.AddState(finishReading); fsm.AddState(cancelReading); }
public override void Process(string scene, UnityEngine.Object changeObj) { if (scene != _sceneName || !(changeObj is PlayMakerFSM fsm) || fsm.FsmName != _fsmName || fsm.gameObject.name != _objectName) { return; } FsmState pdBool = fsm.GetState("PD Bool?"); FsmState charm = fsm.GetState("Charm?"); FsmState trinkFlash = fsm.GetState("Trink Flash"); FsmState giveTrinket = fsm.GetState("Store Key"); // Remove actions that stop shiny from spawning pdBool.RemoveActionsOfType <PlayerDataBoolTest>(); pdBool.RemoveActionsOfType <StringCompare>(); // Add our own check to stop the shiny from being grabbed twice pdBool.AddAction(new RandomizerBoolTest(_boolName, null, "COLLECTED", true)); // Force the FSM to follow the path for the correct trinket charm.ClearTransitions(); charm.AddTransition("FINISHED", "Trink Flash"); trinkFlash.ClearTransitions(); fsm.GetState("Trinket Type").ClearTransitions(); trinkFlash.AddTransition("FINISHED", "Store Key"); giveTrinket.AddFirstAction(new RandomizerExecuteLambda(() => AreaRando.Instance.Settings.UpdateObtainedProgressionByBoolName(_boolName))); giveTrinket.AddAction(new RandomizerExecuteLambda(() => RandoLogger.LogItemToTrackerByBoolName(_boolName, _location))); giveTrinket.AddAction(new RandomizerExecuteLambda(() => RandoLogger.UpdateHelperLog())); giveTrinket.GetActionsOfType <SetPlayerDataBool>().First().boolName = _boolName; // Makes sure the correct icon and text appear switch (_trinketNum) { case 1: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_TRINKET1"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.WanderersJournal"); break; case 2: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_TRINKET2"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.HallownestSeal"); break; case 3: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_TRINKET3"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.KingsIdol"); break; case 4: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_TRINKET4"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.ArcaneEgg"); break; case 6: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_TRAM_PASS"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.TramPass"); break; case 8: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_STOREKEY"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.ShopkeepersKey"); break; case 9: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_CITYKEY"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.CityKey"); break; case 10: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_LOVEKEY"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.LoveKey"); break; case 11: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_RANCIDEGG"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.RancidEgg"); break; case 12: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_SIMPLEKEY"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.SimpleKey"); break; case 13: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "RANDOMIZER_NAME_CHARM_NOTCH"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.CharmNotch"); break; case 14: giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "RANDOMIZER_NAME_PALE_ORE"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.PaleOre"); break; case 20: //lantern giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_LANTERN"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.Lantern"); break; case 21: //elegant key giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "INV_NAME_WHITEKEY"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.ElegantKey"); break; case 22: //mask shards giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "RANDOMIZER_NAME_MASK_SHARD"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.MaskShard"); break; case 23: //vessel fragments giveTrinket.GetActionsOfType <GetLanguageString>().First().convName = "RANDOMIZER_NAME_VESSEL_FRAGMENT"; giveTrinket.GetActionsOfType <SetSpriteRendererSprite>().First().sprite = AreaRando.GetSprite("ShopIcons.VesselFragment"); break; } }