Beispiel #1
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);
         }
     }
 }
        public void GenerateZone(SpawnCtrl spawnCtrl, ZoneType zoneType)
        {
            if (zoneType == (ZoneType)17)
            {
                spawnCtrl.ti.mainBattleGrid.currentEnemies.Clear();
                spawnCtrl.ctrl.GameState = GState.Battle;


                List <Tile> tileList = spawnCtrl.ti.mainBattleGrid.Get(new TileApp(Location.RandEnemyUnique, Shape.Default, Pattern.Unoccupied, 1, (Tile)null, Pattern.All), 0,
                                                                       (Being)null, (ItemObject)null, true);
                int index = Random.Range(0, tileList.Count);
                spawnCtrl.PlaceBeing("BossSelicy", spawnCtrl.ti.mainBattleGrid.grid[tileList[index].x, tileList[index].y], 0, true, (BattleGrid)null);
            }
        }
        static void HalveHellPass20Defense(SpawnCtrl __instance)
        {
            var spawnCtrl = __instance;

            foreach (var pact in spawnCtrl.ctrl.currentPlayer.pactObjs)
            {
                if (pact.itemID == STACKING_DEF_HELL_PASS)
                {
                    var oldDef = pact.defense;
                    pact.defense /= 2;
                    Debug.Log($"At campsite, so -def reduced from {oldDef} to {pact.defense}");
                }
            }
        }
 static void SpawnZoneCPostfix(SpawnCtrl __instance, ZoneType zoneType)
 {
     foreach (ICustomZone customZone in customZonesImpl)
     {
         try
         {
             customZone?.GenerateZone(__instance, zoneType);
         }
         catch (Exception e)
         {
             Debug.LogException(e);
         }
     }
 }
        public void GenerateZone(SpawnCtrl spawnCtrl, ZoneType zoneType)
        {
            if (zoneType == (ZoneType)16)
            {
                spawnCtrl.ti.mainBattleGrid.currentEnemies.Clear();
                spawnCtrl.idCtrl.MakeWorldBarAvailable(false);
                spawnCtrl.ctrl.GameState = GState.Idle;

                for (int i = 0; i < 10; i++)
                {
                    List <Tile> tileList = spawnCtrl.ti.mainBattleGrid.Get(new TileApp(Location.RandEnemyUnique, Shape.Default, Pattern.Unoccupied, 1, (Tile)null, Pattern.All), 0, (Being)null, (ItemObject)null, true);
                    int         index    = Random.Range(0, tileList.Count);
                    spawnCtrl.PlaceBeing(spawnCtrl.treasureChests[Random.Range(0, spawnCtrl.treasureChests.Count)].beingID, spawnCtrl.ti.mainBattleGrid.grid[tileList[index].x, tileList[index].y], 0, true, (BattleGrid)null).GetComponent <Cpu>();
                }
            }
        }
 static void Postfix(SpawnCtrl __instance, ZoneType zoneType)
 {
     //If boss set rewards.
     if (zoneType == ZoneType.Boss)
     {
         S.I.batCtrl.experienceGained = 600;
         //Run couroutine to add money right after boss starts.
         __instance.StartCoroutine(WaitAndMoney());
         S.I.batCtrl.noHitMoneyBonus = 150;
         if (S.I.runCtrl.currentRun.worldName == "Normal")
         {
             //IDK what this does but im too scared to remove it.
             __instance.bossesToSpawn.Insert(0, "BossGate");
         }
     }
 }
Beispiel #7
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());
        //    }
        //}
    }
Beispiel #8
0
 public static bool SpawnCustomZone(SpawnCtrl __instance, ZoneType zoneType)
 {
     CustomZoneUtil.TriggerTypeZoneEvent(zoneType, "Init");
     return(true);
 }
Beispiel #9
0
 void Awake()
 {
     tr = GetComponent <Transform>();
     sc = GetComponent <SpawnCtrl>();
 }
        public static void BossHandler(FileInfo info)
        {
            SpawnCtrl spCtrl = S.I.spCtrl;

            spCtrl.CreateBeingObjectPrototypes(info.Name, (BeingType)Enum.Parse(typeof(BeingType), "Boss"), true, info.DirectoryName);
        }
Beispiel #11
0
 static bool Prefix(SpawnCtrl __instance)
 {
     return(false);
 }