static bool Prefix(ListCard __instance, bool useRemover)
        {
            var     card    = __instance;
            RunCtrl runCtrl = card.deCtrl.runCtrl;

            if (!CustomHell.IsHellEnabled(runCtrl, CustomHellPassEffect.TWO_REMOVES_FOR_PACT))
            {
                return(true);
            }

            if (!IsNormalPact(card) || !useRemover)
            {
                return(true);
            }

            DeckScreen deckScreen = GetDeckScreen(card);

            if (deckScreen.busy)
            {
                return(true);
            }

            // This is clunky, but so is using a transpiler.
            if (runCtrl.currentRun.removals < HELL_PRICE)
            {
                PlayForbiddenEffect(card, deckScreen);
                return(false);
            }

            runCtrl.currentRun.removals -= HELL_PRICE;
            deckScreen.UpdateRemoverCountText();
            PlayRemoveCardEffect(card);
            return(false);
        }
Пример #2
0
 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);
 }
Пример #3
0
        static bool Prefix(RunCtrl __instance, ZoneDot zoneDot)
        {
            var num = 2;

            if (__instance.currentZoneDot.stepNum == num)
            {
                __instance.currentRun.zoneNum = 1000;
            }
            return(true);
        }
Пример #4
0
 static void StartCampaign(ref RunCtrl __instance, ref SpawnCtrl ___spCtrl)
 {
     Debug.Log("Adding custom bosses to boss dictionary");
     foreach (GameObject customBoss in customBosses.Values.ToList())
     {
         if (!___spCtrl.bossDictionary.ContainsKey(customBoss.GetComponent <Boss>().bossID))
         {
             ___spCtrl.bossDictionary.Add(customBoss.GetComponent <Boss>().bossID, customBoss);
         }
     }
 }
Пример #5
0
 static bool Prefix(RunCtrl __instance, ZoneDot zoneDot)
 {
     if (zoneDot.type == ZoneType.World)
     {
         if (CustomWorldGenerator.refreshWorldDots.Contains(zoneDot))
         {
             __instance.currentRun.unvisitedWorldNames.Add(__instance.currentWorld.nameString);
         }
         __instance.currentRun.zoneNum = 10000;
     }
     return(true);
 }
    static bool Prefix(ref RunCtrl __instance, ref ZoneDot zoneDot)
    {
        Debug.Log((object)("GOING TO NEXT WORLD... " + zoneDot.worldName + " cur zone num : " + (object)__instance.currentRun.zoneNum + "  and the zone= " + (object)__instance.currentWorld.numZones + " BossExecs= " + (object)__instance.currentRun.bossExecutions + " unvis world nums:" + (object)__instance.currentRun.unvisitedWorldNames.Count));
        ++__instance.currentRun.worldTierNum;

        int count = 0;

        foreach (string worldName in __instance.currentRun.visitedWorldNames)
        {
            if (!LuaPowerData.GenocideLenientStages.Contains(worldName))
            {
                count++;
            }
        }

        if (__instance.currentRun.shopkeeperKilled)
        {
            ++count;
        }
        if (__instance.currentRun.unvisitedWorldNames.Count > 0)
        {
            __instance.currentRun.visitedWorldNames.Add(zoneDot.worldName);
            __instance.currentRun.unvisitedWorldNames.Remove(zoneDot.worldName);
        }
        else if (S.I.BETA)
        {
            zoneDot.worldName = "Beta";
        }
        else if (__instance.currentRun.bossExecutions == 0)
        {
            zoneDot.worldName = "Pacifist";
            __instance.currentRun.pacifist = true;
        }
        else if (__instance.currentRun.bossExecutions < count)
        {
            zoneDot.worldName             = "Normal";
            __instance.currentRun.neutral = true;
        }
        else if (__instance.currentRun.bossExecutions >= count)
        {
            __instance.currentRun.genocide = true;
            zoneDot.worldName = "Genocide";
        }
        __instance.progressBar.transform.SetParent(Camera.main.transform);
        __instance.currentRun.worldName = zoneDot.worldName;
        __instance.ResetWorld(zoneDot.worldName, -1);
        __instance.currentRun.zoneNum = 0;
        zoneDot = __instance.worldBar.currentZoneDots[0];

        return(false);
    }
Пример #7
0
    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);
    }
Пример #8
0
    static void StartCampaign(ref RunCtrl __instance, ref SpawnCtrl ___spCtrl)
    {
        Debug.Log("Adding custom bosses to boss dictionary");
        foreach (GameObject customBoss in customBosses.Values.ToList())
        {
            if (!___spCtrl.bossDictionary.ContainsKey(customBoss.GetComponent <Boss>().bossID))
            {
                ___spCtrl.bossDictionary.Add(customBoss.GetComponent <Boss>().bossID, customBoss);
            }
        }

        //Debug.Log("Boss dictionary contents:");
        //foreach (var bossKVP in ___spCtrl.bossDictionary)
        //{
        //    Debug.Log(bossKVP.Key);
        //    foreach (var component in bossKVP.Value.GetComponents(typeof(Component)))
        //    {
        //        Debug.Log(component.GetType());
        //    }
        //}
    }
Пример #9
0
        public static bool Next(RunCtrl __instance)
        {
            var battleGrid = S.I.tiCtrl.mainBattleGrid;

            for (int index1 = 0; index1 < battleGrid.gridLength; ++index1)
            {
                for (int index2 = 0; index2 < battleGrid.gridHeight; ++index2)
                {
                    battleGrid.grid[index1, index2].SetAlign(index1 < battleGrid.gridLength / 2 ? 1 : -1);
                }
            }
            foreach (var player in S.I.batCtrl.currentPlayers)
            {
                player.transform.right = Vector3.zero - Vector3.left;
                if (player.mov.currentTile.x > 3)
                {
                    player.mov.MoveTo(player.mov.currentTile.x - 4, player.mov.currentTile.y, false, true, false, false);
                }
            }
            return(true);
        }
Пример #10
0
 public static void StartPost(RunCtrl __instance, bool loadRun, string seed = "")
 {
     S.I.StartCoroutine(BossRush_Misc.WaitAndShop());
 }
Пример #11
0
 static bool SaveRun(RunCtrl __instance)
 {
     return(false);
 }