private static void OpenYNDialogue(GameObject shiny, string itemName, int cost, int type) { FSMUtility.LocateFSM(GameObject.Find("DialogueManager"), "Box Open YN").SendEvent("BOX UP YN"); FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmGameObject("Requester").Value = shiny; if (type == TYPE_ESSENCE) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Essence: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (Ref.PD.dreamOrbs < cost) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control") .StartCoroutine(KillGeoText()); } cost = 0; } else { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", LanguageStringManager.GetLanguageString(itemName, "UI")); } FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmInt("Toll Cost").Value = cost; GameObject.Find("Text YN").GetComponent <DialogueBox>().StartConversation("RANDOMIZER_YN_DIALOGUE", "UI"); }
private static void OpenYNDialogue(GameObject shiny, string itemName, int cost, CostType type) { FSMUtility.LocateFSM(GameObject.Find("DialogueManager"), "Box Open YN").SendEvent("BOX UP YN"); FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmGameObject("Requester").Value = shiny; string UIName; switch (type) { case CostType.Essence: // prevent beginners from being confused by dn-locked dn UIName = LanguageStringManager.GetLanguageString(itemName, "UI"); if (UIName == "Dream Nail") { UIName = "Dream Gate"; } LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Essence: " + UIName); if (Ref.PD.dreamOrbs < cost) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control") .StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.Simple: LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Simple Key: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.simpleKeys < 1 || (PlayerData.instance.simpleKeys < 2 && !PlayerData.instance.openedWaterwaysManhole)) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.Grub: LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Grubs: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.grubsCollected < cost) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.Wraiths: LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Have Howling Wraiths: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.screamLevel < 1) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.Spore: LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Equipped Spore Shroom: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (!PlayerData.instance.GetBool("equippedCharm_17")) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.Dreamnail: // prevent beginners from being confused by dn-locked dn UIName = LanguageStringManager.GetLanguageString(itemName, "UI"); if (UIName == "Dream Nail") { UIName = "Dream Gate"; } LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Have Dream Nail: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (!PlayerData.instance.hasDreamNail) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; break; case CostType.whisperingRoot: // prevent beginners from being confused by dn-locked dn UIName = LanguageStringManager.GetLanguageString(itemName, "UI"); if (UIName == "Dream Nail") { UIName = "Dream Gate"; } LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Complete the trial: " + UIName); { if (GameObject.Find("Dream Plant") is GameObject dreamPlant) { if (dreamPlant.FindGameObjectInChildren("Dream Dialogue") is GameObject dreamDialogue) { if (!dreamDialogue.activeSelf) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } else { LogDebug("Unlocking dream plant with active dream dialogue."); } } } else { LogWarn("Unable to find gameobject associated to nearObjectName. Unlocking YN dialogue..."); } cost = 0; } break; default: LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", LanguageStringManager.GetLanguageString(itemName, "UI")); break; } FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmInt("Toll Cost").Value = cost; FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmGameObject("Geo Text").Value.SetActive(true); GameObject.Find("Text YN").GetComponent <DialogueBox>().StartConversation("RANDOMIZER_YN_DIALOGUE", "UI"); }
private static void OpenYNDialogue(GameObject shiny, string itemName, int cost, int type) { FSMUtility.LocateFSM(GameObject.Find("DialogueManager"), "Box Open YN").SendEvent("BOX UP YN"); FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmGameObject("Requester").Value = shiny; if (type == TYPE_ESSENCE) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Essence: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (Ref.PD.dreamOrbs < cost) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control") .StartCoroutine(KillGeoText()); } cost = 0; } else if (type == TYPE_SIMPLE) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Simple Key: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.simpleKeys < 1 || (PlayerData.instance.simpleKeys < 2 && !PlayerData.instance.openedWaterwaysManhole)) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; } else if (type == TYPE_GRUB) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", cost + " Grubs: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.grubsCollected < cost) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; } else if (type == TYPE_WRAITHS) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Have Howling Wraiths: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (PlayerData.instance.screamLevel < 1) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; } else if (type == TYPE_DREAMNAIL) { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", "Have Dream Nail: " + LanguageStringManager.GetLanguageString(itemName, "UI")); if (!PlayerData.instance.hasDreamNail) { FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").StartCoroutine(KillGeoText()); } cost = 0; } else { LanguageStringManager.SetString("UI", "RANDOMIZER_YN_DIALOGUE", LanguageStringManager.GetLanguageString(itemName, "UI")); } FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables .GetFsmInt("Toll Cost").Value = cost; GameObject.Find("Text YN").GetComponent <DialogueBox>().StartConversation("RANDOMIZER_YN_DIALOGUE", "UI"); }
public static void ApplyHintChanges(Scene newScene) { switch (newScene.name) { // King Fragment hint case SceneNames.Abyss_05: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "King_Fragment").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString( "Lore Tablets", "DUSK_KNIGHT_CORPSE", "A corpse in white armour. You can clearly see the " + itemName + " it's holding, " + "but for some reason you get the feeling you're going to have to go" + " through an unnecessarily long gauntlet of spikes and sawblades just to pick it up." ); } break; // Colosseum hints case SceneNames.Room_Colosseum_01: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Charm_Notch-Colosseum").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString("Prompts", "TRIAL_BOARD_BRONZE", "Trial of the Warrior. Fight for " + itemName + ".\n" + "Place a mark and begin the Trial?"); } { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Pale_Ore-Colosseum").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString("Prompts", "TRIAL_BOARD_SILVER", "Trial of the Conqueror. Fight for " + itemName + ".\n" + "Place a mark and begin the Trial?"); } break; // Grey Mourner hint case SceneNames.Room_Mansion: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Mask_Shard-Grey_Mourner").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString( "Prompts", "XUN_OFFER", "Accept the Gift, even knowing you'll only get a lousy " + itemName + "?" ); } break; // Enable Jiji hints when the player does not have a shade case SceneNames.Room_Ouiji: 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]); } break; // Tuk only sells eggs when you have no eggs in your inventory, if Jiji hints are on case SceneNames.Waterways_03 when RandomizerMod.Instance.Settings.Jiji: GameObject.Find("Tuk NPC").LocateMyFSM("Conversation Control").GetState("Convo Choice").GetActionOfType <IntCompare>().integer2 = 1; break; } }
public static void ApplyHintChanges(Scene newScene) { switch (newScene.name) { // King Fragment hint case SceneNames.Abyss_05: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "King_Fragment").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString( "Lore Tablets", "DUSK_KNIGHT_CORPSE", "A corpse in white armour. You can clearly see the " + itemName + " it's holding, " + "but for some reason you get the feeling you're going to have to go" + " through an unnecessarily long gauntlet of spikes and sawblades just to pick it up." ); } break; // Colosseum hints case SceneNames.Room_Colosseum_01: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Charm_Notch-Colosseum").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString("Prompts", "TRIAL_BOARD_BRONZE", "Trial of the Warrior. Fight for " + itemName + ".\n" + "Place a mark and begin the Trial?"); } { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Pale_Ore-Colosseum").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString("Prompts", "TRIAL_BOARD_SILVER", "Trial of the Conqueror. Fight for " + itemName + ".\n" + "Place a mark and begin the Trial?"); } break; // Grey Mourner hint case SceneNames.Room_Mansion: { string item = RandomizerMod.Instance.Settings.ItemPlacements.FirstOrDefault(pair => pair.Item2 == "Mask_Shard-Grey_Mourner").Item1; string itemName = LanguageStringManager.GetLanguageString(LogicManager.GetItemDef(item).nameKey, "UI"); LanguageStringManager.SetString( "Prompts", "XUN_OFFER", "Accept the Gift, even knowing you'll only get a lousy " + itemName + "?" ); } break; // Enable Jiji hints when the player does not have a shade case SceneNames.Room_Ouiji: 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]); } // I don't think Jinn necessarily belongs in the ApplyHintChanges function, but w/e { GameObject Jinn = ObjectCache.Jinn; Jinn.SetActive(true); Jinn.transform.position = GameObject.Find("Jiji NPC").transform.position + new Vector3(-10f, 0, 0); FsmState transaction = Jinn.LocateMyFSM("Conversation Control").GetState("Transaction"); transaction.RemoveActionsOfType <RandomInt>(); transaction.RemoveActionsOfType <CallMethodProper>(); transaction.AddFirstAction(new RandomizerExecuteLambda(() => HeroController.instance.AddGeo(450))); // Jinn Sell All if (RandomizerMod.Instance.Settings.JinnSellAll) { PlayMakerFSM fsm = Jinn.FindGameObjectInChildren("Talk NPC").LocateMyFSM("Conversation Control"); fsm.GetState("Talk Finish").AddFirstAction(new RandomizerExecuteLambda(() => { int n = Ref.PD.GetInt(nameof(Ref.PD.rancidEggs)); if (n > 0) { Ref.Hero.AddGeo(450 * n); Ref.PD.SetInt(nameof(Ref.PD.rancidEggs), Ref.PD.GetInt(nameof(Ref.PD.rancidEggs)) - n); Ref.PD.SetInt(nameof(Ref.PD.jinnEggsSold), Ref.PD.GetInt(nameof(Ref.PD.jinnEggsSold)) + n); } })); } } break; // Tuk only sells eggs when you have no eggs in your inventory, to balance around hints and/or eggs case SceneNames.Waterways_03: GameObject.Find("Tuk NPC").LocateMyFSM("Conversation Control").GetState("Convo Choice").GetActionOfType <IntCompare>().integer2 = 1; break; } }