Decompiled source of HuntdownKR v0.0.1
Huntdown.dll
Decompiled 6 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Huntdown.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Huntdown")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Huntdown")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("2b817e02-a71e-44d9-aa9a-94bb15fecd9f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace Huntdown { public static class ConfigSettings { public struct ConfigurableSetting { public Enum Index; public string Section; public string Key; public object DefaultValue; public ConfigDescription Description; } private enum ConfigSections { [Description("1: 일반 설정")] General, [Description("2: 미션 활성화")] Toggle, [Description("3: 미션 가중치")] Weight, [Description("4: 미션 보상")] Reward } public enum DisplayTargetSettings { Full, Some, None } public enum ConfigIndexes { DisplayTarget, GeneralPercentageChance, ToggleWeightDynamic, ChangeSubtext, ToggleFlea, ToggleSpider, ToggleHoarder, ToggleBracken, ToggleThumper, ToggleNutcracker, ToggleMasked, ToggleDog, ToggleMafia, ToggleBlunderbug, ToggleInfestation, ToggleLastcrew, ToggleButler, ToggleManeater, ToggleStabbinBros, ToggleGiantSize, ToggleLittleEnemies, TogglePuppies, ToggleBaboonGang, ToggleFacilityKeeper, ToggleLoneHawk, ToggleDuo, ToggleDen, ToggleOutbreak, ToggleLeft4Dead, ToggleZombie, ToggleZombieCrew, ToggleZombieApocalypse, ToggleBoomba, ToggleBoombopocalypse, ToggleHauntedHarpist, TogglePhantomPiper, ToggleEnforcerGhost, ToggleFiringSquad, ToggleManorLord, ToggleJanitor, ToggleRivals, ToggleBellCrab, WeightFlea, WeightSpider, WeightHoarder, WeightBracken, WeightThumper, WeightNutcracker, WeightMasked, WeightDog, WeightMafia, WeightBlunderbug, WeightInfestation, WeightLastcrew, WeightButler, WeightManeater, WeightStabbinBros, WeightGiantSize, WeightLittleEnemies, WeightPuppies, WeightBaboonGang, WeightFacilityKeeper, WeightLoneHawk, WeightDuo, WeightDen, WeightOutbreak, WeightLeft4Dead, WeightZombie, WeightZombieCrew, WeightZombieApocalypse, WeightBoomba, WeightBoombopocalypse, WeightHauntedHarpist, WeightPhantomPiper, WeightEnforcerGhost, WeightFiringSquad, WeightManorLord, WeightJanitor, WeightRivals, WeightBellCrab, RewardLow, RewardMedium, RewardHigh, RewardExtreme, RewardBrutal, RewardExecution, EnableToolRewards } public static readonly ConfigurableSetting[] AllConfigurableSettings = new ConfigurableSetting[87] { new ConfigurableSetting { Index = ConfigIndexes.DisplayTarget, Section = ConfigSections.General.GetDescription(), Key = "라운드 시작 시 목표 표시", DefaultValue = DisplayTargetSettings.Full, Description = new ConfigDescription("0: 목표 존재 여부와 이름을 모두 표시합니다.\n1: 목표 존재 여부만 표시하고 이름은 숨깁니다.\n2: 목표 관련 정보를 전혀 표시하지 않습니다.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, Enum.GetNames(typeof(DisplayTargetSettings)).Length - 1), Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.GeneralPercentageChance, Section = ConfigSections.General.GetDescription(), Key = "미션 발생 확률", DefaultValue = 100, Description = new ConfigDescription("팀이 사냥 목표를 받을 확률 (%)입니다.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleWeightDynamic, Section = ConfigSections.General.GetDescription(), Key = "동적 가중치 시스템", DefaultValue = true, Description = new ConfigDescription("아직 받지 않은 미션이 더 자주 나오도록 하여 다양성을 유지합니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ChangeSubtext, Section = ConfigSections.General.GetDescription(), Key = "스캔 노드 서브텍스트 변경", DefaultValue = false, Description = new ConfigDescription("true로 설정 시 '목표' 라벨을 headerText 대신 subText에 표시합니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleFlea, Section = ConfigSections.Toggle.GetDescription(), Key = "올가미 벼룩 미션 활성화", DefaultValue = true, Description = new ConfigDescription("올가미 벼룩이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleSpider, Section = ConfigSections.Toggle.GetDescription(), Key = "벙커 거미 미션 활성화", DefaultValue = true, Description = new ConfigDescription("벙커 거미가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleHoarder, Section = ConfigSections.Toggle.GetDescription(), Key = "비축 벌레 미션 활성화", DefaultValue = true, Description = new ConfigDescription("비축 벌레가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBracken, Section = ConfigSections.Toggle.GetDescription(), Key = "브라켄 미션 활성화", DefaultValue = true, Description = new ConfigDescription("브라켄이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleThumper, Section = ConfigSections.Toggle.GetDescription(), Key = "덤퍼 미션 활성화", DefaultValue = true, Description = new ConfigDescription("덤퍼가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleNutcracker, Section = ConfigSections.Toggle.GetDescription(), Key = "병정 미션 활성화", DefaultValue = true, Description = new ConfigDescription("병정이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleMasked, Section = ConfigSections.Toggle.GetDescription(), Key = "마스크 미션 활성화", DefaultValue = true, Description = new ConfigDescription("마스크가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleDog, Section = ConfigSections.Toggle.GetDescription(), Key = "착한 개 미션 활성화", DefaultValue = true, Description = new ConfigDescription("착한 개가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleMafia, Section = ConfigSections.Toggle.GetDescription(), Key = "벌레 마피아 미션 활성화", DefaultValue = true, Description = new ConfigDescription("벌레 마피아가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBlunderbug, Section = ConfigSections.Toggle.GetDescription(), Key = "어리버리 벌레 미션 활성화", DefaultValue = false, Description = new ConfigDescription("(개발 중, 비활성화 권장) 어리버리 벌레가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleInfestation, Section = ConfigSections.Toggle.GetDescription(), Key = "해충 떼 미션 활성화", DefaultValue = true, Description = new ConfigDescription("해충 떼(비축 벌레 2마리, 올가미 벼룩 2마리, 벙커 거미 1마리)가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleLastcrew, Section = ConfigSections.Toggle.GetDescription(), Key = "지난달 인턴들 미션 활성화", DefaultValue = true, Description = new ConfigDescription("지난달 인턴들(마스크 4마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleButler, Section = ConfigSections.Toggle.GetDescription(), Key = "집사 미션 활성화", DefaultValue = true, Description = new ConfigDescription("집사가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleManeater, Section = ConfigSections.Toggle.GetDescription(), Key = "식인귀 미션 활성화", DefaultValue = true, Description = new ConfigDescription("식인귀가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleStabbinBros, Section = ConfigSections.Toggle.GetDescription(), Key = "찌르기 형제 미션 활성화", DefaultValue = true, Description = new ConfigDescription("찌르기 형제가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleGiantSize, Section = ConfigSections.Toggle.GetDescription(), Key = "초대형: 강화판 미션 활성화", DefaultValue = true, Description = new ConfigDescription("초대형: 강화판(랜덤 대형 적 1마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleLittleEnemies, Section = ConfigSections.Toggle.GetDescription(), Key = "작은 적, 큰 위협 미션 활성화", DefaultValue = true, Description = new ConfigDescription("작은 적, 큰 위협(랜덤 소형 적 15마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.TogglePuppies, Section = ConfigSections.Toggle.GetDescription(), Key = "누가 개들을 풀어놨어 미션 활성화", DefaultValue = true, Description = new ConfigDescription("누가 개들을 풀어놨어?(소형 개 12마리)가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBaboonGang, Section = ConfigSections.Toggle.GetDescription(), Key = "개코매 갱단 미션 활성화", DefaultValue = true, Description = new ConfigDescription("개코매 갱단(개코매 3마리)이 사냥 목표로 지정될 수 있는지 여부입니다. (StarlancerAIFix 모드 필요)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleFacilityKeeper, Section = ConfigSections.Toggle.GetDescription(), Key = "시설 수호자 미션 활성화", DefaultValue = true, Description = new ConfigDescription("시설 수호자가 사냥 목표로 지정될 수 있는지 여부입니다. (StarlancerAIFix 모드 필요)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleLoneHawk, Section = ConfigSections.Toggle.GetDescription(), Key = "고독한 개코매 미션 활성화", DefaultValue = true, Description = new ConfigDescription("고독한 개코매가 사냥 목표로 지정될 수 있는지 여부입니다. (StarlancerAIFix 모드 필요)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleDuo, Section = ConfigSections.Toggle.GetDescription(), Key = "역동적인 듀오 미션 활성화", DefaultValue = true, Description = new ConfigDescription("역동적인 듀오(덤퍼와 거미)가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleDen, Section = ConfigSections.Toggle.GetDescription(), Key = "괴물 소굴 미션 활성화", DefaultValue = true, Description = new ConfigDescription("괴물 소굴(거미 2마리, 비축 벌레 2마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleOutbreak, Section = ConfigSections.Toggle.GetDescription(), Key = "마스크 대발생 미션 활성화", DefaultValue = true, Description = new ConfigDescription("마스크 대발생(마스크 8마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleLeft4Dead, Section = ConfigSections.Toggle.GetDescription(), Key = "마스크 포 데드 2 미션 활성화", DefaultValue = true, Description = new ConfigDescription("마스크 포 데드 2(마스크 15마리)가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleZombie, Section = ConfigSections.Toggle.GetDescription(), Key = "좀비 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(LethalThings 모드 필요) 좀비가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleZombieCrew, Section = ConfigSections.Toggle.GetDescription(), Key = "작년 인턴들 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(LethalThings 모드 필요) 작년 인턴들(좀비 4마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleZombieApocalypse, Section = ConfigSections.Toggle.GetDescription(), Key = "좀비 대재앙 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(LethalThings 모드 필요) 좀비 대재앙(좀비 15마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBoomba, Section = ConfigSections.Toggle.GetDescription(), Key = "붐바 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(LethalThings 모드 필요) 붐바가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBoombopocalypse, Section = ConfigSections.Toggle.GetDescription(), Key = "붐바 대재앙 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(LethalThings 모드 필요) 붐바 대재앙(붐바 15마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleHauntedHarpist, Section = ConfigSections.Toggle.GetDescription(), Key = "저주받은 하피스트 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 저주받은 하피스트가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.TogglePhantomPiper, Section = ConfigSections.Toggle.GetDescription(), Key = "유령 피리 연주자 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 유령 피리 연주자가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleEnforcerGhost, Section = ConfigSections.Toggle.GetDescription(), Key = "집행자 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 집행자가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleFiringSquad, Section = ConfigSections.Toggle.GetDescription(), Key = "총살 집행단 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 총살 집행단(집행자 4명, 병정 1마리)이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleManorLord, Section = ConfigSections.Toggle.GetDescription(), Key = "저택의 군주 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Code Rebirth 모드 필요) 저택의 군주가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleJanitor, Section = ConfigSections.Toggle.GetDescription(), Key = "청소부 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Code Rebirth 모드 필요) 청소부가 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleRivals, Section = ConfigSections.Toggle.GetDescription(), Key = "청소 라이벌 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Code Rebirth 모드 필요) 청소 라이벌이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleBellCrab, Section = ConfigSections.Toggle.GetDescription(), Key = "벨 크랩 미션 활성화", DefaultValue = true, Description = new ConfigDescription("(Surfaced 모드 필요) 벨 크랩이 사냥 목표로 지정될 수 있는지 여부입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightFlea, Section = ConfigSections.Weight.GetDescription(), Key = "올가미 벼룩 미션 가중치", DefaultValue = 100, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 올가미 벼룩이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightSpider, Section = ConfigSections.Weight.GetDescription(), Key = "벙커 거미 미션 가중치", DefaultValue = 100, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 벙커 거미가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightHoarder, Section = ConfigSections.Weight.GetDescription(), Key = "비축 벌레 미션 가중치", DefaultValue = 100, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 비축 벌레가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBracken, Section = ConfigSections.Weight.GetDescription(), Key = "브라켄 미션 가중치", DefaultValue = 50, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 브라켄이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightThumper, Section = ConfigSections.Weight.GetDescription(), Key = "덤퍼 미션 가중치", DefaultValue = 100, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 덤퍼가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightNutcracker, Section = ConfigSections.Weight.GetDescription(), Key = "병정 미션 가중치", DefaultValue = 50, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 병정이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightMasked, Section = ConfigSections.Weight.GetDescription(), Key = "마스크 미션 가중치", DefaultValue = 75, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 마스크가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightDog, Section = ConfigSections.Weight.GetDescription(), Key = "착한 개 미션 가중치", DefaultValue = 20, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 착한 개가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightMafia, Section = ConfigSections.Weight.GetDescription(), Key = "벌레 마피아 미션 가중치", DefaultValue = 50, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 벌레 마피아가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBlunderbug, Section = ConfigSections.Weight.GetDescription(), Key = "어리버리 벌레 미션 가중치", DefaultValue = 0, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 어리버리 벌레가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightInfestation, Section = ConfigSections.Weight.GetDescription(), Key = "해충 떼 미션 가중치", DefaultValue = 25, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 해충 떼가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightLastcrew, Section = ConfigSections.Weight.GetDescription(), Key = "지난달 인턴들 미션 가중치", DefaultValue = 15, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 지난달 인턴들이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightButler, Section = ConfigSections.Weight.GetDescription(), Key = "집사 미션 가중치", DefaultValue = 50, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 집사가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightManeater, Section = ConfigSections.Weight.GetDescription(), Key = "식인귀 미션 가중치", DefaultValue = 10, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 식인귀가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightStabbinBros, Section = ConfigSections.Weight.GetDescription(), Key = "찌르기 형제 미션 가중치", DefaultValue = 40, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 찌르기 형제가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightGiantSize, Section = ConfigSections.Weight.GetDescription(), Key = "초대형: 강화판 미션 가중치", DefaultValue = 5, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 초대형: 강화판이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightLittleEnemies, Section = ConfigSections.Weight.GetDescription(), Key = "작은 적, 큰 위협 미션 가중치", DefaultValue = 5, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 작은 적, 큰 위협이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightPuppies, Section = ConfigSections.Weight.GetDescription(), Key = "누가 개들을 풀어놨어 미션 가중치", DefaultValue = 5, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 누가 개들을 풀어놨어?가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBaboonGang, Section = ConfigSections.Weight.GetDescription(), Key = "개코매 갱단 미션 가중치", DefaultValue = 40, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 개코매 갱단이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightFacilityKeeper, Section = ConfigSections.Weight.GetDescription(), Key = "시설 수호자 미션 가중치", DefaultValue = 15, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 시설 수호자가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightLoneHawk, Section = ConfigSections.Weight.GetDescription(), Key = "고독한 개코매 미션 가중치", DefaultValue = 70, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 고독한 개코매가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightDuo, Section = ConfigSections.Weight.GetDescription(), Key = "역동적인 듀오 미션 가중치", DefaultValue = 30, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 역동적인 듀오가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightDen, Section = ConfigSections.Weight.GetDescription(), Key = "괴물 소굴 미션 가중치", DefaultValue = 20, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 괴물 소굴이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightOutbreak, Section = ConfigSections.Weight.GetDescription(), Key = "마스크 대발생 미션 가중치", DefaultValue = 6, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 마스크 대발생이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightLeft4Dead, Section = ConfigSections.Weight.GetDescription(), Key = "마스크 포 데드 2 미션 가중치", DefaultValue = 2, Description = new ConfigDescription("값이 높을수록 더 자주 선택됩니다. 마스크 포 데드 2가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightZombie, Section = ConfigSections.Weight.GetDescription(), Key = "좀비 미션 가중치", DefaultValue = 75, Description = new ConfigDescription("(LethalThings 모드 필요) 값이 높을수록 더 자주 선택됩니다. 좀비가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightZombieCrew, Section = ConfigSections.Weight.GetDescription(), Key = "작년 인턴들 미션 가중치", DefaultValue = 15, Description = new ConfigDescription("(LethalThings 모드 필요) 값이 높을수록 더 자주 선택됩니다. 작년 인턴들이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightZombieApocalypse, Section = ConfigSections.Weight.GetDescription(), Key = "좀비 대재앙 미션 가중치", DefaultValue = 8, Description = new ConfigDescription("(LethalThings 모드 필요) 값이 높을수록 더 자주 선택됩니다. 좀비 대재앙이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBoomba, Section = ConfigSections.Weight.GetDescription(), Key = "붐바 미션 가중치", DefaultValue = 75, Description = new ConfigDescription("(LethalThings 모드 필요) 값이 높을수록 더 자주 선택됩니다. 붐바가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBoombopocalypse, Section = ConfigSections.Weight.GetDescription(), Key = "붐바 대재앙 미션 가중치", DefaultValue = 8, Description = new ConfigDescription("(LethalThings 모드 필요) 값이 높을수록 더 자주 선택됩니다. 붐바 대재앙이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightHauntedHarpist, Section = ConfigSections.Weight.GetDescription(), Key = "저주받은 하피스트 미션 가중치", DefaultValue = 30, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 값이 높을수록 더 자주 선택됩니다. 저주받은 하피스트가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightPhantomPiper, Section = ConfigSections.Weight.GetDescription(), Key = "유령 피리 연주자 미션 가중치", DefaultValue = 20, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 값이 높을수록 더 자주 선택됩니다. 유령 피리 연주자가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightEnforcerGhost, Section = ConfigSections.Weight.GetDescription(), Key = "집행자 미션 가중치", DefaultValue = 50, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 값이 높을수록 더 자주 선택됩니다. 집행자가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightFiringSquad, Section = ConfigSections.Weight.GetDescription(), Key = "총살 집행단 미션 가중치", DefaultValue = 30, Description = new ConfigDescription("(Haunted Harpist 모드 필요) 값이 높을수록 더 자주 선택됩니다. 총살 집행단이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightManorLord, Section = ConfigSections.Weight.GetDescription(), Key = "저택의 군주 미션 가중치", DefaultValue = 5, Description = new ConfigDescription("(Code Rebirth 모드 필요) 값이 높을수록 더 자주 선택됩니다. 저택의 군주가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightJanitor, Section = ConfigSections.Weight.GetDescription(), Key = "청소부 미션 가중치", DefaultValue = 60, Description = new ConfigDescription("(Code Rebirth 모드 필요) 값이 높을수록 더 자주 선택됩니다. 청소부가 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightRivals, Section = ConfigSections.Weight.GetDescription(), Key = "청소 라이벌 미션 가중치", DefaultValue = 40, Description = new ConfigDescription("(Code Rebirth 모드 필요) 값이 높을수록 더 자주 선택됩니다. 청소 라이벌이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBellCrab, Section = ConfigSections.Weight.GetDescription(), Key = "벨 크랩 미션 가중치", DefaultValue = 75, Description = new ConfigDescription("(Surfaced 모드 필요) 값이 높을수록 더 자주 선택됩니다. 벨 크랩이 목표로 선택될 확률입니다.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardLow, Section = ConfigSections.Reward.GetDescription(), Key = "쉬운 미션 보상", DefaultValue = 50, Description = new ConfigDescription("쉬운 미션 완료 시 드롭되는 스크랩의 가치입니다. (올가미 벼룩, 비축 벌레, 고독한 개코매, 벨 크랩)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardMedium, Section = ConfigSections.Reward.GetDescription(), Key = "보통 미션 보상", DefaultValue = 100, Description = new ConfigDescription("보통 미션 완료 시 드롭되는 스크랩의 가치입니다. (덤퍼, 벙커 거미, 마스크, 집사, 어리버리 비축이, 좀비, 집행자, 저주받은 하피스트, 청소부)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardHigh, Section = ConfigSections.Reward.GetDescription(), Key = "어려운 미션 보상", DefaultValue = 200, Description = new ConfigDescription("어려운 미션 완료 시 드롭되는 스크랩의 가치입니다. (브레켄, 병정, 벌레 마피아, 해충 떼, 개코매 갱단, 찌르기 형제, 시설 수호자, 역동적인 듀오, 괴물 소굴, 유령 피리 연주자, 청소 라이벌)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardExtreme, Section = ConfigSections.Reward.GetDescription(), Key = "극한 미션 보상", DefaultValue = 300, Description = new ConfigDescription("극한 미션 완료 시 드롭되는 스크랩의 가치입니다. (착한 개, 지난달 인턴들, 작년 인턴들)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardBrutal, Section = ConfigSections.Reward.GetDescription(), Key = "잔혹 미션 보상", DefaultValue = 400, Description = new ConfigDescription("잔혹 미션 완료 시 드롭되는 스크랩의 가치입니다. (초대형: 강화판, 작은 적 큰 위협, 누가 개들을 풀어놨어?, 마스크 대발생, 식인귀, 좀비 대재앙, 저택의 군주)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardExecution, Section = ConfigSections.Reward.GetDescription(), Key = "처형 미션 보상", DefaultValue = 500, Description = new ConfigDescription("처형 미션 완료 시 드롭되는 스크랩의 가치입니다. (마스크 포 데드 2)", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.EnableToolRewards, Section = ConfigSections.Reward.GetDescription(), Key = "도구 보상 활성화", DefaultValue = true, Description = new ConfigDescription("true로 설정 시 도구 아이템이 보상 풀에 포함됩니다.", (AcceptableValueBase)null, Array.Empty<object>()) } }; public static ConfigEntryBase[] ConfigEntries = (ConfigEntryBase[])(object)new ConfigEntryBase[AllConfigurableSettings.Length]; private static string GetDescription(this Enum value) { if (value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), inherit: false) is DescriptionAttribute[] source && source.Any()) { return source.First().Description; } return value.ToString(); } public static void BindConfigSettings() { for (int i = 0; i < AllConfigurableSettings.Length; i++) { Huntdown._logger.LogInfo((object)$"[{i}] Binding: {AllConfigurableSettings[i].Key}"); BindAnyObject(AllConfigurableSettings[i], i); } } private static void BindAnyObject(ConfigurableSetting setting, int index) { if (setting.DefaultValue is int || setting.DefaultValue is Enum) { ConfigEntryBase[] configEntries = ConfigEntries; string section = setting.Section; string key = setting.Key; int defaultValue = (int)setting.DefaultValue; ConfigDescription description = setting.Description; configEntries[index] = (ConfigEntryBase)(object)Bind(section, key, defaultValue, (description != null) ? description.Description : null); } else if (setting.DefaultValue is bool) { ConfigEntryBase[] configEntries2 = ConfigEntries; string section2 = setting.Section; string key2 = setting.Key; bool defaultValue2 = (bool)setting.DefaultValue; ConfigDescription description2 = setting.Description; configEntries2[index] = (ConfigEntryBase)(object)Bind(section2, key2, defaultValue2, (description2 != null) ? description2.Description : null); } else if (setting.DefaultValue is float) { ConfigEntryBase[] configEntries3 = ConfigEntries; string section3 = setting.Section; string key3 = setting.Key; float defaultValue3 = (float)setting.DefaultValue; ConfigDescription description3 = setting.Description; configEntries3[index] = (ConfigEntryBase)(object)Bind(section3, key3, defaultValue3, (description3 != null) ? description3.Description : null); } else { LogUnsupportedType(setting.Key); } } private static void LogUnsupportedType(string settingKey) { Huntdown._logger.LogError((object)("지원하지 않는 DefaultValue 타입 - 설정: " + settingKey + ".")); } private static ConfigEntry<T> Bind<T>(string section, string key, T defaultValue, string description = null) { return ((BaseUnityPlugin)Huntdown._instance).Config.Bind<T>(section, key, defaultValue, description); } } public enum EnemyKey { SnareFlea, BunkerSpider, HoarderBug, Bracken, Thumper, Nutcracker, Masked, EyelessDog, Butler, Maneater, BaboonHawk, ForestKeeper, Zombie, HauntedHarpist, PhantomPiper, EnforcerGhost, ManorLord, Janitor, BellCrab, Boomba, Random } public class StoredEnemy { private EnemyKey _key; private string _ID; private string _name; private SpawnableEnemyWithRarity _storedEnemy; public EnemyKey Key { get { return _key; } set { _key = value; } } public string ID { get { return _ID; } set { _ID = value; } } public string Name { get { return _name; } set { _name = value; } } public SpawnableEnemyWithRarity SpawnableEnemy { get { return _storedEnemy; } set { _storedEnemy = value; } } public StoredEnemy(EnemyKey key, string id) { _key = key; _ID = id; } } public class Mission { private readonly string _name; private readonly Dictionary<EnemyKey, int> _enemiesToSpawn; private static List<EnemyAI> _aliveEnemies = new List<EnemyAI>(); public static int _maxEnemies; private RewardPool _rewardPool; private readonly int _baseWeight; private int _weight; private static int _totalWeight; private static readonly int _missionChance = (int)ConfigSettings.ConfigEntries[1].BoxedValue; private bool _enabled; private readonly List<EnemyKey> _randomEnemyChoices = new List<EnemyKey> { EnemyKey.Thumper, EnemyKey.BunkerSpider, EnemyKey.HoarderBug, EnemyKey.SnareFlea, EnemyKey.Nutcracker, EnemyKey.Masked, EnemyKey.Bracken, EnemyKey.Maneater }; public string Name => _name; public Dictionary<EnemyKey, int> EnemiesToSpawn => _enemiesToSpawn; public RewardPool RewardPool { get { return _rewardPool; } set { _rewardPool = value; } } public int BaseWeight => _baseWeight; public int Weight { get { return _weight; } set { _weight = value; } } public static int TotalWeight { get { return _totalWeight; } set { _totalWeight = value; } } public static int MissionChance => _missionChance; public bool Enabled { get { return _enabled; } set { _enabled = value; } } public static List<EnemyAI> AliveEnemies { get { return _aliveEnemies; } set { _aliveEnemies = value; } } public Mission(string name, int baseWeight, Dictionary<EnemyKey, int> enemiesToSpawn, bool enabled, RewardPool rewardPool) { _name = name; _baseWeight = baseWeight; _weight = baseWeight; _enemiesToSpawn = enemiesToSpawn; _enabled = enabled; _rewardPool = rewardPool; } public void Start(ref SelectableLevel level, EnemyVent[] allVents) { Huntdown._currentLevel = level; Huntdown._allEnemyVents = allVents; SpawnEnemiesAtVent(ref level, RollRandomFarVent(allVents)); } public void End() { if (Huntdown._currentMission != null) { _aliveEnemies.Clear(); Huntdown._currentMission = null; } } public static EnemyVent RollRandomFarVent(EnemyVent[] allVents) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) Huntdown._logger.LogInfo((object)"Rolling for a random faraway vent..."); Vector3 entrancePos = RoundManager.FindMainEntrancePosition(false, false); float longestDist = 0f; List<EnemyVent> list = new List<EnemyVent>(); ManualLogSource logger = Huntdown._logger; Vector3 val = entrancePos; logger.LogInfo((object)("MainEntrancePos: " + ((object)(Vector3)(ref val)).ToString())); for (int i = 0; i < allVents.Length; i++) { ManualLogSource logger2 = Huntdown._logger; string text = i.ToString(); val = ((Component)allVents[i]).transform.position; logger2.LogInfo((object)(text + "VentPosEntrancePos: " + ((object)(Vector3)(ref val)).ToString())); float num = Vector3.Distance(entrancePos, ((Component)allVents[i]).transform.position); if (num > longestDist) { longestDist = num; } } Huntdown._logger.LogInfo((object)("longest dist: " + longestDist)); Vector3 val2 = (entrancePos + ((Component)allVents.Where((EnemyVent vent) => Vector3.Distance(entrancePos, ((Component)vent).transform.position) == longestDist).FirstOrDefault()).transform.position) / 2f; ManualLogSource logger3 = Huntdown._logger; val = val2; logger3.LogInfo((object)("midpoint: " + ((object)(Vector3)(ref val)).ToString())); float num2 = Vector3.Distance(entrancePos, val2); Huntdown._logger.LogInfo((object)("halfway dist: " + num2)); for (int j = 0; j < allVents.Length; j++) { ManualLogSource logger4 = Huntdown._logger; string text2 = j.ToString(); val = ((Component)allVents[j]).transform.position; logger4.LogInfo((object)(text2 + "VentPosEntrancePos: " + ((object)(Vector3)(ref val)).ToString())); float num3 = Vector3.Distance(entrancePos, ((Component)allVents[j]).transform.position); if (num3 >= num2) { Huntdown._logger.LogInfo((object)("dist: " + num3)); Huntdown._logger.LogInfo((object)("halfwaydist " + num2)); list.Add(allVents[j]); } } int index = new Random().Next(0, list.Count); Huntdown._logger.LogInfo((object)("Rolled " + index + " out of " + list.Count + ".")); return list[index]; } public static bool RollMissionChance() { Huntdown._logger.LogInfo((object)"Rolling for mission generation..."); int num = new Random().Next(0, 100); ManualLogSource logger = Huntdown._logger; string[] obj = new string[5] { "Rolled ", num.ToString(), " out of ", null, null }; int missionChance = _missionChance; obj[3] = missionChance.ToString(); obj[4] = "."; logger.LogInfo((object)string.Concat(obj)); Huntdown._logger.LogInfo((object)("Mission received: " + (num <= _missionChance) + ".")); return num <= _missionChance; } private void ForceAIInside(EnemyAI enemyAI) { Huntdown._logger.LogInfo((object)"Forcing AI to work indoors."); enemyAI.enemyType.isOutsideEnemy = false; enemyAI.daytimeEnemyLeaving = false; enemyAI.allAINodes = GameObject.FindGameObjectsWithTag("AINode"); } private void SpawnUnnaturalEnemy(ref SelectableLevel level, EnemyVent vent, EnemyKey enemyKey) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) Huntdown._logger.LogInfo((object)("Spawning a single unnatural enemy of type: " + Huntdown._storedEnemies[(int)enemyKey].Name)); level.Enemies.Add(Huntdown._storedEnemies[(int)enemyKey].SpawnableEnemy); int num = level.Enemies.IndexOf(Huntdown._storedEnemies[(int)enemyKey].SpawnableEnemy); RoundManager.Instance.SpawnEnemyOnServer(((Component)vent).transform.position, 0f, num); EnemyAI val = RoundManager.Instance.SpawnedEnemies.Last(); _aliveEnemies.Add(val); if (val is MouthDogAI || val is BaboonBirdAI || val is ForestGiantAI) { ForceAIInside(val); } ApplyConditionalModifications(val); level.Enemies.RemoveAt(num); } private void ApplyConditionalModifications(EnemyAI enemyAI) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) ScanNodeProperties componentInChildren = ((Component)enemyAI).gameObject.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { if ((bool)ConfigSettings.ConfigEntries[3].BoxedValue) { componentInChildren.subText = "<color=white>목표</color>"; } else { componentInChildren.headerText = "<color=white>목표</color>"; } } if (Huntdown._currentMission == null) { return; } if (Huntdown._currentMission.Name == "Facility Keeper") { SafeDespawn(enemyAI); Transform transform = ((Component)enemyAI).transform; transform.localScale /= 4f; enemyAI.enemyHP = 5; SafeRespawn(enemyAI); } else if (Huntdown._currentMission.Name == "Giant Size: Upgraded") { SafeDespawn(enemyAI); Transform transform2 = ((Component)enemyAI).transform; transform2.localScale *= 2f; if (enemyAI is HoarderBugAI) { enemyAI.enemyHP *= 12; } else if (enemyAI is CentipedeAI) { enemyAI.enemyHP *= 17; } else if (enemyAI is MaskedPlayerEnemy) { enemyAI.enemyHP *= 5; } else if (enemyAI is CaveDwellerAI) { enemyAI.enemyHP *= 2; } else { enemyAI.enemyHP *= 3; } SafeRespawn(enemyAI); } else if (Huntdown._currentMission.Name == "Big Trouble Little Enemies" || Huntdown._currentMission.Name == "Who let the puppies out?") { SafeDespawn(enemyAI); Transform transform3 = ((Component)enemyAI).transform; transform3.localScale /= 3f; enemyAI.enemyHP = 1; SafeRespawn(enemyAI); } } private void SafeDespawn(EnemyAI enemyAI) { if (((Component)enemyAI).gameObject.GetComponent<NetworkObject>().IsSpawned) { ((Component)enemyAI).gameObject.GetComponent<NetworkObject>().Despawn(false); } } private void SafeRespawn(EnemyAI enemyAI) { if (!((Component)enemyAI).gameObject.GetComponent<NetworkObject>().IsSpawned) { ((Component)enemyAI).gameObject.GetComponent<NetworkObject>().Spawn(false); } } public void SpawnEnemiesAtVent(ref SelectableLevel level, EnemyVent vent) { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) Huntdown._logger.LogInfo((object)"Spawning mission targets..."); _aliveEnemies.Clear(); foreach (KeyValuePair<EnemyKey, int> item in _enemiesToSpawn) { for (int i = 0; i < item.Value; i++) { EnemyKey enemyKey = item.Key; if (enemyKey == EnemyKey.Random) { int index = new Random().Next(0, _randomEnemyChoices.Count); enemyKey = _randomEnemyChoices[index]; Huntdown._logger.LogInfo((object)("Randomly selected enemy: " + Huntdown._storedEnemies[(int)enemyKey].Name)); } if (!level.Enemies.Contains(Huntdown._storedEnemies[(int)enemyKey].SpawnableEnemy)) { SpawnUnnaturalEnemy(ref level, vent, enemyKey); continue; } RoundManager.Instance.SpawnEnemyOnServer(((Component)vent).transform.position, 0f, level.Enemies.IndexOf(Huntdown._storedEnemies[(int)enemyKey].SpawnableEnemy)); EnemyAI val = RoundManager.Instance.SpawnedEnemies.Last(); _aliveEnemies.Add(val); ApplyConditionalModifications(val); } } _maxEnemies = _aliveEnemies.Count; Huntdown._logger.LogInfo((object)$"Total enemies spawned: {_maxEnemies}"); } } public enum ItemKey { Binoculars, Boombox, CardboardBox, Flashlight, Jetpack, Key, LockPicker, LungApparatus, MapDevice, ProFlashlight, Shovel, StunGrenade, ExtensionLadder, TZPInhalant, WalkieTalkie, ZapGun, _7Ball, Airhorn, Bell, BigBolt, BottleBin, Brush, Candy, CashRegister, ChemicalJug, ClownHorn, Cog1, Dentures, DustPan, EggBeater, EnginePart1, FancyCup, FancyLamp, FancyPainting, FishTestProp, FlashLaserPointer, GoldBar, Hairdryer, MagnifyingGlass, MetalSheet, MoldPan, Mug, PerfumeBottle, Phone, PickleJar, PillBottle, Remote, Ring, RobotToy, RubberDuck, SodaCanRed, SteeringWheel, StopSign, TeaKettle, Toothpaste, ToyCube, RedLocustHive, RadarBooster, YieldSign, Shotgun, GunAmmo, SprayPaint, DiyFlashbang, GiftBox, Flask, TragedyMask, ComedyMask, WhoopieCushion, EasterEgg, GarbageLid, ToiletPaperRolls, Zeddog, WeedKillerBottle, ToyTrain, SoccerBall, Knife, ControlPad, PlasticCup, BeltBag, CaveDwellerBaby, Pokeball, GreatBall, UltraBall, MasterBall, CatItem, Pouch, ArsonPlush, ArsonPlushDirty, CookieFumo, ToimariPlush, glizzy, GhostPlushieItemData, HamisPlush, GnarpyPlush, RocketLauncher, GremlinEnergy, Dingus, ToyGun, Chronos, GamblerItem, Saint, Sacrificer, SurfacedDieItem, Rusty, BabyKiwiEgg } public class StoredItem { private ItemKey _key; private string _ID; private string _name; private Item _gameItem; public ItemKey Key { get { return _key; } set { _key = value; } } public string ID { get { return _ID; } set { _ID = value; } } public string Name { get { return _name; } set { _name = value; } } public Item GameItem { get { return _gameItem; } set { _gameItem = value; } } public StoredItem(ItemKey key, string id) { _key = key; _ID = id; } } public enum RewardPoolKey { EasyRewardPool, MediumRewardPool, HardRewardPool, ExtremeRewardPool, MaskRewardPool, BrutalRewardPool, ExecutionRewardPool } public class RewardPool { private List<StoredItem> _rewards; private int _value; public List<StoredItem> Rewards { get { return _rewards; } set { _rewards = value; } } public int Value { get { return _value; } set { _value = value; } } public RewardPool(StoredItem[] rewards, int value) { _rewards = new List<StoredItem>(rewards); _value = value; } } [BepInPlugin("mine9289.Huntdown", "Huntdown_Korean", "0.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Huntdown : BaseUnityPlugin { private const string _modGUID = "mine9289.Huntdown"; private const string _modName = "Huntdown_Korean"; private const string _modVersion = "0.0.1"; private readonly Harmony _harmony = new Harmony("mine9289.Huntdown"); public static Huntdown _instance; public static ManualLogSource _logger; public static bool _isHost = false; public static bool _objectsStored = false; public static int _framesPassedSinceInput = 0; public static SelectableLevel _currentLevel; public static EnemyVent[] _allEnemyVents; public static int[] _allScrapValue; public static NetworkObjectReference[] _allScrapNetwork; public static StoredEnemy[] _storedEnemies; public static StoredItem[] _storedItems; public static RewardPool[] _possibleRewardPools; public static Mission[] _possibleMissions; public static TerminalNode _terminalNode = new TerminalNode(); public static TerminalKeyword _terminalKeyword = new TerminalKeyword(); public static Mission _currentMission; public static EnemyAI _lastEnemyKilled; public static bool lethalThingsPresent = false; public static bool hauntedHarpistPresent = false; public static bool needyCatsPresent = false; public static bool emergencyDicePresent = false; public static bool codeRebirthPresent = false; public static bool surfacedPresent = false; public static bool starlancerAIFixPresent = false; private Dictionary<EnemyKey, int> CreateEnemyDictionary(params (EnemyKey key, int value)[] keyValuePairs) { Dictionary<EnemyKey, int> dictionary = new Dictionary<EnemyKey, int>(); for (int i = 0; i < keyValuePairs.Length; i++) { (EnemyKey, int) tuple = keyValuePairs[i]; dictionary.Add(tuple.Item1, tuple.Item2); } return dictionary; } private RewardPool CreateRewardPool(StoredItem[] items, ConfigSettings.ConfigIndexes index) { int num = (int)ConfigSettings.ConfigEntries[(int)index].BoxedValue; _logger.LogInfo((object)$"Creating reward pool. Index: {index}, Value: {num}"); return new RewardPool(items.Where((StoredItem item) => item != null).ToArray(), (int)ConfigSettings.ConfigEntries[(int)index].BoxedValue); } private Mission CreateMission(string name, ConfigSettings.ConfigIndexes weightIndex, Dictionary<EnemyKey, int> enemies, bool enabled, RewardPool rewardPool) { int num = (int)ConfigSettings.ConfigEntries[(int)weightIndex].BoxedValue; _logger.LogInfo((object)$"Creating mission: {name}, Weight: {num}, Enabled: {enabled}"); return new Mission(name, num, enemies, enabled, rewardPool); } private void Awake() { if ((Object)(object)_instance == (Object)null) { _instance = this; } _logger = ((BaseUnityPlugin)this).Logger; lethalThingsPresent = Chainloader.PluginInfos.ContainsKey("evaisa.lethalthings"); if (lethalThingsPresent) { _logger.LogInfo((object)"LethalThings detected. Zombie missions and more rewards will be available."); } hauntedHarpistPresent = Chainloader.PluginInfos.ContainsKey("LethalCompanyHarpGhost"); if (hauntedHarpistPresent) { _logger.LogInfo((object)"Haunted Harpist detected. Ghost missions will be available."); } needyCatsPresent = Chainloader.PluginInfos.ContainsKey("Jordo.NeedyCats"); if (needyCatsPresent) { _logger.LogInfo((object)"Needy Cats detected. Cat rewards will be available."); } emergencyDicePresent = Chainloader.PluginInfos.ContainsKey("Theronguard.EmergencyDice"); if (emergencyDicePresent) { _logger.LogInfo((object)"Emergency Dice detected. Dice rewards will be available."); } codeRebirthPresent = Chainloader.PluginInfos.ContainsKey("CodeRebirth"); if (codeRebirthPresent) { _logger.LogInfo((object)"Code Rebirth detected. More missions will be available."); } surfacedPresent = Chainloader.PluginInfos.ContainsKey("Surfaced"); if (surfacedPresent) { _logger.LogInfo((object)"Surfaced detected. Bell Crab mission will be available."); } starlancerAIFixPresent = Chainloader.PluginInfos.ContainsKey("AudioKnight.StarlancerAIFix"); if (starlancerAIFixPresent) { _logger.LogInfo((object)"Starlancer AI Fix detected. More missions will be available."); } try { _logger.LogInfo((object)"Binding configs."); ConfigSettings.BindConfigSettings(); _logger.LogInfo((object)"Configs successfully bound."); } catch (Exception ex) { _logger.LogError((object)("Could not bind configs.\n" + ex.Message)); } try { _logger.LogInfo((object)"Assigning keys to enemies."); _storedEnemies = new StoredEnemy[20] { new StoredEnemy(EnemyKey.SnareFlea, "Centipede (EnemyType)"), new StoredEnemy(EnemyKey.BunkerSpider, "SandSpider (EnemyType)"), new StoredEnemy(EnemyKey.HoarderBug, "HoarderBug (EnemyType)"), new StoredEnemy(EnemyKey.Bracken, "Flowerman (EnemyType)"), new StoredEnemy(EnemyKey.Thumper, "Crawler (EnemyType)"), new StoredEnemy(EnemyKey.Nutcracker, "Nutcracker (EnemyType)"), new StoredEnemy(EnemyKey.Masked, "MaskedPlayerEnemy (EnemyType)"), new StoredEnemy(EnemyKey.EyelessDog, "MouthDog (EnemyType)"), new StoredEnemy(EnemyKey.Butler, "Butler (EnemyType)"), new StoredEnemy(EnemyKey.Maneater, "CaveDweller (EnemyType)"), new StoredEnemy(EnemyKey.BaboonHawk, "BaboonHawk (EnemyType)"), new StoredEnemy(EnemyKey.ForestKeeper, "ForestGiant (EnemyType)"), new StoredEnemy(EnemyKey.Zombie, "Maggie (EnemyType)"), new StoredEnemy(EnemyKey.HauntedHarpist, "HarpGhost (EnemyType)"), new StoredEnemy(EnemyKey.PhantomPiper, "BagpipesGhost (EnemyType)"), new StoredEnemy(EnemyKey.EnforcerGhost, "EnforcerGhost (EnemyType)"), new StoredEnemy(EnemyKey.ManorLord, "ManorLordObj (EnemyType)"), new StoredEnemy(EnemyKey.Janitor, "JanitorObj (EnemyType)"), new StoredEnemy(EnemyKey.BellCrab, "BellCrabAsset (EnemyType)"), new StoredEnemy(EnemyKey.Boomba, "Boomba (EnemyType)") }; _logger.LogInfo((object)"Keys successfully assigned to enemies."); } catch (Exception ex2) { _logger.LogError((object)("Could not assign keys to enemies.\n" + ex2.Message)); } try { _logger.LogInfo((object)"Assigning keys to items."); _storedItems = new StoredItem[105] { new StoredItem(ItemKey.Binoculars, "Binoculars (Item)"), new StoredItem(ItemKey.Boombox, "Boombox (Item)"), new StoredItem(ItemKey.CardboardBox, "CardboardBox (Item)"), new StoredItem(ItemKey.Flashlight, "Flashlight (Item)"), new StoredItem(ItemKey.Jetpack, "Jetpack (Item)"), new StoredItem(ItemKey.Key, "Key (Item)"), new StoredItem(ItemKey.LockPicker, "LockPicker (Item)"), new StoredItem(ItemKey.LungApparatus, "LungApparatus (Item)"), new StoredItem(ItemKey.MapDevice, "MapDevice (Item)"), new StoredItem(ItemKey.ProFlashlight, "ProFlashlight (Item)"), new StoredItem(ItemKey.Shovel, "Shovel (Item)"), new StoredItem(ItemKey.StunGrenade, "StunGrenade (Item)"), new StoredItem(ItemKey.ExtensionLadder, "ExtensionLadder (Item)"), new StoredItem(ItemKey.TZPInhalant, "TZPInhalant (Item)"), new StoredItem(ItemKey.WalkieTalkie, "WalkieTalkie (Item)"), new StoredItem(ItemKey.ZapGun, "ZapGun (Item)"), new StoredItem(ItemKey._7Ball, "7Ball (Item)"), new StoredItem(ItemKey.Airhorn, "Airhorn (Item)"), new StoredItem(ItemKey.Bell, "Bell (Item)"), new StoredItem(ItemKey.BigBolt, "BigBolt (Item)"), new StoredItem(ItemKey.BottleBin, "BottleBin (Item)"), new StoredItem(ItemKey.Brush, "Brush (Item)"), new StoredItem(ItemKey.Candy, "Candy (Item)"), new StoredItem(ItemKey.CashRegister, "CashRegister (Item)"), new StoredItem(ItemKey.ChemicalJug, "ChemicalJug (Item)"), new StoredItem(ItemKey.ClownHorn, "ClownHorn (Item)"), new StoredItem(ItemKey.Cog1, "Cog1 (Item)"), new StoredItem(ItemKey.Dentures, "Dentures (Item)"), new StoredItem(ItemKey.DustPan, "DustPan (Item)"), new StoredItem(ItemKey.EggBeater, "EggBeater (Item)"), new StoredItem(ItemKey.EnginePart1, "EnginePart1 (Item)"), new StoredItem(ItemKey.FancyCup, "FancyCup (Item)"), new StoredItem(ItemKey.FancyLamp, "FancyLamp (Item)"), new StoredItem(ItemKey.FancyPainting, "FancyPainting (Item)"), new StoredItem(ItemKey.FishTestProp, "FishTestProp (Item)"), new StoredItem(ItemKey.FlashLaserPointer, "FlashLaserPointer (Item)"), new StoredItem(ItemKey.GoldBar, "GoldBar (Item)"), new StoredItem(ItemKey.Hairdryer, "Hairdryer (Item)"), new StoredItem(ItemKey.MagnifyingGlass, "MagnifyingGlass (Item)"), new StoredItem(ItemKey.MetalSheet, "MetalSheet (Item)"), new StoredItem(ItemKey.MoldPan, "MoldPan (Item)"), new StoredItem(ItemKey.Mug, "Mug (Item)"), new StoredItem(ItemKey.PerfumeBottle, "PerfumeBottle (Item)"), new StoredItem(ItemKey.Phone, "Phone (Item)"), new StoredItem(ItemKey.PickleJar, "PickleJar (Item)"), new StoredItem(ItemKey.PillBottle, "PillBottle (Item)"), new StoredItem(ItemKey.Remote, "Remote (Item)"), new StoredItem(ItemKey.Ring, "Ring (Item)"), new StoredItem(ItemKey.RobotToy, "RobotToy (Item)"), new StoredItem(ItemKey.RubberDuck, "RubberDuck (Item)"), new StoredItem(ItemKey.SodaCanRed, "SodaCanRed (Item)"), new StoredItem(ItemKey.SteeringWheel, "SteeringWheel (Item)"), new StoredItem(ItemKey.StopSign, "StopSign (Item)"), new StoredItem(ItemKey.TeaKettle, "TeaKettle (Item)"), new StoredItem(ItemKey.Toothpaste, "Toothpaste (Item)"), new StoredItem(ItemKey.ToyCube, "ToyCube (Item)"), new StoredItem(ItemKey.RedLocustHive, "RedLocustHive (Item)"), new StoredItem(ItemKey.RadarBooster, "RadarBooster (Item)"), new StoredItem(ItemKey.YieldSign, "YieldSign (Item)"), new StoredItem(ItemKey.Shotgun, "Shotgun (Item)"), new StoredItem(ItemKey.GunAmmo, "GunAmmo (Item)"), new StoredItem(ItemKey.SprayPaint, "SprayPaint (Item)"), new StoredItem(ItemKey.DiyFlashbang, "DiyFlashbang (Item)"), new StoredItem(ItemKey.GiftBox, "GiftBox (Item)"), new StoredItem(ItemKey.Flask, "Flask (Item)"), new StoredItem(ItemKey.TragedyMask, "TragedyMask (Item)"), new StoredItem(ItemKey.ComedyMask, "ComedyMask (Item)"), new StoredItem(ItemKey.WhoopieCushion, "WhoopieCushion (Item)"), new StoredItem(ItemKey.EasterEgg, "EasterEgg (Item)"), new StoredItem(ItemKey.GarbageLid, "GarbageLid (Item)"), new StoredItem(ItemKey.ToiletPaperRolls, "ToiletPaperRolls (Item)"), new StoredItem(ItemKey.Zeddog, "Zeddog (Item)"), new StoredItem(ItemKey.WeedKillerBottle, "WeedKillerBottle (Item)"), new StoredItem(ItemKey.ToyTrain, "ToyTrain (Item)"), new StoredItem(ItemKey.SoccerBall, "SoccerBall (Item)"), new StoredItem(ItemKey.Knife, "Knife (Item)"), new StoredItem(ItemKey.ControlPad, "ControlPad (Item)"), new StoredItem(ItemKey.PlasticCup, "PlasticCup (Item)"), new StoredItem(ItemKey.BeltBag, "BeltBag (Item)"), new StoredItem(ItemKey.CaveDwellerBaby, "CaveDwellerBaby (Item)"), new StoredItem(ItemKey.Pokeball, "Pokeball (Item)"), new StoredItem(ItemKey.GreatBall, "GreatBall (Item)"), new StoredItem(ItemKey.UltraBall, "UltraBall (Item)"), new StoredItem(ItemKey.MasterBall, "MasterBall (Item)"), new StoredItem(ItemKey.CatItem, "CatItem (Item)"), new StoredItem(ItemKey.Pouch, "Pouch (Item)"), new StoredItem(ItemKey.ArsonPlush, "ArsonPlush (Item)"), new StoredItem(ItemKey.ArsonPlushDirty, "ArsonPlushDirty (Item)"), new StoredItem(ItemKey.CookieFumo, "CookieFumo (Item)"), new StoredItem(ItemKey.ToimariPlush, "ToimariPlush (Item)"), new StoredItem(ItemKey.glizzy, "glizzy (Item)"), new StoredItem(ItemKey.GhostPlushieItemData, "GhostPlushieItemData (Item)"), new StoredItem(ItemKey.HamisPlush, "HamisPlush (Item)"), new StoredItem(ItemKey.GnarpyPlush, "GnarpyPlush (Item)"), new StoredItem(ItemKey.RocketLauncher, "RocketLauncher (Item)"), new StoredItem(ItemKey.GremlinEnergy, "GremlinEnergy (Item)"), new StoredItem(ItemKey.Dingus, "Dingus (Item)"), new StoredItem(ItemKey.ToyGun, "ToyGun (Item)"), new StoredItem(ItemKey.Chronos, "Chronos (Item)"), new StoredItem(ItemKey.GamblerItem, "GamblerItem (Item)"), new StoredItem(ItemKey.Saint, "Saint (Item)"), new StoredItem(ItemKey.Sacrificer, "Sacrificer (Item)"), new StoredItem(ItemKey.SurfacedDieItem, "SurfacedDieItem (Item)"), new StoredItem(ItemKey.Rusty, "Rusty (Item)"), new StoredItem(ItemKey.BabyKiwiEgg, "BabyKiwiEgg (Item)") }; _logger.LogInfo((object)"Keys successfully assigned to items."); } catch (Exception ex3) { _logger.LogError((object)("Could not assign keys to items.\n" + ex3.Message)); } try { _logger.LogInfo((object)"Creating reward pools for missions."); _possibleRewardPools = new RewardPool[7] { CreateRewardPool(new StoredItem[14] { _storedItems[49], _storedItems[55], _storedItems[22], _storedItems[67], _storedItems[34], ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[61] : null, ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[13] : null, ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[11] : null, _storedItems[68], ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[78] : null, _storedItems[28], _storedItems[21], lethalThingsPresent ? _storedItems[90] : null, lethalThingsPresent ? _storedItems[97] : null }, ConfigSettings.ConfigIndexes.RewardLow), CreateRewardPool(new StoredItem[16] { _storedItems[44], _storedItems[43], _storedItems[46], _storedItems[37], _storedItems[48], _storedItems[38], _storedItems[27], _storedItems[69], hauntedHarpistPresent ? _storedItems[91] : null, lethalThingsPresent ? _storedItems[92] : null, lethalThingsPresent ? _storedItems[95] : null, ((bool)ConfigSettings.ConfigEntries[86].BoxedValue && lethalThingsPresent) ? _storedItems[94] : null, ((bool)ConfigSettings.ConfigEntries[86].BoxedValue && lethalThingsPresent) ? _storedItems[85] : null, lethalThingsPresent ? _storedItems[89] : null, emergencyDicePresent ? _storedItems[102] : null, emergencyDicePresent ? _storedItems[101] : null }, ConfigSettings.ConfigIndexes.RewardMedium), CreateRewardPool(new StoredItem[18] { _storedItems[47], _storedItems[33], _storedItems[42], _storedItems[31], _storedItems[32], ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[4] : null, ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[15] : null, _storedItems[73], _storedItems[74], _storedItems[76], _storedItems[70], needyCatsPresent ? _storedItems[84] : null, lethalThingsPresent ? _storedItems[86] : null, lethalThingsPresent ? _storedItems[87] : null, lethalThingsPresent ? _storedItems[88] : null, lethalThingsPresent ? _storedItems[93] : null, emergencyDicePresent ? _storedItems[98] : null, emergencyDicePresent ? _storedItems[103] : null }, ConfigSettings.ConfigIndexes.RewardHigh), CreateRewardPool(new StoredItem[8] { _storedItems[36], _storedItems[23], ((bool)ConfigSettings.ConfigEntries[86].BoxedValue) ? _storedItems[8] : null, _storedItems[71], _storedItems[77], lethalThingsPresent ? _storedItems[96] : null, emergencyDicePresent ? _storedItems[100] : null, needyCatsPresent ? _storedItems[84] : null }, ConfigSettings.ConfigIndexes.RewardExtreme), CreateRewardPool(new StoredItem[2] { _storedItems[65], _storedItems[66] }, ConfigSettings.ConfigIndexes.RewardMedium), CreateRewardPool(new StoredItem[5] { _storedItems[71], _storedItems[77], lethalThingsPresent ? _storedItems[96] : null, emergencyDicePresent ? _storedItems[100] : null, needyCatsPresent ? _storedItems[84] : null }, ConfigSettings.ConfigIndexes.RewardBrutal), CreateRewardPool(new StoredItem[1] { _storedItems[104] }, ConfigSettings.ConfigIndexes.RewardExecution) }; _logger.LogInfo((object)"Reward pools successfully created."); } catch (Exception ex4) { _logger.LogError((object)("Could not create reward pools.\n" + ex4.Message)); } try { _logger.LogInfo((object)"Creating missions with information from player configuration."); List<Mission> list = new List<Mission>(); list.Add(CreateMission("Snare Flea", ConfigSettings.ConfigIndexes.WeightFlea, CreateEnemyDictionary((EnemyKey.SnareFlea, 1)), (bool)ConfigSettings.ConfigEntries[4].BoxedValue, _possibleRewardPools[0])); list.Add(CreateMission("Bunker Spider", ConfigSettings.ConfigIndexes.WeightSpider, CreateEnemyDictionary((EnemyKey.BunkerSpider, 1)), (bool)ConfigSettings.ConfigEntries[5].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Hoarding Bug", ConfigSettings.ConfigIndexes.WeightHoarder, CreateEnemyDictionary((EnemyKey.HoarderBug, 1)), (bool)ConfigSettings.ConfigEntries[6].BoxedValue, _possibleRewardPools[0])); list.Add(CreateMission("Bracken", ConfigSettings.ConfigIndexes.WeightBracken, CreateEnemyDictionary((EnemyKey.Bracken, 1)), (bool)ConfigSettings.ConfigEntries[7].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Thumper", ConfigSettings.ConfigIndexes.WeightThumper, CreateEnemyDictionary((EnemyKey.Thumper, 1)), (bool)ConfigSettings.ConfigEntries[8].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Nutcracker", ConfigSettings.ConfigIndexes.WeightNutcracker, CreateEnemyDictionary((EnemyKey.Nutcracker, 1)), (bool)ConfigSettings.ConfigEntries[9].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Masked", ConfigSettings.ConfigIndexes.WeightMasked, CreateEnemyDictionary((EnemyKey.Masked, 1)), (bool)ConfigSettings.ConfigEntries[10].BoxedValue, _possibleRewardPools[4])); list.Add(CreateMission("A Good Boy", ConfigSettings.ConfigIndexes.WeightDog, CreateEnemyDictionary((EnemyKey.EyelessDog, 1)), (bool)ConfigSettings.ConfigEntries[11].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("Bug Mafia", ConfigSettings.ConfigIndexes.WeightMafia, CreateEnemyDictionary((EnemyKey.HoarderBug, 5)), (bool)ConfigSettings.ConfigEntries[12].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Blunderbug", ConfigSettings.ConfigIndexes.WeightBlunderbug, CreateEnemyDictionary((EnemyKey.HoarderBug, 1)), (bool)ConfigSettings.ConfigEntries[13].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Infestation", ConfigSettings.ConfigIndexes.WeightInfestation, CreateEnemyDictionary((EnemyKey.HoarderBug, 2), (EnemyKey.SnareFlea, 2), (EnemyKey.BunkerSpider, 1)), (bool)ConfigSettings.ConfigEntries[14].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Last Month's Interns", ConfigSettings.ConfigIndexes.WeightLastcrew, CreateEnemyDictionary((EnemyKey.Masked, 4)), (bool)ConfigSettings.ConfigEntries[15].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("Butler", ConfigSettings.ConfigIndexes.WeightButler, CreateEnemyDictionary((EnemyKey.Butler, 1)), (bool)ConfigSettings.ConfigEntries[16].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Maneater", ConfigSettings.ConfigIndexes.WeightManeater, CreateEnemyDictionary((EnemyKey.Maneater, 1)), (bool)ConfigSettings.ConfigEntries[17].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Stabbin' Bros", ConfigSettings.ConfigIndexes.WeightStabbinBros, CreateEnemyDictionary((EnemyKey.HoarderBug, 3), (EnemyKey.Butler, 2)), (bool)ConfigSettings.ConfigEntries[18].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Giant Size: Upgraded", ConfigSettings.ConfigIndexes.WeightGiantSize, CreateEnemyDictionary((EnemyKey.Random, 1)), (bool)ConfigSettings.ConfigEntries[19].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Big Trouble Little Enemies", ConfigSettings.ConfigIndexes.WeightLittleEnemies, CreateEnemyDictionary((EnemyKey.Random, 15)), (bool)ConfigSettings.ConfigEntries[20].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Who let the puppies out?", ConfigSettings.ConfigIndexes.WeightPuppies, CreateEnemyDictionary((EnemyKey.EyelessDog, 12)), (bool)ConfigSettings.ConfigEntries[21].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Baboon Gang", ConfigSettings.ConfigIndexes.WeightBaboonGang, CreateEnemyDictionary((EnemyKey.BaboonHawk, 3)), starlancerAIFixPresent && (bool)ConfigSettings.ConfigEntries[22].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Facility Keeper", ConfigSettings.ConfigIndexes.WeightFacilityKeeper, CreateEnemyDictionary((EnemyKey.ForestKeeper, 1)), starlancerAIFixPresent && (bool)ConfigSettings.ConfigEntries[23].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("Lone Baboon Hawk", ConfigSettings.ConfigIndexes.WeightLoneHawk, CreateEnemyDictionary((EnemyKey.BaboonHawk, 1)), starlancerAIFixPresent && (bool)ConfigSettings.ConfigEntries[24].BoxedValue, _possibleRewardPools[0])); list.Add(CreateMission("Dynamic Duo", ConfigSettings.ConfigIndexes.WeightDuo, CreateEnemyDictionary((EnemyKey.Thumper, 1), (EnemyKey.BunkerSpider, 1)), (bool)ConfigSettings.ConfigEntries[25].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Monstrous Den", ConfigSettings.ConfigIndexes.WeightDen, CreateEnemyDictionary((EnemyKey.HoarderBug, 2), (EnemyKey.BunkerSpider, 2)), (bool)ConfigSettings.ConfigEntries[26].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Mask Outbreak", ConfigSettings.ConfigIndexes.WeightOutbreak, CreateEnemyDictionary((EnemyKey.Masked, 8)), (bool)ConfigSettings.ConfigEntries[27].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Left 4 Mask 2", ConfigSettings.ConfigIndexes.WeightLeft4Dead, CreateEnemyDictionary((EnemyKey.Masked, 15)), (bool)ConfigSettings.ConfigEntries[28].BoxedValue, _possibleRewardPools[6])); list.Add(CreateMission("Zombie", ConfigSettings.ConfigIndexes.WeightZombie, CreateEnemyDictionary((EnemyKey.Zombie, 1)), lethalThingsPresent && (bool)ConfigSettings.ConfigEntries[29].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Last Year's Interns", ConfigSettings.ConfigIndexes.WeightZombieCrew, CreateEnemyDictionary((EnemyKey.Zombie, 4)), lethalThingsPresent && (bool)ConfigSettings.ConfigEntries[30].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("Zombie Apocalypse", ConfigSettings.ConfigIndexes.WeightZombieApocalypse, CreateEnemyDictionary((EnemyKey.Zombie, 15)), lethalThingsPresent && (bool)ConfigSettings.ConfigEntries[31].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Boomba", ConfigSettings.ConfigIndexes.WeightBoomba, CreateEnemyDictionary((EnemyKey.Boomba, 1)), lethalThingsPresent && (bool)ConfigSettings.ConfigEntries[32].BoxedValue, _possibleRewardPools[0])); list.Add(CreateMission("Boombopocalypse", ConfigSettings.ConfigIndexes.WeightBoombopocalypse, CreateEnemyDictionary((EnemyKey.Boomba, 15)), lethalThingsPresent && (bool)ConfigSettings.ConfigEntries[33].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("Haunted Harpist", ConfigSettings.ConfigIndexes.WeightHauntedHarpist, CreateEnemyDictionary((EnemyKey.HauntedHarpist, 1)), hauntedHarpistPresent && (bool)ConfigSettings.ConfigEntries[34].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Phantom Piper", ConfigSettings.ConfigIndexes.WeightPhantomPiper, CreateEnemyDictionary((EnemyKey.PhantomPiper, 1)), hauntedHarpistPresent && (bool)ConfigSettings.ConfigEntries[35].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Enforcer", ConfigSettings.ConfigIndexes.WeightEnforcerGhost, CreateEnemyDictionary((EnemyKey.EnforcerGhost, 1)), hauntedHarpistPresent && (bool)ConfigSettings.ConfigEntries[36].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("The Firing Squad", ConfigSettings.ConfigIndexes.WeightFiringSquad, CreateEnemyDictionary((EnemyKey.EnforcerGhost, 4), (EnemyKey.Nutcracker, 1)), hauntedHarpistPresent && (bool)ConfigSettings.ConfigEntries[37].BoxedValue, _possibleRewardPools[3])); list.Add(CreateMission("The Manor Lord", ConfigSettings.ConfigIndexes.WeightManorLord, CreateEnemyDictionary((EnemyKey.ManorLord, 1)), codeRebirthPresent && (bool)ConfigSettings.ConfigEntries[38].BoxedValue, _possibleRewardPools[5])); list.Add(CreateMission("Janitor", ConfigSettings.ConfigIndexes.WeightJanitor, CreateEnemyDictionary((EnemyKey.Janitor, 1)), codeRebirthPresent && (bool)ConfigSettings.ConfigEntries[39].BoxedValue, _possibleRewardPools[1])); list.Add(CreateMission("Cleaner Rivals", ConfigSettings.ConfigIndexes.WeightRivals, CreateEnemyDictionary((EnemyKey.Janitor, 1), (EnemyKey.Butler, 1)), codeRebirthPresent && (bool)ConfigSettings.ConfigEntries[40].BoxedValue, _possibleRewardPools[2])); list.Add(CreateMission("Bell Crab", ConfigSettings.ConfigIndexes.WeightBellCrab, CreateEnemyDictionary((EnemyKey.BellCrab, 1)), surfacedPresent && (bool)ConfigSettings.ConfigEntries[41].BoxedValue, _possibleRewardPools[0])); _possibleMissions = list.ToArray(); _logger.LogInfo((object)"Missions successfully created."); } catch (Exception ex5) { _logger.LogError((object)("Could not create missions.\n" + ex5.Message)); } try { _logger.LogInfo((object)"Patching mod."); _harmony.PatchAll(typeof(Huntdown)); _harmony.PatchAll(typeof(StartOfRoundPatch)); _harmony.PatchAll(typeof(RoundManagerPatch)); _harmony.PatchAll(typeof(TerminalPatch)); _harmony.PatchAll(typeof(MouthDogAIPatch)); _harmony.PatchAll(typeof(HoarderBugAIPatch)); _logger.LogInfo((object)"Patches were successful."); } catch (Exception ex6) { _logger.LogError((object)("Could not patch mod.\n" + ex6.Message)); } _logger.LogInfo((object)"Huntdown mod loaded."); } } } namespace Huntdown.Patches { [HarmonyPatch(typeof(HoarderBugAI))] internal class HoarderBugAIPatch { private static float _blunderbugShootTimer = 3f; private static float _blunderbugAngryTimer = 0f; [HarmonyPatch("Start")] [HarmonyPostfix] public static void WeaponiseBugs(HoarderBugAI __instance) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Expected O, but got Unknown //IL_0414: Unknown result type (might be due to invalid IL or missing references) if (!Huntdown._isHost) { return; } for (int i = 0; i < Mission.AliveEnemies.Count; i++) { if (!((Object)(object)__instance == (Object)(object)Mission.AliveEnemies[i])) { continue; } if (Huntdown._currentMission.Name == "Bug Mafia") { for (int j = 0; j < StartOfRound.Instance.allItemsList.itemsList.Count; j++) { if (((object)StartOfRound.Instance.allItemsList.itemsList[j]).ToString() == Huntdown._storedItems[10].ID) { GameObject obj = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[j].spawnPrefab, ((EnemyAI)__instance).serverPosition, Quaternion.identity, StartOfRound.Instance.propsContainer); obj.GetComponent<GrabbableObject>().fallTime = 0f; NetworkObject component = obj.GetComponent<NetworkObject>(); GrabbableObject component2 = ((Component)component).gameObject.GetComponent<GrabbableObject>(); __instance.targetItem = null; HoarderBugAI.HoarderBugItems.Add(new HoarderBugItem(component2, (HoarderBugItemStatus)0, __instance.nestPosition)); __instance.heldItem = HoarderBugAI.HoarderBugItems[HoarderBugAI.HoarderBugItems.Count - 1]; component2.parentObject = __instance.grabTarget; component2.hasHitGround = false; component2.isHeldByEnemy = true; component2.grabbableToEnemies = false; component2.grabbable = true; component2.GrabItemFromEnemy((EnemyAI)(object)__instance); component2.EnablePhysics(false); component.Spawn(false); __instance.GrabItemServerRpc(NetworkObjectReference.op_Implicit(component)); } } } else if (Huntdown._currentMission.Name == "Stabbin' Bros") { for (int k = 0; k < StartOfRound.Instance.allItemsList.itemsList.Count; k++) { if (((object)StartOfRound.Instance.allItemsList.itemsList[k]).ToString() == Huntdown._storedItems[75].ID) { GameObject obj2 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[k].spawnPrefab, ((EnemyAI)__instance).serverPosition, Quaternion.identity, StartOfRound.Instance.propsContainer); obj2.GetComponent<GrabbableObject>().fallTime = 0f; obj2.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(4, 7)); NetworkObject component3 = obj2.GetComponent<NetworkObject>(); GrabbableObject component4 = ((Component)component3).gameObject.GetComponent<GrabbableObject>(); __instance.targetItem = null; HoarderBugAI.HoarderBugItems.Add(new HoarderBugItem(component4, (HoarderBugItemStatus)0, __instance.nestPosition)); __instance.heldItem = HoarderBugAI.HoarderBugItems[HoarderBugAI.HoarderBugItems.Count - 1]; component4.parentObject = __instance.grabTarget; component4.hasHitGround = false; component4.isHeldByEnemy = true; component4.grabbableToEnemies = false; component4.grabbable = true; component4.GrabItemFromEnemy((EnemyAI)(object)__instance); component4.EnablePhysics(false); component3.Spawn(false); __instance.GrabItemServerRpc(NetworkObjectReference.op_Implicit(component3)); } } } else { if (!(Huntdown._currentMission.Name == "Blunderbug")) { continue; } for (int l = 0; l < StartOfRound.Instance.allItemsList.itemsList.Count; l++) { if (((object)StartOfRound.Instance.allItemsList.itemsList[l]).ToString() == Huntdown._storedItems[59].ID) { GameObject obj3 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[l].spawnPrefab, ((EnemyAI)__instance).serverPosition, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); obj3.GetComponent<GrabbableObject>().fallTime = 0f; NetworkObject component5 = obj3.GetComponent<NetworkObject>(); GrabbableObject component6 = ((Component)component5).gameObject.GetComponent<GrabbableObject>(); __instance.targetItem = null; HoarderBugAI.HoarderBugItems.Add(new HoarderBugItem(component6, (HoarderBugItemStatus)0, __instance.nestPosition)); __instance.heldItem = HoarderBugAI.HoarderBugItems[HoarderBugAI.HoarderBugItems.Count - 1]; component6.parentObject = __instance.grabTarget; component6.hasHitGround = false; component6.isHeldByEnemy = true; component6.grabbableToEnemies = false; component6.grabbable = false; component6.GrabItemFromEnemy((EnemyAI)(object)__instance); component6.EnablePhysics(false); component5.Spawn(false); __instance.GrabItemServerRpc(NetworkObjectReference.op_Implicit(component5)); } } } } } [HarmonyPatch("DropItem")] [HarmonyPrefix] public static bool ForcePreventDrop(HoarderBugAI __instance) { if (!Huntdown._isHost) { return true; } for (int i = 0; i < Mission.AliveEnemies.Count; i++) { if ((Object)(object)__instance == (Object)(object)Mission.AliveEnemies[i] && !((EnemyAI)__instance).isEnemyDead && (Huntdown._currentMission.Name == "Bug Mafia" || Huntdown._currentMission.Name == "Blunderbug" || Huntdown._currentMission.Name == "Stabbin' Bros")) { __instance.targetItem = null; return false; } } return true; } private static void ShootGun(ShotgunItem item, HoarderBugAI instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (item.safetyOn) { item.safetyOn = false; } if (item.shellsLoaded == 0) { item.shellsLoaded = 2; } Vector3 position = ((Component)instance.watchingPlayer).transform.position; Vector3 forward = item.shotgunRayPoint.forward; item.ShootGunServerRpc(position, forward); } [HarmonyPatch("Update")] [HarmonyPostfix] public static void BlunderShoot(HoarderBugAI __instance) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown for (int i = 0; i < Mission.AliveEnemies.Count; i++) { if (!((Object)(object)__instance == (Object)(object)Mission.AliveEnemies[i]) || !(Huntdown._currentMission.Name == "Blunderbug")) { continue; } _blunderbugShootTimer += Time.deltaTime; if (__instance.heldItem == null) { continue; } GrabbableObject itemGrabbableObject = __instance.heldItem.itemGrabbableObject; if ((Object)(object)((Component)itemGrabbableObject).GetComponent<ShotgunItem>() != (Object)null && __instance.angryTimer > 0f) { _blunderbugAngryTimer += Time.deltaTime; if (_blunderbugAngryTimer >= 1f && _blunderbugShootTimer >= 3f) { ShootGun((ShotgunItem)itemGrabbableObject, __instance); _blunderbugShootTimer = 0f; } } else if (__instance.angryTimer <= 0f) { _blunderbugAngryTimer = 0f; } } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void DebugMode(ref float ___sprintMeter, ref float ___sprintMultiplier) { if (!Huntdown._isHost) { return; } ___sprintMeter = 1f; ___sprintMultiplier = 3f; if (((ButtonControl)Keyboard.current.digit1Key).wasPressedThisFrame && Huntdown._framesPassedSinceInput >= 60) { Huntdown._framesPassedSinceInput = 0; Huntdown._logger.LogInfo((object)"Spawning DEBUG target."); RoundManagerPatch.SpawnTargetPatch(ref Huntdown._currentLevel, ref Huntdown._allEnemyVents); } else if (((ButtonControl)Keyboard.current.digit2Key).wasPressedThisFrame && Huntdown._framesPassedSinceInput >= 60) { Huntdown._framesPassedSinceInput = 0; Huntdown._logger.LogInfo((object)"Killing DEBUG target."); for (int i = 0; i < Mission.AliveEnemies.Count; i++) { Mission.AliveEnemies[i].KillEnemyClientRpc(false); } } Huntdown._framesPassedSinceInput++; } } [HarmonyPatch(typeof(Application))] public class ApplicationPatch { [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] public static void ForceIsEditor(ref bool __result) { __result = true; } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void IsPlayerHost(StartOfRound __instance) { Huntdown._isHost = ((NetworkBehaviour)__instance).IsServer || ((NetworkBehaviour)__instance).IsHost; } [HarmonyPatch("ShipLeave")] [HarmonyPrefix] public static void ShipLeavePatch(StartOfRound __instance) { if (Huntdown._isHost && Huntdown._currentMission != null) { HUDManager.Instance.AddTextToChatOnServer("<color=red>미션 실패. 목표: </color><color=white>" + MissionNameKR.Get(Huntdown._currentMission.Name) + "</color>", -1); Huntdown._currentMission.End(); } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void StoreItems() { if (!Huntdown._isHost) { return; } for (int i = 0; i < StartOfRound.Instance.allItemsList.itemsList.Count; i++) { for (int j = 0; j < Huntdown._storedItems.Length; j++) { if (((object)StartOfRound.Instance.allItemsList.itemsList[i]).ToString() == Huntdown._storedItems[j].ID) { Huntdown._storedItems[j].GameItem = StartOfRound.Instance.allItemsList.itemsList[i]; Huntdown._storedItems[j].Name = StartOfRound.Instance.allItemsList.itemsList[i].itemName; break; } } } } } [HarmonyPatch(typeof(MouthDogAI))] internal class MouthDogAIPatch { public static void EnterLunge(MouthDogAI __instance, Ray ray, RaycastHit rayHit, RoundManager roundManager) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)__instance).SwitchToBehaviourState(3); __instance.endingLunge = false; ((Ray)(ref ray))..ctor(((Component)__instance).transform.position + Vector3.up, ((Component)__instance).transform.forward); Vector3 val = ((!Physics.Raycast(ray, ref rayHit, 17f, StartOfRound.Instance.collidersAndRoomMask)) ? ((Ray)(ref ray)).GetPoint(17f) : ((RaycastHit)(ref rayHit)).point); val = roundManager.GetNavMeshPosition(val, default(NavMeshHit), 5f, -1); ((EnemyAI)__instance).SetDestinationToPosition(val, false); ((EnemyAI)__instance).agent.speed = 13f; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] public static bool FixIndoorDogBehaviourForClients(MouthDogAI __instance, ref Collider other, bool ___inKillAnimation, ref Collider ___debugCollider, ref bool ___inLunge, Ray ___ray, RaycastHit ___rayHit, RoundManager ___roundManager) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) if (!((EnemyAI)__instance).enemyType.isOutsideEnemy && Huntdown._isHost) { if (!((EnemyAI)__instance).isEnemyDead && !___inKillAnimation && !(((EnemyAI)__instance).stunNormalizedTimer >= 0f)) { PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if (!((Object)(object)component != (Object)null)) { Huntdown._logger.LogError((object)"Player returned null"); return false; } Vector3 val = Vector3.Normalize((((Component)__instance).transform.position + Vector3.up - ((Component)component.gameplayCamera).transform.position) * 100f); RaycastHit val2 = default(RaycastHit); if (Physics.Linecast(((Component)__instance).transform.position + Vector3.up + val * 0.5f, ((Component)component.gameplayCamera).transform.position, ref val2, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { if (!((Object)(object)((RaycastHit)(ref val2)).collider == (Object)(object)___debugCollider)) { Debug.Log((object)("Eyeless dog collide, linecast obstructed: " + ((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name)); ___debugCollider = ((RaycastHit)(ref val2)).collider; return false; } return false; } if (((EnemyAI)__instance).currentBehaviourStateIndex == 3) { component.inAnimationWithEnemy = (EnemyAI)(object)__instance; __instance.KillPlayerServerRpc((int)component.playerClientId); return false; } if (((EnemyAI)__instance).currentBehaviourStateIndex == 0 || ((EnemyAI)__instance).currentBehaviourStateIndex == 1) { ((EnemyAI)__instance).SwitchToBehaviourState(2); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(NetworkManager.Singleton.LocalClientId); ((EnemyAI)__instance).SetDestinationToPosition(((Component)component).transform.position, false); return false; } if (((EnemyAI)__instance).currentBehaviourStateIndex == 2 && !___inLunge) { ((Component)__instance).transform.LookAt(((Component)other).transform.position); ((Component)__instance).transform.localEulerAngles = new Vector3(0f, ((Component)__instance).transform.eulerAngles.y, 0f); ___inLunge = true; EnterLunge(__instance, ___ray, ___rayHit, ___roundManager); return false; } } return false; } return true; } } internal static class MissionNameKR { private static readonly Dictionary<string, string> _table = new Dictionary<string, string> { { "Snare Flea", "올가미 벼룩" }, { "Bunker Spider", "벙커 거미" }, { "Hoarding Bug", "비축 벌레" }, { "Bracken", "브라켄" }, { "Thumper", "덤퍼" }, { "Nutcracker", "병정