public static bool LoopRunPrefix(RunCtrl __instance) { CustomZoneUtil.TriggerZoneEvent("Loop"); if (__instance.currentRun != null) { __instance.currentRun.unvisitedWorldNames.Clear(); } if (CustomZoneUtil.currentCampaign != "Default") { __instance.currentRun.visitedWorldNames.Clear(); ++__instance.currentRun.loopNum; CustomZoneUtil.GenerateCampaignWorlds(); __instance.currentRun.Loop(); if (__instance.ctrl.currentPlayer.beingObj.tags.Contains(Tag.Shopkeeper)) { __instance.currentRun.yamiObtained = true; } __instance.ResetWorld(__instance.currentWorld.nameString); __instance.StartZone(__instance.currentRun.zoneNum, __instance.currentZoneDot, true); if (__instance.currentRun.loopNum > SaveDataCtrl.Get <int>("MostLoops")) { SaveDataCtrl.Set <int>("MostLoops", __instance.currentRun.loopNum); } if (__instance.currentRun.loopNum > SaveDataCtrl.Get <int>(__instance.ctrl.currentHeroObj.nameString + "MostLoops")) { SaveDataCtrl.Set <int>(__instance.ctrl.currentHeroObj.nameString + "MostLoops", __instance.currentRun.loopNum); } return(false); } return(true); }
public static bool EndBattlePrefix(BC __instance) { if (__instance.perfectBattle) { CustomZoneUtil.TriggerTypeZoneEvent(__instance.runCtrl.currentZoneDot.type, "PerfectBattle"); } CustomZoneUtil.TriggerTypeZoneEvent(__instance.runCtrl.currentZoneDot.type, "EndBattle"); return(true); }
public static bool DownBossZoneEvent(Boss __instance) { if (S.I.batCtrl.perfectBattle) { CustomZoneUtil.TriggerTypeZoneEvent(__instance.runCtrl.currentZoneDot.type, "PerfectBoss"); } CustomZoneUtil.TriggerTypeZoneEvent(__instance.runCtrl.currentZoneDot.type, "Downed"); return(true); }
public static bool CreateRunPrefix(RunCtrl __instance, int zoneNum, int worldTierNum, bool campaign, string seed = "") { CustomZoneUtil.TriggerZoneEvent("Start"); var heroID = __instance.ctrl.currentHeroObj.beingID; CustomZoneUtil.currentCampaign = CustomZoneUtil.customCampaignCharacters.ContainsKey(heroID) ? CustomZoneUtil.customCampaignCharacters[heroID] : "Default"; if (CustomZoneUtil.customCampaignCharacters.ContainsKey(heroID) && CustomZoneUtil.currentCampaign != "Default") { __instance.currentRun = new Run("Run"); __instance.currentRun.beingID = heroID; __instance.currentRun.animName = __instance.ctrl.currentHeroObj.animName; if (!string.IsNullOrEmpty(seed)) { __instance.currentRun.seed = seed; __instance.currentRun.seedWasPredefined = true; } else if (__instance.useRandomSeed) { __instance.currentRun.seed = Mathf.Abs(Environment.TickCount).ToString(); } else if (__instance.testSeed != null) { __instance.currentRun.seed = __instance.testSeed; } __instance.pseudoRandom = new System.Random(__instance.currentRun.seed.GetHashCode()); __instance.pseudoRandomWorld = new System.Random(__instance.currentRun.seed.GetHashCode()); __instance.worldBar.seedText.text = ScriptLocalization.UI.Worldbar_Seed + " " + __instance.currentRun.seed; CustomZoneUtil.GenerateCampaignWorlds(); __instance.currentRun.zoneNum = zoneNum; __instance.currentRun.worldTierNum = worldTierNum; __instance.currentRun.hellPassNum = __instance.currentHellPassNum; __instance.currentRun.hellPasses = new List <int>((IEnumerable <int>)__instance.currentHellPasses); __instance.idCtrl.heroNameText.text = __instance.ctrl.currentHeroObj.localizedName; __instance.idCtrl.heroLevelText.text = string.Format(ScriptLocalization.UI.TopNav_LevelShort + " {0}", (object)1); if (__instance.heCtrl.gameMode == GameMode.CoOp) { __instance.currentRun.coOp = true; } __instance.ctrl.deCtrl.deckScreen.ResetValues(); return(false); } return(true); }
static void Prepare() { if (Harmony.HasAnyPatches("com.MoreLuaPower.patch")) { return; } Debug.Log("MoreLuaPower Version 2.1"); LuaPowerData.Setup(); LuaPowerCustomEnumsSetup.Setup(); CustomZoneUtil.Setup(); CustomBosses.DataHandler.Setup(); if (S.I.GetComponent <PowerMonoBehavior>() == null) { S.I.gameObject.AddComponent <PowerMonoBehavior>(); } if (!LuaPowerData.customEnums[typeof(Effect)].Contains("Lua")) { LuaPowerData.customEnums[typeof(Effect)].Add("Lua"); } //MoreLuaPowerTesting.Test(); }
public static bool SpareBossZoneEvent(Boss __instance) { CustomZoneUtil.TriggerTypeZoneEvent(__instance.runCtrl.currentZoneDot.type, "Spare"); return(true); }
public static bool SpawnCustomZone(SpawnCtrl __instance, ZoneType zoneType) { CustomZoneUtil.TriggerTypeZoneEvent(zoneType, "Init"); return(true); }