int WhichRegion()// 해당하는 region 찾으면 region크기 관련 변수도 다 바꿔버린다 { int i; for (i = 0; i < transform.childCount; i++) { SpawnRegion region = transform.GetChild(i).gameObject.GetComponent <SpawnRegion>(); float width = region.Width; float height = region.Height; float regionx = region.gameObject.transform.position.x; float regiony = region.gameObject.transform.position.y; if ((x >= regionx - width) && (x < regionx + width) && (y >= regiony - height) && (y < regiony + height)) { curWidth = region.Width; curHeight = region.Height; curLeft = regionx - width; curRight = regionx + width; curUp = regiony + height; curDown = regiony - height; regionNum = i; curRegion = region; break; } } return(i); }
static void Prefix(SpawnRegion __instance) { if (GameManager.IsStoryMode()) { return; } bool m_StartHasBeenCalled = (bool)AccessTools.Field(typeof(SpawnRegion), "m_StartHasBeenCalled").GetValue(__instance); if (m_StartHasBeenCalled) { return; } if (__instance.m_SpawnablePrefab.name.ToLowerInvariant().Contains("wolf")) { AdjustRegion(__instance, 0.1f, 0.1f, 0.7f); } else if (__instance.m_SpawnablePrefab.name.ToLowerInvariant().Contains("rabbit")) { AdjustRegion(__instance, 0.5f, 0.4f, 0.9f); } else { AdjustRegion(__instance, 0.1f, 0.2f, 0.9f); } }
public void Respawn() { if (regionNum < transform.childCount - 1) { curRegion = transform.GetChild(regionNum + 1).GetComponent <SpawnRegion>(); regionNum++; float regionx = curRegion.gameObject.transform.position.x; float regiony = curRegion.gameObject.transform.position.y; curWidth = curRegion.Width; curHeight = curRegion.Height; curLeft = regionx - curWidth; curRight = regionx + curWidth; curUp = regiony + curHeight; curDown = regiony - curHeight; curRegion.SetSpawn(player); } else { SceneChange(); } }
private static void AdjustRegion(SpawnRegion region, float activeModifier, float respawnModifier, float maximumCountModifier) { float oldChanceActive = region.m_ChanceActive; region.m_ChanceActive *= 0.1f; float oldRespawnTime = region.m_MaxRespawnsPerDayStalker; region.m_MaxRespawnsPerDayPilgrim *= 0.1f; region.m_MaxRespawnsPerDayVoyageur *= 0.1f; region.m_MaxRespawnsPerDayStalker *= 0.1f; region.m_MaxRespawnsPerDayInterloper *= 0.1f; int oldMaximumCountDay = region.m_MaxSimultaneousSpawnsDayStalker; int oldMaximumCountNight = region.m_MaxSimultaneousSpawnsNightStalker; region.m_MaxSimultaneousSpawnsDayPilgrim = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsDayPilgrim * maximumCountModifier)); region.m_MaxSimultaneousSpawnsDayVoyageur = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsDayVoyageur * maximumCountModifier)); region.m_MaxSimultaneousSpawnsDayStalker = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsDayStalker * maximumCountModifier)); region.m_MaxSimultaneousSpawnsDayInterloper = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsDayInterloper * maximumCountModifier)); region.m_MaxSimultaneousSpawnsNightPilgrim = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsNightPilgrim * maximumCountModifier)); region.m_MaxSimultaneousSpawnsNightVoyageur = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsNightVoyageur * maximumCountModifier)); region.m_MaxSimultaneousSpawnsNightStalker = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsNightStalker * maximumCountModifier)); region.m_MaxSimultaneousSpawnsNightInterloper = Math.Max(1, (int)(region.m_MaxSimultaneousSpawnsNightInterloper * maximumCountModifier)); Debug.LogFormat("Adjusted spawner {0}: Active chance {1:F1} -> {2:F1}, respawns / day {3:F2} -> {4:F2}, maximum spawns ({5:D}, {6:D}) -> ({7:D}, {8:D})", region.name, oldChanceActive, region.m_ChanceActive, oldRespawnTime, region.m_MaxRespawnsPerDayStalker, oldMaximumCountDay, oldMaximumCountNight, region.m_MaxSimultaneousSpawnsDayStalker, region.m_MaxSimultaneousSpawnsNightStalker ); }
private static void Postfix(SpawnRegion __instance) { if (__instance.m_AiSubTypeSpawned == AiSubType.Wolf) { //MelonLoader.MelonLogger.Log("Start"); AdjustToRegionSetting(__instance); } }
private static void MakeRandomWolves(SpawnRegion spawnRegion) { if (Utils.RollChance(Settings.options.regularWolfPercentage)) { MakeRegularWolves(spawnRegion); } else { MakeTimberwolves(spawnRegion); } }
private static void MakeRegularWolves(SpawnRegion spawnRegion) { if (spawnRegion is null) { return; } GameObject regularWolf = Resources.Load("WILDLIFE_Wolf")?.Cast <GameObject>(); GameObject regularWolf_aurora = Resources.Load("WILDLIFE_Wolf_aurora")?.Cast <GameObject>(); if (regularWolf && regularWolf_aurora) { spawnRegion.m_AuroraSpawnablePrefab = regularWolf_aurora; spawnRegion.m_SpawnablePrefab = regularWolf; } }
private static void AdjustTimberwolfPackSize(SpawnRegion spawnRegion) { if (spawnRegion is null) { return; } spawnRegion.m_MaxSimultaneousSpawnsDayInterloper = NotOne(spawnRegion.m_MaxSimultaneousSpawnsDayInterloper); spawnRegion.m_MaxSimultaneousSpawnsDayPilgrim = NotOne(spawnRegion.m_MaxSimultaneousSpawnsDayPilgrim); spawnRegion.m_MaxSimultaneousSpawnsDayStalker = NotOne(spawnRegion.m_MaxSimultaneousSpawnsDayStalker); spawnRegion.m_MaxSimultaneousSpawnsDayVoyageur = NotOne(spawnRegion.m_MaxSimultaneousSpawnsDayVoyageur); spawnRegion.m_MaxSimultaneousSpawnsNightInterloper = NotOne(spawnRegion.m_MaxSimultaneousSpawnsNightInterloper); spawnRegion.m_MaxSimultaneousSpawnsNightPilgrim = NotOne(spawnRegion.m_MaxSimultaneousSpawnsNightPilgrim); spawnRegion.m_MaxSimultaneousSpawnsNightStalker = NotOne(spawnRegion.m_MaxSimultaneousSpawnsNightStalker); spawnRegion.m_MaxSimultaneousSpawnsNightVoyageur = NotOne(spawnRegion.m_MaxSimultaneousSpawnsNightVoyageur); }
private static void MakeTimberwolves(SpawnRegion spawnRegion) { if (spawnRegion is null) { return; } GameObject timberwolf = Resources.Load("WILDLIFE_Wolf_grey")?.Cast <GameObject>(); GameObject timberwolf_aurora = Resources.Load("WILDLIFE_Wolf_grey_aurora")?.Cast <GameObject>(); if (timberwolf && timberwolf_aurora) { spawnRegion.m_AuroraSpawnablePrefab = timberwolf_aurora; spawnRegion.m_SpawnablePrefab = timberwolf; AdjustTimberwolfPackSize(spawnRegion); } }
void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); regionNum = WhichRegion(); x = player.transform.position.x; y = player.transform.position.y; int i; for (i = 0; i < transform.childCount; i++) { if (transform.GetChild(i).GetComponent <SpawnRegion>().IsFirst) { startRegion = transform.GetChild(i).GetComponent <SpawnRegion>(); } } }
private static void Prefix(SpawnRegion __instance) { bool m_StartHasBeenCalled = (bool)startHasBeenCalled.GetValue(__instance); if (m_StartHasBeenCalled || (GameManager.IsStoryMode() && !WildlifeBegone.Config.enableInStoryMode)) { return; } GameObject spawnedObject = __instance.m_SpawnablePrefab; BaseAi ai = spawnedObject.GetComponent <BaseAi>(); if (ai == null) { return; } SpawnRateSetting spawnRates = WildlifeBegone.Config.spawnRates[(int)ai.m_AiSubType]; AdjustRegion(__instance, spawnRates); }
private static void SetWolfType(SpawnRegion spawnRegion, SpawnType spawnType) { if (spawnRegion is null) { return; } switch (spawnType) { case SpawnType.RegularWolves: MakeRegularWolves(spawnRegion); return; case SpawnType.Timberwolves: MakeTimberwolves(spawnRegion); return; case SpawnType.Random: MakeRandomWolves(spawnRegion); return; } }
private static void AdjustRegion(SpawnRegion region, SpawnRateSetting spawnRates) { float activeMultiplier = spawnRates.SpawnRegionActiveTimeMultiplier; float respawnMultiplier = spawnRates.MaximumRespawnsPerDayMultiplier; float maximumCountMultiplier = spawnRates.MaximumSpawnedAnimalsMultiplier; float oldChanceActive = region.m_ChanceActive; region.m_ChanceActive *= activeMultiplier; float oldRespawnTime = region.m_MaxRespawnsPerDayStalker; region.m_MaxRespawnsPerDayPilgrim *= respawnMultiplier; region.m_MaxRespawnsPerDayVoyageur *= respawnMultiplier; region.m_MaxRespawnsPerDayStalker *= respawnMultiplier; region.m_MaxRespawnsPerDayInterloper *= respawnMultiplier; int oldMaximumCountDay = region.m_MaxSimultaneousSpawnsDayStalker; int oldMaximumCountNight = region.m_MaxSimultaneousSpawnsNightStalker; RoundingMultiply(ref region.m_MaxSimultaneousSpawnsDayPilgrim, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsDayVoyageur, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsDayStalker, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsDayInterloper, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsNightPilgrim, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsNightVoyageur, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsNightStalker, maximumCountMultiplier); RoundingMultiply(ref region.m_MaxSimultaneousSpawnsNightInterloper, maximumCountMultiplier); if (WildlifeBegone.Config.logging) { Debug.LogFormat("Adjusted spawner {0}: Active chance {1:F1} -> {2:F1}, respawns / day {3:F2} -> {4:F2}, maximum spawns ({5:D}, {6:D}) -> ({7:D}, {8:D})", region.name, oldChanceActive, region.m_ChanceActive, oldRespawnTime, region.m_MaxRespawnsPerDayStalker, oldMaximumCountDay, oldMaximumCountNight, region.m_MaxSimultaneousSpawnsDayStalker, region.m_MaxSimultaneousSpawnsNightStalker ); } }
public void Summon(SpawnRegion region) { if (region.paths.Remove(this)) { region.spawnedPaths.Add(this); List <int> order = new List <int>(); for (int i = 0; i < this.points.Length; i++) { order.Add(i); } this.instances = new GameObject[this.points.Length]; foreach (EnemyData enemy in receipt.enemyTypes) { int orderId = Random.Range(0, order.Count); int id = order[orderId]; order.RemoveAt(orderId); this.instances[id] = enemy.SummonAt(this.points[id], region.transform.parent); } } }
private static void AdjustToRegionSetting(SpawnRegion spawnRegion) { string sceneName = GameManager.m_ActiveScene; if (sceneName is null) { return; } if (sceneName == "AshCanyonRegion") { SetWolfType(spawnRegion, Settings.options.ashCanyonWolves); } else if (sceneName == "CanneryRegion") { SetWolfType(spawnRegion, Settings.options.bleakInletWolves); } else if (sceneName == "TracksRegion") { SetWolfType(spawnRegion, Settings.options.brokenRailroadWolves); } else if (sceneName == "CoastalRegion") { SetWolfType(spawnRegion, Settings.options.coastalHighwayWolves); } else if (sceneName == "HighwayTransitionZone") { SetWolfType(spawnRegion, Settings.options.crumblingHighwayWolves); } else if (sceneName == "WhalingStationRegion") { SetWolfType(spawnRegion, Settings.options.desolationPointWolves); } else if (sceneName == "MarshRegion") { SetWolfType(spawnRegion, Settings.options.forlornMuskegWolves); } else if (sceneName == "RiverValleyRegion") { SetWolfType(spawnRegion, Settings.options.hushedRiverValleyWolves); } else if (sceneName == "MountainTownRegion") { SetWolfType(spawnRegion, Settings.options.mountainTownWolves); } else if (sceneName == "LakeRegion") { SetWolfType(spawnRegion, Settings.options.mysteryLakeWolves); } else if (sceneName == "RuralRegion") { SetWolfType(spawnRegion, Settings.options.pleasantValleyWolves); } else if (sceneName == "CrashMountainRegion") { SetWolfType(spawnRegion, Settings.options.timberwolfMountainWolves); } else if (sceneName == "DamRiverTransitionZoneB") { SetWolfType(spawnRegion, Settings.options.windingRiverWolves); } }
/// <summary> /// What the Client sends to the server. /// </summary> public override void FromClient(PacketFromClient packet) { while (phase == Phases.Handshake) { Thread.Sleep(100); } //Wait for handshake to complete if (phase == Phases.FinalClose) { throw new SessionClosedException(); } if (packet.PacketID == PassThrough.ID) { SendToBackend(packet); return; } //Fix players eid to what is known for the server if (packet is IEntity) { IEntity ie = (IEntity)packet; if (ie.EID == Player.EntityID) { ie.EID = EID; packet.SetPacketBuffer(null); } } WorldRegion region = CurrentRegion; switch (packet.PacketID) { case PlayerPosition.ID: if (AttachedEntity > 0) { //Ignore relative movements } else { var pp = ((PlayerPosition)packet); if (pp.Position.Y > -900) { SetPosition(pp.Position, true); OnGround = pp.OnGround != 0; } } break; case PlayerPositionLookClient.ID: if (AttachedEntity > 0) { //Ignore relative movements } else { PlayerPositionLookClient pp = ((PlayerPositionLookClient)packet); if (pp.Position.Y > -900) { SetPosition(pp.Position, true); OnGround = pp.OnGround; } } Pitch = ((PlayerPositionLookClient)packet).Pitch; Yaw = ((PlayerPositionLookClient)packet).Yaw; break; case PlayerGround.ID: OnGround = ((PlayerGround)packet).OnGround; //Good but a few false positives /* * if (Sprinting)//Hacked client: Invalid sprint * { * Chatting.Parser.TellAdmin(Player.Name + Chat.Gray + " sprinting standing still"); * }*/ break; case EntityAction.ID: EntityAction ea = packet as EntityAction; switch (ea.Action) { case EntityAction.Actions.LeaveBed: Sleeping = false; break; case EntityAction.Actions.Crounch: Crouched = true; break; case EntityAction.Actions.Uncrounch: Crouched = false; break; case EntityAction.Actions.StartSprinting: Sprinting = true; break; case EntityAction.Actions.StopSprinting: Sprinting = false; break; } break; case UseEntity.ID: if (Mode == GameMode.Creative && (Player.Admin(Permissions.AnyAdmin) == false)) { return; //Donors can't hurt while in creative mode } if (UseEntityFromClient((UseEntity)packet)) { return; } break; case HeldItemClient.ID: //Active item var hc = (HeldItemClient)packet; if (hc.SlotID >= 0 && hc.SlotID <= 8) { ActiveInventoryIndex = hc.SlotID; } else { Log.Write( new InvalidOperationException("Invalid holding slot id: " + hc.SlotID), this.Player ); } break; //Prevent non admins from getting items in creative case CreativeInventory.ID: if (Player.Admin(Permissions.CreativeBuild) == false) { Player.SendToClient(new EntityStatus(Player.EntityID, EntityStatuses.EntityHurt)); Player.TellSystem(Chat.Yellow, "Creative Inventory Disabled"); return; } CreativeInventory ci = (CreativeInventory)packet; if (0 <= ci.Slot && ci.Slot <= Inventory.Length) { Inventory[ci.Slot] = ci.Item; } break; //If block action is done from another region case PlayerBlockPlacement.ID: //AfkTime = DateTime.Now; //Non admins can't place block if (Mode == GameMode.Creative && (Player.Admin(Permissions.CreativeBuild) == false)) { Player.SendToClient(new EntityStatus(Player.EntityID, EntityStatuses.EntityHurt)); Player.TellSystem(Chat.Yellow, "Creative Build Disabled"); return; } PlayerBlockPlacement pb = (PlayerBlockPlacement)packet; if (pb.BlockPosition.IsNull() == false) { CoordDouble pos = pb.BlockPosition.CloneDouble(); region = RegionCrossing.GetRegion(pos, Dimension, World.Regions); //Remember the last position clicked so we can do better chest protection LastClickRegion = region; //this is obsolete since we moved to blocking open across regions } else { if (pb.Item != null) { Charge = new ChargeState(pb.Item.ItemID); } } if (FilterDirection(pb.BlockPosition)) { return; } if (region == null) { if (Dimension == 0 && FilterLava(pb)) { return; } } if (Protected.ProtectBlockPlace(this, region, pb)) { return; } break; case PlayerDigging.ID: //AfkTime = DateTime.Now; PlayerDigging pd = (PlayerDigging)packet; if (pd.Status == PlayerDigging.StatusEnum.FinishedDigging || pd.Status == PlayerDigging.StatusEnum.StartedDigging) { CoordDouble pos = pd.Position.CloneDouble(); region = RegionCrossing.GetRegion(pos, Dimension, World.Regions); } //Log breaking blocks to determine if they found the diamond if (pd.Status == PlayerDigging.StatusEnum.FinishedDigging) { OreTracker.BrokeBlock = DateTime.Now; } if (pd.Status == PlayerDigging.StatusEnum.ShootArrow) { Charge = null; } //Prevent non admin creative from digging if (Mode == GameMode.Creative && Player.Admin(Permissions.AnyAdmin) == false) { return; } if (FilterDirection(pd.Position)) { return; } if (Protected.ProtectBlockBreak(this, region, pd)) { return; } break; case WindowClick.ID: var wc = packet as WindowClick; if (wc.WindowID == 0) { //TODO: handle } //AfkTime = DateTime.Now; if (Protected.ProtectChestsClick(this, wc)) { return; } ///Workaround bug clicky items duplication if (wc.Item != null) { if (wc.Item.Count > 64) { return; } } break; case WindowCloseClient.ID: WindowClose((WindowCloseClient)packet); break; } if (region != null) { if (region.Type == SpawnRegion.Type) { if (SpawnRegion.FilterClient(Player, packet)) { return; } } if (region.Type == SpawnTimeRegion.Type) { if (SpawnTimeRegion.FilterClient(region, Player, packet)) { return; } } } SendToBackend(packet); }
static void adjust_spawn_point(SpawnRegion inst, int idx, string name, float active_scale, float max_respawn_scale, float max_sim_day_scale, float max_sim_night_scale) { if ((idx < 0) || (idx > 3)) { return; } float previous_active = inst.m_ChanceActive; inst.m_ChanceActive *= active_scale; float previous_max_respawn = -1, new_max_respawn = -1; float previous_max_sim_day = -1, previous_max_sim_night = -1; float new_max_sim_day = -1, new_max_sim_night = -1; if (idx == 0) { previous_max_respawn = inst.m_MaxRespawnsPerDayPilgrim; inst.m_MaxRespawnsPerDayPilgrim *= max_respawn_scale; new_max_respawn = inst.m_MaxRespawnsPerDayPilgrim; previous_max_sim_day = inst.m_MaxSimultaneousSpawnsDayPilgrim; previous_max_sim_night = inst.m_MaxSimultaneousSpawnsNightPilgrim; inst.m_MaxSimultaneousSpawnsDayPilgrim = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsDayPilgrim * max_sim_day_scale)); inst.m_MaxSimultaneousSpawnsNightPilgrim = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsNightPilgrim * max_sim_night_scale)); new_max_sim_day = inst.m_MaxSimultaneousSpawnsDayPilgrim; new_max_sim_night = inst.m_MaxSimultaneousSpawnsNightPilgrim; } else if (idx == 1) { previous_max_respawn = inst.m_MaxRespawnsPerDayVoyageur; inst.m_MaxRespawnsPerDayVoyageur *= max_respawn_scale; new_max_respawn = inst.m_MaxRespawnsPerDayVoyageur; previous_max_sim_day = inst.m_MaxSimultaneousSpawnsDayVoyageur; previous_max_sim_night = inst.m_MaxSimultaneousSpawnsNightVoyageur; inst.m_MaxSimultaneousSpawnsDayVoyageur = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsDayVoyageur * max_sim_day_scale)); inst.m_MaxSimultaneousSpawnsNightVoyageur = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsNightVoyageur * max_sim_night_scale)); new_max_sim_day = inst.m_MaxSimultaneousSpawnsDayVoyageur; new_max_sim_night = inst.m_MaxSimultaneousSpawnsNightVoyageur; } else if (idx == 2) { previous_max_respawn = inst.m_MaxRespawnsPerDayStalker; inst.m_MaxRespawnsPerDayStalker *= max_respawn_scale; new_max_respawn = inst.m_MaxRespawnsPerDayStalker; previous_max_sim_day = inst.m_MaxSimultaneousSpawnsDayStalker; previous_max_sim_night = inst.m_MaxSimultaneousSpawnsNightStalker; inst.m_MaxSimultaneousSpawnsDayStalker = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsDayStalker * max_sim_day_scale)); inst.m_MaxSimultaneousSpawnsNightStalker = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsNightStalker * max_sim_night_scale)); new_max_sim_day = inst.m_MaxSimultaneousSpawnsDayStalker; new_max_sim_night = inst.m_MaxSimultaneousSpawnsNightStalker; } else if (idx == 3) { previous_max_respawn = inst.m_MaxRespawnsPerDayInterloper; inst.m_MaxRespawnsPerDayInterloper *= max_respawn_scale; new_max_respawn = inst.m_MaxRespawnsPerDayInterloper; previous_max_sim_day = inst.m_MaxSimultaneousSpawnsDayInterloper; previous_max_sim_night = inst.m_MaxSimultaneousSpawnsNightInterloper; inst.m_MaxSimultaneousSpawnsDayInterloper = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsDayInterloper * max_sim_day_scale)); inst.m_MaxSimultaneousSpawnsNightInterloper = Math.Max(1, (int)(inst.m_MaxSimultaneousSpawnsNightInterloper * max_sim_night_scale)); new_max_sim_day = inst.m_MaxSimultaneousSpawnsDayInterloper; new_max_sim_night = inst.m_MaxSimultaneousSpawnsNightInterloper; } Debug.LogFormat("AdjustableDifficulty - Adjusted {0} spawn region: new active chance '{1:F2}' (previously '{2:F2}'), new max respawn '{3:F2}' (previously '{4:F2}'), new max respawns during day: '{5:F2}' (prev: '{6:F2}'), new max respawns during night: '{7:F2}' (prev: '{8:F2}').", name, inst.m_ChanceActive, previous_active, new_max_respawn, previous_max_respawn, new_max_sim_day, previous_max_sim_day, new_max_sim_night, previous_max_sim_night); }
static void Prefix(SpawnRegion __instance) { if (GameManager.IsStoryMode()) { return; } bool start_called = (bool)AccessTools.Field(typeof(SpawnRegion), "m_StartHasBeenCalled").GetValue(__instance); if (start_called) { return; } int exp_mode = get_current_exp_mode(); if (exp_mode < 0) { return; } if (xml_initialized != 1) { if (!load_xmlfile_if_not_loaded()) { Debug.LogFormat("AdjustableDifficulty - ERROR: unable to load XML file '{0}'; will do no adjustments as a result.", xml_file_name); return; } Debug.LogFormat("AdjustableDifficulty - Read XML configuration file '{0}' successfully.", xml_file_name); xml_initialized = 1; } string prefab_name = __instance.m_SpawnablePrefab.name.ToLowerInvariant(); if (prefab_name.Contains("wolf")) { adjust_spawn_point(__instance, exp_mode, "wolf", xml_params[exp_mode].wildlife_spawns_wolves_scale_chance_active, xml_params[exp_mode].wildlife_spawns_wolves_scale_max_respawn_per_day, xml_params[exp_mode].wildlife_spawns_wolves_scale_max_simultaneous_spawns_during_day, xml_params[exp_mode].wildlife_spawns_wolves_scale_max_simultaneous_spawns_during_night); } else if (prefab_name.Contains("rabbit")) { adjust_spawn_point(__instance, exp_mode, "rabbit", xml_params[exp_mode].wildlife_spawns_rabbits_scale_chance_active, xml_params[exp_mode].wildlife_spawns_rabbits_scale_max_respawn_per_day, xml_params[exp_mode].wildlife_spawns_rabbits_scale_max_simultaneous_spawns_during_day, xml_params[exp_mode].wildlife_spawns_rabbits_scale_max_simultaneous_spawns_during_night); } else if (prefab_name.Contains("stag")) { adjust_spawn_point(__instance, exp_mode, "deer", xml_params[exp_mode].wildlife_spawns_deers_scale_chance_active, xml_params[exp_mode].wildlife_spawns_deers_scale_max_respawn_per_day, xml_params[exp_mode].wildlife_spawns_deers_scale_max_simultaneous_spawns_during_day, xml_params[exp_mode].wildlife_spawns_deers_scale_max_simultaneous_spawns_during_night); } else if (prefab_name.Contains("bear")) { adjust_spawn_point(__instance, exp_mode, "bear", xml_params[exp_mode].wildlife_spawns_bears_scale_chance_active, xml_params[exp_mode].wildlife_spawns_bears_scale_max_respawn_per_day, xml_params[exp_mode].wildlife_spawns_bears_scale_max_simultaneous_spawns_during_day, xml_params[exp_mode].wildlife_spawns_bears_scale_max_simultaneous_spawns_during_night); } }
void OnEnable() { region = this.target as SpawnRegion; points = new List <Vector2>(); nextPath = null; }
void Awake() { main = this; }