public void Load(int index) { for (int i = 0; i < this.m_Members.Count; i++) { if (this.m_Members[i] != null) { this.m_AllObjects.Remove(this.m_Members[i].gameObject); UnityEngine.Object.Destroy(this.m_Members[i].gameObject); } } this.m_Members.Clear(); int num = SaveGame.LoadIVal("HAGroupCount" + index); for (int j = 0; j < num; j++) { AI.AIID aiid = (AI.AIID)Enum.Parse(typeof(AI.AIID), SaveGame.LoadSVal("HAGroupID" + j.ToString() + "_" + index.ToString())); Vector3 position = SaveGame.LoadV3Val("HAGroupPos" + j.ToString() + "_" + index.ToString()); Quaternion rotation = SaveGame.LoadQVal("HAGroupRot" + j.ToString() + "_" + index.ToString()); GameObject prefab = GreenHellGame.Instance.GetPrefab(aiid.ToString()); GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab, position, rotation, base.transform); HumanAI component = gameObject.GetComponent <HumanAI>(); this.AddAI(component); } this.Deactivate(); }
private void LoadGoalScript(string script_name, int index) { List <TextAssetParser> list = new List <TextAssetParser>(); TextAsset textAsset = Resources.Load("Scripts/AI/" + script_name + "Goals") as TextAsset; if (textAsset) { TextAssetParser textAssetParser = new TextAssetParser(textAsset); list.Add(textAssetParser); this.m_GoalParsersByName.Add(script_name, textAssetParser); Resources.UnloadAsset(textAsset); } else { for (int i = 0; i < 9999; i++) { AI.AIID aiid = (AI.AIID)index; string text = aiid.ToString() + "Goals_" + i.ToString(); textAsset = (Resources.Load("Scripts/AI/" + text) as TextAsset); if (!textAsset) { break; } TextAssetParser textAssetParser2 = new TextAssetParser(textAsset); list.Add(textAssetParser2); this.m_GoalParsersByName.Add(text, textAssetParser2); Resources.UnloadAsset(textAsset); } } this.m_GoalParsers.Add(index, list); }
public void Catch() { if (this.m_AI) { return; } AI.AIID aiid = AI.AIID.None; if (!this.m_FishTrap) { List <AI.AIID> list = new List <AI.AIID>(); for (int i = 0; i < AIManager.Get().m_Spawners.Count; i++) { AISpawner aispawner = AIManager.Get().m_Spawners[i]; if (aispawner.enabled) { if (!aispawner.m_Bounds.Contains(base.transform.position)) { Vector3 to = aispawner.m_Bounds.ClosestPoint(base.transform.position); if (base.transform.position.Distance(to) > this.m_AdditionalDist) { goto IL_C5; } } if (this.m_AIIDs.Contains(aispawner.m_ID)) { list.Add(aispawner.m_ID); } } IL_C5 :; } if (list.Count > 0) { aiid = list[UnityEngine.Random.Range(0, list.Count)]; } else if (UnityEngine.Random.Range(0f, 1f) < this.m_ChanceToCatchOutsideSpawner) { aiid = this.m_AIIDs[UnityEngine.Random.Range(0, this.m_AIIDs.Count)]; } } else { aiid = this.m_AIIDs[UnityEngine.Random.Range(0, this.m_AIIDs.Count)]; } if (aiid != AI.AIID.None) { this.Catch(aiid); } else { if (this.m_Bait && this.m_Bait.m_Item) { this.m_Bait.DeleteItem(); } this.SetArmed(false); this.m_ChanceToCatchOutsideSpawner += this.m_ChanceToCatchOutsideSpawnerChange; } }
public override void Load(int index) { base.Load(index); this.SetArmed(SaveGame.LoadBVal("TrapArmed" + index)); AI.AIID aiid = (AI.AIID)SaveGame.LoadIVal("TrapAI" + index); if (aiid != AI.AIID.None) { this.Catch(aiid); } }
private void Catch(AI.AIID id) { if (id != AI.AIID.None) { GameObject prefab = GreenHellGame.Instance.GetPrefab(id.ToString()); GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab); gameObject.name = prefab.name; this.m_AI = gameObject.GetComponent <AI>(); this.m_AI.m_Trap = this; Component[] components = gameObject.GetComponents(typeof(Component)); for (int i = 0; i < components.Length; i++) { Type type = components[i].GetType(); if (type != typeof(Transform) && type != typeof(BoxCollider) && type != typeof(Animator) && type != typeof(AI) && !type.IsSubclassOf(typeof(AI)) && type != typeof(SkinnedMeshRenderer) && type != typeof(AnimationEventsReceiver)) { UnityEngine.Object.Destroy(components[i]); } } this.m_AI.m_BoxCollider.isTrigger = true; this.m_AI.m_Trap = this; if (GreenHellGame.Instance.GetPrefab(this.m_AI.m_ID.ToString() + "_Body")) { AIInTrapTrigger aiinTrapTrigger = gameObject.AddComponent <AIInTrapTrigger>(); aiinTrapTrigger.m_AI = this.m_AI; } else { this.m_AI.AddDeadBodyComponent(); } Transform transform; if (this.m_SpecificAIDummies.ContainsKey((int)this.m_AI.m_ID)) { transform = this.m_SpecificAIDummies[(int)this.m_AI.m_ID]; } else if (this.m_AIDummy) { transform = this.m_AIDummy; } else { transform = base.transform; } gameObject.transform.position = transform.position; gameObject.transform.rotation = transform.rotation; this.UpdateEffect(); } if (this.m_Bait && this.m_Bait.m_Item) { this.m_Bait.DeleteItem(); } this.SetArmed(false); this.m_ChanceToCatchOutsideSpawner = 0f; }
private TextAssetParser GetParser() { TextAssetParser textAssetParser = null; if (this.m_HumanAI) { string text = null; AI.AIID id = this.m_HumanAI.m_ID; switch (id) { case AI.AIID.Hunter: text = "AI/SavageAnimEvents"; break; case AI.AIID.Spearman: text = "AI/SpearmanAnimEvents"; break; case AI.AIID.Thug: text = "AI/ThugAnimEvents"; break; case AI.AIID.Savage: text = "AI/SavageAnimEvents"; break; default: if (id == AI.AIID.KidRunner) { text = "AI/KidRunnerAnimEvents"; } break; } if (text != null && !AnimationEventsReceiver.s_ParsedAnimEventScriptsCache.TryGetValue(text, out textAssetParser)) { textAssetParser = new TextAssetParser(); textAssetParser.Parse(text, true); AnimationEventsReceiver.s_ParsedAnimEventScriptsCache.Add(text, textAssetParser); } } else if (this.m_AnimEventsScript != null && !AnimationEventsReceiver.s_ParsedAnimEventScriptsCache.TryGetValue(this.m_AnimEventsScript.name, out textAssetParser)) { textAssetParser = new TextAssetParser(this.m_AnimEventsScript); AnimationEventsReceiver.s_ParsedAnimEventScriptsCache.Add(this.m_AnimEventsScript.name, textAssetParser); } if (textAssetParser == null) { Debug.Log("Could not parse animation event script for: " + base.name); textAssetParser = new TextAssetParser(); } return(textAssetParser); }
private void TakeFish() { if (!this.m_Fish) { return; } AI component = this.m_Fish.GetComponent <AI>(); AI.AIID id = component.m_ID; Item item = ItemsManager.Get().CreateItem(id.ToString() + "_Body", false); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); UnityEngine.Object.Destroy(component.gameObject); this.m_Fish = null; }
private void InitializeGoalParsers() { int num = 0; for (int i = 0; i < 44; i++) { AI.AIID aiid = (AI.AIID)i; string script_name = aiid.ToString(); this.LoadGoalScript(script_name, num); num++; } foreach (string script_name2 in this.m_AdditionalGoalScripts) { this.LoadGoalScript(script_name2, num); num++; } }
private void Setup() { if (!this.m_List) { return; } this.m_List.Clear(); for (int i = 0; i < 44; i++) { AI.AIID aiid = (AI.AIID)i; if (aiid.ToString().ToLower().Contains(this.m_LastField)) { this.m_List.AddElement(aiid.ToString(), -1); } } this.m_List.SortAlphabetically(); this.m_List.SetSelectionIndex(0); }
private static void ParseSoundFile(AI.AIID ai_id) { ScriptParser scriptParser = new ScriptParser(); scriptParser.Parse("AI/" + ai_id.ToString() + "Sounds", true); AISoundModule.s_IdleClips[(int)ai_id] = new List <AudioClip>(); AISoundModule.s_PanicClips[(int)ai_id] = new List <AudioClip>(); AISoundModule.s_DeathClips[(int)ai_id] = new List <AudioClip>(); for (int i = 0; i < scriptParser.GetKeysCount(); i++) { Key key = scriptParser.GetKey(i); if (key.GetName() == "Idle") { for (int j = 0; j < key.GetVariablesCount(); j++) { CJVariable variable = key.GetVariable(j); AudioClip item = Resources.Load("Sounds/AI/" + ai_id.ToString() + "/" + variable.SValue) as AudioClip; AISoundModule.s_IdleClips[(int)ai_id].Add(item); } } else if (key.GetName() == "Panic") { for (int k = 0; k < key.GetVariablesCount(); k++) { CJVariable variable2 = key.GetVariable(k); AudioClip item2 = Resources.Load("Sounds/AI/" + ai_id.ToString() + "/" + variable2.SValue) as AudioClip; AISoundModule.s_PanicClips[(int)ai_id].Add(item2); } } else if (key.GetName() == "Death") { for (int l = 0; l < key.GetVariablesCount(); l++) { CJVariable variable3 = key.GetVariable(l); AudioClip item3 = Resources.Load("Sounds/AI/" + ai_id.ToString() + "/" + variable3.SValue) as AudioClip; AISoundModule.s_DeathClips[(int)ai_id].Add(item3); } } } AISoundModule.s_Status[(int)ai_id] = true; }
private void InitializeAnimatorDataParsers() { for (int i = 0; i < 44; i++) { List <TextAssetParser> list = new List <TextAssetParser>(); AI.AIID aiid = (AI.AIID)i; string text = aiid.ToString() + "AnimatorData"; TextAsset textAsset = Resources.Load("Scripts/AI/" + text) as TextAsset; if (textAsset) { TextAssetParser textAssetParser = new TextAssetParser(textAsset); list.Add(textAssetParser); this.m_AnimatorDataParsers.Add(text, textAssetParser); Resources.UnloadAsset(textAsset); } else { Debug.Log("Can't load animator data script - " + text); } } }
public override void Load(int index) { base.Load(index); this.SetArmed(SaveGame.LoadBVal("TrapArmed" + index)); int num = SaveGame.LoadIVal("TrapCount" + index); for (int i = 0; i < num; i++) { AI.AIID aiid = (AI.AIID)SaveGame.LoadIVal(string.Concat(new object[] { "TrapAI", index, "Count", i })); if (aiid != AI.AIID.None) { this.Catch(aiid, i); } } }
private void TakeFish() { if (!this.m_Fish) { return; } AI component = this.m_Fish.GetComponent <AI>(); AI.AIID id = component.m_ID; Item item = ItemsManager.Get().CreateItem(id.ToString() + "_Body", false); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); UnityEngine.Object.Destroy(component.gameObject); this.m_Fish = null; this.SetState(FishingController.State.Idle); Animator componentDeepChild = General.GetComponentDeepChild <Animator>(item.gameObject); if (componentDeepChild != null) { componentDeepChild.SetBool("Backpack", true); } HintsManager.Get().HideHint("Cast_FishingRod"); }
public override void OnExecute(TriggerAction.TYPE action) { base.OnExecute(action); AI.AIID id = this.m_AI.m_ID; Item item = ItemsManager.Get().CreateItem(id.ToString() + "_Body", false); if (id == AI.AIID.PoisonDartFrog) { List <Renderer> componentsDeepChild = General.GetComponentsDeepChild <Renderer>(base.gameObject); Material material = null; for (int i = 0; i < componentsDeepChild.Count; i++) { material = componentsDeepChild[i].material; } item.ApplyMaterial(material); } if (!item.Take()) { Inventory3DManager.Get().DropItem(item); } UnityEngine.Object.Destroy(this.m_AI.gameObject); this.m_AI = null; }
private void InitializeGoalParsers() { for (int i = 0; i < 39; i++) { List <TextAssetParser> list = new List <TextAssetParser>(); AI.AIID aiid = (AI.AIID)i; string text = aiid.ToString() + "Goals"; string path = "Scripts/AI/" + text; TextAsset textAsset = Resources.Load(path) as TextAsset; if (textAsset) { TextAssetParser textAssetParser = new TextAssetParser(textAsset); list.Add(textAssetParser); this.m_GoalParsersByName.Add(text, textAssetParser); Resources.UnloadAsset(textAsset); } else { for (int j = 0; j < 9999; j++) { AI.AIID aiid2 = (AI.AIID)i; text = aiid2.ToString() + "Goals_" + j.ToString(); path = "Scripts/AI/" + text; textAsset = (Resources.Load(path) as TextAsset); if (!textAsset) { break; } TextAssetParser textAssetParser2 = new TextAssetParser(textAsset); list.Add(textAssetParser2); this.m_GoalParsersByName.Add(text, textAssetParser2); Resources.UnloadAsset(textAsset); } } this.m_GoalParsers.Add(i, list); } }
public TextAssetParser GetRandomGoalsParser(AI.AIID id) { List <TextAssetParser> list = this.m_GoalParsers[(int)id]; return(list[UnityEngine.Random.Range(0, list.Count)]); }
private void Catch(AI.AIID id, int index) { if (id != AI.AIID.None) { GameObject prefab = GreenHellGame.Instance.GetPrefab(id.ToString()); GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab); gameObject.name = prefab.name; AI component = gameObject.GetComponent <AI>(); component.m_Trap = this; Behaviour[] components = gameObject.GetComponents <Behaviour>(); for (int i = 0; i < components.Length; i++) { Type type = components[i].GetType(); if (type != typeof(Transform) && type != typeof(BoxCollider) && type != typeof(Animator) && type != typeof(AI) && !type.IsSubclassOf(typeof(AI)) && type != typeof(SkinnedMeshRenderer) && type != typeof(AnimationEventsReceiver) && type != typeof(GuidComponent) && type != typeof(ReplicationComponent) && type != typeof(Relevance)) { if (components[i] is IReplicatedBehaviour) { components[i].enabled = false; } else { UnityEngine.Object.Destroy(components[i]); } } } component.m_BoxCollider.isTrigger = true; component.m_Trap = this; if ((this.m_Effect == Trap.Effect.Block || this.m_Info.m_ID == ItemID.Snare_Trap) && component.m_SoundModule) { component.m_SoundModule.RequestSound(AISoundType.Panic); } if (GreenHellGame.Instance.GetPrefab(component.m_ID.ToString() + "_Body")) { gameObject.AddComponent <AIInTrapTrigger>().m_AI = component; } else { component.AddDeadBodyComponent(); } Transform transform; if (this.m_SpecificAIDummies.ContainsKey((int)component.m_ID)) { transform = this.m_SpecificAIDummies[(int)component.m_ID][index]; } else if (this.m_AIDummy) { transform = this.m_AIDummy; } else { transform = base.transform; } gameObject.transform.position = transform.position; gameObject.transform.rotation = transform.rotation; if (this.m_WaterColl) { Vector3 position = gameObject.transform.position; position.y = this.m_WaterColl.bounds.max.y - component.m_BoxCollider.size.y * 0.5f; gameObject.transform.position = position; } this.UpdateEffect(); this.m_AIs.Add(component); } if (this.m_Bait && this.m_Bait.m_Item) { this.m_Bait.DeleteItem(); } this.SetArmed(false); this.m_ChanceToCatchOutsideSpawner = 0f; }
public static bool IsHuman(AI.AIID id) { return(id == AI.AIID.Savage || id == AI.AIID.Hunter || id == AI.AIID.Thug || id == AI.AIID.SpearMan || id == AI.AIID.Regular); }
public static bool IsCat(AI.AIID id) { return(id == AI.AIID.Puma || id == AI.AIID.Jaguar); }
private void UpdateFishAttractedByHook() { if (!this.m_FishingRod || !this.m_FishingRod.m_Hook || !this.m_FishingRod.m_Hook.m_Bait) { this.ResetFishAttractedByHook(this.m_FishAttractedByHook); return; } if (this.m_FishAttractedByHook) { return; } if (this.m_Fishes.Count <= 0) { return; } float num = 0f; List <Fish> list = new List <Fish>(); this.chance_map.Clear(); foreach (Fish fish in this.m_Fishes) { if (!(fish == this.m_LastFishAttractedByHook)) { if (fish.m_Params.m_Baits.Contains(this.m_FishingRod.m_Hook.m_Bait.m_Info.m_ID)) { if (fish.m_Params.m_FishingRods.Contains(this.m_FishingRod.m_FishingRodItem.m_Info.m_ID)) { list.Add(fish); if (!this.chance_map.ContainsKey((int)fish.m_ID)) { this.chance_map.Add((int)fish.m_ID, fish.m_Params.m_BitingChance); num += fish.m_Params.m_BitingChance; } } } } } if (list.Count == 0) { return; } AI.AIID aiid = AI.AIID.None; float num2 = UnityEngine.Random.Range(0f, num); num = 0f; using (Dictionary <int, float> .KeyCollection.Enumerator enumerator2 = this.chance_map.Keys.GetEnumerator()) { while (enumerator2.MoveNext()) { AI.AIID aiid2 = (AI.AIID)enumerator2.Current; if (num2 >= num && num2 <= num + this.chance_map[(int)aiid2]) { aiid = aiid2; break; } num += this.chance_map[(int)aiid2]; } } int i = 0; while (i < list.Count) { if (list[i].m_ID != aiid) { list.RemoveAt(i); } else { i++; } } if (list.Count == 0) { return; } this.m_FishAttractedByHook = list[UnityEngine.Random.Range(0, list.Count)]; this.m_FishAttractedByHook.SetHook(this.m_FishingRod.m_Hook); }
public static bool IsTurtle(AI.AIID id) { return(id == AI.AIID.RedFootedTortoise || id == AI.AIID.MudTurtle); }
public static bool IsArmadillo(AI.AIID id) { return(id == AI.AIID.Armadillo || id == AI.AIID.ArmadilloThreeBanded); }
public static bool IsHuntingTarget(AI.AIID id) { return(id == AI.AIID.Agouti || id == AI.AIID.Peccary || id == AI.AIID.Capybara || id == AI.AIID.Tapir || id == AI.AIID.Armadillo || id == AI.AIID.GoldenLionTamarin || id == AI.AIID.Atelinae || id == AI.AIID.GreenIguana); }
public static bool IsAIIDEnabled(AI.AIID id) { return(((id != AI.AIID.BlackCaiman && !AI.IsCat(id)) || DifficultySettings.ActivePreset.m_Predators) && ((id != AI.AIID.Piranha && id != AI.AIID.Stingray) || DifficultySettings.ActivePreset.m_Aquatic) && (!AI.IsSnake(id) || DifficultySettings.ActivePreset.m_Snakes) && ((id != AI.AIID.BrasilianWanderingSpider && id != AI.AIID.GoliathBirdEater && id != AI.AIID.Scorpion) || DifficultySettings.ActivePreset.m_Insects) && (DifficultySettings.Get().m_ActivePresetType != DifficultySettings.PresetType.Tourist || (id != AI.AIID.Piranha && id != AI.AIID.Stingray && id != AI.AIID.BrasilianWanderingSpider && id != AI.AIID.GoliathBirdEater && id != AI.AIID.Scorpion && !AI.IsSnake(id)))); }
private void OnEnterState() { WeaponSpearController.State spearState = this.m_SpearState; switch (spearState) { case WeaponSpearController.State.UnAim: case WeaponSpearController.State.ThrowUnAim: this.m_Player.StopAim(); break; case WeaponSpearController.State.AttackDown: this.Attack(); this.m_WasWaterHit = false; this.m_CanHitWater = false; PlayerAudioModule.Get().PlayAttackSound(1f, false); this.m_Player.DecreaseStamina(this.m_Player.GetStaminaDecrease(StaminaDecreaseReason.Attack) * Skill.Get <SpearSkill>().GetStaminaMul()); break; case WeaponSpearController.State.Attack: this.Attack(); this.m_WasWaterHit = false; this.m_CanHitWater = false; PlayerAudioModule.Get().PlayAttackSound(1f, false); this.m_Player.DecreaseStamina(this.m_Player.GetStaminaDecrease(StaminaDecreaseReason.Attack) * Skill.Get <SpearSkill>().GetStaminaMul()); this.m_Player.StopAim(); break; default: if (spearState == WeaponSpearController.State.Aim) { this.m_Player.StartAim(Player.AimType.SpearFishing); } break; case WeaponSpearController.State.ThrowAim: this.m_Player.StartAim(Player.AimType.SpearHunting); break; case WeaponSpearController.State.Throw: this.m_Player.StopAim(); this.m_Player.DecreaseStamina(this.m_Player.GetStaminaDecrease(StaminaDecreaseReason.Throw) * Skill.Get <SpearSkill>().GetStaminaMul()); break; case WeaponSpearController.State.Presentation: { this.m_ImpaledObject.transform.parent = null; AI component = this.m_ImpaledObject.GetComponent <AI>(); this.m_ImpaledIsStingRay = false; this.m_ImpaledArowana = false; this.m_ImpaledPiranha = false; AI.AIID id = component.m_ID; Item item = ItemsManager.Get().CreateItem(id.ToString() + "_Body", false); Item currentItem = this.m_Player.GetCurrentItem(Hand.Right); Vector3 b = (currentItem.m_DamagerStart.position - currentItem.m_DamagerEnd.position).normalized * -0.07f; item.transform.rotation = currentItem.m_DamagerStart.rotation; if (component.m_ID == AI.AIID.Arowana) { this.m_ImpaledArowana = true; item.transform.Rotate(Vector3.forward, -60f); } else if (component.m_ID == AI.AIID.Piranha) { this.m_ImpaledPiranha = true; item.transform.Rotate(Vector3.forward, -90f); } else if (component.IsStringray()) { this.m_ImpaledIsStingRay = true; item.transform.Rotate(Vector3.forward, -210f); } else { item.transform.Rotate(Vector3.forward, 0f); this.m_ImpaledIsStingRay = false; } item.transform.position = currentItem.m_DamagerStart.position + b; item.transform.parent = this.m_Player.GetCurrentItem(Hand.Right).transform; item.m_BlockGrabAnimOnExecute = true; item.m_AttachedToSpear = true; this.m_ItemBody = item; UnityEngine.Object.Destroy(this.m_ImpaledObject.gameObject); this.m_ImpaledObject = null; item.m_CanBeOutlined = false; this.PlayCatchAnimation(); break; } } }
public static bool IsSnake(AI.AIID id) { return(id == AI.AIID.SouthAmericanRattlesnake || id == AI.AIID.GreenAnaconda || id == AI.AIID.BoaConstrictor); }
public virtual void Catch() { if (this.m_AIs.Count > 0) { return; } AI.AIID aiid = AI.AIID.None; if (!this.m_FishTrap) { List <AI.AIID> list = new List <AI.AIID>(); for (int i = 0; i < AIManager.Get().m_Spawners.Count; i++) { AISpawner aispawner = AIManager.Get().m_Spawners[i]; if (aispawner.enabled) { if (!aispawner.m_Bounds.Contains(base.transform.position)) { Vector3 to = aispawner.m_Bounds.ClosestPoint(base.transform.position); if (base.transform.position.Distance(to) > this.m_AdditionalDist) { goto IL_BA; } } if (this.m_AIIDs.Contains(aispawner.m_ID) && DifficultySettings.IsAIIDEnabled(aispawner.m_ID)) { list.Add(aispawner.m_ID); } } IL_BA :; } if (list.Count > 0) { aiid = list[UnityEngine.Random.Range(0, list.Count)]; } else { if (UnityEngine.Random.Range(0f, 1f) < this.m_ChanceToCatchOutsideSpawner) { aiid = this.m_AIIDs[UnityEngine.Random.Range(0, this.m_AIIDs.Count)]; } if (!DifficultySettings.IsAIIDEnabled(aiid)) { aiid = AI.AIID.None; } } } else { OccurringFishes occurringFishes = this.m_WaterColl ? this.m_WaterColl.GetComponent <OccurringFishes>() : null; if (occurringFishes) { List <AI.AIID> list2 = new List <AI.AIID>(); foreach (AI.AIID aiid2 in this.m_AIIDs) { if (occurringFishes.m_IDs.Contains(aiid2) && DifficultySettings.IsAIIDEnabled(aiid2)) { list2.Add(aiid2); } } if (list2.Count > 0) { aiid = list2[UnityEngine.Random.Range(0, list2.Count)]; } else { if (UnityEngine.Random.Range(0f, 1f) < this.m_ChanceToCatchOutsideSpawner) { aiid = this.m_AIIDs[UnityEngine.Random.Range(0, this.m_AIIDs.Count)]; } if (!DifficultySettings.IsAIIDEnabled(aiid)) { aiid = AI.AIID.None; } } } else { aiid = this.m_AIIDs[UnityEngine.Random.Range(0, this.m_AIIDs.Count)]; if (!DifficultySettings.IsAIIDEnabled(aiid)) { aiid = AI.AIID.None; } } } if (aiid == AI.AIID.None) { if (this.m_Bait && this.m_Bait.m_Item) { this.m_Bait.DeleteItem(); } this.SetArmed(false); this.m_ChanceToCatchOutsideSpawner += this.m_ChanceToCatchOutsideSpawnerChange; return; } if (this.m_SpecificAIDummies.ContainsKey((int)aiid)) { for (int j = 0; j < this.m_SpecificAIDummies[(int)aiid].Count; j++) { this.Catch(aiid, j); } return; } this.Catch(aiid, 0); }