Exemplo n.º 1
0
 static void Postfix(scriptEncounterArea __instance)
 {
     if (Harmony.DEBUG)
     {
         FileLog.Log("Titel: " + __instance.title);
     }
 }
Exemplo n.º 2
0
        public static void ModifyArea(scriptEncounterArea __instance)
        {
            try
            {
                List <string> monsterlist = new List <string>();
                monsterlist.AddRange(VoidConstants.MODENCOUNTERS.GetValueSafe(__instance.title));

                for (int i = 0; i < __instance.monsters.Count() - 1; i++)
                {
                    monsterlist.Add(__instance.monsters[i]);
                }
                GameObject global = GameObject.FindGameObjectWithTag("Global");

                if (Harmony.DEBUG)
                {
                    FileLog.Log("Anzahl Sprites: " + global.GetComponent <scriptMonsters>().dSprites.Length);
                    foreach (Sprite ds in global.GetComponent <scriptMonsters>().dSprites)
                    {
                        FileLog.Log("Sprite Name: " + ds.name);
                    }
                }



                GameObject player = GameObject.FindGameObjectWithTag("Player");
                player.GetComponent <scriptOWPlayer>().SetEncounterData(
                    __instance.canEncounter,   // Boolean to determine if monsters can spawn
                    monsterlist.ToArray(),     // List of monsters that are supposed to spawn
                    __instance.levelMin,       // Minimum level of wild monsters
                    __instance.levelMax,       // Maximum level of wild monsters
                    __instance.encounterDelay, // Not sure. Either the delay between the monster spawning and beginning to act or the timer inbetween spawns
                    __instance.uMonID,         // ID of the wild crossbreed
                    __instance.uMonVar,        // Crossbreed Variant
                    __instance.uMonPal);       // Color Palette of the variant
            }
            catch (Exception e)
            {
                FileLog.Log("Titel: " + __instance.title);
                FileLog.Log(e.Message);
                FileLog.Log(e.StackTrace);
                FileLog.Log(e.InnerException.Message);
                FileLog.Log(e.InnerException.StackTrace);
            }
        }
Exemplo n.º 3
0
 static void Postfix(scriptEncounterArea __instance)
 {
     ModifyArea(__instance);
 }