using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using DynamicSmokeSystem; using Fusion; using Fusion.Sockets; using HarmonyLib; using HarmonyLib.Tools; using Helpers.Collections; using LycansNewRoles.NewEffects; using LycansNewRoles.NewItems; using LycansNewRoles.NewItems.Accessories; using LycansNewRoles.NewMaps; using LycansNewRoles.NewMaps.Components; using LycansNewRoles.NewPrimaryRoles; using LycansNewRoles.PowerObjects; using LycansNewRoles.Sabotages; using LycansNewRoles.Stats; using Managers; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Voice.Fusion; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Localization; using UnityEngine.Localization.Components; using UnityEngine.Localization.Settings; using UnityEngine.Localization.Tables; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.Scripting; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LycansNewRoles")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e3f04cbf9e40dd7e387b7e56a3144dbba041aaca")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("LycansNewRoles")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LycansNewRoles { public static class BalancingValues { public struct ModifiedEffectData { public int RealIndex; public int BlueMageCooldownSeconds; public float? DurationOnTransformedWolf; public float? DurationOnZombie; public ModifiedEffectData(int realIndex, int blueMageCooldownSeconds, float? durationOnTransformedWolf, float? durationOnZombie) { RealIndex = realIndex; BlueMageCooldownSeconds = blueMageCooldownSeconds; DurationOnTransformedWolf = durationOnTransformedWolf; DurationOnZombie = durationOnZombie; } } public const float EffectDurationStunned = 5f; public const float EffectDurationChasing = 3f; public const float EffectDurationSprinting = 5f; public const float EffectDurationReverting = 15f; public const float EffectDurationDisoriented = 3f; public const float EffectDurationInfected = 10f; public const float EffectDurationUndetected = 15f; public const float EffectDurationStarvationActive = 150f; public const float EffectDurationBlind = 3.5f; public const float EffectDurationIllusion = 15f; public const float EffectDurationDisguised = 300f; public const float EffectDurationDiseased = 300f; public const float EffectDurationBomb = 20f; public const float EffectDurationPanic = 3f; public const float EffectDurationFleeing = 4f; public const float EffectDurationDowned = 10f; public const float EffectDurationWounded = 30f; public const float EffectDurationPoisoned = 45f; public const float EffectDurationExorcised = 15f; public const float EffectDurationPhasing = 3f; public const float EffectDurationDying = 45f; public const float EffectDurationAngel = 12f; public const float EffectDurationResistance = 10f; public const float EffectDurationPortal = 8f; public const float EffectDurationSpiritResistance = 15f; public const float EffectDurationSneaky = 7f; public const float EffectDurationSpotter = 20f; public const float EffectDurationPotionDeaf = 60f; public const float EffectDurationPotionMidas = 60f; public const float EffectDurationPotionVampire = 35f; public const float EffectDurationPotionTiny = 35f; public const float EffectDurationPotionHaunted = 70f; public const float EffectDurationPotionNearsighted = 60f; public const float EffectDurationPotionAssassin = 20f; public const float EffectDurationPotionStinking = 60f; public const float EffectDurationPotionMute = 100f; public const float EffectDurationPotionClairvoyance = 75f; public const float EffectDurationPotionChaos = 60f; public const float EffectDurationPotionEnergized = 60f; public const float EffectDurationPotionConfused = 45f; public const float EffectDurationPotionCamouflage = 90f; public const float AgentEliminationRange = 2.5f; public const float AgentEliminationSneakyDuration = 8f; public const float NecromancerMarkCastTime = 2f; public const float NecromancerResurrectCastTime = 2f; public const int NecromancerChargePerSecondInWolfForm = 150; public const int NecromancerChargeLossPerSecondWhenResurrected = 300; public const int NecromancerMinimumChargeToResurrect = 10000; public const int WarlockShapeshiftCastTime = 1; public const float DeceiverScaryEffectDistance = 40f; public const float DeceiverIllusionDelayInitialMinSeconds = 2f; public const float DeceiverIllusionDelayInitialMaxSeconds = 5f; public const float DeceiverIllusionDelayBetweenMinSeconds = 15f; public const float DeceiverIllusionDelayBetweenMaxSeconds = 30f; public const float DeceiverIllusionDurationMinSeconds = 8f; public const float DeceiverIllusionDurationMaxSeconds = 15f; public const float DeceiverTrickRange = 10f; public const float DeceiverDrunkChangeVoteChance = 0.65f; public const float DeceiverDrunkStunChanceEverySecondWhenTalking = 0.15f; public const float DeceiverDrunkStunDurationInMeetings = 8f; public const float DeceiverDrunkStunDurationOutsideMeetings = 2f; public const int VillageIdiotStartingBoredom = 2500; public const int VillageIdiotBoredomIncreasePerSecond = 200; public const float VillageIdiotBoredomReductionPerSecondAtMinDistance = 3000f; public const float VillageIdiotBoredomReductionPerSecondAtMaxDistance = 0f; public const float VillageIdiotBoredomReductionMultiplierForWolf = 2f; public const float VillageIdiotHumanRangeForBoredom = 30f; public const float VillageIdiotWolfRangeForBoredom = 40f; public const int VillageIdiotBoredomReductionPerCollect = 1700; public const int VillageIdiotBoredomReductionPerSecondInWolfForm = 400; public const float VillageIdiotHungerPerSecondPerBoredom = 0.0002f; public const float SpyMaximumDistanceForBestTarget = 80f; public const float SpySpyingPerSecondWithoutBonus = 10f; public const float SpySpyingPerSecondWithTargetVisible = 32f; public const float SpySpyingPerSecondWithSpyImmobile = 18f; public const float SpySpyingPerSecondWithTargetVisibleAndSpyImmobile = 63f; public const float ScientistAnalysisPowerAtMinDistance = 70f; public const float ScientistAnalysisPowerAtMaxDistance = 20f; public const float ScientistAnalysisMultiplierIfNotRealWolf = 0.2f; public const float ScientistAnalysisMultiplierForTransform = 8f; public const float ScientistAnalysisMultiplierForKill = 8f; public const float ScientistAnalysisMultiplierIfWolfVisible = 4f; public const float ScientistAnalysisMultiplierIfWolfVisibleButWounded = 0.4f; public const float ScientistAnalysisMultiplierIfScientistCrouched = 0.8f; public const float ScientistAnalysisMultiplierIfScientistInvisible = 0.4f; public const float ScientistAnalysisMultiplierIfScientistFast = 0.3f; public const float ScientistAnalysisMultiplierIfScientistFeigningDeath = 0.5f; public const float ScientistAnalysisRangePeriodic = 40f; public const float ScientistAnalysisRangeTransform = 40f; public const float ScientistAnalysisRangeKill = 30f; public const float ScientistCreateGadgetCooldown = 60f; public const float BeastMarkRange = 7f; public const float BeastTransformationTime = 7f; public const float BeastKillRange = 3f; public const float BeastHealthLossPercentagePerSecond = 0.0115f; public const float BeastTrapHealthLossPercentagePerSecond = 0.025f; public const float BeastHealthGainPercentagePerKill = 0.15f; public const float BeastMovementSpeed = 1.25f; public const float BeastNegativeEffectsDurationPercentage = 0.5f; public const float BeastHealthLossPercentageOnShot = 0.1f; public const float BeastHealthLossPercentageOnBomb = 0.25f; public const float BeastTrapDurationSeconds = 5f; public const int BeastDamageBonusOnDoors = 50; public const int BeastActiveFogEndDistance = 65; public static Color BeastActiveFogColor = new Color(1f, 0f, 0f, 1f); public const float BeastVoiceRange = 40f; public const float BeastGlobalKnockbackMultiplier = 0.6f; public const float BeastSleepingGasStacksMultiplier = 0.5f; public const float MercenarySleepDurationOnHuman = 30f; public const float MercenarySleepDurationOnWolf = 8f; public const float MercenaryParalysisCooldown = 60f; public const int MercenaryBonusPointsOnSuccessfulShot = 200; public const int MercenaryCooldownBetweenTargets = 90; public const float VoodooReanimateRange = 10f; public const float VoodooReanimateCastTime = 2f; public const float VoodooHealthLossPerZombiePerPlayerCount = 0.015f; public const float ZombieMovementSpeed = 1.1f; public const float ZombieKillRange = 2.5f; public const float ZombieAttackOnWolfDownedDuration = 7f; public const float ZombieAttackOnWolfKnockbackPower = 7f; public const float ZombieAttackOnWolfKnockbackReductionPerSecond = 7f; public const float ZombieKillVoodooCooldownMultiplication = 0.3f; public const float ZombieMoaningRange = 20f; public const float ZombieHealthLossPerSecondWhenRunning = 25f; public const float ZombieHealthRegenPerSecondWhenNotRunning = 4f; public static Color ZombieFogColor = new Color(0.75f, 0f, 0.75f, 1f); public const float KidnapperAbductRange = 5f; public const float KidnapperAbductTimer = 3f; public const float KidnapperCooldownAfterGameStart = 75f; public const float KidnapperCooldownAfterDayStart = 15f; public const float KidnapperKidnapBlindRadius = 10f; public const float KidnapperKidnapBlindDuration = 3f; public const float KidnapperSilenceHealthAdditionalHungerOutsideMeetings = 0.25f; public const float KidnapperSilenceHealthAdditionalHungerDuringMeetings = 0.1f; public const float CultistSkullCreationCastTime = 1f; public const float CultistGoal = 10000f; public const float CultistChargeGainPerSecondPerSkull = 15f; public const float CultistSpiritMoveSpeed = 1.4f; public const float CultistSpiritCaptureCooldown = 5f; public const float CultistInvokedSkullCreationInterval = 6f; public const float CultistInvokedSkullCreationTimer = 4f; public const float CultistInvokedSkullLifetime = 45f; public const float CultistInvokedSkullMoveSpeed = 2.75f; public const float CultistInvokedSkullMoveSpeedWhenSlowed = 0.8f; public const float CultistInvokedSkullSlowDuration = 2f; public const int CultistActiveFogEndDistance = 65; public static Color CultistActiveFogColor = new Color(0f, 0.6f, 0.6f, 1f); public const float CultistPortalOnPlayerChance = 0.25f; public const float WarlockWolfCurseRange = 10f; public const float WarlockWolfCurseDormantMinimumDelay = 1f; public const float WarlockWolfCurseDormantMaximumDelay = 20f; public const float WarlockWolfCurseDormantMinimumDuration = 30f; public const float WarlockWolfCurseDormantMaximumDuration = 60f; public const int PossessorProgressPerSecond = 400; public const float PossessorMarkRange = 5f; public const float SaboteurTrapHeldItemRange = 6f; public const float SaboteurPoisonHealthDecrease = 1.2f; public const int SaboteurPoisonFogEndDistance = 20; public static Color SaboteurPoisonFogColor = new Color(0f, 0.5f, 0f, 1f); public const float SaboteurTrappedGadgetHealthLossPercentage = 0.25f; public const float SaboteurWoundedMoveSpeedMultiplier = 0.65f; public const float SaboteurItemLightIntensityNotHeld = 2f; public const float SaboteurItemLightIntensityHeld = 0.5f; public const float SaboteurItemLightRangeNotHeld = 2f; public const float SaboteurItemLightRangeHeld = 0.15f; public const int SaboteurChargesGainPerSecond = 160; public const float TraitorSabotageDelayMultiplier = 1f; public const float BomberCreateBombRange = 6f; public const float BomberGiveBombRange = 2.5f; public const float BomberBombDamagePercentageOnHuman = 0.35f; public const float BomberBombDamagePercentageOnWolf = 0.35f; public const float BomberBombDamagePercentageOnBeast = 0.15f; public const float BomberBombGlowingDuration = 180f; public const float BomberBombWoundedDurationOnHuman = 180f; public const float BomberBombWoundedDurationOnWolf = 30f; public const float BomberBombStartMinimumDelay = 5f; public const float BomberBombStartMaximumDelay = 10f; public const float BomberBombTickingSoundRange = 20f; public const float BomberBombExplosionSoundRange = 60f; public const float PoacherShotSoundRange = 20f; public const float PoacherMarkSoundRange = 30f; public const float RitualistChargePerSecondAtMinDistance = 600f; public const float RitualistChargePerSecondAtMaxDistance = 100f; public const float RitualistChargePerSecondRange = 25f; public const float RitualistMuteDuration = 55f; public const float RitualistDeafDuration = 20f; public const float RitualistParanoiaDuration = 12f; public const float RitualistFlatulenceDuration = 20f; public const float RitualistNearsightedDuration = 25f; public const float RitualistConfusedDuration = 30f; public const float RitualistStunnedDuration = 10f; public const float PredatorScaryEffectRangeNotCrouched = 30f; public const float PredatorScaryEffectRangeCrouched = 5f; public const float PredatorHeartbeatRange = 20f; public const float PredatorEmpoweredDurationOnKill = 45f; public const float PredatorEffectMovementSpeed = 1.15f; public const float PredatorEffectScaryEffectRangeMultiplier = 0.75f; public const float PredatorHealthAfterBeingShotIfPrey = 0.5f; public const float SneakySpeedMultiplier = 1.5f; public const float SneakSilentTransformationDelayMultiplier = 2f; public const float TrackerPlaceRadarCastTime = 6f; public const float TrackerRadarRadius = 30f; public const int TrackerRadarDuration = 30; public const int TrackerChargesGainPerSecond = 100; public const int HostEggHatchDuration = 15; public const float HostParasiteDestroyRange = 0.1f; public const float HostParasiteDetectRange = 20f; public const float HostParasiteTargetDamagePercentage = 0.2f; public const float HostParasiteTargetPoisonDuration = 15f; public const float HostParasiteNearbyPlayerRange = 12f; public const float HostParasiteNearbyPlayerMaximumDamagePercentage = 0.2f; public const float HostParasiteNearbyPlayerMaximumPoisonDuration = 15f; public static Dictionary SecondaryRoleMaxAmountInDraft = new Dictionary { { PlayerCustom.PlayerSecondaryRole.BothAlcoholic, 3 }, { PlayerCustom.PlayerSecondaryRole.BothSprinter, 3 }, { PlayerCustom.PlayerSecondaryRole.BothInfected, 2 }, { PlayerCustom.PlayerSecondaryRole.BothTeleporter, 2 }, { PlayerCustom.PlayerSecondaryRole.BothEngineer, 2 }, { PlayerCustom.PlayerSecondaryRole.BothPolitician, 2 }, { PlayerCustom.PlayerSecondaryRole.BothMetabolic, 2 }, { PlayerCustom.PlayerSecondaryRole.BothIllusionist, 3 }, { PlayerCustom.PlayerSecondaryRole.BothSherif, 1 }, { PlayerCustom.PlayerSecondaryRole.BothGambler, 1 }, { PlayerCustom.PlayerSecondaryRole.BothMedium, 2 }, { PlayerCustom.PlayerSecondaryRole.BothAstral, 3 }, { PlayerCustom.PlayerSecondaryRole.BothScavenger, 1 }, { PlayerCustom.PlayerSecondaryRole.BothBlueMage, 2 }, { PlayerCustom.PlayerSecondaryRole.BothActor, 3 }, { PlayerCustom.PlayerSecondaryRole.BothScribe, 3 }, { PlayerCustom.PlayerSecondaryRole.BothCarabineer, 2 }, { PlayerCustom.PlayerSecondaryRole.BothForger, 2 }, { PlayerCustom.PlayerSecondaryRole.BothImitator, 2 }, { PlayerCustom.PlayerSecondaryRole.BothMerchant, 1 }, { PlayerCustom.PlayerSecondaryRole.BothTinkerer, 3 } }; public const float AlcoholicPotionHealWolf = 0.45f; public const float AlcoholicPotionHealBeast = 0.2f; public const float SprinterSprintingMoveSpeedMultiplier = 1.75f; public const float SprinterChasingMoveSpeedMultiplier = 1.5f; public const float EngineerTrappedDuration = 4f; public const float EngineerTrapDisarmTime = 1f; public const int EngineerDoorBashBonusDamageWolf = 40; public const int EngineerDoorBashBonusDamageNonWolf = 20; public const int EngineerSmokeRadiusBoosted = 250; public const int EngineerSmokeRadiusNotBoosted = 250; public const float EngineerGrenadeKnockbackMultiplier = 0.6f; public const float EngineerSleepingGasStacksMultiplier = 0.4f; public const int InfectedWolfRadius = 30; public const float GamblerSwitchRange = 5f; public const float GamblerHealOnHumanForm = 0.2f; public const float GamblerHealOnWolfForm = 0.5f; public const float GamblerHealOnBeast = 0.15f; public const float MetabolicWolfStarvationRange = 10f; public const float MetabolicVillagerFeedMultiplier = 1.4f; public const float MetabolicStarvationAdditionalHunger = 0.8f; public const float MetabolicPositiveEffectsDurationMultiplier = 1.25f; public const float MetabolicNegativeEffectsDurationMultiplier = 0.8f; public const float PoliticianDenyVoteRange = 10f; public const float SherifInitialCooldown = 240f; public const float SherifKillRange = 3f; public const float ResistanceMinimumHealthAfterBeingShot = 0.6f; public const float SprinterSprintingAdditionalHunger = 4f; public const float ScavengerHumanFormHealPercentage = 0.25f; public const float ScavengerWolfFormHealPercentage = 0.75f; public const float BlueMageCastRange = 7f; public const float BlueMageMinimumCooldownAfterNewSpell = 10f; public const float ActorInWolfFormHungerMultiplier = 0.25f; public const float CarabineerKnockbackPower = 14f; public const float CarabineerKnockbackReductionPerSecond = 9.5f; public const float CarabineerDisorientedDurationOnWolf = 3f; public const float CarabineerForcedRotationPower = 900f; public const float CarabineerForcedRotationReductionPerSecond = 700f; public const float CarabineerResilienceDuration = 3f; public const float CarabineerKnockdownDurationOnHuman = 4f; public const float ForgerCopyItemRange = 10f; public const float ForgerStealItemRange = 3f; public const float AstralActiveBaseHunger = 0.2f; public const float AstralActiveExtraHungerPerDistance = 0.01f; public const float AstralMoveSpeedHumanForm = 3f; public const float AstralMoveSpeedWolfForm = 9f; public const float AstralFearRadiusMultiplier = 0.35f; public const int ImitatorSecondaryRolesToChoose = 4; public const float MerchantMinimumDistanceToCoin = 40f; public const int MerchantGainPerCoinForNonWolf = 3; public const int MerchantGainPerCoinForWolf = 2; public const int MerchantStartingCoins = 10; public const int MerchantOffersCount = 4; public const int MerchantRerollCost = 3; public const float MerchantDeliveryTime = 5f; public const float TinkererBootsInvisibilityDurationHumanForm = 3f; public const float TinkererBootsInvisibilityDurationWolfForm = 6f; public const float TinkererHornHealPercentage = 0.25f; public const float TinkererPowerInteractionRange = 10f; public const float TinkererRingQuicknessDurationHumanForm = 20f; public const float TinkererRingQuicknessDurationWolfForm = 10f; public const float TinkererMagnifierBlindDurationHumanForm = 6f; public const float TinkererMagnifierBlindDurationWolfForm = 3f; public const float TinkererCrystalBallTruesightDurationHumanForm = 45f; public const float TinkererCrystalBallTruesightDurationWolfForm = 45f; public const int MerchantPriestProtectionCost = 20; public const int MerchantHealCost = 20; public const float MerchantHealPercentage = 0.5f; public const float PeasantChargePerSecondAtMinDistance = 330f; public const float PeasantChargePerSecondAtMaxDistance = 70f; public const float PeasantChargePerSecondRange = 30f; public const float PeasantMinimumChargeToUse = 2500f; public const float PeasantChargeLossPerSecondWhenActive = 1250f; public const float ExorcistCastTime = 3f; public const float ExorcistBlindDuration = 1.5f; public const float ExorcistResilienceDuration = 5f; public const int ExorcistFogEndDistance = 20; public static Color ExorcistFogColor = new Color(0.5f, 0.5f, 0f, 1f); public const float ExorcistDetectorKnockbackPower = 5f; public const float ExorcistDetectorKnockbackReductionPerSecond = 5f; public const float ExorcistDetectorMinimumDuration = 80f; public const float ExorcistDetectorMaximumDuration = 210f; public const float ExorcistDetectorDistanceFromMeetingForMaximumDuration = 80f; public const float AvengerAttackRange = 3.5f; public const float AvengerAttackDownedDuration = 5f; public const float AvengerAttackResilienceDuration = 8f; public const float AvengerOnWolfKnockbackPower = 6f; public const float AvengerOnWolfKnockbackReductionPerSecond = 6f; public const float AvengerRadiusForChargeBonus = 30f; public const float AvengerChargePerSecondIfNearbyWolf = 100f; public const int AvengerChargeIncreaseOnNearbyWolfKill = 2500; public const int InvestigatorHintsAmountOnNewDay = 3; public const float InvestigatorMinimumPlaceDistanceFromEachOther = 30f; public const float InvestigatorMinimumPlaceDistanceFromPlayer = 30f; public const float InvestigatorMaximumPlaceDistanceFromPlayer = 100f; public const float InvestigatorHintDurationAtMinimumDistance = 30f; public const float InvestigatorHintDurationAtMaximumDistance = 100f; public const float InvestigatorDurationRandomnessMinimum = 0.7f; public const float InvestigatorDurationRandomnessMaximum = 1.3f; public const int InvestigatorStartingCharge = 50; public const int InvestigatorHintChargePercentage = 25; public const int InvestigatorPlayerTargetChargePercentage = 35; public const float InvestigatorPlayerTargetInsteadOfHintChance = 0.6f; public const float InvestigatorPlayerTargetMinimumDistance = 25f; public const float InvestigatorPlayerTargetInteractRange = 3f; public const int InvestigatorAmountOfIntel = 2; public static Dictionary InvestigatorChanceByIntelType = new Dictionary { { PlayerDetectiveIntel.PlayerDetectiveIntelType.OneIsEvil, 3 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.DifferentSides, 1 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.NotWolf, 0 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.TransformationsAndDetransformations, 2 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.WolvesAndSoloRolesRemaining, 2 } }; public const float SurvivalistSaveCastTime = 4f; public const float SurvivalistHungerPercentageWhenDowned = 0.095f; public const float SurvivalistHungerPercentageWhenSaved = 0.395f; public const float SurvivalistAlertRange = 40f; public const float SurvivalistHeartbeatRange = 15f; public const float SurvivalistBuffRange = 2.5f; public const int SurvivalistMaterialsPerHint = 2000; public const float SurvivalistHintCreationChancePerSecond = 0.035f; public const int SurvivalistHintLifetimeSeconds = 90; public const float SurvivalistSelfCastTime = 3f; public const float SurvivalistDyingDurationOnNonElite = 50f; public const float SurvivalistDyingDurationOnElite = 35f; public const float PriestProtectRange = 2.5f; public const float PriestProtectDownedDuration = 2f; public const float PriestProtectEliteDownedDuration = 1f; public const float PriestProtectionKnockbackPower = 6f; public const float PriestProtectionKnockbackReductionPerSecond = 3f; public const float PriestProtectionEliteKnockbackPower = 4f; public const float PriestProtectionEliteKnockbackReductionPerSecond = 2f; public const float PriestProtectionForcedRotationPower = 4000f; public const float PriestProtectionForcedRotationReductionPerSecond = 3000f; public const float PriestProtectionFleeingDuration = 6f; public const float PriestProtectionEliteFleeingDuration = 4f; public const float PriestResilienceDuration = 6f; public const float AngelHealPercentage = 0.2f; public const float AngelEffectWolfOnMinimapRadius = 40f; public const float AngelDebuffOnWolfDuration = 15f; public const float GhostMoveSpeed = 1.3f; public const float SpecterMoveSpeed = 1.8f; public const float SpecterInteractionRange = 2.5f; public const float SpecterLeftClickCooldown = 25f; public const float SpecterLeftClickCooldownInMeetings = 40f; public const float SpecterRightClickCooldown = 120f; public const float SpecterPowerOnWolfDuration = 15f; public const float SpecterDebuffOnVillagerDuration = 25f; public const float SpecterDebuffOnVillagerDurationInMeetings = 8f; public const float SpecterDebuffOnVillagerImmunityDuration = 50f; public const float SummonerSpiritAttackKnockbackPower = 15f; public const float SummonerSpiritAttackKnockbackReductionPerSecond = 21f; public const float SummonerSpiritAttackDamagePercentage = 0.05f; public const float SummonerSpiritAttackWoundedDuration = 6f; public const float SummonerSpiritAttackCooldown = 5f; public const float SummonerSpiritAttackResilienceDuration = 5f; public const float SummonerSpiritAttackResistanceDuration = 20f; public const float SummonerSpiritSpellMaximumRange = 20f; public const float SummonerSpiritSpellDamagePercentage = 0.05f; public const float SummonerSpiritSpellWoundedDuration = 6f; public const float SummonerSpiritSpellCooldown = 20f; public const float SummonerSpiritSpellResilienceDuration = 5f; public const float SummonerSpiritSpellResistanceDuration = 20f; public const float SummonerInteractionRange = 2.5f; public const float ScoutPlaceRadarCastTime = 2f; public const float ScoutRadarRadius = 36f; public const float ScoutRadarMinimumDuration = 70f; public const float ScoutRadarMaximumDuration = 140f; public const float ScoutRadarDistanceFromMeetingForMaximumDuration = 60f; public const float MagicianBeaconCastTime = 1f; public const int MagicianIllusionDuration = 7; public const float MagicianIllusionMoveSpeed = 3f; public const float MagicianIllusionExplosionBlindDuration = 2f; public const int MysticCastTime = 1; public const int MysticPowerChargePerSecondAtMaximumHealth = 25; public const int MysticPowerChargePerSecondAtZeroHealth = 150; public const float MysticRepulsorRadius = 30f; public const int MysticRepulsorDuration = 15; public const float MysticRepulsorBanishDuration = 8f; public static Color MysticRepulsorFogColor = Color.cyan; public static float MysticRepulsorFogEndDistanceAtZeroStack = 40f; public static float MysticRepulsorFogEndDistanceAtMaxStacks = 15f; public const int MysticRepulsorStacksMaximum = 1000; public const int MysticRepulsorStacksPerSecond = 175; public const float MysticRepulsorStacksMultiplierAtZeroRange = 1f; public const float MysticRepulsorStacksMultiplierAtMaximumRange = 0.35f; public const float MysticRepulsorMovementSpeedAtZeroStack = 0.9f; public const float MysticRepulsorMovementSpeedAtMaxStacks = 0.25f; public const float ShadowRadiusForChargeBonus = 30f; public const float ShadowAuraRadius = 20f; public const float ShadowChargePerSecondDefault = 35f; public const float ShadowChargePerSecondBonusIfNearbyWolf = 215f; public const int ShadowChargeIncreaseOnNearbyWolfKill = 10000; public const int ShadowChargeLossOnActivation = 2000; public const float ShadowChargeLossPerSecondWhenActive = 1500f; public const float ShadowMinimumDistanceForInvisibility = 40f; public const float ShadowMinimumDistanceForLevel3Camouflage = 25f; public const float ShadowMinimumDistanceForLevel2Camouflage = 10f; public const int HermitHideoutsAmountOnNewDay = 4; public const int HermitHideoutDuration = 80; public const int HermitHideoutFadeMultiplierWhenInside = 3; public const int HermitHideoutCreationInterval = 20; public const float HermitHideoutRadius = 12f; public const float HermitHiddenRaycastRange = 2f; public const int HermitHideoutDurationIncreaseOnPower = 20; public const int HermitHideoutMaximumDurationForYellowIcon = 60; public const int HermitHideoutMaximumDurationForRedIcon = 30; public const int HermitHideoutMinimumPlaceDistanceFromEachOther = 30; public const float AvatarWolfOnMinimapRadius = 40f; public const float AvatarHealthPercentageToCreateItem = 0.25f; public const float BulletsBaseMultiplier = 0.25f; public const float BulletsAdditionalMultiplierPerEliteRole = 0.5f; public const float AlchemistWhitePotionHealPercent = 0.25f; public const float AlchemistWhitePotionDurationMultiplier = 0.6f; public const int AlchemistMaterialsGainForBulletRecharge = 100; public const int SpotterMaterialsGainForBulletRecharge = 150; public const float SpotterVoiceRangeBoosted = 70f; public const float SpotterMinimapRangeUnboosted = 25f; public const float SpotterMinimapRangeBoosted = 45f; public const float SpotterWolvesLightRange = 250f; public const float SpotterWolvesLightIntensity = 4f; public const float SpotterMovementSpeedMultiplierBoosted = 1.13f; public const int PurifierMaterialsGainForBulletRecharge = 150; public const float PurifierYAngleIncrease = 0.1f; public const float PurifierLaunchPower = 25f; public const float PurifierMovementReductionPercentagePerSecond = 0.5f; public const int PurifierFireDurationMilliseconds = 9000; public const float PurifierEntityExistenceMillisecondsForMaximumBurnDuration = 5f; public const float PurifierMinimumBurnDurationAtMinimumRadius = 3f; public const float PurifierMaximumBurnDurationAtMaximumRadius = 7f; public const float PurifierBurnMovementSpeedMultiplierHumanForm = 1.2f; public const float PurifierBurnMovementSpeedMultiplierWolfForm = 0.7f; public const float PurifierBurnHealthIncreaseHumanForm = 1.5f; public const float PurifierBurnHealthDecreaseWolfForm = 0.8f; public const float PurifierConfusionDurationOnWolf = 6f; public static Color PurifierBurnFogColor = Color.green; public const float PurifierBurnFogMaximumDistance = 25f; public const float PurifierBurnDurationIfKilledByWolf = 15f; public static int VillageIdiotTrapItemCooldown = 75; public static int VillageIdiotBombCooldown = 110; public static int VillageIdiotCurseCooldown = 120; public const float MegaFartChancePerFart = 0.0035f; public const float MegaFartKnockbackPowerOnHuman = 25f; public const float MegaFartKnockbackReductionPerSecondOnHuman = 10f; public const float MegaFartKnockbackPowerOnWolf = 15f; public const float MegaFartKnockbackReductionPerSecondOnWolf = 8f; public const float MidasEffectValueMultiplier = 2f; public const float VampireBaseRadius = 25f; public const float VampireEffectCurrentPercentage = 0.03f; public const float TinyMovementSpeed = 0.6f; public const float HauntedMinimumDelayServer = 3f; public const float HauntedMaximumDelayServer = 6f; public const float HauntedHealthGainPercentage = 0.25f; public const float HauntedHealthLossPercentage = 0.2f; public const float HauntedDoorRadius = 40f; public const float HauntedLanternFlickerRadius = 30f; public const int HauntedLanternFlickersCount = 20; public const float HauntedForcedRotationPower = 3000f; public const float HauntedForcedRotationReductionPerSecond = 2000f; public static Dictionary HauntedChanceByEffect = new Dictionary { { HauntedEffect.HauntedPossibleEffect.HealthGain, 2 }, { HauntedEffect.HauntedPossibleEffect.HealthLoss, 1 }, { HauntedEffect.HauntedPossibleEffect.OpenDoors, 3 }, { HauntedEffect.HauntedPossibleEffect.CloseDoors, 3 }, { HauntedEffect.HauntedPossibleEffect.Teleport, 2 }, { HauntedEffect.HauntedPossibleEffect.GainItem, 2 }, { HauntedEffect.HauntedPossibleEffect.RandomEffect, 4 }, { HauntedEffect.HauntedPossibleEffect.Sound, 3 }, { HauntedEffect.HauntedPossibleEffect.FlickerLanterns, 2 }, { HauntedEffect.HauntedPossibleEffect.ForcedRotation, 1 } }; public const int NearsightedFogEndDistance = 12; public static Color NearsightedFogColor = new Color(0f, 0f, 0.1f, 1f); public const float AssassinRange = 3.5f; public const float AssassinOnWolfDownedDuration = 6f; public const float AssassinOnWolfKnockbackPower = 6f; public const float AssassinOnWolfKnockbackReductionPerSecond = 6f; public const float AssassinResilienceDuration = 9f; public const float MidasPetrifyRange = 3f; public const float MidasDurationOnHuman = 30f; public const float MidasDurationOnWolf = 8f; public static Color PetrifiedFogColor = new Color(0.75f, 0.75f, 0f, 1f); public const float DisorientedMovementSpeed = 0.5f; public const float StunnedMovementSpeed = 0.5f; public const float StinkingEffectRadiusOnNonWolf = 5f; public const float StinkingEffectRadiusOnWolf = 15f; public const float NauseatedMovementSpeed = 0.85f; public const int NauseatedFogEndDistance = 30; public static Color NauseatedFogColor = new Color(0f, 0.5f, 0f, 1f); public const float PhasingMovementSpeedHumanForm = 1.5f; public const float PhasingMovementSpeedWolfForm = 1.25f; public const float BombMovementSpeed = 1.15f; public const float FleeingMovementSpeed = 1.75f; public const float PanicMovementSpeed = 0.65f; public const float ChaosMinimumDelayServer = 6f; public const float ChaosMaximumDelayServer = 12f; public static Dictionary ChaosChanceByEffect = new Dictionary { { ChaosEffect.ChaosPossibleEffect.CreateTraps, 2 }, { ChaosEffect.ChaosPossibleEffect.CreateGrenade, 4 }, { ChaosEffect.ChaosPossibleEffect.UseScrollOnNearbyPlayer, 6 }, { ChaosEffect.ChaosPossibleEffect.LockNearbyDoor, 1 }, { ChaosEffect.ChaosPossibleEffect.UnlockNearbyDoor, 2 }, { ChaosEffect.ChaosPossibleEffect.CreateSmoke, 4 }, { ChaosEffect.ChaosPossibleEffect.UseDiamondOnNearbyPlayer, 1 } }; public const float ChaosMaximumPlayerRange = 15f; public const float ChaosMaximumDoorRange = 20f; public const int ChaosMinimumTraps = 1; public const int ChaosMaximumTraps = 3; public const float ChaosMaximumTrapRange = 2f; public const float ChaosMaximumGrenadeRange = 2f; public const float ChaosSmokeDuration = 8f; public const float ChaosGrenadeKnockbackMultiplier = 0.7f; public const float TruesightItemLightIntensity = 2f; public const float TruesightItemLightRange = 2f; public const float IsolationFogEndDistance = 40f; public static Color IsolationFogColor = new Color(0.35f, 0.35f, 0.35f, 1f); public const float EnergizedHealPerSecondIfNoChargeablePower = 0.6f; public const float EnergizedCooldownSecondsReductionPerSecond = 1f; public const float ClairvoyanceMinimapRadius = 40f; public const float ResilienceHungerMultiplier = 0.25f; public const float LoverVillagerHungerRateBase = 0.5f; public const float LoverVillagerHungerRatePerLivingPlayer = 0.02f; public const float LoverVillagerHealPercentageOnWolfKill = 0.4f; public const int LoverFogEndDistance = 55; public static Color LoverFogColor = new Color(1f, 0.4f, 1f, 1f); public const float MercenaryHuntSneakyDuration = 10f; public const float EscapingSpeedMultiplier = 1.1f; public const float WolfKillRange = 1.75f; public const float LootCorpseCastTime = 3f; public const float CultistSkullForbiddenAreaRadius = 10f; public static Dictionary> CultistSkullForbiddenAreasByMapId = new Dictionary> { { 1, new List { new Vector3(111.98f, 22.08f, 153.42f), new Vector3(135.76f, 22.08f, 153.86f), new Vector3(104.75f, 22.17f, 217.89f), new Vector3(148.08f, 22.28f, 254.41f), new Vector3(176.49f, 22.7f, 222.09f), new Vector3(184.45f, 22.58f, 228.51f), new Vector3(196.93f, 22.28f, 242.07f) } } }; public const float CultistSkullMinimumDistanceFromCorpses = 3f; public const float CultistSkullMinimumDistanceFromOtherSkulls = 10f; public const float MagicScrollDurationMultiplier = 0.75f; public const float GrenadeFuseTime = 2f; public const float GrenadeYAngleIncrease = 0.1f; public const float GrenadeLaunchPower = 25f; public const float GrenadeMovementReductionPercentagePerSecond = 0.5f; public const float GrenadeMovementReductionPercentagePerSecondWhenGrounded = 60f; public const float GrenadeArea = 15f; public const float GrenadeKnockbackMultiplierAtMaximumDistance = 0.4f; public const float GrenadeMaximumKnockback = 20f; public const float GrenadeKnockbackMultiplierOnCrouched = 0.5f; public const float GrenadeKnockbackReductionPerSecond = 9f; public const float GrenadeKnockbackMultiplierIfNotVisible = 0.6f; public const float GrenadeMaximumDisorientedDuration = 8f; public const float GrenadeDisorientedDurationMultiplierAtMaximumDistance = 0.4f; public const float MolotovYAngleIncrease = 0.1f; public const float MolotovLaunchPower = 25f; public const float MolotovMovementReductionPercentagePerSecond = 0.5f; public const int MolotovFireDurationMilliseconds = 12000; public const float MolotovEntityExistenceMillisecondsForMaximumBurnDuration = 6f; public const float MolotovMinimumBurnDurationAtMinimumRadius = 2f; public const float MolotovMaximumBurnDurationAtMaximumRadius = 8f; public const float MolotovBurnMovementSpeedMultiplier = 0.7f; public const float MolotovBurnHealthDecreaseHumanForm = 2.2f; public const float MolotovBurnHealthDecreaseWolfForm = 1.5f; public static Color MolotovBurnFogColor = Color.red; public const float MolotovBurnFogMaximumDistance = 30f; public const float RadarDelayBeforeActivation = 2f; public const float RadarDuration = 23f; public const float RadarYAngleIncrease = 0.1f; public const float RadarLaunchPower = 25f; public const float RadarMovementReductionPercentagePerSecond = 0.5f; public const float RadarMovementReductionPercentagePerSecondWhenGrounded = 60f; public const float RadarAreaOnHumans = 15f; public const float RadarAreaOnWolves = 40f; public const float SleepingGasPrepareTime = 4f; public const float SleepingGasDetonateSoundRange = 30f; public const float SleepingGasDurationForSleepingGas = 20f; public const float SleepingGasDurationForCamouflage = 20f; public const float SleepingGasDurationForPoisonGas = 50f; public const float SleepingGasInitialScaleRatio = 0.2f; public const float SleepingGasDurationForMaximumScaleRatio = 4f; public const float SleepingGasParticleSystemScalePerRadius = 0.175f; public static Color SleepingGasColorForSleepingGas = new Color(0.5f, 0f, 0.5f, 0.7f); public static Color SleepingGasColorForCamouflage = new Color(0f, 0.5f, 1f, 0.7f); public static Color SleepingGasColorForPoisonGas = new Color(0f, 1f, 0f, 0.7f); public const float SleepingGasMaximumRadiusForSleepingGas = 20f; public const float SleepingGasMaximumRadiusForCamouflage = 20f; public const float SleepingGasMaximumRadiusForPoisonGas = 30f; public const float SleepingGasSleepyMovementSpeedAtZeroStack = 0.85f; public const float SleepingGasSleepyMovementSpeedAtMaxStacks = 0.25f; public const float SleepingGasSleepyDuration = 7f; public const float SleepingGasCamouflageDuration = 2f; public const float SleepingGasFlatulenceDuration = 5.5f; public static Color SleepingGasSleepyFogColor = Color.white; public static float SleepingGasSleepyFogEndDistanceAtZeroStack = 60f; public static float SleepingGasSleepyFogEndDistanceAtMaxStacks = 5f; public const float SleepingGasApplyEffectInterval = 1f; public const int SleepingGasSleepStacksMaximum = 1000; public const int SleepingGasSleepStacksPerHalfSecondOnHuman = 150; public const int SleepingGasSleepStacksPerHalfSecondOnWolf = 150; public const float SleepingGasSleepStacksMultiplierAtZeroRange = 1.7f; public const float SleepingGasSleepStacksMultiplierAtMaximumRange = 0.6f; public const float SleepingGasSleepDurationOnHuman = 30f; public const float SleepingGasSleepDurationOnWolf = 12f; public const float RingMovementSpeedForVillagerInDanger = 1.15f; public const float RingMovementSpeedForTransformedWolf = 1.15f; public const float HornHealthIncreaseInHumanForm = 0.3f; public const float HornHealthIncreaseForLoverVillager = 0.15f; public const float HornHealthIncreaseInWolfForm = 0.2f; public const float BootsDetectionRadiusMultiplierInWolfForm = 0.85f; public const int MagnifierWolfFootstepsDuration = 90; public const int MagnifierVillagerFootstepsDuration = 10; public const float CrystalBallWolfDetectionRange = 25f; public const float SpellbookCooldown = 30f; public const float SpellbookNegativeEffectsDurationMultiplier = 0.7f; public static Dictionary SpellbookPossibleEffectsAndDurationsOnHumans = new Dictionary { { AccessorySpellbook.PossibleEffects.Invisibility, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Swiftness, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Petrified, new AccessorySpellbook.SpellbookEffectDetails { Duration = 10f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Giant, new AccessorySpellbook.SpellbookEffectDetails { Duration = 10f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.FlatulencesWithMegaFart, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Blind, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Illusion, new AccessorySpellbook.SpellbookEffectDetails { Duration = 30f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Asleep, new AccessorySpellbook.SpellbookEffectDetails { Duration = 20f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Bomb, new AccessorySpellbook.SpellbookEffectDetails { Duration = 20f, Ponderation = 1 } }, { AccessorySpellbook.PossibleEffects.Burning, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Detected, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Teleportation, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Confusion, new AccessorySpellbook.SpellbookEffectDetails { Duration = 30f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Regeneration, new AccessorySpellbook.SpellbookEffectDetails { Duration = 40f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Camouflage, new AccessorySpellbook.SpellbookEffectDetails { Duration = 60f, Ponderation = 3 } } }; public static Dictionary SpellbookPossibleEffectsAndDurationsOnWolves = new Dictionary { { AccessorySpellbook.PossibleEffects.Invisibility, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Swiftness, new AccessorySpellbook.SpellbookEffectDetails { Duration = 12f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Petrified, new AccessorySpellbook.SpellbookEffectDetails { Duration = 5f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Giant, new AccessorySpellbook.SpellbookEffectDetails { Duration = 5f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.FlatulencesWithMegaFart, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Blind, new AccessorySpellbook.SpellbookEffectDetails { Duration = 5f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Asleep, new AccessorySpellbook.SpellbookEffectDetails { Duration = 4f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Bomb, new AccessorySpellbook.SpellbookEffectDetails { Duration = 20f, Ponderation = 1 } }, { AccessorySpellbook.PossibleEffects.Burning, new AccessorySpellbook.SpellbookEffectDetails { Duration = 8f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Detected, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Teleportation, new AccessorySpellbook.SpellbookEffectDetails { Duration = 10f, Ponderation = 2 } }, { AccessorySpellbook.PossibleEffects.Resilience, new AccessorySpellbook.SpellbookEffectDetails { Duration = 20f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Clairvoyance, new AccessorySpellbook.SpellbookEffectDetails { Duration = 15f, Ponderation = 3 } }, { AccessorySpellbook.PossibleEffects.Camouflage, new AccessorySpellbook.SpellbookEffectDetails { Duration = 40f, Ponderation = 3 } } }; public const float SabotageObjectRaycastRange = 7f; public const float SabotageSubtlyDurationMultiplier = 5f; public const float DiseaseEffectHealthDecrease = 0.3f; public const float DiseaseMoveSpeedMultiplier = 0.85f; public const float EmpoweredWolfHungerMultiplier = 0.75f; public const float EmpoweredMovementSpeed = 1.15f; public const float PortalSabotageStayActiveTime = 120f; public const float PortalSabotageReactivateTime = 10f; public const float PortalBonusMovementSpeed = 1.2f; public const float PortalMaximumHealthGainOnPass = 0.35f; public const float CursedNightFogEndDistanceMultiplier = 0.65f; public const float CursedNightDefaultCurseCooldown = 100f; public const float LaboratoryLightsFogEndDistance = 17.5f; public const float MayorActionStunDuration = 7f; public const float MayorActionStunCooldown = 15f; public const float MayorActionListenDuration = 8f; public const float MayorActionListenCooldown = 25f; public const float MayorActionSpeechDuration = 8f; public const float MayorActionSpeechCooldown = 25f; public const float EventHarvestLootMultiplier = 1.75f; public const float EventHarvestItemsMultiplier = 1.75f; public const float EventHarvestAccessoriesMultiplier = 1.75f; public const float EventHasteHumanMoveSpeedMultiplier = 1.35f; public const float EventHasteWolfMoveSpeedMultiplier = 1.25f; public const float EventFogCamouflageDuration = 30f; public const float EventFogCamouflageMinimumDelay = 50f; public const float EventFogCamouflageMaximumDelay = 90f; public static Color EventFogFogColor = new Color(0f, 0f, 0.5f, 0.1f); public const float EventFogFogMaximumDistance = 40f; public const float EventSpellstormChanceEachSecondForEachPlayer = 0.01f; public static Color EventSpellstormFogColor = new Color(0.5f, 0f, 0.5f, 0.1f); public const float EventSpellstormFogMaximumDistance = 70f; public const float EventEclipseWolfMoveSpeedMultiplier = 0.86f; public const float EventEclipseMinimumHumanHealthPercentage = 0.35f; public static Color EventEclipseFogColor = new Color(0f, 0f, 0f, 0.1f); public const float EventEclipseFogMaximumDistance = 60f; public const float EventPlagueHungerGainPerSecond = 0.4f; public const float EventPlagueHungerLossAtZeroDistance = 12f; public const float EventPlagueHungerLossAtMaxDistance = 2.25f; public const float EventPlagueHungerRange = 12f; public static Color EventPlagueFogColor = new Color(0f, 0.5f, 0f, 1f); public const float EventPlagueFogMaximumDistance = 65f; public const float PlayerRaycastRange = 10f; public const float PlayerRaycastRangeWhenInvisible = 3.5f; public const float PlayerRaycastRangeWhenHiddenWithPeasant = 2.25f; public const float TrapSetupTime = 1f; public const float TrapDisarmTime = 2.5f; public const float TrapDisarmTimeInWolfForm = 5f; public const int SmokeBoostedRadius = 4000; public const float MaxSpeedBase = 1.5f; public const int WolfRecuperateMillisecondsToStart = 4000; public const float WolfRecuperateHealthIncrease = 2f; public const float VillagerRecuperateHealthIncrease = 1.2f; public const float WolfHealthPercentageAfterShotByHunter = 0.125f; public const float WolfTenacityMaximumRatio = 0.16f; public const float WolfTenacityMovementSpeedMultiplier = 1.2f; public const float WolfTenacityHungerMultiplier = 0.7f; public const float WolfTenacityRecuperateEffectivenessMultiplier = 2f; public const float WolfTenacityNegativeEffectsDurationMultiplier = 0.66f; public const float WolfHubrisMinimumRatio = 0.31f; public const float WolfHubrisMovementSpeedMultiplier = 0.92f; public const float WolfHubrisHungerMultiplier = 1.08f; public const float WolfHubrisPositiveEffectsDurationMultiplier = 0.75f; public const float WolfCamouflageLevel1DetectionMultiplier = 0.9f; public const float WolfCamouflageLevel2DetectionMultiplier = 0.8f; public const float WolfCamouflageLevel3DetectionMultiplier = 0.7f; public const int ItemChanceTrap = 10; public const int ItemChanceSmoke = 10; public const int ItemChanceSpyglass = 10; public const int ItemChanceLock = 10; public const int ItemChanceScroll = 14; public const int ItemChanceDiamond = 7; public const int ItemChanceGrenade = 8; public const int ItemChanceGas = 6; public const int ItemChanceMolotov = 8; public const int ItemChanceRadar = 7; public const float AmogusModeKillRange = 5f; public const float AmogusModeKillCooldown = 30f; public const float AmogusModeReportRange = 10f; public const int AmogusBaseLootsSpawn = 5; public const int AmogusBaseIntervalBetweenLoots = 60; public static Dictionary FogEndDistanceDaytimeByFogConfigPercentage = new Dictionary { { 0, 300f }, { 10, 300f }, { 20, 300f }, { 30, 300f }, { 40, 300f }, { 50, 300f }, { 60, 300f }, { 70, 300f }, { 80, 300f }, { 90, 300f }, { 100, 300f } }; public static Dictionary FogEndDistanceNightByFogConfigPercentage = new Dictionary { { 0, 300f }, { 10, 150f }, { 20, 125f }, { 30, 100f }, { 40, 80f }, { 50, 65f }, { 60, 55f }, { 70, 45f }, { 80, 35f }, { 90, 26f }, { 100, 18f } }; public const int FogBonusEndDistanceForWolfForm = 25; public static int BeastMarkCooldown => Mathf.RoundToInt(60f - (float)PlayerRegistry.Count * 3f); public static float CurrentLootProgress => (float)GameManager.Instance.Score / (float)GameManager.Instance.MaxScore; public static float CultistSkullCreationCooldown(int currentSkulls) { return currentSkulls switch { 0 => 20f, 1 => 20f, 2 => 40f, 3 => 80f, 4 => 125f, 5 => 175f, _ => 175f, }; } public static float CultistChargeGainMultiplierForPlayersAmount(int livingPlayers) { return livingPlayers switch { 6 => 0.4f, 7 => 0.45f, 8 => 0.5f, 9 => 0.55f, 10 => 0.6f, 11 => 0.68f, 12 => 0.76f, 13 => 0.84f, 14 => 0.92f, 15 => 1f, _ => 0.4f, }; } public static float PossessorMaximumRangeByMap(int mapId) { return 25f * DistanceMultiplierByMap(mapId); } public static int GetMerchantOfferTypePonderation(MerchantOffer.MerchantOfferType type) { return type switch { MerchantOffer.MerchantOfferType.Scroll => 2, MerchantOffer.MerchantOfferType.OtherGadget => 4, MerchantOffer.MerchantOfferType.Potion => 2, MerchantOffer.MerchantOfferType.ImmediateEffect => 4, MerchantOffer.MerchantOfferType.PriestProtection => 1, MerchantOffer.MerchantOfferType.Heal => 1, _ => 0, }; } public static int? GetMerchantCostForPotionEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 20; } if (effect is NightVision) { return 15; } if (effect is SatiatedEffect) { return 20; } if (effect is SpeedEffect) { return 20; } if (effect is MidasEffect) { return 15; } if (effect is AssassinEffect) { return 40; } if (effect is ClairvoyanceEffect) { return 20; } if (effect is CamouflageEffect) { return 15; } if (effect is GiantEffect) { return 15; } if (effect is TeleportationEffect) { return 10; } if (effect is VampireEffect) { return 10; } if (effect is TinyEffect) { return 10; } if (effect is HauntedEffect) { return 10; } if (effect is ChaosEffect) { return 15; } if (effect is StinkingEffect) { return 10; } if (effect is FlatulenceEffect) { return null; } if (effect is GlowingEffect) { return null; } if (effect is ParanoiaEffect) { return null; } if (effect is DeafnessEffect) { return null; } if (effect is NearsightedEffect) { return null; } if (effect is MuteEffect) { return null; } if (effect is ConfusedEffect) { return null; } return null; } public static int GetMerchantCostForScrollEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 20; } if (effect is NightVision) { return 15; } if (effect is SatiatedEffect) { return 20; } if (effect is SpeedEffect) { return 20; } if (effect is ClairvoyanceEffect) { return 20; } if (effect is CamouflageEffect) { return 15; } if (effect is GiantEffect) { return 15; } if (effect is TeleportationEffect) { return 10; } if (effect is VampireEffect) { return 10; } if (effect is HauntedEffect) { return 10; } if (effect is ChaosEffect) { return 15; } if (effect is FlatulenceEffect) { return 10; } if (effect is ParanoiaEffect) { return 10; } if (effect is DeafnessEffect) { return 10; } if (effect is NearsightedEffect) { return 10; } if (effect is MuteEffect) { return 10; } if (effect is ConfusedEffect) { return 10; } return 10; } public static int? GetMerchantCostForImmediateEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 25; } if (effect is NightVision) { return 20; } if (effect is SatiatedEffect) { return 25; } if (effect is SpeedEffect) { return 25; } if (effect is MidasEffect) { return 20; } if (effect is AssassinEffect) { return 40; } if (effect is ClairvoyanceEffect) { return 25; } if (effect is CamouflageEffect) { return 15; } if (effect is GiantEffect) { return 20; } if (effect is TeleportationEffect) { return 15; } if (effect is VampireEffect) { return 15; } if (effect is TinyEffect) { return 15; } if (effect is HauntedEffect) { return 10; } if (effect is ChaosEffect) { return 15; } if (effect is StinkingEffect) { return 10; } if (effect is FlatulenceEffect) { return null; } if (effect is GlowingEffect) { return null; } if (effect is ParanoiaEffect) { return null; } if (effect is DeafnessEffect) { return null; } if (effect is NearsightedEffect) { return null; } if (effect is MuteEffect) { return null; } if (effect is ConfusedEffect) { return null; } return null; } public static int MediumAdditionalPlayersToAdd(int livingPlayersCount) { if (livingPlayersCount <= 5) { return 1; } if (livingPlayersCount <= 9) { return 2; } return 3; } public static int GetVillagerJobChancePonderation(PlayerCustom.PlayerPrimaryRolePower power) { return power switch { PlayerCustom.PlayerPrimaryRolePower.Peasant => 3, PlayerCustom.PlayerPrimaryRolePower.Exorcist => 3, PlayerCustom.PlayerPrimaryRolePower.Avenger => 2, PlayerCustom.PlayerPrimaryRolePower.Investigator => 3, PlayerCustom.PlayerPrimaryRolePower.Survivalist => 3, PlayerCustom.PlayerPrimaryRolePower.Priest => 3, PlayerCustom.PlayerPrimaryRolePower.Scout => 3, PlayerCustom.PlayerPrimaryRolePower.Magician => 3, PlayerCustom.PlayerPrimaryRolePower.Mystic => 2, PlayerCustom.PlayerPrimaryRolePower.Shadow => 2, PlayerCustom.PlayerPrimaryRolePower.Hermit => 3, PlayerCustom.PlayerPrimaryRolePower.Avatar => 0, _ => 0, }; } public static int DetectiveOneIsEvilPlayersToAdd(int livingPlayersCount) { if (livingPlayersCount <= 8) { return 2; } return 3; } public static float ExorcistChargeMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.65f, "map_dungeon" => 0.85f, "map_haddoncans" => 1f, "map_apartcan" => 0.9f, "map_laboratory" => 1f, "map_got" => 0.8f, _ => 1f, }; } public static float DetectiveMaximumRangeByMap(int mapId) { return 15f * DistanceMultiplierByMap(mapId); } public static int? GetCastTimeForSecondaryRole(PlayerCustom.PlayerSecondaryRole role) { return role switch { PlayerCustom.PlayerSecondaryRole.BothTeleporter => 3, PlayerCustom.PlayerSecondaryRole.BothMedium => 3, PlayerCustom.PlayerSecondaryRole.BothScavenger => 2, _ => null, }; } public static int? GetCooldownForPrimaryRolePower(PlayerCustom.PlayerPrimaryRolePower role, int totalCycleTime) { return role switch { PlayerCustom.PlayerPrimaryRolePower.Warlock => 5 * totalCycleTime, PlayerCustom.PlayerPrimaryRolePower.Deceiver => 5 * totalCycleTime, PlayerCustom.PlayerPrimaryRolePower.Investigator => 30, PlayerCustom.PlayerPrimaryRolePower.Hermit => 20, PlayerCustom.PlayerPrimaryRolePower.Angel => 6 * totalCycleTime, _ => null, }; } public static PowerMaterialsInfo? GetMaterialsInfoForPrimaryRolePower(PlayerCustom.PlayerPrimaryRolePower power) { return power switch { PlayerCustom.PlayerPrimaryRolePower.Necromancer => new PowerMaterialsInfo(10000, 2f, 1.006f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Possessor => new PowerMaterialsInfo(10000, 1f, 0f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Bomber => new PowerMaterialsInfo(70, 2.5f, 0.506f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Ritualist => new PowerMaterialsInfo(10000, 1.5f, 0.256f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Saboteur => new PowerMaterialsInfo(10000, 3f, 0.506f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Tracker => new PowerMaterialsInfo(10000, 2f, 0.506f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Host => new PowerMaterialsInfo(40, 4f, 2.006f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Peasant => new PowerMaterialsInfo(10000, 1f, 0.506f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Avenger => new PowerMaterialsInfo(10000, 1.5f, 0.256f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Exorcist => new PowerMaterialsInfo(80, 1.5f, 1.056f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Priest => new PowerMaterialsInfo(100, 1.5f, 1.056f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Investigator => new PowerMaterialsInfo(100, 2f, 0.506f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Survivalist => new PowerMaterialsInfo(10000, 1.5f, 1.306f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Scout => new PowerMaterialsInfo(120, 1.5f, 1.256f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Magician => new PowerMaterialsInfo(40, 4f, 2.506f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Mystic => new PowerMaterialsInfo(10000, 1.5f, 0.756f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Shadow => new PowerMaterialsInfo(10000, 3f, 1.056f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Hermit => new PowerMaterialsInfo(200, 2f, 0.506f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Alchemist => new PowerMaterialsInfo(40, 5f, 2.006f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Spotter => new PowerMaterialsInfo(100, 3f, 1.5f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Purifier => new PowerMaterialsInfo(100, 3f, 1.5f, gainsMaterialsOnCollect: false, 0f), _ => null, }; } public static int? GetCooldownForSecondaryRole(PlayerCustom.PlayerSecondaryRole role, int totalCycleTime) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) return role switch { PlayerCustom.PlayerSecondaryRole.BothAlcoholic => 60, PlayerCustom.PlayerSecondaryRole.BothEngineer => NetworkBool.op_Implicit(Plugin.CustomConfig.DropItemsAvailable) ? 120 : 80, PlayerCustom.PlayerSecondaryRole.BothGambler => 150, PlayerCustom.PlayerSecondaryRole.BothIllusionist => 90, PlayerCustom.PlayerSecondaryRole.BothInfected => 90, PlayerCustom.PlayerSecondaryRole.BothMetabolic => 8 * totalCycleTime, PlayerCustom.PlayerSecondaryRole.BothSherif => 120, PlayerCustom.PlayerSecondaryRole.BothAstral => 5, PlayerCustom.PlayerSecondaryRole.BothSprinter => 90, PlayerCustom.PlayerSecondaryRole.BothTeleporter => 120, PlayerCustom.PlayerSecondaryRole.BothScavenger => 30, PlayerCustom.PlayerSecondaryRole.BothActor => 30, PlayerCustom.PlayerSecondaryRole.BothScribe => 60, PlayerCustom.PlayerSecondaryRole.BothCarabineer => 60, PlayerCustom.PlayerSecondaryRole.BothForger => 120, _ => null, }; } public static int? GetSecondCooldownForSecondaryRole(PlayerCustom.PlayerSecondaryRole role, int totalCycleTime) { return role switch { PlayerCustom.PlayerSecondaryRole.BothScribe => 20, PlayerCustom.PlayerSecondaryRole.BothForger => 40, _ => null, }; } public static ModifiedEffectData GetModifiedEffectData(Effect effect) { if (effect is AuditionEffect) { return new ModifiedEffectData(0, 60, null, null); } if (effect is InvisibilityEffect) { return new ModifiedEffectData(1, 120, 25f, 25f); } if (effect is NightVision) { return new ModifiedEffectData(2, 90, 45f, null); } if (effect is SatiatedEffect) { return new ModifiedEffectData(3, 60, 30f, null); } if (effect is SpeedEffect) { return new ModifiedEffectData(4, 120, 30f, 30f); } if (effect is MidasEffect) { return new ModifiedEffectData(5, 90, null, null); } if (effect is AssassinEffect) { return new ModifiedEffectData(6, 120, 0f, 0f); } if (effect is StinkingEffect) { return new ModifiedEffectData(7, 60, null, null); } if (effect is ClairvoyanceEffect) { return new ModifiedEffectData(8, 75, 30f, 45f); } if (effect is GiantEffect) { return new ModifiedEffectData(9, 90, 10f, 20f); } if (effect is TeleportationEffect) { return new ModifiedEffectData(10, 75, 15f, 15f); } if (effect is VampireEffect) { return new ModifiedEffectData(11, 75, 45f, 45f); } if (effect is TinyEffect) { return new ModifiedEffectData(12, 120, 12f, null); } if (effect is HauntedEffect) { return new ModifiedEffectData(13, 60, null, null); } if (effect is ChaosEffect) { return new ModifiedEffectData(14, 75, null, null); } if (effect is FlatulenceEffect) { return new ModifiedEffectData(15, 60, null, null); } if (effect is GlowingEffect) { return new ModifiedEffectData(16, 60, null, 0f); } if (effect is ParanoiaEffect) { return new ModifiedEffectData(17, 45, null, null); } if (effect is DeafnessEffect) { return new ModifiedEffectData(18, 60, null, null); } if (effect is NearsightedEffect) { return new ModifiedEffectData(19, 60, null, null); } if (effect is MuteEffect) { return new ModifiedEffectData(20, 60, null, null); } return new ModifiedEffectData(99, 60, null, null); } public static int EnergizedMaterialsGainByPower(PlayerCustom.PlayerPrimaryRolePower power) { return power switch { PlayerCustom.PlayerPrimaryRolePower.Alchemist => 2, PlayerCustom.PlayerPrimaryRolePower.Avenger => 50, PlayerCustom.PlayerPrimaryRolePower.Bomber => 2, PlayerCustom.PlayerPrimaryRolePower.Exorcist => 2, PlayerCustom.PlayerPrimaryRolePower.Investigator => 1, PlayerCustom.PlayerPrimaryRolePower.Peasant => 100, PlayerCustom.PlayerPrimaryRolePower.Survivalist => 100, PlayerCustom.PlayerPrimaryRolePower.Priest => 2, PlayerCustom.PlayerPrimaryRolePower.Scout => 2, PlayerCustom.PlayerPrimaryRolePower.Magician => 2, PlayerCustom.PlayerPrimaryRolePower.Mystic => 100, PlayerCustom.PlayerPrimaryRolePower.Shadow => 200, PlayerCustom.PlayerPrimaryRolePower.Hermit => 2, PlayerCustom.PlayerPrimaryRolePower.Spotter => 3, PlayerCustom.PlayerPrimaryRolePower.Purifier => 3, PlayerCustom.PlayerPrimaryRolePower.Ritualist => 100, PlayerCustom.PlayerPrimaryRolePower.Saboteur => 200, PlayerCustom.PlayerPrimaryRolePower.Tracker => 100, PlayerCustom.PlayerPrimaryRolePower.Host => 2, _ => 0, }; } public static int AgentMaxSurvivorsToWin(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: return 2; case 8: case 9: case 10: case 11: case 12: return 3; case 13: case 14: case 15: return 4; default: return 4; } } public static int SpyGoal(int totalPlayers) { return 10000; } public static float SpyMaximumRange(int mapId) { return 25f * DistanceMultiplierByMap(mapId); } public static int BeastTargetAmount(int survivingPlayers) { return Mathf.CeilToInt((float)survivingPlayers * 0.6f); } public static int ScientistGoal(int totalPlayers) { return Mathf.RoundToInt((float)(PlayerRegistry.Count * 500)); } public static int VoodooReanimationCooldown(int zombiesCount, int totalPlayers) { float num = Mathf.Lerp(1f, 0.5f, CurrentLootProgress); return Mathf.RoundToInt((float)VoodooBaseCooldown(totalPlayers) * num * (1f + (float)zombiesCount * 0.5f)); } public static int VoodooBaseCooldown(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: return 200; case 10: return 180; case 11: return 160; case 12: return 145; case 13: return 130; case 14: return 115; case 15: return 100; default: return 100; } } public static int MercenaryTotalObjective(int lootMultiplier, float configMultiplier, int totalCycleTime, float soloRoleDifficulty) { return Mathf.RoundToInt((float)(totalCycleTime * lootMultiplier) * configMultiplier * soloRoleDifficulty * 18f); } public static int KidnapperFinalCooldown(int abductsCount, int abductsObjective, int remainingLivingPlayers, int totalPlayers) { float num = KidnapperBaseCooldown(totalPlayers); float num2 = (float)abductsCount / (float)abductsObjective; float num3 = Mathf.Lerp(0.5f, 2f, num2); float num4 = (float)remainingLivingPlayers / (float)totalPlayers; float num5 = Mathf.Lerp(0.15f, 1.8f, num4); return Mathf.RoundToInt(num * num3 * num5); } public static int KidnapperTargetAmount(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: return 3; case 12: case 13: case 14: case 15: return 4; default: return 4; } } public static int KidnapperBaseCooldown(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: return 65; case 7: return 70; case 8: return 75; case 9: return 80; case 10: return 85; case 11: return 90; case 12: return 60; case 13: return 65; case 14: return 70; case 15: return 75; default: return 70; } } public static int CultistTargetAmount(int survivingPlayers) { return Mathf.CeilToInt((float)survivingPlayers * 0.75f); } public static bool IsValidEffectForScroll(Effect effect) { return effect is AuditionEffect || effect is InvisibilityEffect || effect is NightVision || effect is SatiatedEffect || effect is SpeedEffect || effect is ClairvoyanceEffect || effect is EnergizedEffect || effect is CamouflageEffect || effect is GiantEffect || effect is TeleportationEffect || effect is VampireEffect || effect is HauntedEffect || effect is ChaosEffect || effect is GlowingEffect || effect is FlatulenceEffect || effect is ParanoiaEffect || effect is DeafnessEffect || effect is NearsightedEffect || effect is MuteEffect || effect is ConfusedEffect; } public static int GetScrollCharges(Effect effect) { if (!(effect is AuditionEffect)) { if (!(effect is InvisibilityEffect)) { if (!(effect is NightVision)) { if (!(effect is SatiatedEffect)) { if (!(effect is SpeedEffect)) { if (!(effect is ClairvoyanceEffect)) { if (!(effect is EnergizedEffect)) { if (!(effect is CamouflageEffect)) { if (!(effect is GiantEffect)) { if (!(effect is TeleportationEffect)) { if (!(effect is VampireEffect)) { if (!(effect is HauntedEffect)) { if (!(effect is ChaosEffect)) { if (!(effect is GlowingEffect)) { if (!(effect is FlatulenceEffect)) { if (!(effect is ParanoiaEffect)) { if (!(effect is DeafnessEffect)) { if (!(effect is NearsightedEffect)) { if (!(effect is MuteEffect)) { if (effect is ConfusedEffect) { return 2; } return 1; } return 2; } return 2; } return 2; } return 2; } return 2; } return 2; } return 1; } return 2; } return 1; } return 1; } return 1; } return 1; } return 1; } return 1; } return 1; } return 1; } return 2; } return 1; } return 2; } public static float SleepingGasRadiusByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.5f, "map_dungeon" => 1f, "map_haddoncans" => 0.6f, "map_apartcan" => 0.65f, "map_laboratory" => 0.85f, "map_got" => 0.6f, _ => 1f, }; } public static int AccessoriesAmountToSpawn(int configItemsCount, int livingPlayersWithoutAccessory) { float num = (float)livingPlayersWithoutAccessory * (float)configItemsCount / 7f; int num2 = Mathf.FloorToInt(num); if (Random.value < num % 1f) { num2++; } return num2; } public static bool WolvesHaveTenacity() { int num = 0; num = LivingWolves() switch { 1 => 5, 2 => 11, _ => 20, }; if (PlayerCustomRegistry.Any((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Traitor)) { num = Mathf.RoundToInt((float)num * 1.5f); } return LivingPlayers() >= num; } public static bool WolvesHaveHubris() { int num = 0; num = LivingWolves() switch { 1 => 0, 2 => 6, _ => 10, }; if (PlayerCustomRegistry.Any((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Traitor)) { num = Mathf.RoundToInt((float)num * 0.7f); } return LivingPlayers() <= num; } public static int LivingWolves() { return PlayerCustomRegistry.CountWhere((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead) && (int)o.PlayerController.Role == 1 && !NetworkBool.op_Implicit(o.Resurrected)); } public static int LivingPlayers() { return PlayerCustomRegistry.CountWhere((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead) && !NetworkBool.op_Implicit(o.Resurrected)); } public static float DistanceMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.6f, "map_dungeon" => 1f, "map_haddoncans" => 0.6f, "map_apartcan" => 0.75f, "map_laboratory" => 0.75f, "map_got" => 0.65f, _ => 1f, }; } public static float WolfKillSoundRangeByMap(int mapId) { return 30f * DistanceMultiplierByMap(mapId); } public static float NightFogEndDistanceMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.6f, "map_dungeon" => 1f, "map_haddoncans" => 0.5f, "map_apartcan" => 0.65f, "map_laboratory" => 0.6f, "map_got" => 0.6f, _ => 1f, }; } public static float ScoutRadarRadiusMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.45f, "map_dungeon" => 1.15f, "map_haddoncans" => 0.6f, "map_apartcan" => 0.7f, "map_laboratory" => 0.8f, "map_got" => 0.6f, _ => 1f, }; } public static float ScientistPowerMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1.5f, "map_dungeon" => 1.5f, "map_haddoncans" => 1f, "map_apartcan" => 1.4f, "map_laboratory" => 1.5f, "map_got" => 1.4f, _ => 1f, }; } public static float BeastHeartbeatMaximumRange(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 12f, "map_2" => 9f, "map_dungeon" => 12f, "map_haddoncans" => 9f, "map_apartcan" => 12f, "map_laboratory" => 12f, "map_got" => 9f, _ => 12f, }; } public static float FallingHeightMultiplierForDamage(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 0.2f, "map_2" => 0.2f, "map_dungeon" => 1f, "map_haddoncans" => 1.75f, "map_apartcan" => 1f, "map_laboratory" => 1f, "map_got" => 1f, _ => 1f, }; } public static float GravityMultiplier(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1f, "map_dungeon" => 1f, "map_haddoncans" => 1f, "map_apartcan" => 1f, "map_laboratory" => 0.5f, "map_got" => 0.75f, _ => 1f, }; } public static float LootGenerationMultiplier(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1f, "map_dungeon" => 1.15f, "map_haddoncans" => 1f, "map_apartcan" => 1f, "map_laboratory" => 1f, "map_got" => 1f, _ => 1f, }; } public static int MerchantTotalCoinsOnMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 7, "map_2" => 7, "map_dungeon" => 8, "map_haddoncans" => 6, "map_apartcan" => 6, "map_laboratory" => 8, "map_got" => 7, _ => 8, }; } public static bool ShowMinimapArrowsOnMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => false, "map_2" => true, "map_dungeon" => false, "map_haddoncans" => false, "map_apartcan" => false, "map_laboratory" => true, "map_got" => true, _ => false, }; } } public class PowerMaterialsInfo { public int RequiredMaterials; public float MaximumMaterialsPercentage; public float StartingMaterialsPercentage; public bool GainsMaterialOnCollect; public float BonusMultiplierAtFullHealth; public PowerMaterialsInfo(int requiredMaterials, float maximumMaterialsPercentage, float startingMaterialsPercentage, bool gainsMaterialsOnCollect, float bonusMultiplierAtFullHealth) { RequiredMaterials = requiredMaterials; MaximumMaterialsPercentage = maximumMaterialsPercentage; StartingMaterialsPercentage = startingMaterialsPercentage; GainsMaterialOnCollect = gainsMaterialsOnCollect; BonusMultiplierAtFullHealth = bonusMultiplierAtFullHealth; } } [NetworkBehaviourWeaved(20)] public class BeastManager : NetworkBehaviour { private float DelayToNextHeartbeat; private const float DelaySoundSlow = 2.1f; private const float DelaySoundMid = 1.42f; private const float DelaySoundFast = 0.9f; [Networked(OnChanged = "BeastActiveChanged")] [NetworkedWeaved(0, 1)] public unsafe NetworkBool BeastActive { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastActive. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)(*base.Ptr); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastActive. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } [Networked(OnChanged = "BeastKillsChanged")] [NetworkedWeaved(1, 1)] public unsafe int BeastKills { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKills. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[1]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKills. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[1] = value; } } [Networked] [NetworkedWeaved(2, 1)] public unsafe int BeastKillsObjective { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKillsObjective. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[2]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKillsObjective. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[2] = value; } } public static BeastManager Instance { get; private set; } public void Reset() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) BeastActive = NetworkBool.op_Implicit(false); BeastKills = 0; BeastKillsObjective = 0; } public override void Spawned() { ((NetworkBehaviour)this).Spawned(); Instance = this; } public override void Despawned(NetworkRunner runner, bool hasState) { ((NetworkBehaviour)this).Despawned(runner, hasState); Instance = null; } private void Update() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) if (!NetworkBool.op_Implicit(BeastActive)) { return; } if (DelayToNextHeartbeat <= 0f) { float num = BalancingValues.BeastHeartbeatMaximumRange(GameManager.Instance.MapID); float num2 = num * 0.7f; float num3 = num * 0.4f; PlayerCustom povPlayerCustom = PlayerCustomRegistry.GetPlayer(PlayerController.Local.LocalCameraHandler.PovPlayer.Ref); if (povPlayerCustom.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Beast) { List list = PlayerRegistry.Where((Predicate)((PlayerController o) => o.Ref != povPlayerCustom.Ref && !NetworkBool.op_Implicit(o.IsDead))).ToList(); PlayerController val = null; float? num4 = null; foreach (PlayerController item in list) { float num5 = Vector3.Distance(((Component)povPlayerCustom.PlayerController).transform.position, ((Component)item).transform.position); if (!num4.HasValue || num5 < num4.Value) { val = item; num4 = num5; } } if ((Object)(object)val != (Object)null && num4.Value <= num) { string text; float delayToNextHeartbeat; if (num4.Value > num2) { text = "BeastHeartBeatSlow"; delayToNextHeartbeat = 2f; } else if (num4.Value > num3) { text = "BeastHeartBeatMid"; delayToNextHeartbeat = 1.337f; } else { text = "BeastHeartBeatFast"; delayToNextHeartbeat = 0.841f; } AudioManager.PlayAndFollow(text, ((Component)val).transform, (MixerTarget)2, num, 0.8f); DelayToNextHeartbeat = delayToNextHeartbeat; } else { DelayToNextHeartbeat = 0.5f; } return; } PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast); float num6 = Vector3.Distance(((Component)povPlayerCustom.PlayerController).transform.position, ((Component)specificNewPrimaryRole.PlayerController).transform.position); if (num6 <= num) { string text2; float delayToNextHeartbeat2; if (num6 > num2) { text2 = "BeastHeartBeatSlow"; delayToNextHeartbeat2 = 2f; } else if (num6 > num3) { text2 = "BeastHeartBeatMid"; delayToNextHeartbeat2 = 1.337f; } else { text2 = "BeastHeartBeatFast"; delayToNextHeartbeat2 = 0.841f; } AudioManager.Play(text2, (MixerTarget)2, 0.65f, 1f); DelayToNextHeartbeat = delayToNextHeartbeat2; } else { DelayToNextHeartbeat = 0.5f; } } else { DelayToNextHeartbeat -= Time.deltaTime; } } public void ActivateBeast() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) BeastActive = NetworkBool.op_Implicit(true); foreach (PlayerController item in PlayerRegistry.Where((Predicate)((PlayerController o) => NetworkBool.op_Implicit(o.IsWolf) && !NetworkBool.op_Implicit(o.IsDead)))) { item.IsWolf = NetworkBool.op_Implicit(false); item.Hunger = GameManager.Instance.MaxHunger; } } [Preserve] public static void BeastActiveChanged(Changed changed) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) try { BeastManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.BeastActive)) { int num = BalancingValues.BeastTargetAmount(PlayerRegistry.CountWhere((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) - 1); PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast); if (((SimulationBehaviour)behaviour).Runner.IsServer) { behaviour.BeastKillsObjective = num; specificNewPrimaryRole.PlayerController.Hunger = GameManager.Instance.MaxHunger; Traverse.Create((object)specificNewPrimaryRole.PlayerController).Property("WolfDelay", (object[])null).SetValue((object)TickTimer.CreateFromSeconds(((SimulationBehaviour)behaviour).Runner, 7f)); specificNewPrimaryRole.PlayerController.TransformedNight = NetworkBool.op_Implicit(true); specificNewPrimaryRole.PlayerController.IsWolf = NetworkBool.op_Implicit(true); specificNewPrimaryRole.PlayerController.MovementAction = 0; specificNewPrimaryRole.PlayerController.CanMoveAnimation = NetworkBool.op_Implicit(false); specificNewPrimaryRole.PlayerController.IsZooming = NetworkBool.op_Implicit(false); GameManager.Rpc_BroadcastFollowSound(((SimulationBehaviour)behaviour).Runner, NetworkString<_16>.op_Implicit("BeastAwakening"), ((Component)specificNewPrimaryRole.PlayerController).transform.position, 50f, 0.8f); } Traverse.Create((object)specificNewPrimaryRole.PlayerController).Field("smokeParticleSystem").Value.Play(); PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.LocalCameraHandler.PovPlayer.Ref); if (player.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Beast) { UIManager.ShowRedCenterMessage("NALES_UI_BEAST_UNLEASHED_BEAST", 0.5f, 5f, new List { num }); } else { UIManager.ShowRedCenterMessage("NALES_UI_BEAST_UNLEASHED_OTHERS", 0.5f, 4f); } } } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorIndexChanged error: " + ex)); } } [Preserve] public static void BeastKillsChanged(Changed changed) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) try { BeastManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.BeastActive) && ((SimulationBehaviour)behaviour).Runner.IsServer && behaviour.BeastKills >= behaviour.BeastKillsObjective) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)behaviour).Runner, PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast).Index); } } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorIndexChanged error: " + ex)); } } } [HarmonyPatch(typeof(Effect), "Init")] internal class BeastReducedNegativeEffectsDurationPatch { private static bool Prefix(PlayerRef targetPlayer, Effect __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) try { PlayerController player = PlayerRegistry.GetPlayer(targetPlayer); PlayerCustom.ApplyEffectToPlayer(player, __instance, ((SimulationBehaviour)__instance).Runner); return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("BeastReducedNegativeEffectsDurationPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(NetworkRunnerHandler), "StartSession")] internal class StartSessionPatch { private static void Prefix(ref int playerCount) { try { playerCount = 15; } catch (Exception ex) { Plugin.Logger.LogError((object)("CreateGamePatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerRegistry), "GetAvailable")] internal class PlayerRegistryPatch { private static bool Prefix(PlayerRegistry __instance, ref bool __result, out byte index) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) try { NetworkDictionary value = Traverse.Create((object)__instance).Property>("ObjectByRef", (object[])null).Value; if (value.Count == 0) { index = 0; __result = true; return false; } if (value.Count == 15) { index = 0; __result = false; return false; } byte[] array = ((IEnumerable>)(object)value).OrderBy(delegate(KeyValuePair kvp) { KeyValuePair keyValuePair2 = kvp; return keyValuePair2.Value.Index; }).Select(delegate(KeyValuePair kvp) { KeyValuePair keyValuePair = kvp; return keyValuePair.Value.Index; }).ToArray(); for (int i = 0; i < array.Length - 1; i++) { if (array[i + 1] > array[i] + 1) { index = (byte)(array[i] + 1); __result = true; return false; } } index = (byte)(array[^1] + 1); __result = true; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("PlayerRegistryPatch error: " + ex)); index = 0; return true; } } } [HarmonyPatch(typeof(GameUI), "UpdatePlayerCount")] internal class UpdatePlayerCountPatch { private static bool Prefix(int count, GameUI __instance) { try { ((TMP_Text)Traverse.Create((object)__instance).Field("playerCount").Value).text = count + "/15"; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("UpdatePlayerCountPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(ColorManager), "Awake")] internal class ColorManagerPatch { private static void Postfix(ColorManager __instance) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) try { List list = Traverse.Create((object)__instance).Field("villagerTextures").Value.ToList(); List list2 = Traverse.Create((object)__instance).Field("colors").Value.ToList(); list.Add(list[0]); list.Add(list[1]); list.Add(list[2]); list2.Add(list2[0]); list2.Add(list2[1]); list2.Add(list2[2]); Traverse.Create((object)__instance).Field("villagerTextures").SetValue((object)list.ToArray()); Traverse.Create((object)__instance).Field("colors").SetValue((object)list2.ToArray()); } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorManagerPatch error: " + ex)); } } } [HarmonyPatch(typeof(GameManager), "GetSpawnPosition")] internal class SpawnPositionPatch { private static bool Prefix(PlayerController playerController, GameManager __instance, ref Vector3 __result) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) try { float num = 24f; float num2 = (float)(int)playerController.Index * num; Vector3 val = Quaternion.Euler(0f, num2, 0f) * Vector3.forward * Traverse.Create((object)__instance).Field("radius").Value; __result = Traverse.Create((object)__instance).Field("mapSpawns").Value[__instance.MapID - 1].position + val; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("SpawnPositionPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(LocalCameraHandler), "UpdateAnchorOffset")] internal class TinyEffectLocalCameraHandlerPatch { private static void Postfix(LocalCameraHandler __instance) { //IL_0002: 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_003b: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) try { if ((int)GameManager.LocalGameState == 0 || !((Object)(object)__instance.PovPlayer != (Object)null) || NetworkBool.op_Implicit(__instance.PovPlayer.IsDead)) { return; } PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); Traverse val = Traverse.Create((object)__instance).Field("_giant"); if (val.Value != NetworkBool.op_Implicit(player.Tiny)) { Transform value = Traverse.Create((object)__instance).Field("localCameraAnchorPoint").Value; int value2 = Traverse.Create((object)__instance).Field("_movementStatus").Value; Traverse val2 = Traverse.Create((object)__instance).Field("_isWolf"); float value3 = Traverse.Create((object)__instance).Field("_baseCameraOffset").Value; int movementAction = __instance.PovPlayer.MovementAction; bool flag = NetworkBool.op_Implicit(__instance.PovPlayer.IsWolf); bool flag2 = NetworkBool.op_Implicit(__instance.PovPlayer.PlayerEffectManager.Giant); bool flag3 = NetworkBool.op_Implicit(player.Tiny); float num = ((movementAction == 1) ? (value3 - 0.5f) : value3); if (flag) { num = (flag3 ? ((movementAction == 1) ? 0.35f : 0.5f) : ((!flag2) ? (num + 0.25f) : ((movementAction == 1) ? 7.2f : 10.2f))); } else if (flag2) { num = ((movementAction == 1) ? 7.2f : 10.2f); } else if (flag3) { num = ((movementAction == 1) ? 0.09f : 0.12f); } Vector3 localPosition = value.localPosition; ((Vector3)(ref localPosition))..ctor(localPosition.x, num, localPosition.z); value.localPosition = localPosition; value2 = movementAction; val2.Value = flag; val.Value = flag2 || flag3; } } catch (Exception ex) { Plugin.Logger.LogError((object)("TinyEffectLocalCameraHandlerPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerController), "UpdateCameraAnchorOffset")] internal class CameraAnchorPatch { private static void Postfix(PlayerController __instance) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) try { PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.Ref); if (NetworkBool.op_Implicit(player.Tiny)) { float num = ((__instance.MovementAction == 1) ? 0.09f : 0.12f); Transform value = Traverse.Create((object)__instance).Field("cameraAnchorPoint").Value; Vector3 localPosition = value.localPosition; ((Vector3)(ref localPosition))..ctor(localPosition.x, num, localPosition.z); value.localPosition = localPosition; } } catch (Exception ex) { Plugin.Logger.LogError((object)("CameraAnchorPatch error: " + ex)); } } } [HarmonyPatch(typeof(LocalCameraHandler), "LateUpdate")] internal class LocalCameraHandlerLateUpdatePatch { private static bool Prefix(LocalCameraHandler __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_002b: 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_004d: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) try { if (!((Behaviour)__instance.LocalCamera).enabled || (int)GameManager.LocalGameState == 0) { return false; } if (NetworkBool.op_Implicit(PlayerCustom.Local.Dying) || NetworkBool.op_Implicit(PlayerCustom.Local.Downed) || NetworkBool.op_Implicit(PlayerCustom.Local.Asleep) || NetworkBool.op_Implicit(PlayerCustom.Local.Banished) || NetworkBool.op_Implicit(PlayerCustom.Local.CapturedByCultist) || (PlayerCustom.Local.SecondaryRole == PlayerCustom.PlayerSecondaryRole.BothActor && NetworkBool.op_Implicit(PlayerCustom.Local.SecondaryRolePowerActive))) { return false; } if (UIManager.GenericChoicePanel.Active) { if ((Object)(object)__instance.PovPlayer != (Object)null && __instance.PovPlayer.Ref == PlayerController.Local.Ref) { ((Component)__instance.LocalCamera).transform.position = Traverse.Create((object)__instance).Field("localCameraAnchorPoint").Value.position; } return false; } if ((Object)(object)__instance.PovPlayer == (Object)null) { return true; } if (__instance.PovPlayer.Ref == PlayerController.Local.Ref) { PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); if (player.ForcedRotationY != 0f) { Traverse obj = Traverse.Create((object)__instance).Field("_cameraRotationY"); obj.Value += player.ForcedRotationY * Time.deltaTime; } } return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("LocalCameraHandlerLateUpdatePatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(LocalCameraHandler), "SwitchPov")] internal class LocalCameraHandlerSwitchPoVPatch { private static bool Prefix(LocalCameraHandler __instance, PlayerController spectatedPlayer, out PlayerRef __state) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.PovPlayer == (Object)null) { __state = PlayerRef.None; return true; } if (PlayerCustom.Local.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Ghost || PlayerCustom.Local.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Specter) { __state = PlayerRef.None; return false; } if (NetworkBool.op_Implicit(PlayerCustom.Local.Kidnapped)) { PlayerCustom playerCustom = PlayerCustomRegistry.Where((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Kidnapper).FirstOrDefault(); GameManager.Instance.gameUI.UpdateSpectatedUsername(((object)playerCustom.PlayerController.PlayerData.Username).ToString(), playerCustom.PlayerController.Role); } __state = __instance.PovPlayer.Ref; return true; } private static void Postfix(LocalCameraHandler __instance, PlayerRef __state) { //IL_001d: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance.PovPlayer == (Object)null) { return; } PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); if ((Object)(object)player != (Object)null) { foreach (PlayerCustom allPlayer in PlayerCustomRegistry.AllPlayers) { allPlayer.UpdateVisibility(); allPlayer.UpdatePoacherMarkVisibility(); ((Component)allPlayer.PlayerController).GetComponent().UpdateState(); } } Plugin.Minimap.RefreshLegendsIfActive(); PlayerCustom.UpdateTeleporterBeaconOnMinimap(); if (__state != PlayerRef.None) { PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(__state); player2.UpdatePredatorComponent(); player2.UpdateTargetArrowComponent(); } player.UpdatePredatorComponent(); player.UpdateTargetArrowComponent(); ItemCustom.UpdateAllItems(); ExorcistDetector.UpdateVisibilityForAllDetectors(); ScoutRadar.UpdateVisibilityForAllRadars(); MagicianBeacon.UpdateVisibilityForAllBeacons(); MagicianIllusion.UpdateVisibilityForAllMagicianIllusions(); InvestigatorHint.UpdateVisibilityForAllHints(); SurvivalistHint.UpdateVisibilityForAllHints(); DiscipleAnchor.UpdateVisibilityForAllAnchors(); MysticRepulsor.UpdateVisibilityForAllRepulsors(); HermitHideout.UpdateVisibilityForAllHideouts(); if (UIManager.DetectivePanel.Active) { UIManager.DetectivePanel.Hide(); GameManager.Instance.gameUI.UpdateCursor(false); } } catch (Exception ex) { Plugin.Logger.LogError((object)("LocalCameraHandlerSwitchPoVPatch error: " + ex)); } } } [HarmonyPatch(typeof(LocalCameraHandler), "NextPov")] internal class LocalCameraHandlerNextPoVPatch { private static bool Prefix(LocalCameraHandler __instance, bool forward) { if (PlayerCustom.Local.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Ghost || PlayerCustom.Local.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Specter) { return false; } List list = (from o in PlayerCustomRegistry where !NetworkBool.op_Implicit(o.PlayerController.IsDead) && !NetworkBool.op_Implicit(o.PlayerController.IsDisconnected) && !o.IsOutOfTheWorld select o.PlayerController).ToList(); if (!list.Any()) { __instance.SwitchPov(PlayerController.Local); return false; } int num = list.IndexOf(__instance.PovPlayer); if (num > -1) { PlayerController val; if (forward) { int num2 = num + 1; val = ((num2 >= list.Count) ? list[0] : list[num2]); } else { int num3 = num - 1; if (num3 >= 0) { val = list[num3]; } else { List list2 = list; val = list2[list2.Count - 1]; } } __instance.SwitchPov(val); return false; } __instance.SwitchPov(list[0]); return false; } } [HarmonyPatch(typeof(PlayerController), "OnPlayerDataChanged")] internal class OnPlayerDataChangedColorPatch { private static void Postfix(Changed changed) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) try { PlayerController behaviour = changed.Behaviour; if (((SimulationBehaviour)behaviour).HasInputAuthority) { if (PlayerPrefs.HasKey("FavoriteColor")) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)behaviour).Runner, behaviour.Index, PlayerPrefs.GetInt("FavoriteColor")); } else { int num = Mathf.Min(11, (int)behaviour.Index); PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)behaviour).Runner, behaviour.Index, behaviour.Index); } PlayerCustom.Rpc_Set_No_Dead_Role(((SimulationBehaviour)PlayerController.Local).Runner, PlayerController.Local.Index, ExtraSettings.Instance.NoDeadRoleOnDeath ? 1 : 0); } PlayerCustom player = PlayerCustomRegistry.GetPlayer(behaviour.Ref); if ((Object)(object)player != (Object)null) { player.UpdateColor(); } if (((SimulationBehaviour)behaviour).Runner.IsServer) { UIManager.ModInstallationPanel.AddOrUpdatePlayer(behaviour.Ref); } } catch (Exception ex) { Plugin.Logger.LogError((object)("OnPlayerDataChangedColorPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerEffectsManager), "GlowingChanged")] internal class GlowingChangedColorPatch { private static bool Prefix(Changed changed) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00ca: Unknown result type (might be due to invalid IL or missing references) try { PlayerEffectsManager behaviour = changed.Behaviour; PlayerController value = Traverse.Create((object)behaviour).Field("_playerController").Value; PlayerCustom player = PlayerCustomRegistry.GetPlayer(value.Ref); SkinnedMeshRenderer value2 = Traverse.Create((object)value.PlayerEffectManager).Field("skinnedMeshRenderer").Value; Light value3 = Traverse.Create((object)value.PlayerEffectManager).Field("glowingLight").Value; if (NetworkBool.op_Implicit(behaviour.Glowing) && !NetworkBool.op_Implicit(value.IsWolf)) { Color color = ColorManager.GetColor(player.ColorIndex); ((Renderer)value2).material.SetColor(Shader.PropertyToID("_EmissionColor"), color * 3f); ((Renderer)value2).material.EnableKeyword("_EMISSION"); value3.color = color; ((Behaviour)value3).enabled = true; player.UpdateVisibility(); return false; } ((Renderer)value2).material.DisableKeyword("_EMISSION"); ((Behaviour)value3).enabled = false; player.UpdateVisibility(); return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("GlowingChangedColorPatch error: " + ex)); return true; } } } public static class ColorPicker { public const int ColorsLength = 12; public const string FavoriteColorPlayerPref = "FavoriteColor"; public static void NextColor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if (player.ColorIndex >= 11) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, 0); } else { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, player.ColorIndex + 1); } } public static void PreviousColor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if (player.ColorIndex == 0) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, 11); } else { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, player.ColorIndex - 1); } } } [NetworkBehaviourWeaved(20)] public class CultistManager : NetworkBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static OnBeforeSpawned <>9__17_0; public static Func <>9__17_1; public static Predicate <>9__17_2; public static Predicate <>9__19_0; internal void b__17_0(NetworkRunner _, NetworkObject no) { } internal bool b__17_1(Teleporter o) { return o.MapID == GameManager.Instance.MapID; } internal bool b__17_2(PlayerCustom o) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) return !NetworkBool.op_Implicit(o.PlayerController.IsDead) && o.NewPrimaryRole != PlayerCustom.PlayerNewPrimaryRole.Cultist && !o.IsOutOfTheWorld && !NetworkBool.op_Implicit(o.CapturedByCultist); } internal bool b__19_0(PlayerController o) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return !NetworkBool.op_Implicit(o.IsDead); } } private Stopwatch _skullCreationStopwatch = new Stopwatch(); [Networked(OnChanged = "CultistActiveChanged")] [NetworkedWeaved(0, 1)] public unsafe NetworkBool CultistActive { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistActive. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)(*base.Ptr); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistActive. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } [Networked(OnChanged = "CultistCapturesChanged")] [NetworkedWeaved(1, 1)] public unsafe int CultistCaptures { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistCaptures. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[1]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistCaptures. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[1] = value; } } [Networked] [NetworkedWeaved(2, 1)] public unsafe int CultistCapturesObjective { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistCapturesObjective. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[2]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CultistCapturesObjective. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[2] = value; } } public static CultistManager Instance { get; private set; } public void Reset() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CultistActive = NetworkBool.op_Implicit(false); CultistCaptures = 0; CultistCapturesObjective = 0; } public override void Spawned() { ((NetworkBehaviour)this).Spawned(); Instance = this; } public override void Despawned(NetworkRunner runner, bool hasState) { ((NetworkBehaviour)this).Despawned(runner, hasState); Instance = null; } public override void FixedUpdateNetwork() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_009c: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) if (!((SimulationBehaviour)this).Runner.IsServer || !NetworkBool.op_Implicit(CultistActive) || !((float)_skullCreationStopwatch.ElapsedMilliseconds >= 6000f) || !LycansUtility.GameActuallyInPlay) { return; } NetworkPrefabId networkObject = NetworkObjectService.Instance.GetNetworkObject("LycansNewRoles.GameObjectCultistSkullSpirit"); NetworkRunner runner = ((SimulationBehaviour)GameManager.Instance).Runner; Vector3? val = ((Component)this).transform.position; Quaternion? val2 = Quaternion.identity; object obj = <>c.<>9__17_0; if (obj == null) { OnBeforeSpawned val3 = delegate { }; <>c.<>9__17_0 = val3; obj = (object)val3; } NetworkObject val4 = runner.Spawn(networkObject, val, val2, (PlayerRef?)null, (OnBeforeSpawned)obj, (NetworkObjectPredictionKey?)null, true, (NetworkObject)null); ((Component)val4).GetComponent().SetCreatorRef(PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Cultist).Ref); Vector3 position; if (Random.value <= 0.25f) { List source = (from o in Object.FindObjectsOfType() where o.MapID == GameManager.Instance.MapID select o).ToList(); Teleporter val5 = source.First(); position = ((Component)val5).transform.position; } else { List list = PlayerCustomRegistry.Where((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead) && o.NewPrimaryRole != PlayerCustom.PlayerNewPrimaryRole.Cultist && !o.IsOutOfTheWorld && !NetworkBool.op_Implicit(o.CapturedByCultist)).ToList(); PlayerCustom playerCustom = CollectionsUtil.Grab(list, 1).First(); position = ((Component)playerCustom.PlayerController).transform.position; } ((Component)val4).transform.position = position; GameManager.Rpc_BroadcastFollowSound(((SimulationBehaviour)this).Runner, NetworkString<_16>.op_Implicit("VoodooRez"), position, 20f, 0.6f); _skullCreationStopwatch.Restart(); } public void ActivateCultist() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CultistActive = NetworkBool.op_Implicit(true); _skullCreationStopwatch.Restart(); } [Preserve] public static void CultistActiveChanged(Changed changed) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) try { CultistManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.CultistActive)) { int cultistCapturesObjective = BalancingValues.CultistTargetAmount(PlayerRegistry.CountWhere((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) - 1); PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Cultist); if (((SimulationBehaviour)behaviour).Runner.IsServer) { behaviour.CultistCapturesObjective = cultistCapturesObjective; specificNewPrimaryRole.PlayerController.Hunger = GameManager.Instance.MaxHunger; } } } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorIndexChanged error: " + ex)); } } [Preserve] public static void CultistCapturesChanged(Changed changed) { //IL_0011: 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) try { PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.LocalCameraHandler.PovPlayer.Ref); if (player.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Cultist) { player.UpdateDescriptionStatusIfNeeded(); } CultistManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.CultistActive) && ((SimulationBehaviour)behaviour).Runner.IsServer && behaviour.CultistCaptures >= behaviour.CultistCapturesObjective) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)behaviour).Runner, PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Cultist).Index); } } catch (Exception ex) { Plugin.Logger.LogError((object)("CultistCapturesChanged error: " + ex)); } } } [NetworkBehaviourWeaved(20)] public class DraftManager : NetworkBehaviour { public enum DraftPlayerMainRole { NormalVillager, Wolf, Solo, Traitor, WolfPup, EliteVillager } public class PlayerDraftData { public DraftPlayerMainRole MainRole; public List OfferedSoloRoles = new List(); public PlayerCustom.PlayerNewPrimaryRole SelectedSoloRole = PlayerCustom.PlayerNewPrimaryRole.None; public bool GetsPrimaryRolePower = false; public List OfferedPowers = new List(); public PlayerCustom.PlayerPrimaryRolePower SelectedPower = PlayerCustom.PlayerPrimaryRolePower.None; public bool GetsSecondaryRole = false; public List OfferedSecondaryRoles = new List(); public PlayerCustom.PlayerSecondaryRole SelectedSecondaryRole = PlayerCustom.PlayerSecondaryRole.None; public bool SelectionDone = false; } public const float TimeToChooseRolesSeconds = 30f; public Dictionary PlayersDraftDataByPlayerIndex = new Dictionary(); public PlayerDraftData MyData = new PlayerDraftData(); [Networked(OnChanged = "ActiveChanged")] [NetworkedWeaved(0, 1)] public unsafe NetworkBool Active { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.Active. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)(*base.Ptr); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.Active. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } [Networked] [NetworkedWeaved(1, 1)] public unsafe TickTimer DraftTimer { get { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CurrentPlayerTimer. Networked properties can only be accessed when Spawned() has been called."); } return (TickTimer)base.Ptr[1]; } set { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.CurrentPlayerTimer. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 1, value); } } public static DraftManager Instance { get; private set; } public void Init() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0de3: Unknown result type (might be due to invalid IL or missing references) PlayersDraftDataByPlayerIndex.Clear(); List allPlayers = PlayerCustomRegistry.AllPlayers; allPlayers.Shuffle(); foreach (PlayerCustom item in allPlayers) { item.PlayerController.Role = (PlayerRole)0; } List list = (from o in Plugin.CustomConfig.SoloRoleActive where o.Key != 0 && o.Key != PlayerCustom.PlayerNewPrimaryRole.Traitor && o.Value && !PlayerCustom.IsNewPrimaryRoleDisabled(o.Key) select o.Key).ToList(); if (GameManager.Instance.WolvesCount < 2 && !NetworkBool.op_Implicit(Plugin.CustomConfig.LoverWolfReplacesVillager)) { list.Remove(PlayerCustom.PlayerNewPrimaryRole.Lover); } int num = Plugin.CustomConfig.WolfPowersCount; List list2 = (from o in Plugin.CustomConfig.PrimaryRolePowerActive where o.Value && PlayerCustom.IsPrimaryRolePowerForWolves(o.Key) && !PlayerCustom.IsPrimaryRolePowerDisabled(o.Key) select o.Key).ToList(); List list3 = (from o in Plugin.CustomConfig.PrimaryRolePowerActive where o.Value && PlayerCustom.IsPrimaryRolePowerForEliteVillagers(o.Key) && !PlayerCustom.IsPrimaryRolePowerDisabled(o.Key) select o.Key).ToList(); List list4 = (from o in Plugin.CustomConfig.PrimaryRolePowerActive where o.Value && PlayerCustom.IsPrimaryRolePowerForNormalVillagers(o.Key) && !PlayerCustom.IsPrimaryRolePowerDisabled(o.Key) select o.Key).ToList(); List list5 = new List(); foreach (PlayerCustom.PlayerPrimaryRolePower item2 in list4) { int villagerJobChancePonderation = BalancingValues.GetVillagerJobChancePonderation(item2); for (int i = 0; i < villagerJobChancePonderation; i++) { list5.Add(item2); } } if (Random.value * 100f < (float)Plugin.CustomConfig.AvatarChance) { list5.Add(PlayerCustom.PlayerPrimaryRolePower.Avatar); } int num2 = Plugin.CustomConfig.SecondaryRolesCount; List list6 = (from o in Plugin.CustomConfig.SecondaryRoleActive where o.Value && o.Key != PlayerCustom.PlayerSecondaryRole.BothTelepath && !PlayerCustom.IsSecondaryRoleDisabled(o.Key) select o.Key).ToList(); foreach (KeyValuePair item3 in BalancingValues.SecondaryRoleMaxAmountInDraft) { if (item3.Value > 1) { for (int j = 1; j < item3.Value; j++) { list6.Add(item3.Key); } } } List list7 = new List(); for (int k = 0; k < Math.Min(Plugin.CustomConfig.ElitesCount, list3.Count); k++) { list7.Add(DraftPlayerMainRole.EliteVillager); } for (int l = 0; l < GameManager.Instance.WolvesCount; l++) { list7.Add(DraftPlayerMainRole.Wolf); } for (int m = 0; m < Plugin.CustomConfig.TraitorsCount; m++) { list7.Add(DraftPlayerMainRole.Traitor); } for (int n = 0; n < Plugin.CustomConfig.WolfPupsCount; n++) { list7.Add(DraftPlayerMainRole.WolfPup); } for (int num3 = 0; num3 < Math.Min(Plugin.CustomConfig.SoloRolesCount, list.Count); num3++) { list7.Add(DraftPlayerMainRole.Solo); } for (int num4 = list7.Count; num4 < PlayerRegistry.Count; num4++) { list7.Add(DraftPlayerMainRole.NormalVillager); } LogRemainingMainRoles(list7); list7.Shuffle(); foreach (PlayerCustom item4 in allPlayers) { PlayerDraftData playerDraftData6 = new PlayerDraftData(); playerDraftData6.MainRole = list7.First(); list7.RemoveAt(0); switch (playerDraftData6.MainRole) { case DraftPlayerMainRole.NormalVillager: playerDraftData6.GetsPrimaryRolePower = Random.value * 100f < (float)Plugin.CustomConfig.VillagerPowersChance; break; case DraftPlayerMainRole.EliteVillager: playerDraftData6.GetsPrimaryRolePower = true; break; case DraftPlayerMainRole.Solo: playerDraftData6.GetsPrimaryRolePower = true; break; case DraftPlayerMainRole.Wolf: case DraftPlayerMainRole.Traitor: case DraftPlayerMainRole.WolfPup: if (num > 0) { playerDraftData6.GetsPrimaryRolePower = true; num--; } else { playerDraftData6.GetsPrimaryRolePower = false; } break; } if (num2 > 0) { playerDraftData6.GetsSecondaryRole = true; num2--; } else { playerDraftData6.GetsSecondaryRole = false; } PlayersDraftDataByPlayerIndex[item4.Index] = playerDraftData6; } for (int num5 = 0; num5 < 3; num5++) { foreach (PlayerDraftData playerDraftData5 in PlayersDraftDataByPlayerIndex.Values.Where((PlayerDraftData o) => o.MainRole == DraftPlayerMainRole.Solo)) { List list8 = list.Where((PlayerCustom.PlayerNewPrimaryRole o) => !playerDraftData5.OfferedSoloRoles.Contains(o)).ToList(); if (list8.Count > 0) { PlayerCustom.PlayerNewPrimaryRole playerNewPrimaryRole = CollectionsUtil.Grab(list8, 1).First(); playerDraftData5.OfferedSoloRoles.Add(playerNewPrimaryRole); list.Remove(playerNewPrimaryRole); if (playerDraftData5.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.None) { playerDraftData5.SelectedSoloRole = playerNewPrimaryRole; } } } } for (int num6 = 0; num6 < 3; num6++) { foreach (PlayerDraftData playerDraftData4 in PlayersDraftDataByPlayerIndex.Values.Where((PlayerDraftData o) => o.MainRole == DraftPlayerMainRole.NormalVillager && o.GetsPrimaryRolePower)) { List list9 = list5.Where((PlayerCustom.PlayerPrimaryRolePower o) => !playerDraftData4.OfferedPowers.Contains(o)).ToList(); if (list9.Count > 0) { PlayerCustom.PlayerPrimaryRolePower playerPrimaryRolePower = CollectionsUtil.Grab(list9, 1).First(); playerDraftData4.OfferedPowers.Add(playerPrimaryRolePower); list5.Remove(playerPrimaryRolePower); if (playerDraftData4.SelectedPower == PlayerCustom.PlayerPrimaryRolePower.None) { playerDraftData4.SelectedPower = playerPrimaryRolePower; } } } } for (int num7 = 0; num7 < 3; num7++) { foreach (PlayerDraftData playerDraftData3 in PlayersDraftDataByPlayerIndex.Values.Where((PlayerDraftData o) => o.MainRole == DraftPlayerMainRole.EliteVillager)) { List list10 = list3.Where((PlayerCustom.PlayerPrimaryRolePower o) => !playerDraftData3.OfferedPowers.Contains(o)).ToList(); if (list10.Count > 0) { PlayerCustom.PlayerPrimaryRolePower playerPrimaryRolePower2 = CollectionsUtil.Grab(list10, 1).First(); playerDraftData3.OfferedPowers.Add(playerPrimaryRolePower2); list3.Remove(playerPrimaryRolePower2); if (playerDraftData3.SelectedPower == PlayerCustom.PlayerPrimaryRolePower.None) { playerDraftData3.SelectedPower = playerPrimaryRolePower2; } } } } for (int num8 = 0; num8 < 3; num8++) { foreach (PlayerDraftData playerDraftData2 in PlayersDraftDataByPlayerIndex.Values.Where((PlayerDraftData o) => (o.MainRole == DraftPlayerMainRole.Wolf || o.MainRole == DraftPlayerMainRole.Traitor || o.MainRole == DraftPlayerMainRole.WolfPup) && o.GetsPrimaryRolePower)) { List list11 = list2.Where((PlayerCustom.PlayerPrimaryRolePower o) => !playerDraftData2.OfferedPowers.Contains(o)).ToList(); if (playerDraftData2.MainRole == DraftPlayerMainRole.Traitor) { list11.RemoveAll((PlayerCustom.PlayerPrimaryRolePower o) => !PlayerCustom.IsWolfPowerAvailableForTraitor(o)); } if (list11.Count > 0) { PlayerCustom.PlayerPrimaryRolePower playerPrimaryRolePower3 = CollectionsUtil.Grab(list11, 1).First(); playerDraftData2.OfferedPowers.Add(playerPrimaryRolePower3); list2.Remove(playerPrimaryRolePower3); if (playerDraftData2.SelectedPower == PlayerCustom.PlayerPrimaryRolePower.None) { playerDraftData2.SelectedPower = playerPrimaryRolePower3; } } } } for (int num9 = 0; num9 < 3; num9++) { foreach (PlayerDraftData playerDraftData in PlayersDraftDataByPlayerIndex.Values.Where((PlayerDraftData o) => o.GetsSecondaryRole)) { List list12 = list6.Where((PlayerCustom.PlayerSecondaryRole o) => !playerDraftData.OfferedSecondaryRoles.Contains(o)).ToList(); if (playerDraftData.MainRole == DraftPlayerMainRole.Traitor) { list12.RemoveAll((PlayerCustom.PlayerSecondaryRole o) => PlayerCustom.IsSecondaryRoleDisabledForTraitor(o)); } if (list12.Count > 0) { PlayerCustom.PlayerSecondaryRole playerSecondaryRole = CollectionsUtil.Grab(list12, 1).First(); playerDraftData.OfferedSecondaryRoles.Add(playerSecondaryRole); list6.Remove(playerSecondaryRole); if (playerDraftData.SelectedSecondaryRole == PlayerCustom.PlayerSecondaryRole.None) { playerDraftData.SelectedSecondaryRole = playerSecondaryRole; } } } } foreach (KeyValuePair item5 in PlayersDraftDataByPlayerIndex) { if (item5.Value.MainRole == DraftPlayerMainRole.Solo) { Rpc_Send_Player_Info(((SimulationBehaviour)this).Runner, item5.Key, (int)item5.Value.MainRole, (int)((item5.Value.OfferedSoloRoles.Count >= 1) ? item5.Value.OfferedSoloRoles[0] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((item5.Value.OfferedSoloRoles.Count >= 2) ? item5.Value.OfferedSoloRoles[1] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((item5.Value.OfferedSoloRoles.Count >= 3) ? item5.Value.OfferedSoloRoles[2] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 1) ? item5.Value.OfferedSecondaryRoles[0] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 2) ? item5.Value.OfferedSecondaryRoles[1] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 3) ? item5.Value.OfferedSecondaryRoles[2] : ((PlayerCustom.PlayerSecondaryRole)(-1)))); } else { Rpc_Send_Player_Info(((SimulationBehaviour)this).Runner, item5.Key, (int)item5.Value.MainRole, (int)((item5.Value.OfferedPowers.Count >= 1) ? item5.Value.OfferedPowers[0] : ((PlayerCustom.PlayerPrimaryRolePower)(-1))), (int)((item5.Value.OfferedPowers.Count >= 2) ? item5.Value.OfferedPowers[1] : ((PlayerCustom.PlayerPrimaryRolePower)(-1))), (int)((item5.Value.OfferedPowers.Count >= 3) ? item5.Value.OfferedPowers[2] : ((PlayerCustom.PlayerPrimaryRolePower)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 1) ? item5.Value.OfferedSecondaryRoles[0] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 2) ? item5.Value.OfferedSecondaryRoles[1] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((item5.Value.OfferedSecondaryRoles.Count >= 3) ? item5.Value.OfferedSecondaryRoles[2] : ((PlayerCustom.PlayerSecondaryRole)(-1)))); } } DraftTimer = TickTimer.CreateFromSeconds(((SimulationBehaviour)this).Runner, 30f); } private void LogRemainingMainRoles(List mainRoles) { LycansUtility.DebugLog("----- Showing remaining roles -----"); foreach (DraftPlayerMainRole mainRole in mainRoles) { LycansUtility.DebugLog(mainRole.ToString()); } LycansUtility.DebugLog("----- End showing roles ------"); } public override void Spawned() { ((NetworkBehaviour)this).Spawned(); Instance = this; } public override void Despawned(NetworkRunner runner, bool hasState) { ((NetworkBehaviour)this).Despawned(runner, hasState); Instance = null; } public override void FixedUpdateNetwork() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (NetworkBool.op_Implicit(Active) && ((SimulationBehaviour)this).Runner.IsServer) { TickTimer draftTimer = DraftTimer; if (((TickTimer)(ref draftTimer)).Expired(((SimulationBehaviour)this).Runner)) { TimerExpired(); } } } private void TimerExpired() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) DraftTimer = TickTimer.None; foreach (KeyValuePair item in PlayersDraftDataByPlayerIndex.Where((KeyValuePair o) => !o.Value.SelectionDone)) { Instance.FinishChoice(item.Key); } } public void FinishChoice(int playerIndex) { //IL_00e1: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Invalid comparison between Unknown and I4 //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Unknown result type (might be due to invalid IL or missing references) //IL_0a09: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0a15: Unknown result type (might be due to invalid IL or missing references) //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_0a66: Unknown result type (might be due to invalid IL or missing references) PlayerDraftData playerDraftData = PlayersDraftDataByPlayerIndex[playerIndex]; playerDraftData.SelectionDone = true; PlayerCustom playerCustom = PlayerCustomRegistry.GetPlayer(playerIndex); switch (playerDraftData.MainRole) { case DraftPlayerMainRole.NormalVillager: playerCustom.PlayerController.Role = (PlayerRole)0; playerCustom.GivePrimaryRolePower(playerDraftData.SelectedPower); break; case DraftPlayerMainRole.EliteVillager: playerCustom.PlayerController.Role = (PlayerRole)0; playerCustom.GivePrimaryRolePower(playerDraftData.SelectedPower); break; case DraftPlayerMainRole.Wolf: playerCustom.PlayerController.Role = (PlayerRole)1; playerCustom.GivePrimaryRolePower(playerDraftData.SelectedPower); playerCustom.IsWolfPup = NetworkBool.op_Implicit(false); break; case DraftPlayerMainRole.Traitor: playerCustom.PlayerController.Role = (PlayerRole)0; playerCustom.GiveNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Traitor); playerCustom.GivePrimaryRolePower(playerDraftData.SelectedPower); break; case DraftPlayerMainRole.WolfPup: playerCustom.PlayerController.Role = (PlayerRole)1; playerCustom.GivePrimaryRolePower(playerDraftData.SelectedPower); playerCustom.IsWolfPup = NetworkBool.op_Implicit(true); break; case DraftPlayerMainRole.Solo: if (playerDraftData.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover) { if (PlayersDraftDataByPlayerIndex.Any((KeyValuePair o) => o.Value.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover && o.Key != playerIndex)) { PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover && o.Key != playerIndex).Key); playerCustom.PlayerController.Role = (PlayerRole)((int)player.PlayerController.Role != 1); } else { playerCustom.PlayerController.Role = (PlayerRole)(!(Random.value < 0.5f)); } } else { playerCustom.PlayerController.Role = (PlayerRole)0; } playerCustom.GiveNewPrimaryRole(playerDraftData.SelectedSoloRole); break; } if (playerDraftData.SelectedSecondaryRole != 0 && !PlayerCustom.GetAvailableSecondaryRoles(playerCustom.PlayerController.Role, playerCustom.NewPrimaryRole, playerCustom.PrimaryRolePower).Contains(playerDraftData.SelectedSecondaryRole)) { List list = playerDraftData.OfferedSecondaryRoles.Where((PlayerCustom.PlayerSecondaryRole o) => PlayerCustom.GetAvailableSecondaryRoles(playerCustom.PlayerController.Role, playerCustom.NewPrimaryRole, playerCustom.PrimaryRolePower).Contains(o)).ToList(); if (list.Any()) { playerDraftData.SelectedSecondaryRole = CollectionsUtil.Grab(list, 1).First(); } else { playerDraftData.SelectedSecondaryRole = PlayerCustom.PlayerSecondaryRole.None; } } playerCustom.GiveSecondaryRole(playerDraftData.SelectedSecondaryRole); NetworkString<_32> username = playerCustom.PlayerController.PlayerData.Username; LycansUtility.AddLogOnlyForMe("--- Player " + ((object)username).ToString() + " --- finished choice"); LycansUtility.AddLogOnlyForMe("Main role: " + playerDraftData.MainRole); PlayerRole role = playerCustom.PlayerController.Role; LycansUtility.AddLogOnlyForMe("Player role: " + ((object)(PlayerRole)(ref role)).ToString()); LycansUtility.AddLogOnlyForMe("Selected solo roles: " + playerDraftData.SelectedSoloRole); LycansUtility.AddLogOnlyForMe("Selected power: " + playerDraftData.SelectedPower); LycansUtility.AddLogOnlyForMe("Selected secondary role: " + playerDraftData.SelectedSecondaryRole); if (playerDraftData.MainRole == DraftPlayerMainRole.Solo && ((playerDraftData.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Agent && PlayersDraftDataByPlayerIndex.Count((KeyValuePair o) => o.Value.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Agent) == 1) || (playerDraftData.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover && PlayersDraftDataByPlayerIndex.Count((KeyValuePair o) => o.Value.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover) == 1))) { LycansUtility.AddLogOnlyForMe("-> Add second agent or lover"); if (playerDraftData.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Agent) { KeyValuePair keyValuePair = (PlayersDraftDataByPlayerIndex.Any((KeyValuePair o) => o.Value.MainRole == DraftPlayerMainRole.NormalVillager && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondAgent && !o.Value.SelectionDone) ? PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == DraftPlayerMainRole.NormalVillager && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondAgent && !o.Value.SelectionDone) : ((!PlayersDraftDataByPlayerIndex.Any((KeyValuePair o) => o.Value.MainRole == DraftPlayerMainRole.NormalVillager && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondAgent)) ? PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == DraftPlayerMainRole.NormalVillager) : PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == DraftPlayerMainRole.NormalVillager && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondAgent))); PlayerCustomRegistry.GetPlayer(keyValuePair.Key).Reset(); keyValuePair.Value.SelectionDone = false; keyValuePair.Value.MainRole = DraftPlayerMainRole.Solo; keyValuePair.Value.OfferedSoloRoles = new List { PlayerCustom.PlayerNewPrimaryRole.Agent }; keyValuePair.Value.SelectedSoloRole = PlayerCustom.PlayerNewPrimaryRole.Agent; keyValuePair.Value.OfferedPowers.Clear(); keyValuePair.Value.SelectedPower = PlayerCustom.PlayerPrimaryRolePower.None; keyValuePair.Value.OfferedSecondaryRoles.RemoveAll((PlayerCustom.PlayerSecondaryRole o) => !PlayerCustom.GetAvailableSecondaryRoles((PlayerRole)0, PlayerCustom.PlayerNewPrimaryRole.Agent, PlayerCustom.PlayerPrimaryRolePower.None).Contains(o)); keyValuePair.Value.SelectedSecondaryRole = (keyValuePair.Value.OfferedSecondaryRoles.Any() ? keyValuePair.Value.OfferedSecondaryRoles[0] : PlayerCustom.PlayerSecondaryRole.None); Rpc_Send_Player_Info(((SimulationBehaviour)this).Runner, keyValuePair.Key, (int)keyValuePair.Value.MainRole, (int)((keyValuePair.Value.OfferedSoloRoles.Count >= 1) ? keyValuePair.Value.OfferedSoloRoles[0] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair.Value.OfferedSoloRoles.Count >= 2) ? keyValuePair.Value.OfferedSoloRoles[1] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair.Value.OfferedSoloRoles.Count >= 3) ? keyValuePair.Value.OfferedSoloRoles[2] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair.Value.OfferedSecondaryRoles.Count >= 1) ? keyValuePair.Value.OfferedSecondaryRoles[0] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((keyValuePair.Value.OfferedSecondaryRoles.Count >= 2) ? keyValuePair.Value.OfferedSecondaryRoles[1] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((keyValuePair.Value.OfferedSecondaryRoles.Count >= 3) ? keyValuePair.Value.OfferedSecondaryRoles[2] : ((PlayerCustom.PlayerSecondaryRole)(-1)))); } else if (playerDraftData.SelectedSoloRole == PlayerCustom.PlayerNewPrimaryRole.Lover) { DraftPlayerMainRole targetMainRole = ((!NetworkBool.op_Implicit(Plugin.CustomConfig.LoverWolfReplacesVillager)) ? DraftPlayerMainRole.Wolf : DraftPlayerMainRole.NormalVillager); KeyValuePair keyValuePair2 = (PlayersDraftDataByPlayerIndex.Any((KeyValuePair o) => o.Value.MainRole == targetMainRole && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondLover && !o.Value.SelectionDone) ? PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == targetMainRole && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondLover && !o.Value.SelectionDone) : ((!PlayersDraftDataByPlayerIndex.Any((KeyValuePair o) => o.Value.MainRole == targetMainRole && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondLover)) ? PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == targetMainRole) : PlayersDraftDataByPlayerIndex.First((KeyValuePair o) => o.Value.MainRole == targetMainRole && PlayerCustomRegistry.GetPlayer(o.Key).DraftWantsSecondLover))); PlayerCustomRegistry.GetPlayer(keyValuePair2.Key).Reset(); keyValuePair2.Value.SelectionDone = false; keyValuePair2.Value.MainRole = DraftPlayerMainRole.Solo; keyValuePair2.Value.OfferedSoloRoles = new List { PlayerCustom.PlayerNewPrimaryRole.Lover }; keyValuePair2.Value.SelectedSoloRole = PlayerCustom.PlayerNewPrimaryRole.Lover; keyValuePair2.Value.OfferedPowers.Clear(); keyValuePair2.Value.SelectedPower = PlayerCustom.PlayerPrimaryRolePower.None; keyValuePair2.Value.OfferedSecondaryRoles.RemoveAll((PlayerCustom.PlayerSecondaryRole o) => !PlayerCustom.GetAvailableSecondaryRoles((PlayerRole)0, PlayerCustom.PlayerNewPrimaryRole.Lover, PlayerCustom.PlayerPrimaryRolePower.None).Contains(o)); keyValuePair2.Value.SelectedSecondaryRole = (keyValuePair2.Value.OfferedSecondaryRoles.Any() ? keyValuePair2.Value.OfferedSecondaryRoles[0] : PlayerCustom.PlayerSecondaryRole.None); Rpc_Send_Player_Info(((SimulationBehaviour)this).Runner, keyValuePair2.Key, (int)keyValuePair2.Value.MainRole, (int)((keyValuePair2.Value.OfferedSoloRoles.Count >= 1) ? keyValuePair2.Value.OfferedSoloRoles[0] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair2.Value.OfferedSoloRoles.Count >= 2) ? keyValuePair2.Value.OfferedSoloRoles[1] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair2.Value.OfferedSoloRoles.Count >= 3) ? keyValuePair2.Value.OfferedSoloRoles[2] : ((PlayerCustom.PlayerNewPrimaryRole)(-1))), (int)((keyValuePair2.Value.OfferedSecondaryRoles.Count >= 1) ? keyValuePair2.Value.OfferedSecondaryRoles[0] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((keyValuePair2.Value.OfferedSecondaryRoles.Count >= 2) ? keyValuePair2.Value.OfferedSecondaryRoles[1] : ((PlayerCustom.PlayerSecondaryRole)(-1))), (int)((keyValuePair2.Value.OfferedSecondaryRoles.Count >= 3) ? keyValuePair2.Value.OfferedSecondaryRoles[2] : ((PlayerCustom.PlayerSecondaryRole)(-1)))); } TickTimer draftTimer = DraftTimer; if (((TickTimer)(ref draftTimer)).IsRunning) { draftTimer = DraftTimer; if (!(((TickTimer)(ref draftTimer)).RemainingTime(((SimulationBehaviour)this).Runner) < 2f)) { return; } } LycansUtility.AddLogOnlyForMe("-> Change draft timer"); DraftTimer = TickTimer.CreateFromSeconds(((SimulationBehaviour)this).Runner, 2f); } else if (PlayersDraftDataByPlayerIndex.All((KeyValuePair o) => o.Value.SelectionDone)) { StartGame(); } } private void StartGame() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) DraftTimer = TickTimer.None; Active = NetworkBool.op_Implicit(false); SessionStats.Stats.NewGame(); GameManagerCustom.Instance.EventsManager.RollEvent(); GameManager.Instance.ClearSpawnedItems(); GameManager.Instance.UpdatePotions(); GameManager.Instance.SpawnRandomItems(); PlayerRegistry.ForEach((Action)delegate(PlayerController pObj) { pObj.Hunger = GameManager.Instance.MaxHunger; }); CollectionsUtil.ForEach(Object.FindObjectsOfType(), (Action)delegate(Portal p) { p.ResetPortal(); }); GameManager.Instance.TeleportAllPlayers(); foreach (PlayerCustom allPlayer in PlayerCustomRegistry.AllPlayers) { allPlayer.PlayerController.CanMove = NetworkBool.op_Implicit(true); allPlayer.InitForGameStart(); if (((SimulationBehaviour)allPlayer).Runner.IsServer) { allPlayer.InitStats(); } } SabotageManager.Instance.Init(); BeastManager.Instance.Reset(); CultistManager.Instance.Reset(); GameManager.Instance.UpdateLoot(true); GameManager.Instance.GiveAlchemistPotions(); GameManagerCustom.Instance.NewDay(); Plugin.CreatePlayerIllusionIfNeeded(); foreach (PlayerCustom allPlayer2 in PlayerCustomRegistry.AllPlayers) { PlayerController playerController = allPlayer2.PlayerController; string[] obj = new string[14] { "Player ", null, null, null, null, null, null, null, null, null, null, null, null, null }; NetworkString<_32> username = playerController.PlayerData.Username; obj[1] = ((object)username).ToString(); obj[2] = " with ref "; PlayerRef @ref = playerController.Ref; obj[3] = ((object)(PlayerRef)(ref @ref)).ToString(); obj[4] = " has base role "; PlayerRole role = playerController.Role; obj[5] = ((object)(PlayerRole)(ref role)).ToString(); obj[6] = ", primary role "; obj[7] = allPlayer2.NewPrimaryRole.ToString(); obj[8] = ", secondary role "; obj[9] = allPlayer2.SecondaryRole.ToString(); obj[10] = ", power "; obj[11] = allPlayer2.PrimaryRolePower.ToString(); obj[12] = ", is wolf pup: "; NetworkBool isWolfPup = allPlayer2.IsWolfPup; obj[13] = ((object)(NetworkBool)(ref isWolfPup)).ToString(); LycansUtility.DebugLog(string.Concat(obj)); } } [Preserve] public static void ActiveChanged(Changed changed) { //IL_0009: 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_003b: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Invalid comparison between Unknown and I4 try { if (NetworkBool.op_Implicit(changed.Behaviour.Active)) { UIManager.DraftPanel.Show(); return; } UIManager.DraftPanel.Hide(); if ((int)GameManager.LocalGameState != 2) { return; } GameManager.Instance.gameUI.UpdateCursor(false); GameManager.Instance.gameUI.ShowGameMenu(true); GameManager.Instance.gameUI.ShowRole(true); foreach (PlayerCustom allPlayer in PlayerCustomRegistry.AllPlayers) { allPlayer.PlayerController.EnablePlayerInteraction(true); allPlayer.InitialPower = allPlayer.PrimaryRolePower; allPlayer.AlreadyPossessed = false; } PlayerRegistry.ForEach((Action)delegate(PlayerController p) { p.EnablePlayerInteraction(true); }); PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref).UpdatePrimaryRole(); PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); string text; float num; switch (player.NewPrimaryRole) { case PlayerCustom.PlayerNewPrimaryRole.Traitor: text = "WOLF"; num = 0.5f; break; case PlayerCustom.PlayerNewPrimaryRole.None: { PlayerRole role = player.PlayerController.Role; PlayerRole val = role; if ((int)val == 1) { text = "WOLF"; num = 0.5f; } else { text = "VILLAGER"; num = 0.25f; } break; } default: text = "AngelHeal"; num = 0.5f; break; } AudioManager.Play(text, (MixerTarget)2, num, 1f); UIManager.RoleDescription.Hide(); } catch (Exception ex) { Plugin.Logger.LogError((object)("ActiveChanged error: " + ex)); } } [Rpc] public unsafe static void Rpc_Send_Player_Info(NetworkRunner runner, int playerIndex, int mainRoleIndex, int powerOrSoloRoleIndex1, int powerOrSoloRoleIndex2, int powerOrSoloRoleIndex3, int secondaryRoleIndex1, int secondaryRoleIndex2, int secondaryRoleIndex3) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 48; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.DraftManager::Rpc_Send_Player_Info(Fusion.NetworkRunner,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; *(int*)(data + num2) = mainRoleIndex; num2 += 4; *(int*)(data + num2) = powerOrSoloRoleIndex1; num2 += 4; *(int*)(data + num2) = powerOrSoloRoleIndex2; num2 += 4; *(int*)(data + num2) = powerOrSoloRoleIndex3; num2 += 4; *(int*)(data + num2) = secondaryRoleIndex1; num2 += 4; *(int*)(data + num2) = secondaryRoleIndex2; num2 += 4; *(int*)(data + num2) = secondaryRoleIndex3; num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } DraftPlayerMainRole draftPlayerMainRole = (DraftPlayerMainRole)mainRoleIndex; List list = new List(); List list2 = new List(); List list3 = new List(); DraftPlayerMainRole draftPlayerMainRole2 = draftPlayerMainRole; DraftPlayerMainRole draftPlayerMainRole3 = draftPlayerMainRole2; if (draftPlayerMainRole3 == DraftPlayerMainRole.Solo) { if (powerOrSoloRoleIndex1 != -1) { list.Add((PlayerCustom.PlayerNewPrimaryRole)powerOrSoloRoleIndex1); } if (powerOrSoloRoleIndex2 != -1) { list.Add((PlayerCustom.PlayerNewPrimaryRole)powerOrSoloRoleIndex2); } if (powerOrSoloRoleIndex3 != -1) { list.Add((PlayerCustom.PlayerNewPrimaryRole)powerOrSoloRoleIndex3); } } else { if (powerOrSoloRoleIndex1 != -1) { list2.Add((PlayerCustom.PlayerPrimaryRolePower)powerOrSoloRoleIndex1); } if (powerOrSoloRoleIndex2 != -1) { list2.Add((PlayerCustom.PlayerPrimaryRolePower)powerOrSoloRoleIndex2); } if (powerOrSoloRoleIndex3 != -1) { list2.Add((PlayerCustom.PlayerPrimaryRolePower)powerOrSoloRoleIndex3); } } if (secondaryRoleIndex1 != -1) { list3.Add((PlayerCustom.PlayerSecondaryRole)secondaryRoleIndex1); } if (secondaryRoleIndex2 != -1) { list3.Add((PlayerCustom.PlayerSecondaryRole)secondaryRoleIndex2); } if (secondaryRoleIndex3 != -1) { list3.Add((PlayerCustom.PlayerSecondaryRole)secondaryRoleIndex3); } PlayerCustom player = PlayerCustomRegistry.GetPlayer(playerIndex); if (player.Ref == PlayerController.Local.Ref) { Instance.MyData.SelectionDone = false; Instance.MyData.MainRole = draftPlayerMainRole; Instance.MyData.OfferedSoloRoles = list; Instance.MyData.OfferedPowers = list2; Instance.MyData.OfferedSecondaryRoles = list3; UIManager.DraftPanel.UpdateInfo(); } NetworkString<_32> username = player.PlayerController.PlayerData.Username; LycansUtility.AddLogOnlyForMe("--- Player " + ((object)username).ToString() + " ---"); LycansUtility.AddLogOnlyForMe("Main role: " + draftPlayerMainRole); LycansUtility.AddLogOnlyForMe("Offered solo roles: "); foreach (PlayerCustom.PlayerNewPrimaryRole item in list) { LycansUtility.AddLogOnlyForMe(item.ToString()); } LycansUtility.AddLogOnlyForMe("Offered powers: "); foreach (PlayerCustom.PlayerPrimaryRolePower item2 in list2) { LycansUtility.AddLogOnlyForMe(item2.ToString()); } LycansUtility.AddLogOnlyForMe("Offered secondary roles:"); foreach (PlayerCustom.PlayerSecondaryRole item3 in list3) { LycansUtility.AddLogOnlyForMe(item3.ToString()); } } catch (Exception ex) { Plugin.Logger.LogError((object)("Rpc_Send_Player_Info error: " + ex)); } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.DraftManager::Rpc_Send_Player_Info(Fusion.NetworkRunner,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)")] [Preserve] protected unsafe static void Rpc_Send_Player_Info_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; int mainRoleIndex = *(int*)(data + num); num += 4; int powerOrSoloRoleIndex = *(int*)(data + num); num += 4; int powerOrSoloRoleIndex2 = *(int*)(data + num); num += 4; int powerOrSoloRoleIndex3 = *(int*)(data + num); num += 4; int secondaryRoleIndex = *(int*)(data + num); num += 4; int secondaryRoleIndex2 = *(int*)(data + num); num += 4; int secondaryRoleIndex3 = *(int*)(data + num); num += 4; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Send_Player_Info(runner, playerIndex, mainRoleIndex, powerOrSoloRoleIndex, powerOrSoloRoleIndex2, powerOrSoloRoleIndex3, secondaryRoleIndex, secondaryRoleIndex2, secondaryRoleIndex3); } [Rpc] public unsafe static void Rpc_Select_Roles(NetworkRunner runner, int playerIndex, int powerOrSoloRoleIndex, int secondaryRoleIndex) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 60; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.DraftManager::Rpc_Select_Roles(Fusion.NetworkRunner,System.Int32,System.Int32,System.Int32)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; *(int*)(data + num2) = powerOrSoloRoleIndex; num2 += 4; *(int*)(data + num2) = secondaryRoleIndex; num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } if (runner.IsServer) { PlayerDraftData playerDraftData = Instance.PlayersDraftDataByPlayerIndex[playerIndex]; if (playerDraftData.MainRole == DraftPlayerMainRole.Solo) { playerDraftData.SelectedSoloRole = (PlayerCustom.PlayerNewPrimaryRole)powerOrSoloRoleIndex; } else { playerDraftData.SelectedPower = ((powerOrSoloRoleIndex > -1) ? ((PlayerCustom.PlayerPrimaryRolePower)powerOrSoloRoleIndex) : PlayerCustom.PlayerPrimaryRolePower.None); } playerDraftData.SelectedSecondaryRole = ((secondaryRoleIndex > -1) ? ((PlayerCustom.PlayerSecondaryRole)secondaryRoleIndex) : PlayerCustom.PlayerSecondaryRole.None); } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.DraftManager::Rpc_Select_Roles(Fusion.NetworkRunner,System.Int32,System.Int32,System.Int32)")] [Preserve] protected unsafe static void Rpc_Select_Roles_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; int powerOrSoloRoleIndex = *(int*)(data + num); num += 4; int secondaryRoleIndex = *(int*)(data + num); num += 4; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Select_Roles(runner, playerIndex, powerOrSoloRoleIndex, secondaryRoleIndex); } [Rpc] public unsafe static void Rpc_Confirm(NetworkRunner runner, int playerIndex) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 60; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.DraftManager::Rpc_Confirm(Fusion.NetworkRunner,System.Int32)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } if (runner.IsServer) { Instance.FinishChoice(playerIndex); } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.DraftManager::Rpc_Confirm(Fusion.NetworkRunner,System.Int32)")] [Preserve] protected unsafe static void Rpc_Confirm_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Confirm(runner, playerIndex); } [Rpc] public unsafe static void Rpc_Random(NetworkRunner runner, int playerIndex) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 12; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.DraftManager::Rpc_Random(Fusion.NetworkRunner,System.Int32)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } if (runner.IsServer) { PlayerDraftData playerDraftData = Instance.PlayersDraftDataByPlayerIndex[playerIndex]; if (playerDraftData.MainRole == DraftPlayerMainRole.Solo) { playerDraftData.SelectedSoloRole = CollectionsUtil.Grab(playerDraftData.OfferedSoloRoles, 1).First(); } else if (playerDraftData.OfferedPowers.Any()) { playerDraftData.SelectedPower = CollectionsUtil.Grab(playerDraftData.OfferedPowers, 1).First(); } if (playerDraftData.OfferedSecondaryRoles.Any()) { playerDraftData.SelectedSecondaryRole = CollectionsUtil.Grab(playerDraftData.OfferedSecondaryRoles, 1).First(); } Instance.FinishChoice(playerIndex); } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.DraftManager::Rpc_Random(Fusion.NetworkRunner,System.Int32)")] [Preserve] protected unsafe static void Rpc_Random_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Random(runner, playerIndex); } [Rpc] public unsafe static void Rpc_Role_Option(NetworkRunner runner, int playerIndex, int roleOptionIndex, bool active) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 60; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.DraftManager::Rpc_Role_Option(Fusion.NetworkRunner,System.Int32,System.Int32,System.Boolean)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; *(int*)(data + num2) = roleOptionIndex; num2 += 4; ReadWriteUtilsForWeaver.WriteBoolean((int*)(data + num2), active); num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 12; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } if (runner.IsServer) { PlayerCustom player = PlayerCustomRegistry.GetPlayer(playerIndex); switch (roleOptionIndex) { case 0: player.DraftWantsSecondAgent = active; break; case 1: player.DraftWantsSecondLover = active; break; } } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.DraftManager::Rpc_Role_Option(Fusion.NetworkRunner,System.Int32,System.Int32,System.Boolean)")] [Preserve] protected unsafe static void Rpc_Role_Option_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; int roleOptionIndex = *(int*)(data + num); num += 4; bool flag = ReadWriteUtilsForWeaver.ReadBoolean((int*)(data + num)); num += 4; bool active = flag; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Role_Option(runner, playerIndex, roleOptionIndex, active); } } [HarmonyPatch(typeof(GameManager), "UpdateLoot")] internal class DraftUpdateLootPatch { private static bool Prefix() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } } [HarmonyPatch(typeof(GameManager), "UpdatePotions")] internal class DraftUpdatePotionsPatch { private static bool Prefix() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } } [HarmonyPatch(typeof(GameManager), "TeleportAllPlayers")] internal class DraftTeleportAllPlayersPatch { private static bool Prefix() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } private static void Postfix() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return; } foreach (PlayerController item in PlayerRegistry.Where((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead)))) { PlayerCustom.ApplyEffectToPlayer(item, "LycansNewRoles.EffectTrapResistance", ((SimulationBehaviour)item).Runner); } } } [HarmonyPatch(typeof(AudioManager), "Play")] internal class DraftAudioManagerPatch { private static bool Prefix(string clip) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (clip == "WOLF" || clip == "VILLAGER") { if (NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(GameUI), "Update")] internal class DraftPreventShowMenuPatch { private static bool Prefix(GameUI __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)DraftManager.Instance != (Object)null && NetworkBool.op_Implicit(DraftManager.Instance.Active)) { Traverse.Create((object)__instance).Method("UpdateTalkingUI", Array.Empty()).GetValue(); return false; } return true; } } [HarmonyPatch(typeof(CharacterInputHandler), "Update")] internal class DraftPreventMovementPatch { private static bool Prefix(CharacterInputHandler __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)DraftManager.Instance != (Object)null && NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } if ((int)GameManager.LocalGameState == 2 && NetworkBool.op_Implicit(PlayerCustom.Local.Petrified)) { Traverse.Create((object)__instance).Field("_localCameraHandler").Value.SetViewInputVector(new Vector2(0f, 0f)); return false; } return true; } private static void Postfix(CharacterInputHandler __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0117: 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) if (NetworkBool.op_Implicit(PlayerCustom.Local.Confused)) { NetworkInputData value = Traverse.Create((object)__instance).Field("_networkInputData").Value; value.movementInput = new Vector2(PlayerCustom.Local.PersonalComponent.ConfusedSidesInverted ? (0f - InputManager.Instance.MoveInput.x) : InputManager.Instance.MoveInput.x, PlayerCustom.Local.PersonalComponent.ConfusedForwardInverted ? (0f - InputManager.Instance.MoveInput.y) : InputManager.Instance.MoveInput.y); Traverse.Create((object)__instance).Field("_networkInputData").SetValue((object)value); Traverse.Create((object)__instance).Field("_localCameraHandler").Value.SetViewInputVector(new Vector2(PlayerCustom.Local.PersonalComponent.ConfusedRotationHorizontalInverted ? (0f - InputManager.Instance.LookInput.x) : InputManager.Instance.LookInput.x, PlayerCustom.Local.PersonalComponent.ConfusedRotationVerticalInverted ? (0f - InputManager.Instance.LookInput.y) : InputManager.Instance.LookInput.y)); } } } [HarmonyPatch(typeof(LocalCameraHandler), "LateUpdate")] internal class DraftPreventCameraPatch { private static bool Prefix() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)DraftManager.Instance != (Object)null && NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } } [HarmonyPatch(typeof(PlayerController), "ActionInput")] internal class DraftPreventActionDuringDraftPatch { private static bool Prefix() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)DraftManager.Instance != (Object)null && NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } } [HarmonyPatch(typeof(PlayerController), "OnPlayerDataChanged")] internal class DraftSendRoleOptionsPatch { private static void Postfix(Changed changed) { try { PlayerController behaviour = changed.Behaviour; if (((SimulationBehaviour)behaviour).HasInputAuthority) { if (PlayerPrefs.HasKey("DRAFT_OPTION_AGENT") && PlayerPrefs.HasKey("DRAFT_OPTION_LOVER")) { DraftManager.Rpc_Role_Option(((SimulationBehaviour)behaviour).Runner, PlayerController.Local.Index, 0, PlayerPrefs.GetInt("DRAFT_OPTION_AGENT") == 1); DraftManager.Rpc_Role_Option(((SimulationBehaviour)behaviour).Runner, PlayerController.Local.Index, 1, PlayerPrefs.GetInt("DRAFT_OPTION_LOVER") == 1); } else { DraftManager.Rpc_Role_Option(((SimulationBehaviour)behaviour).Runner, PlayerController.Local.Index, 0, active: true); DraftManager.Rpc_Role_Option(((SimulationBehaviour)behaviour).Runner, PlayerController.Local.Index, 1, active: true); } } } catch (Exception ex) { Plugin.Logger.LogError((object)("DraftSendRoleOptionsPatch error: " + ex)); } } } [HarmonyPatch(typeof(GameManager), "GiveAlchemistPotions")] public class NoAlchemistPotionPatch { private static bool Prefix(GameManager __instance) { int[] array = new int[5]; List value = Traverse.Create((object)__instance).Field>("_potionEffects").Value; for (int i = 0; i < value.Count; i++) { array[i] = EffectManager.GetEffectIndex(value[i]); } Traverse.Create(typeof(GameManager)).Method("Rpc_AlchemistEffects", new List { typeof(NetworkRunner), typeof(int[]) }.ToArray(), (object[])null).GetValue(new object[2] { ((SimulationBehaviour)__instance).Runner, array }); return false; } } [HarmonyPatch(typeof(PlayerController), "CheckLootRayCast")] internal class AlchemistLootRaycast { private static bool Prefix(PlayerController __instance, Loot targetLoot, ref bool __result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) try { PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.Ref); if (NetworkBool.op_Implicit(player.Tiny) || NetworkBool.op_Implicit(player.Phasing)) { __result = false; return false; } if (NetworkBool.op_Implicit(targetLoot.Available) && !NetworkBool.op_Implicit(__instance.IsWolf) && player.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Alchemist && player.PrimaryRolePowerCurrentMaterials >= player.PowerMaterialsInfo.RequiredMaterials) { GameManager.Instance.gameUI.UpdateInteraction("NALES_UI_ACTION_ALCHEMIZE_LOOT", targetLoot.RarityColor, new List { (InputActionName)3, (InputActionName)4 }, new object[1] { targetLoot.ScoreValue }); __result = true; return false; } return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("TinyEffectPreventRaycastLootPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(GameManager), "CheckForEndGame")] internal class CheckForEndgamePatch { private static bool Prefix(GameManager __instance) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Invalid comparison between Unknown and I4 //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Invalid comparison between Unknown and I4 //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Invalid comparison between Unknown and I4 //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Invalid comparison between Unknown and I4 //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Invalid comparison between Unknown and I4 //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Invalid comparison between Unknown and I4 //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Invalid comparison between Unknown and I4 //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Invalid comparison between Unknown and I4 //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Invalid comparison between Unknown and I4 //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Invalid comparison between Unknown and I4 //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Invalid comparison between Unknown and I4 //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Invalid comparison between Unknown and I4 //IL_07bc: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBool.op_Implicit(__instance.IsStarted) && !NetworkBool.op_Implicit(__instance.IsFinished)) { if (NetworkBool.op_Implicit(BeastManager.Instance.BeastActive) || NetworkBool.op_Implicit(CultistManager.Instance.CultistActive)) { return false; } PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.VillageIdiot); if ((Object)(object)specificNewPrimaryRole != (Object)null) { PlayerController playerController = specificNewPrimaryRole.PlayerController; if (NetworkBool.op_Implicit(playerController.IsDead) && NetworkBool.op_Implicit(specificNewPrimaryRole.RoleDeathUniqueBool)) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, specificNewPrimaryRole.Index); return false; } } if ((int)GameManager.LocalGameState == 4 && PlayerRegistry.CountWhere((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) <= BalancingValues.AgentMaxSurvivorsToWin(PlayerRegistry.Count)) { IEnumerable enumerable = PlayerCustomRegistry.Where((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Agent); if (enumerable.Any()) { int num = 0; foreach (PlayerCustom item in enumerable) { PlayerController playerController2 = item.PlayerController; if (!NetworkBool.op_Implicit(playerController2.IsDead)) { num++; } } if (num == 1) { PlayerCustom playerCustom = enumerable.First((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead)); if (!NetworkBool.op_Implicit(playerCustom.Kidnapped)) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, playerCustom.Index); return false; } } } } if ((int)GameManager.LocalGameState == 4) { PlayerCustom specificNewPrimaryRole2 = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Spy); if ((Object)(object)specificNewPrimaryRole2 != (Object)null && specificNewPrimaryRole2.SoloRoleObjectiveCount >= BalancingValues.SpyGoal(PlayerRegistry.Count) && !NetworkBool.op_Implicit(specificNewPrimaryRole2.PlayerController.IsDead) && !NetworkBool.op_Implicit(specificNewPrimaryRole2.Kidnapped)) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, specificNewPrimaryRole2.Index); return false; } } if ((int)GameManager.LocalGameState == 4) { PlayerCustom specificNewPrimaryRole3 = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Scientist); if ((Object)(object)specificNewPrimaryRole3 != (Object)null && specificNewPrimaryRole3.SoloRoleObjectiveCount >= BalancingValues.ScientistGoal(PlayerRegistry.Count) && !NetworkBool.op_Implicit(specificNewPrimaryRole3.PlayerController.IsDead) && !NetworkBool.op_Implicit(specificNewPrimaryRole3.Kidnapped)) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, specificNewPrimaryRole3.Index); return false; } } List list = PlayerCustomRegistry.Where((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Lover).ToList(); if (list.Count == 2 && !NetworkBool.op_Implicit(PlayerRegistry.GetPlayer(list.First().Ref).IsDead) && !list.Any((PlayerCustom o) => NetworkBool.op_Implicit(o.Kidnapped))) { if (PlayerRegistry.CountWhere((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) == 2) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, list.First().Index); return false; } if ((int)GameManager.LocalGameState == 4 && PlayerRegistry.CountWhere((Predicate)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) <= 4) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, list.First().Index); return false; } } if ((int)GameManager.LocalGameState == 4) { PlayerCustom specificNewPrimaryRole4 = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Voodoo); if ((Object)(object)specificNewPrimaryRole4 != (Object)null && !NetworkBool.op_Implicit(specificNewPrimaryRole4.PlayerController.IsDead) && !NetworkBool.op_Implicit(specificNewPrimaryRole4.Kidnapped)) { int num2 = PlayerCustomRegistry.CountWhere((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Voodoo || o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Zombie); int num3 = PlayerCustomRegistry.CountWhere((PlayerCustom o) => o.NewPrimaryRole != PlayerCustom.PlayerNewPrimaryRole.Voodoo && o.NewPrimaryRole != PlayerCustom.PlayerNewPrimaryRole.Zombie && !NetworkBool.op_Implicit(o.PlayerController.IsDead)); int num4 = PlayerCustomRegistry.CountWhere((PlayerCustom o) => ((int)o.PlayerController.Role == 1 || o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Traitor) && !NetworkBool.op_Implicit(o.PlayerController.IsDead)); if (num2 >= num3 && num2 > num4) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, specificNewPrimaryRole4.Index); return false; } } } PlayerCustom kidnapper = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Kidnapper); if ((int)GameManager.LocalGameState == 4 && (Object)(object)kidnapper != (Object)null && !NetworkBool.op_Implicit(kidnapper.PlayerController.IsDead)) { if (kidnapper.SoloRoleObjectiveCount >= BalancingValues.KidnapperTargetAmount(PlayerRegistry.Count)) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, kidnapper.Index); return false; } if ((int)GameManager.LocalGameState == 4 && PlayerCustomRegistry.CountWhere((PlayerCustom o) => o.Ref != kidnapper.Ref && !NetworkBool.op_Implicit(o.Kidnapped) && !NetworkBool.op_Implicit(o.PlayerController.IsDead)) == 0) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, kidnapper.Index); return false; } } List list2 = PlayerCustomRegistry.Where((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead)).ToList(); if (!NetworkBool.op_Implicit(__instance.BattleRoyale)) { int num5 = list2.Count((PlayerCustom o) => (int)o.PlayerController.Role == 1); int num6 = list2.Count - num5; if ((int)GameManager.LocalGameState == 4 && num5 > 0) { foreach (PlayerCustom item2 in list2) { if (item2.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Traitor) { num5++; num6--; } if (item2.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Lover && (int)item2.PlayerController.Role == 1) { num6 += 2; } } } if (num5 == 0) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, PlayerCustomRegistry.GetAnyVillager().Index); return false; } if (num6 == 0) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, PlayerCustomRegistry.Where((PlayerCustom o) => (int)o.PlayerController.Role == 1 && o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.None).First().Index); return false; } if ((int)GameManager.State.Current == 4) { foreach (PlayerCustom item3 in list2) { if ((NetworkBool.op_Implicit(item3.Downed) || NetworkBool.op_Implicit(item3.Kidnapped)) && ((int)item3.PlayerController.Role == 1 || item3.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Traitor)) { num5--; } } } if (num5 >= num6 && (int)GameManager.State.Current == 4) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, PlayerCustomRegistry.Where((PlayerCustom o) => (int)o.PlayerController.Role == 1 && o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.None).First().Index); return false; } if (GameManager.Instance.Score >= GameManager.Instance.MaxScore) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)__instance).Runner, PlayerCustomRegistry.GetAnyVillager().Index); return false; } } else if (list2.Count <= 1) { GameManager.Rpc_EndGameBattleRoyale(((SimulationBehaviour)__instance).Runner); return false; } } return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("CheckForEndgamePatch: " + ex)); StackTrace stackTrace = new StackTrace(); Plugin.Logger.LogError((object)("StackTrace: " + stackTrace)); return true; } } } [HarmonyPatch(typeof(GameManager), "OnScoreChanged")] internal class OnScoreChangedPatch { private static bool Prefix(Changed changed) { try { GameManager.Instance.gameUI.UpdateScore(); if (((SimulationBehaviour)changed.Behaviour).HasStateAuthority && GameManager.Instance.Score >= GameManager.Instance.MaxScore) { GameManager.Instance.CheckForEndGame(); } return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("OnScoreChangedPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(GameManager), "Rpc_EndGame")] internal class EndgameChangesPatch { private unsafe static bool Prefix(NetworkRunner runner, bool wolfWin) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return false; } if (runner.HasAnyActiveConnections()) { int num = 8; num += 4; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void GameManager::Rpc_EndGame(Fusion.NetworkRunner,System.Boolean)")), data); ReadWriteUtilsForWeaver.WriteBoolean((int*)(data + num2), wolfWin); num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } Plugin.Logger.LogError((object)"ERROR: should never go into Rpc_EndGame method!"); return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("EndgameChangesPatch error: " + ex)); return true; } } } public class EventsManager { public enum EventType { None, Harvest, Haste, Duplicity, Fog, Spellstorm, Eclipse, Plague } public EventType CurrentEvent = EventType.None; public bool CurrentEventUniqueBool = false; private Stopwatch _currentEventStopwatch = new Stopwatch(); private int _currentEventUniqueInt = 0; public void NewEvent(EventType eventType) { LycansUtility.AddLogOnlyForMe("NewEvent: " + eventType); CurrentEvent = eventType; if (CurrentEvent == EventType.Fog) { _currentEventStopwatch.Restart(); _currentEventUniqueInt = Mathf.RoundToInt(Random.Range(50f, 90f) / 2f); } } public void ClearEvent() { if (CurrentEvent == EventType.None) { return; } LycansUtility.AddLogOnlyForMe("ClearEvent"); CurrentEvent = EventType.None; CurrentEventUniqueBool = false; _currentEventStopwatch.Reset(); _currentEventUniqueInt = 0; foreach (PlayerCustom allPlayer in PlayerCustomRegistry.AllPlayers) { allPlayer.UpdateVisibility(); allPlayer.UpdateMoveSpeed(); } } public void RollEvent() { if (CanGenerateEvent() && Random.value * 100f < (float)Plugin.CustomConfig.EventChance && Plugin.CustomConfig.EventsActive.Any((KeyValuePair o) => o.Value)) { List list = (from o in Plugin.CustomConfig.EventsActive where o.Value && o.Key != EventType.None select o.Key).ToList(); if (GameManagerCustom.Instance.CurrentDay == 0) { list.Remove(EventType.Eclipse); } EventType eventIndex = CollectionsUtil.Grab(list, 1).First(); GameManagerCustom.Rpc_New_Event(((SimulationBehaviour)GameManagerCustom.Instance).Runner, (int)eventIndex); } } private bool CanGenerateEvent() { if (PlayerCustomRegistry.Any((PlayerCustom o) => (o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Mercenary && NetworkBool.op_Implicit(o.NewPrimaryRoleUniqueBool)) || (o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Cultist && NetworkBool.op_Implicit(o.NewPrimaryRoleUniqueBool)))) { return false; } return true; } public void ServerUpdate(NetworkRunner runner) { EventType currentEvent = CurrentEvent; EventType eventType = currentEvent; if (eventType != EventType.Fog || _currentEventStopwatch.ElapsedMilliseconds < _currentEventUniqueInt * 1000) { return; } foreach (PlayerCustom item in PlayerCustomRegistry.Where((PlayerCustom o) => !NetworkBool.op_Implicit(o.PlayerController.IsDead))) { PlayerCustom.ApplyEffectToPlayer(item.PlayerController, "LycansNewRoles.EffectStealthing", runner, 1f, 30f); } _currentEventStopwatch.Restart(); _currentEventUniqueInt = Mathf.RoundToInt(Random.Range(50f, 90f)); } } public class ExtraSettings : MonoBehaviour { private static ExtraSettings _instance; public static string PlayerPrefReduceWolfRef = "EXTRA_SETTINGS_REDUCE_WOLF_RED"; public static string PlayerPrefDisableLivingVoicesWhenInDeadChannel = "EXTRA_SETTINGS_DISABLE_LIVING_VOICES_WHEN_IN_DEAD_CHANNEL"; public static string PlayerPrefNoDeadRoleOnDeath = "EXTRA_SETTINGS_NO_DEAD_ROLE_ON_DEATH"; public bool ReduceWolfRed; public bool DisableLivingVoicesWhenInDeadChannel; public bool NoDeadRoleOnDeath; public static ExtraSettings Instance { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject("ExtraSettings"); val.AddComponent(); GameObject val2 = Object.Instantiate(val); _instance = val2.GetComponent(); } return _instance; } } private void Start() { ReduceWolfRed = PlayerPrefs.GetInt(PlayerPrefReduceWolfRef) == 1; DisableLivingVoicesWhenInDeadChannel = PlayerPrefs.GetInt(PlayerPrefDisableLivingVoicesWhenInDeadChannel) == 1; NoDeadRoleOnDeath = PlayerPrefs.GetInt(PlayerPrefNoDeadRoleOnDeath) == 1; } public static void OnReduceWolfRedChanged(bool value) { PlayerPrefs.SetInt(PlayerPrefReduceWolfRef, value ? 1 : 0); Instance.ReduceWolfRed = value; } public static void OnDisableLivingVoicesWhenInDeadChannelChanged(bool value) { PlayerPrefs.SetInt(PlayerPrefDisableLivingVoicesWhenInDeadChannel, value ? 1 : 0); Instance.DisableLivingVoicesWhenInDeadChannel = value; } public static void OnNoDeadRoleOnDeathChanged(bool value) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) PlayerPrefs.SetInt(PlayerPrefNoDeadRoleOnDeath, value ? 1 : 0); Instance.NoDeadRoleOnDeath = value; if ((int)GameManager.LocalGameState != 0 && (Object)(object)PlayerController.Local != (Object)null) { PlayerCustom.Rpc_Set_No_Dead_Role(((SimulationBehaviour)PlayerController.Local).Runner, PlayerController.Local.Index, Instance.NoDeadRoleOnDeath ? 1 : 0); } } } [HarmonyPatch(typeof(SettingsUI), "Start")] internal class ExtraSettingsPatch { private static void Postfix(SettingsUI __instance) { try { if (!PlayerPrefs.HasKey(ExtraSettings.PlayerPrefReduceWolfRef)) { PlayerPrefs.SetInt(ExtraSettings.PlayerPrefReduceWolfRef, 0); ExtraSettings.Instance.ReduceWolfRed = false; } else { ExtraSettings.Instance.ReduceWolfRed = PlayerPrefs.GetInt(ExtraSettings.PlayerPrefReduceWolfRef) == 1; } if (!PlayerPrefs.HasKey(ExtraSettings.PlayerPrefDisableLivingVoicesWhenInDeadChannel)) { PlayerPrefs.SetInt(ExtraSettings.PlayerPrefDisableLivingVoicesWhenInDeadChannel, 1); ExtraSettings.Instance.DisableLivingVoicesWhenInDeadChannel = true; } else { ExtraSettings.Instance.DisableLivingVoicesWhenInDeadChannel = PlayerPrefs.GetInt(ExtraSettings.PlayerPrefDisableLivingVoicesWhenInDeadChannel) == 1; } if (!PlayerPrefs.HasKey(ExtraSettings.PlayerPrefNoDeadRoleOnDeath)) { PlayerPrefs.SetInt(ExtraSettings.PlayerPrefNoDeadRoleOnDeath, 0); ExtraSettings.Instance.NoDeadRoleOnDeath = false; } else { ExtraSettings.Instance.NoDeadRoleOnDeath = PlayerPrefs.GetInt(ExtraSettings.PlayerPrefNoDeadRoleOnDeath) == 1; } Toggle checkbox = GetCheckbox(__instance, "NALES_SETTING_REDUCE_WOLF_RED", ExtraSettings.PlayerPrefReduceWolfRef); ((UnityEvent)(object)checkbox.onValueChanged).AddListener((UnityAction)ExtraSettings.OnReduceWolfRedChanged); Toggle checkbox2 = GetCheckbox(__instance, "NALES_SETTING_DISABLE_LIVING_VOICES_WHEN_IN_DEAD_CHANNEL", ExtraSettings.PlayerPrefDisableLivingVoicesWhenInDeadChannel); ((UnityEvent)(object)checkbox2.onValueChanged).AddListener((UnityAction)ExtraSettings.OnDisableLivingVoicesWhenInDeadChannelChanged); Toggle checkbox3 = GetCheckbox(__instance, "NALES_SETTING_NO_DEAD_ROLE_ON_DEATH", ExtraSettings.PlayerPrefNoDeadRoleOnDeath); ((UnityEvent)(object)checkbox3.onValueChanged).AddListener((UnityAction)ExtraSettings.OnNoDeadRoleOnDeathChanged); } catch (Exception ex) { Plugin.Logger.LogError((object)("ExtraSettingsPatch error: " + ex)); } } private static Toggle GetCheckbox(SettingsUI settingsUI, string textKey, string playerPref) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) Toggle value = Traverse.Create((object)settingsUI).Field("reverseYAxisToggle").Value; Transform parent = ((Component)value).transform.parent.parent.parent; Transform parent2 = ((Component)value).transform.parent.parent.parent.parent; Transform val = Object.Instantiate(parent, parent2); LocalizeStringEvent val2 = ((Component)val).GetComponentsInChildren().First((LocalizeStringEvent o) => ((Object)o).name == "SettingNameText"); ((LocalizedReference)val2.StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit(textKey)); Toggle componentInChildren = ((Component)val).GetComponentInChildren(); GameObject gameObject = ((Component)componentInChildren).gameObject; Object.DestroyImmediate((Object)(object)componentInChildren); componentInChildren = gameObject.AddComponent(); componentInChildren.graphic = ((Component)((Component)componentInChildren).transform.Find("Background").Find("Checkmark")).GetComponent(); componentInChildren.isOn = PlayerPrefs.GetInt(playerPref) == 1; return componentInChildren; } } [HarmonyPatch(typeof(LightingManager), "DisplayWolfLight")] internal class ExtraSettingsReduceWolfRedPatch { private static bool Prefix(bool active, LightingManager __instance) { try { ColorAdjustmentManager.UpdateColorAdjustment(); return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("ExtraSettingsReduceWolfRedPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(LightingManager), "UpdateLighting")] public class FogChangesPatch { public static float FogDensityDaytime = 0.015f; public static float FogEndDistanceDaytime { get; set; } public static float FogEndDistanceNight { get; set; } public static float FogDensityNight { get; set; } private static void Postfix(LightingManager __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) try { EGameState localGameState = GameManager.LocalGameState; EGameState val = localGameState; if (val - 2 <= 2) { PlayerController povPlayer = PlayerController.Local.LocalCameraHandler.PovPlayer; PlayerCustom player = PlayerCustomRegistry.GetPlayer(povPlayer.Ref); float num = 0f; float num2 = 300f; float value = Traverse.Create((object)__instance).Field("_localTimeOfDay").Value; if (value >= 6f && value <= 17f) { num = FogDensityDaytime; num2 = FogEndDistanceDaytime; } else if (value <= 5f || value >= 18f) { num = FogDensityNight; num2 = FogEndDistanceNight; } else if (value > 5f && value < 6f) { num = Mathf.Lerp(FogDensityDaytime, FogDensityNight, 6f - value); num2 = Mathf.Lerp(FogEndDistanceDaytime, FogEndDistanceNight, 6f - value); } else if (value > 17f && value < 18f) { num = Mathf.Lerp(FogDensityNight, FogDensityDaytime, 18f - value); num2 = Mathf.Lerp(FogEndDistanceNight, FogEndDistanceDaytime, 18f - value); } if (SabotageManager.Instance.IsSabotageActive(SabotageManager.SabotageIds.CursedNight)) { num2 *= 0.65f; } switch (GameManagerCustom.Instance.EventsManager.CurrentEvent) { case EventsManager.EventType.Fog: num2 = 40f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.EventFogFogColor; break; case EventsManager.EventType.Spellstorm: num2 = 70f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.25f; RenderSettings.fogColor = BalancingValues.EventSpellstormFogColor; break; case EventsManager.EventType.Eclipse: num2 = 60f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.4f; RenderSettings.fogColor = BalancingValues.EventEclipseFogColor; break; case EventsManager.EventType.Plague: num2 = 65f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0f; RenderSettings.fogColor = BalancingValues.EventPlagueFogColor; break; } if (NetworkBool.op_Implicit(BeastManager.Instance.BeastActive)) { num2 = 65f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.25f; RenderSettings.fogColor = BalancingValues.BeastActiveFogColor; } if (NetworkBool.op_Implicit(CultistManager.Instance.CultistActive)) { num2 = 65f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.25f; RenderSettings.fogColor = BalancingValues.CultistActiveFogColor; } if (NetworkBool.op_Implicit(povPlayer.IsWolf)) { if (NetworkBool.op_Implicit(player.Repulsion)) { float num3 = Mathf.InverseLerp(0f, 1000f, (float)player.RepulsionStacks); num2 = Mathf.Lerp(BalancingValues.MysticRepulsorFogEndDistanceAtZeroStack, BalancingValues.MysticRepulsorFogEndDistanceAtMaxStacks, num3) * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.MysticRepulsorFogColor; } else if (PlayerCustomRegistry.Any((PlayerCustom o) => o.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Lover && !NetworkBool.op_Implicit(o.PlayerController.IsDead)) && !NetworkBool.op_Implicit(BeastManager.Instance.BeastActive)) { num2 = 55f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.LoverFogColor; } else { num2 += 25f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); } } if (SabotageManager.Instance.IsSabotageActive(SabotageManager.SabotageIds.LaboratoryLights) && !NetworkBool.op_Implicit(player.PlayerController.IsWolf)) { num2 = 17.5f; num = 1f; RenderSettings.fogColor = Color.black; } else if (NetworkBool.op_Implicit(player.Nearsighted)) { num2 = 12f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 1f; RenderSettings.fogColor = BalancingValues.NearsightedFogColor; } else if (NetworkBool.op_Implicit(player.Poison)) { num2 = 20f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.75f; RenderSettings.fogColor = BalancingValues.SaboteurPoisonFogColor; } else if (NetworkBool.op_Implicit(player.Exorcised)) { num2 = 20f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 1f; RenderSettings.fogColor = BalancingValues.ExorcistFogColor; } else if (NetworkBool.op_Implicit(player.Nauseated)) { num2 = 30f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.75f; RenderSettings.fogColor = BalancingValues.NauseatedFogColor; } else if (NetworkBool.op_Implicit(player.Burning)) { num2 = 30f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.MolotovBurnFogColor; } else if (NetworkBool.op_Implicit(player.PurifierBurn)) { num2 = 25f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.PurifierBurnFogColor; } else if (NetworkBool.op_Implicit(player.Sleepy)) { float num4 = Mathf.InverseLerp(0f, 1000f, (float)player.SleepStacks); num2 = Mathf.Lerp(BalancingValues.SleepingGasSleepyFogEndDistanceAtZeroStack, BalancingValues.SleepingGasSleepyFogEndDistanceAtMaxStacks, num4) * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.5f; RenderSettings.fogColor = BalancingValues.SleepingGasSleepyFogColor; } else if (player.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Zombie) { RenderSettings.fogColor = BalancingValues.ZombieFogColor; } else if (NetworkBool.op_Implicit(player.Isolation)) { num2 = 40f * BalancingValues.NightFogEndDistanceMultiplierByMap(GameManager.Instance.MapID); num = 0.6f; RenderSettings.fogColor = BalancingValues.IsolationFogColor; } if (NetworkBool.op_Implicit(povPlayer.PlayerEffectManager.NightVision)) { num2 += 200f; num /= 2f; } if (NetworkBool.op_Implicit(player.Petrified)) { RenderSettings.fogColor = BalancingValues.PetrifiedFogColor; } if (NetworkBool.op_Implicit(povPlayer.IsZooming) || (NetworkBool.op_Implicit(povPlayer.IsAiming) && (player.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Mercenary || player.PrimaryRolePower == PlayerCustom.PlayerPrimaryRolePower.Poacher))) { num /= 4f; num2 *= 4f; } RenderSettings.fogDensity = num; RenderSettings.fogEndDistance = num2; } else { RenderSettings.fogDensity = 0f; RenderSettings.fogEndDistance = 300f; } } catch (Exception ex) { Plugin.Logger.LogError((object)("FogChangesPatch error: " + ex)); } } } public class ForcedRotationComponent : MonoBehaviour { private PlayerCustom _playerCustom; private Vector3? _forcedRotation; private Vector3 _forcedRotationReductionPerSecond; public Vector3? ForcedRotation => _forcedRotation; public void SetPlayer(PlayerCustom playerCustom) { _playerCustom = playerCustom; } public void Init(Vector3 direction, float power, float reductionPerSecond) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = new Vector3(direction.x, direction.y, direction.z) * power; _forcedRotation = val; float num = Mathf.Abs(val.x) + Mathf.Abs(val.y) + Mathf.Abs(val.z); float num2 = Mathf.Abs(val.x) / num; float num3 = Mathf.Abs(val.y) / num; float num4 = Mathf.Abs(val.z) / num; _forcedRotationReductionPerSecond = new Vector3(reductionPerSecond * num2, reductionPerSecond * num3, reductionPerSecond * num4); } public void Stop() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) _forcedRotation = Vector3.zero; } public void Update() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_0202: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) if (!_forcedRotation.HasValue) { return; } if (!LycansUtility.GameActuallyInPlay) { _forcedRotation = null; _playerCustom.ForcedRotationY = 0f; return; } float num = 0f; if (_forcedRotation.Value.x > 0f) { num = Mathf.Max(0f, _forcedRotation.Value.x - _forcedRotationReductionPerSecond.x * Time.deltaTime); } else if (_forcedRotation.Value.x < 0f) { num = Mathf.Min(0f, _forcedRotation.Value.x + _forcedRotationReductionPerSecond.x * Time.deltaTime); } float num2 = 0f; if (_forcedRotation.Value.y > 0f) { num2 = Mathf.Max(0f, _forcedRotation.Value.y - _forcedRotationReductionPerSecond.y * Time.deltaTime); } else if (_forcedRotation.Value.y < 0f) { num2 = Mathf.Min(0f, _forcedRotation.Value.y + _forcedRotationReductionPerSecond.y * Time.deltaTime); } float num3 = 0f; if (_forcedRotation.Value.z > 0f) { num3 = Mathf.Max(0f, _forcedRotation.Value.z - _forcedRotationReductionPerSecond.z * Time.deltaTime); } else if (_forcedRotation.Value.z < 0f) { num3 = Mathf.Min(0f, _forcedRotation.Value.z + _forcedRotationReductionPerSecond.z * Time.deltaTime); } if (num == 0f && num2 == 0f && num3 == 0f) { _forcedRotation = null; _playerCustom.ForcedRotationY = 0f; } else { _forcedRotation = new Vector3(num, num2, num3); _playerCustom.ForcedRotationY = _forcedRotation.Value.y; } } } [NetworkBehaviourWeaved(20)] public class GameConfig : NetworkBehaviour { public enum ConfigTypeEnum { Base, RolesVillagers, RolesEnemies, RolesSecondary, RolesDetails, Others, Potions, Gadgets, Events } public static Color ColorSoloRole = new Color(1f, 0f, 1f, 1f); public static Color ColorWolfPower = new Color(1f, 0f, 0f, 1f); public static Color ColorVillagerJob = new Color(0f, 0.5f, 1f, 1f); public static Color ColorElite = new Color(0f, 0.25f, 0.8f, 1f); public static Color ColorTraitor = new Color(1f, 0.5f, 0f, 1f); public static Color ColorWolfPup = new Color(1f, 0.25f, 0f, 1f); public static Color ColorSecondaryRole = new Color(1f, 1f, 1f, 1f); public static TMP_Dropdown SoloRolesCountConfig; public static TMP_Dropdown TraitorsCountConfig; public static TMP_Dropdown WolfPupsCountConfig; public static TMP_Dropdown WolfPowersCountConfig; public static TMP_Dropdown VillagerPowersChanceConfig; public static TMP_Dropdown ElitesCountConfig; public static TMP_Dropdown AvatarChanceConfig; public static TMP_Dropdown GuardianAngelsCountConfig; public static TMP_Dropdown GhostsCountConfig; public static TMP_Dropdown SpectersCountConfig; public static TMP_Dropdown SecondaryRolesCountConfig; public static TMP_Dropdown EventChanceConfig; public static Dictionary SoloRolesConfig = new Dictionary(); public static Dictionary PrimaryRolePowerConfig = new Dictionary(); public static Dictionary SecondaryRolesConfig = new Dictionary(); public static Dictionary EventsConfig = new Dictionary(); public static Dictionary PotionsConfig = new Dictionary(); public static Dictionary GadgetsConfig = new Dictionary(); public static Dictionary AccessoriesConfig = new Dictionary(); public int SoloRolesCount; public int TraitorsCount; public int WolfPupsCount; public int WolfPowersCount; public int VillagerPowersChance; public int ElitesCount; public int AvatarChance; public int GuardianAngelsCount; public int GhostsCount; public int SpectersCount; public int SecondaryRolesCount; public int EventChance; public Dictionary SoloRoleActive = new Dictionary(); public Dictionary PrimaryRolePowerActive = new Dictionary(); public Dictionary SecondaryRoleActive = new Dictionary(); public Dictionary EventsActive = new Dictionary(); public Dictionary PotionsAvailability = new Dictionary(); public Dictionary GadgetsAvailability = new Dictionary(); public Dictionary AccessoriesAvailability = new Dictionary(); public static TMP_Dropdown SpyPercentageDropdown; public static TMP_Dropdown ScientistResearchSpeedDropdown; public static TMP_Dropdown LoverVillagerHungerSpeedDropdown; public static TMP_Dropdown MercenaryPercentageDropdown; public static TMP_Dropdown CultistSpeedDropdown; public static Toggle DeceiverHasFlatulenceChanceToggle; public static Toggle LoverWolfReplacesVillagerToggle; public static Toggle AllowMayorToggle; public static Toggle TenacityHubrisToggle; public static Toggle TrapsModifiedToggle; public static Toggle SmokeBoostedToggle; public static Toggle AnonymousVotesToggle; public static Toggle SabotagesAvailableToggle; public static Toggle DropItemsAvailableToggle; public static TMP_Dropdown NightFogDropdown; public static Toggle WolvesCanUseItemsToggle; public static Toggle DraftModeToggle; public static Toggle ShowLastGameSummaryToggle; public static Button ButtonConfigBaseGame; public static Button ButtonConfigMod; public static GameObject GameSettingsObject; public static GameObject RoleInfoObject; public static GameObject GadgetsInfoObject; public static GameObject AccessoriesInfoObject; [Networked] [NetworkedWeaved(0, 1)] public unsafe NetworkBool TrapsModified { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.TrapsModified. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)(*base.Ptr); } private set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.TrapsModified. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } [Networked] [NetworkedWeaved(1, 1)] public unsafe NetworkBool SmokeBoosted { get { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.SmokeBoosted. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[1]; } private set { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.SmokeBoosted. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 1, value); } } [Networked] [NetworkedWeaved(2, 1)] public unsafe NetworkBool AnonymousVotes { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AnonymousVotes. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[2]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AnonymousVotes. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 2, value); } } [Networked] [NetworkedWeaved(3, 1)] public unsafe NetworkBool UnusedVariable { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AmogusMode. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[3]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AmogusMode. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 3, value); } } [Networked] [NetworkedWeaved(4, 1)] public unsafe NetworkBool SabotagesAvailable { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.SabotagesAvailable. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[4]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.SabotagesAvailable. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 4, value); } } [Networked] [NetworkedWeaved(5, 1)] public unsafe NetworkBool DropItemsAvailable { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DropItemsAvailable. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[5]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DropItemsAvailable. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 5, value); } } [Networked] [NetworkedWeaved(6, 1)] public unsafe int NightFog { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.NightFog. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[6]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.NightFog. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[6] = value; } } [Networked] [NetworkedWeaved(7, 1)] public unsafe NetworkBool WolvesCanUseItems { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.WolvesCanUseItems. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[7]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.WolvesCanUseItems. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 7, value); } } [Networked] [NetworkedWeaved(8, 1)] public unsafe NetworkBool DraftMode { get { //IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DraftMode. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[8]; } private set { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DraftMode. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 8, value); } } [Networked] [NetworkedWeaved(9, 1)] public unsafe NetworkBool UnusedConfig { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.VillageIdiotCanTransform. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[9]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.VillageIdiotCanTransform. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 9, value); } } [Networked] [NetworkedWeaved(10, 1)] public unsafe int MercenaryPercentage { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.MercenaryPercentage. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[10]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.MercenaryPercentage. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[10] = value; } } [Networked] [NetworkedWeaved(11, 1)] public unsafe int SpyPercentage { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.SpyPercentage. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[11]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.SpyPercentage. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[11] = value; } } [Networked] [NetworkedWeaved(12, 1)] public unsafe int ScientistResearchSpeed { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.ScientistResearchSpeed. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[12]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.ScientistResearchSpeed. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[12] = value; } } [Networked] [NetworkedWeaved(13, 1)] public unsafe int LoverVillagerHungerSpeed { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.LoverVillagerHungerSpeed. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[13]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.LoverVillagerHungerSpeed. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[13] = value; } } [Networked] [NetworkedWeaved(14, 1)] public unsafe NetworkBool DeceiverHasFlatulenceChance { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DeceiverHasFlatulenceChance. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[14]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.DeceiverHasFlatulenceChance. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 14, value); } } [Networked] [NetworkedWeaved(15, 1)] public unsafe NetworkBool LoverWolfReplacesVillager { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.WolfLoverReplacesWolf. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[15]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.WolfLoverReplacesWolf. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 15, value); } } [Networked] [NetworkedWeaved(16, 1)] public unsafe NetworkBool AllowMayor { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AllowMayor. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[16]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.AllowMayor. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 16, value); } } [Networked] [NetworkedWeaved(17, 1)] public unsafe NetworkBool ShowLastGameSummary { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.ShowLastGameSummary. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[17]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.ShowLastGameSummary. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 17, value); } } [Networked] [NetworkedWeaved(18, 1)] public unsafe NetworkBool TenacityHubris { get { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.TenacityHubris. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)base.Ptr[18]; } private set { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.TenacityHubris. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr + 18, value); } } [Networked] [NetworkedWeaved(19, 1)] public unsafe int CultistSpeed { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.CultistSpeed. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[19]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing GameConfig.CultistSpeed. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[19] = value; } } private void Start() { FillTrapsModifiedToggle(); FillSmokeBoostedToggle(); FillAnonymousVotesToggle(); FillSabotagesAvailableToggle(); FillDropItemsAvailableToggle(); FillWolvesCanUseItemsToggle(); FillDraftModeToggle(); FillShowLastGameSummaryToggle(); FillDeceiverHasFlatulenceChanceToggle(); FillLoverWolfReplacesVillagerToggle(); FillAllowMayorToggle(); FillTenacityHubrisToggle(); } public override void Spawned() { //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsClient) { Plugin.NetworkObject = ((Component)this).GetComponent(); } try { SoloRolesCount = int.Parse(SoloRolesCountConfig.options[SoloRolesCountConfig.value].text); TraitorsCount = int.Parse(TraitorsCountConfig.options[TraitorsCountConfig.value].text); WolfPupsCount = int.Parse(WolfPupsCountConfig.options[WolfPupsCountConfig.value].text); WolfPowersCount = int.Parse(WolfPowersCountConfig.options[WolfPowersCountConfig.value].text); VillagerPowersChance = int.Parse(VillagerPowersChanceConfig.options[VillagerPowersChanceConfig.value].text.Replace("%", "")); ElitesCount = int.Parse(ElitesCountConfig.options[ElitesCountConfig.value].text.Replace("%", "")); AvatarChance = int.Parse(AvatarChanceConfig.options[AvatarChanceConfig.value].text.Replace("%", "")); GuardianAngelsCount = int.Parse(GuardianAngelsCountConfig.options[GuardianAngelsCountConfig.value].text.Replace("%", "")); GhostsCount = int.Parse(GhostsCountConfig.options[GhostsCountConfig.value].text.Replace("%", "")); SpectersCount = int.Parse(SpectersCountConfig.options[SpectersCountConfig.value].text.Replace("%", "")); SecondaryRolesCount = int.Parse(SecondaryRolesCountConfig.options[SecondaryRolesCountConfig.value].text); EventChance = int.Parse(EventChanceConfig.options[EventChanceConfig.value].text.Replace("%", "")); foreach (KeyValuePair item in SoloRolesConfig) { SoloRoleActive[item.Key] = item.Value.isOn; } foreach (KeyValuePair item2 in PrimaryRolePowerConfig) { PrimaryRolePowerActive[item2.Key] = item2.Value.isOn; } foreach (KeyValuePair item3 in SecondaryRolesConfig) { SecondaryRoleActive[item3.Key] = item3.Value.isOn; } foreach (KeyValuePair item4 in EventsConfig) { EventsActive[item4.Key] = item4.Value.isOn; } NightFog = int.Parse(NightFogDropdown.options[NightFogDropdown.value].text.Replace("%", "")); foreach (KeyValuePair item5 in PotionsConfig) { PotionsAvailability[item5.Key] = item5.Value.isOn; } foreach (KeyValuePair item6 in GadgetsConfig) { GadgetsAvailability[item6.Key] = item6.Value.isOn; } foreach (KeyValuePair item7 in AccessoriesConfig) { AccessoriesAvailability[item7.Key] = item7.Value.isOn; } SpyPercentage = int.Parse(SpyPercentageDropdown.options[SpyPercentageDropdown.value].text.Replace("%", "")); ScientistResearchSpeed = int.Parse(ScientistResearchSpeedDropdown.options[ScientistResearchSpeedDropdown.value].text.Replace("%", "")); MercenaryPercentage = int.Parse(MercenaryPercentageDropdown.options[MercenaryPercentageDropdown.value].text.Replace("%", "")); CultistSpeed = int.Parse(CultistSpeedDropdown.options[CultistSpeedDropdown.value].text.Replace("%", "")); LoverVillagerHungerSpeed = int.Parse(LoverVillagerHungerSpeedDropdown.options[LoverVillagerHungerSpeedDropdown.value].text.Replace("%", "")); DeceiverHasFlatulenceChance = NetworkBool.op_Implicit(DeceiverHasFlatulenceChanceToggle.isOn); LoverWolfReplacesVillager = NetworkBool.op_Implicit(LoverWolfReplacesVillagerToggle.isOn); AllowMayor = NetworkBool.op_Implicit(AllowMayorToggle.isOn); TenacityHubris = NetworkBool.op_Implicit(TenacityHubrisToggle.isOn); } catch (Exception ex) { Plugin.Logger.LogError((object)("GameConfigSetGameSettingsPatch error: " + ex)); } } public override void Despawned(NetworkRunner runner, bool hasState) { } public static void CreateAndAttachSoloRoleConfigToggle(GameSettingsUI gameSettingsUI, PlayerCustom.PlayerNewPrimaryRole role, string key) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) string key2 = ((role == PlayerCustom.PlayerNewPrimaryRole.Lover) ? "NALES_CONFIG_ROLE_TYPE_MAIN_DUO" : "NALES_CONFIG_ROLE_TYPE_MAIN_SOLO"); Toggle toggle = GetToggle(gameSettingsUI, key2, new List { key }, ConfigTypeEnum.RolesEnemies, PlayerCustom.GetNewPrimaryRoleColor(role)); SoloRolesConfig[role] = toggle; FillSoloRoleToggle(toggle, role); } public static void CreateAndAttachPrimaryRolePowerConfigToggle(GameSettingsUI gameSettingsUI, PlayerCustom.PlayerPrimaryRolePower role, string key) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Toggle val = (PlayerCustom.IsPrimaryRolePowerForEliteVillagers(role) ? GetToggle(gameSettingsUI, "NALES_CONFIG_ROLE_TYPE_MAIN_ELITE", new List { key }, ConfigTypeEnum.RolesVillagers, ColorVillagerJob) : ((!PlayerCustom.IsPrimaryRolePowerForNormalVillagers(role)) ? GetToggle(gameSettingsUI, "NALES_CONFIG_ROLE_TYPE_MAIN_WOLF", new List { key }, ConfigTypeEnum.RolesEnemies, ColorWolfPower) : GetToggle(gameSettingsUI, "NALES_CONFIG_ROLE_TYPE_MAIN_VILLAGER", new List { key }, ConfigTypeEnum.RolesVillagers, ColorVillagerJob))); PrimaryRolePowerConfig[role] = val; FillPrimaryRolePowerToggle(val, role); } public static void CreateAndAttachSecondaryRoleConfigToggle(GameSettingsUI gameSettingsUI, PlayerCustom.PlayerSecondaryRole role, string key) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Toggle toggle = GetToggle(gameSettingsUI, "NALES_CONFIG_ROLE_TYPE_SECONDARY", new List { key }, ConfigTypeEnum.RolesSecondary, ColorSecondaryRole); SecondaryRolesConfig[role] = toggle; FillSecondaryRoleToggle(toggle, role); } public static void CreateAndAttachEventConfigToggle(GameSettingsUI gameSettingsUI, EventsManager.EventType dailyEvent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) Toggle toggle = GetToggle(gameSettingsUI, "NALES_EVENT_" + dailyEvent.ToString().ToUpper(), new List(), ConfigTypeEnum.Events, Color.white); EventsConfig[dailyEvent] = toggle; FillEventToggle(toggle, dailyEvent); } public static Toggle CreateAndAttachConfigToggle(GameSettingsUI gameSettingsUI, string key, List arguments, ConfigTypeEnum type, Color textColor) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return GetToggle(gameSettingsUI, key, arguments, type, textColor); } public static TMP_Dropdown CreateAndAttachConfigDropdownWithMax(GameSettingsUI gameSettingsUI, string key, int max, ConfigTypeEnum type, Color textColor) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i <= max; i++) { list.Add(i.ToString()); } return GetDropdown(gameSettingsUI, key, list, type, textColor); } public static TMP_Dropdown CreateAndAttachConfigDropdownWithMinAndMax(GameSettingsUI gameSettingsUI, string key, int min, int max, ConfigTypeEnum type, Color textColor) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = min; i <= max; i++) { list.Add(i.ToString()); } return GetDropdown(gameSettingsUI, key, list, type, textColor); } public static TMP_Dropdown CreateAndAttachConfigDropdownWithPercentages(GameSettingsUI gameSettingsUI, string key, ConfigTypeEnum type, Color textColor, int minValue, int maxValue, int interval) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = minValue; i <= maxValue; i += interval) { list.Add(i + "%"); } return GetDropdown(gameSettingsUI, key, list, type, textColor); } public static void FillSoloRolesCountDropdown() { TMP_Dropdown dropdown = SoloRolesCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_SOLO_ROLES_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_SOLO_ROLES_COUNT", 1); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.SoloRolesCount = int.Parse(dropdown.options[index].text); PlayerPrefs.SetInt("GAME_SETTINGS_SOLO_ROLES_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_SOLO_ROLES_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_SOLO_ROLES_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillTraitorsCountDropdown() { TMP_Dropdown dropdown = TraitorsCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_TRAITORS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_TRAITORS_COUNT", 0); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.TraitorsCount = int.Parse(dropdown.options[index].text); PlayerPrefs.SetInt("GAME_SETTINGS_TRAITORS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_TRAITORS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_TRAITORS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillWolfPupsCountDropdown() { TMP_Dropdown dropdown = WolfPupsCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_WOLF_PUPS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_WOLF_PUPS_COUNT", 0); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.WolfPupsCount = int.Parse(dropdown.options[index].text); PlayerPrefs.SetInt("GAME_SETTINGS_WOLF_PUPS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_WOLF_PUPS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_WOLF_PUPS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillPrimaryRolePowersCountDropdown() { TMP_Dropdown dropdown = WolfPowersCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT", 2); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.WolfPowersCount = int.Parse(dropdown.options[index].text); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillPrimaryRoleVillagerPowersChanceDropdown() { TMP_Dropdown dropdown = VillagerPowersChanceConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_VILLAGER_POWERS_CHANCE")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_VILLAGER_POWERS_CHANCE", 10); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.VillagerPowersChance = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_VILLAGER_POWERS_CHANCE", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_VILLAGER_POWERS_CHANCE")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_VILLAGER_POWERS_CHANCE"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillElitesCountDropdown() { TMP_Dropdown dropdown = ElitesCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_ELITES_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_ELITES_COUNT", 2); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.ElitesCount = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_ELITES_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_ELITES_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_ELITES_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillPrimaryRoleAvatarChanceDropdown() { TMP_Dropdown dropdown = AvatarChanceConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_AVATAR_CHANCE")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_AVATAR_CHANCE", 3); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.AvatarChance = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_AVATAR_CHANCE", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_AVATAR_CHANCE")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_AVATAR_CHANCE"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillGuardianAngelsCountDropdown() { TMP_Dropdown dropdown = GuardianAngelsCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_GUARDIAN_ANGELS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_GUARDIAN_ANGELS_COUNT", 1); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.GuardianAngelsCount = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_GUARDIAN_ANGELS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_GUARDIAN_ANGELS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_GUARDIAN_ANGELS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillGhostsCountDropdown() { TMP_Dropdown dropdown = GhostsCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_GHOSTS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_GHOSTS_COUNT", 1); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.GhostsCount = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_GHOSTS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_GHOSTS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_GHOSTS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillSpectersCountDropdown() { TMP_Dropdown dropdown = SpectersCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_SPECTERS_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_SPECTERS_COUNT", 1); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.SpectersCount = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_SPECTERS_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_PRIMARY_ROLE_SPECTERS_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_PRIMARY_ROLE_SPECTERS_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillSecondaryRolesCountDropdown() { TMP_Dropdown dropdown = SecondaryRolesCountConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_SECONDARY_ROLES_COUNT")) { PlayerPrefs.SetInt("GAME_SETTINGS_SECONDARY_ROLES_COUNT", 15); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.SecondaryRolesCount = int.Parse(dropdown.options[index].text); PlayerPrefs.SetInt("GAME_SETTINGS_SECONDARY_ROLES_COUNT", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_SECONDARY_ROLES_COUNT")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_SECONDARY_ROLES_COUNT"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillSoloRoleToggle(Toggle toggle, PlayerCustom.PlayerNewPrimaryRole role) { string playerPref = "GAME_SETTINGS_NALES_ROLE_" + role; if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)toggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)toggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.SoloRoleActive[role] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { SoloRolesConfig[role].SetIsOnWithoutNotify(true); } } public static void FillPrimaryRolePowerToggle(Toggle toggle, PlayerCustom.PlayerPrimaryRolePower role) { string playerPref = "GAME_SETTINGS_NALES_ROLE_" + role; if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)toggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)toggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.PrimaryRolePowerActive[role] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { PrimaryRolePowerConfig[role].SetIsOnWithoutNotify(true); } } public static void FillSecondaryRoleToggle(Toggle toggle, PlayerCustom.PlayerSecondaryRole role) { string playerPref = "GAME_SETTINGS_NALES_ROLE_" + role; if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)toggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)toggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.SecondaryRoleActive[role] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { SecondaryRolesConfig[role].SetIsOnWithoutNotify(true); } } public static void FillEventChanceDropdown() { TMP_Dropdown dropdown = EventChanceConfig; if (!PlayerPrefs.HasKey("GAME_SETTINGS_EVENT_CHANCE")) { PlayerPrefs.SetInt("GAME_SETTINGS_EVENT_CHANCE", 2); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.EventChance = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_EVENT_CHANCE", index); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_EVENT_CHANCE")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_EVENT_CHANCE"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillEventToggle(Toggle toggle, EventsManager.EventType dailyEvent) { string playerPref = "NALES_EVENT_" + dailyEvent.ToString().ToUpper(); if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)toggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)toggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.EventsActive[dailyEvent] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { EventsConfig[dailyEvent].SetIsOnWithoutNotify(true); } } public void FillTrapsModifiedToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_TRAPS_MODIFIED")) { PlayerPrefs.SetInt("GAME_SETTINGS_TRAPS_MODIFIED", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_TRAPS_MODIFIED") && PlayerPrefs.GetInt("GAME_SETTINGS_TRAPS_MODIFIED") == 1) { TrapsModified = NetworkBool.op_Implicit(true); TrapsModifiedToggle.SetIsOnWithoutNotify(true); } } public static void UpdateTrapsModified(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.TrapsModified = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_TRAPS_MODIFIED", value ? 1 : 0); } public void UpdateTrapsModifiedSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { TrapsModified = NetworkBool.op_Implicit(value); } } public void FillSmokeBoostedToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_SMOKE_BOOSTED")) { PlayerPrefs.SetInt("GAME_SETTINGS_SMOKE_BOOSTED", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_SMOKE_BOOSTED") && PlayerPrefs.GetInt("GAME_SETTINGS_SMOKE_BOOSTED") == 1) { SmokeBoosted = NetworkBool.op_Implicit(true); SmokeBoostedToggle.SetIsOnWithoutNotify(true); } } public static void UpdateSmokeBoosted(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.SmokeBoosted = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_SMOKE_BOOSTED", value ? 1 : 0); } public void UpdateSmokeBoostedSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { SmokeBoosted = NetworkBool.op_Implicit(value); } } public void FillAnonymousVotesToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_ANONYMOUS_VOTES")) { PlayerPrefs.SetInt("GAME_SETTINGS_ANONYMOUS_VOTES", 0); } if (PlayerPrefs.HasKey("GAME_SETTINGS_ANONYMOUS_VOTES") && PlayerPrefs.GetInt("GAME_SETTINGS_ANONYMOUS_VOTES") == 1) { AnonymousVotes = NetworkBool.op_Implicit(true); AnonymousVotesToggle.SetIsOnWithoutNotify(true); } } public static void UpdateAnonymousVotes(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.AnonymousVotes = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_ANONYMOUS_VOTES", value ? 1 : 0); } public void UpdateAnonymousVotesSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { AnonymousVotes = NetworkBool.op_Implicit(value); } } public void FillSabotagesAvailableToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_SABOTAGES_AVAILABLE")) { PlayerPrefs.SetInt("GAME_SETTINGS_SABOTAGES_AVAILABLE", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_SABOTAGES_AVAILABLE") && PlayerPrefs.GetInt("GAME_SETTINGS_SABOTAGES_AVAILABLE") == 1) { SabotagesAvailable = NetworkBool.op_Implicit(true); SabotagesAvailableToggle.SetIsOnWithoutNotify(true); } } public static void UpdateSabotagesAvailable(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.SabotagesAvailable = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_SABOTAGES_AVAILABLE", value ? 1 : 0); } public void UpdateSabotagesAvailableSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { SabotagesAvailable = NetworkBool.op_Implicit(value); } } public void FillDropItemsAvailableToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_DROP_ITEMS_AVAILABLE")) { PlayerPrefs.SetInt("GAME_SETTINGS_DROP_ITEMS_AVAILABLE", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_DROP_ITEMS_AVAILABLE") && PlayerPrefs.GetInt("GAME_SETTINGS_DROP_ITEMS_AVAILABLE") == 1) { DropItemsAvailable = NetworkBool.op_Implicit(true); DropItemsAvailableToggle.SetIsOnWithoutNotify(true); } } public static void UpdateDropItemsAvailable(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.DropItemsAvailable = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_DROP_ITEMS_AVAILABLE", value ? 1 : 0); } public void UpdateDropItemsAvailableSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { DropItemsAvailable = NetworkBool.op_Implicit(value); } } public static void FillNightFogDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_NIGHT_FOG")) { PlayerPrefs.SetInt("GAME_SETTINGS_NIGHT_FOG", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.NightFog = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_NIGHT_FOG", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_NIGHT_FOG")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_NIGHT_FOG"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public void FillWolvesCanUseItemsToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS")) { PlayerPrefs.SetInt("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS") && PlayerPrefs.GetInt("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS") == 1) { WolvesCanUseItems = NetworkBool.op_Implicit(true); WolvesCanUseItemsToggle.SetIsOnWithoutNotify(true); } } public static void UpdateWolvesCanUseItems(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.WolvesCanUseItems = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS", value ? 1 : 0); } public void UpdateWolvesCanUseItemsSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { WolvesCanUseItems = NetworkBool.op_Implicit(value); } } public void FillDraftModeToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_DRAFT_MODE")) { PlayerPrefs.SetInt("GAME_SETTINGS_DRAFT_MODE", 0); } if (PlayerPrefs.HasKey("GAME_SETTINGS_DRAFT_MODE") && PlayerPrefs.GetInt("GAME_SETTINGS_DRAFT_MODE") == 1) { DraftMode = NetworkBool.op_Implicit(true); DraftModeToggle.SetIsOnWithoutNotify(true); } } public static void UpdateDraftMode(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.DraftMode = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_DRAFT_MODE", value ? 1 : 0); } public void UpdateDraftModeSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { DraftMode = NetworkBool.op_Implicit(value); } } public void FillShowLastGameSummaryToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY")) { PlayerPrefs.SetInt("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY") && PlayerPrefs.GetInt("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY") == 1) { ShowLastGameSummary = NetworkBool.op_Implicit(true); ShowLastGameSummaryToggle.SetIsOnWithoutNotify(true); } } public static void UpdateShowLastGameSummary(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.ShowLastGameSummary = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY", value ? 1 : 0); } public void UpdateShowLastGameSummarySetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { ShowLastGameSummary = NetworkBool.op_Implicit(value); } } public static void FillSpyPercentageDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_SPY_PERCENTAGE")) { PlayerPrefs.SetInt("GAME_SETTINGS_SPY_PERCENTAGE", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.SpyPercentage = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_SPY_PERCENTAGE", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_SPY_PERCENTAGE")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_SPY_PERCENTAGE"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillScientistResearchSpeedDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED")) { PlayerPrefs.SetInt("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.ScientistResearchSpeed = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillMercenaryPercentageDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_SMUGGLER_PERCENTAGE")) { PlayerPrefs.SetInt("GAME_SETTINGS_SMUGGLER_PERCENTAGE", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.MercenaryPercentage = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_SMUGGLER_PERCENTAGE", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_SMUGGLER_PERCENTAGE")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_SMUGGLER_PERCENTAGE"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillLoverVillagerHungerSpeedDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED")) { PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.LoverVillagerHungerSpeed = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public static void FillCultistSpeedPercentageDropdown(TMP_Dropdown dropdown) { if (!PlayerPrefs.HasKey("GAME_SETTINGS_CULTIST_SPEED")) { PlayerPrefs.SetInt("GAME_SETTINGS_CULTIST_SPEED", 5); } ((UnityEventBase)dropdown.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)dropdown.onValueChanged).AddListener((UnityAction)delegate(int index) { Plugin.CustomConfig.CultistSpeed = int.Parse(dropdown.options[index].text.Replace("%", "")); PlayerPrefs.SetInt("GAME_SETTINGS_CULTIST_SPEED", index); }); if (PlayerPrefs.HasKey("GAME_SETTINGS_CULTIST_SPEED")) { int @int = PlayerPrefs.GetInt("GAME_SETTINGS_CULTIST_SPEED"); if (@int < dropdown.options.Count) { dropdown.SetValueWithoutNotify(@int); } } } public void FillDeceiverHasFlatulenceChanceToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE")) { PlayerPrefs.SetInt("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE") && PlayerPrefs.GetInt("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE") == 1) { DeceiverHasFlatulenceChance = NetworkBool.op_Implicit(true); DeceiverHasFlatulenceChanceToggle.SetIsOnWithoutNotify(true); } } public static void UpdateDeceiverHasFlatulenceChance(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.DeceiverHasFlatulenceChance = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE", value ? 1 : 0); } public void UpdateDeceiverHasFlatulenceChanceSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { DeceiverHasFlatulenceChance = NetworkBool.op_Implicit(value); } } public void FillLoverWolfReplacesVillagerToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER")) { PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER") && PlayerPrefs.GetInt("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER") == 1) { LoverWolfReplacesVillager = NetworkBool.op_Implicit(true); LoverWolfReplacesVillagerToggle.SetIsOnWithoutNotify(true); } } public static void UpdateLoverWolfReplacesVillagerChance(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.LoverWolfReplacesVillager = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER", value ? 1 : 0); } public void UpdateLoverWolfReplacesVillagerSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { LoverWolfReplacesVillager = NetworkBool.op_Implicit(value); } } public void FillAllowMayorToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_ALLOW_MAYOR")) { PlayerPrefs.SetInt("GAME_SETTINGS_ALLOW_MAYOR", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_ALLOW_MAYOR") && PlayerPrefs.GetInt("GAME_SETTINGS_ALLOW_MAYOR") == 1) { AllowMayor = NetworkBool.op_Implicit(true); AllowMayorToggle.SetIsOnWithoutNotify(true); } } public static void UpdateAllowMayor(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.AllowMayor = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_ALLOW_MAYOR", value ? 1 : 0); } public void UpdateAllowMayorSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { AllowMayor = NetworkBool.op_Implicit(value); } } public void FillTenacityHubrisToggle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!PlayerPrefs.HasKey("GAME_SETTINGS_TENACITY_HUBRIS")) { PlayerPrefs.SetInt("GAME_SETTINGS_TENACITY_HUBRIS", 1); } if (PlayerPrefs.HasKey("GAME_SETTINGS_TENACITY_HUBRIS") && PlayerPrefs.GetInt("GAME_SETTINGS_TENACITY_HUBRIS") == 1) { TenacityHubris = NetworkBool.op_Implicit(true); TenacityHubrisToggle.SetIsOnWithoutNotify(true); } } public static void UpdateTenacityHubris(bool value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Plugin.CustomConfig.TenacityHubris = NetworkBool.op_Implicit(value); PlayerPrefs.SetInt("GAME_SETTINGS_TENACITY_HUBRIS", value ? 1 : 0); } public void UpdateTenacityHubrisSetting(bool value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((SimulationBehaviour)this).Runner.IsServer && (int)GameManager.State.Current == 1) { TenacityHubris = NetworkBool.op_Implicit(value); } } public static void FillPotionToggle(Toggle potionToggle, Effect effect) { string playerPref = "GAME_SETTINGS_NALES_POTION_" + effect.GetTranslateKey(); if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)potionToggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)potionToggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.PotionsAvailability[effect.GetTranslateKey()] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { PotionsConfig[effect.GetTranslateKey()].SetIsOnWithoutNotify(true); } } public static void FillGadgetToggle(Toggle gadgetToggle, string itemKey) { string playerPref = "GAME_SETTINGS_" + itemKey; if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)gadgetToggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)gadgetToggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.GadgetsAvailability[itemKey] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { GadgetsConfig[itemKey].SetIsOnWithoutNotify(true); } } public static void FillAccessoryToggle(Toggle accessoryToggle, string itemKey) { string playerPref = "GAME_SETTINGS_" + itemKey; if (!PlayerPrefs.HasKey(playerPref)) { PlayerPrefs.SetInt(playerPref, 1); } ((UnityEventBase)accessoryToggle.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)accessoryToggle.onValueChanged).AddListener((UnityAction)delegate(bool value) { Plugin.CustomConfig.AccessoriesAvailability[itemKey] = value; PlayerPrefs.SetInt(playerPref, value ? 1 : 0); UIOptionsDisplayPanel.SendRefreshToClients(); }); if (PlayerPrefs.HasKey(playerPref) && PlayerPrefs.GetInt(playerPref) == 1) { AccessoriesConfig[itemKey].SetIsOnWithoutNotify(true); } } public void ResetToDefault() { //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) SoloRolesCountConfig.value = 1; TraitorsCountConfig.value = 0; WolfPupsCountConfig.value = 0; WolfPowersCountConfig.value = 3; VillagerPowersChanceConfig.value = 10; ElitesCountConfig.value = 2; AvatarChanceConfig.value = 3; GuardianAngelsCountConfig.value = 1; GhostsCountConfig.value = 1; SpectersCountConfig.value = 1; SecondaryRolesCountConfig.value = 15; EventChanceConfig.value = 2; PlayerPrefs.SetInt("GAME_SETTINGS_SOLO_ROLES_COUNT", 1); PlayerPrefs.SetInt("GAME_SETTINGS_TRAITORS_COUNT", 0); PlayerPrefs.SetInt("GAME_SETTINGS_WOLF_PUPS_COUNT", 0); PlayerPrefs.SetInt("GAME_SETTINGS_PRIMARY_ROLE_POWERS_COUNT", 3); PlayerPrefs.SetInt("GAME_SETTINGS_VILLAGER_PRIMARY_ROLE_POWERS_CHANCE", 10); PlayerPrefs.SetInt("GAME_SETTINGS_AVATAR_CHANCE", 3); PlayerPrefs.SetInt("GAME_SETTINGS_GUARDIAN_ANGELS_COUNT", 1); PlayerPrefs.SetInt("GAME_SETTINGS_GHOSTS_COUNT", 1); PlayerPrefs.SetInt("GAME_SETTINGS_SPECTERS_COUNT", 1); PlayerPrefs.SetInt("GAME_SETTINGS_SECONDARY_ROLES_COUNT", 15); PlayerPrefs.SetInt("GAME_SETTINGS_EVENT_CHANCE", 2); foreach (KeyValuePair item in SoloRolesConfig) { item.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_NALES_ROLE_" + item.Key, 1); } foreach (KeyValuePair item2 in PrimaryRolePowerConfig) { item2.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_NALES_ROLE_" + item2.Key, 1); } foreach (KeyValuePair item3 in SecondaryRolesConfig) { item3.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_NALES_ROLE_" + item3.Key, 1); } SpyPercentageDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_SPY_PERCENTAGE", 5); ScientistResearchSpeedDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_SCIENTIST_RESEARCH_SPEED", 5); MercenaryPercentageDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_SMUGGLER_PERCENTAGE", 5); LoverVillagerHungerSpeedDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_VILLAGER_HUNGER_SPEED", 5); CultistSpeedDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_CULTIST_SPEED", 5); DeceiverHasFlatulenceChanceToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_DECEIVER_HAS_FLATULENCE_CHANCE", 1); DeceiverHasFlatulenceChance = NetworkBool.op_Implicit(true); LoverWolfReplacesVillagerToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_LOVER_WOLF_REPLACES_VILLAGER", 1); LoverWolfReplacesVillager = NetworkBool.op_Implicit(true); AllowMayorToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_ALLOW_MAYOR", 1); AllowMayor = NetworkBool.op_Implicit(true); TenacityHubrisToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_TENACITY_HUBRIS", 1); TenacityHubris = NetworkBool.op_Implicit(true); TrapsModifiedToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_TRAPS_MODIFIED", 1); TrapsModified = NetworkBool.op_Implicit(true); SmokeBoostedToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_SMOKE_BOOSTED", 1); SmokeBoosted = NetworkBool.op_Implicit(true); AnonymousVotesToggle.SetIsOnWithoutNotify(false); PlayerPrefs.SetInt("GAME_SETTINGS_ANONYMOUS_VOTES", 0); AnonymousVotes = NetworkBool.op_Implicit(false); SabotagesAvailableToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_SABOTAGES_AVAILABLE", 1); SabotagesAvailable = NetworkBool.op_Implicit(true); DropItemsAvailableToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_DROP_ITEMS_AVAILABLE", 1); DropItemsAvailable = NetworkBool.op_Implicit(true); NightFogDropdown.value = 5; PlayerPrefs.SetInt("GAME_SETTINGS_NIGHT_FOG", 5); WolvesCanUseItemsToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_WOLVES_CAN_USE_ITEMS", 1); WolvesCanUseItems = NetworkBool.op_Implicit(true); DraftModeToggle.SetIsOnWithoutNotify(false); PlayerPrefs.SetInt("GAME_SETTINGS_DRAFT_MODE", 0); DraftMode = NetworkBool.op_Implicit(false); ShowLastGameSummaryToggle.SetIsOnWithoutNotify(true); PlayerPrefs.SetInt("GAME_SETTINGS_SHOW_LAST_GAME_SUMMARY", 1); DraftMode = NetworkBool.op_Implicit(true); foreach (KeyValuePair item4 in PotionsConfig) { item4.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_NALES_POTION_" + item4.Key, 1); } foreach (KeyValuePair item5 in GadgetsConfig) { item5.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_" + item5.Key, 1); } foreach (KeyValuePair item6 in AccessoriesConfig) { item6.Value.isOn = true; PlayerPrefs.SetInt("GAME_SETTINGS_" + item6.Key, 1); } UIOptionsDisplayPanel.SendRefreshToClients(); } private static Toggle GetToggle(GameSettingsUI gameSettingsUI, string key, List arguments, ConfigTypeEnum type, Color textColor) { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) Toggle value = Traverse.Create((object)gameSettingsUI).Field("showAllyToggle").Value; Transform parent = ((Component)value).transform.parent.parent.parent; Transform parent2 = ((Component)value).transform.parent.parent.parent.parent; Transform val = Object.Instantiate(parent, parent2); switch (type) { case ConfigTypeEnum.RolesVillagers: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesEnemies: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesSecondary: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesDetails: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Others: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Potions: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Gadgets: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Events: ((Component)val).gameObject.AddComponent(); break; } LocalizeStringEvent val2 = ((Component)val).GetComponentsInChildren().First((LocalizeStringEvent o) => ((Object)o).name == "SettingNameText"); val2.StringReference.Arguments = arguments; ((LocalizedReference)val2.StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit(key)); ((Graphic)((Component)val).GetComponentInChildren()).color = textColor; Toggle componentInChildren = ((Component)val).GetComponentInChildren(); GameObject gameObject = ((Component)componentInChildren).gameObject; Object.DestroyImmediate((Object)(object)componentInChildren); componentInChildren = gameObject.AddComponent(); componentInChildren.graphic = ((Component)((Component)componentInChildren).transform.Find("Background").Find("Checkmark")).GetComponent(); return componentInChildren; } private static TMP_Dropdown GetDropdown(GameSettingsUI gameSettingsUI, string key, List options, ConfigTypeEnum type, Color textColor) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) TMP_Dropdown value = Traverse.Create((object)gameSettingsUI).Field("alchemistsCountDropdown").Value; Transform parent = ((Component)value).transform.parent.parent.parent; Transform parent2 = ((Component)value).transform.parent.parent.parent.parent; Transform val = Object.Instantiate(parent, parent2); switch (type) { case ConfigTypeEnum.RolesVillagers: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesEnemies: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesSecondary: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.RolesDetails: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Others: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Potions: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Gadgets: ((Component)val).gameObject.AddComponent(); break; case ConfigTypeEnum.Events: ((Component)val).gameObject.AddComponent(); break; } ((Graphic)((Component)val).GetComponentInChildren()).color = textColor; LocalizeStringEvent val2 = ((Component)val).GetComponentsInChildren().First((LocalizeStringEvent o) => ((Object)o).name == "SettingNameText"); val2.StringReference.Arguments = new List { TranslationManager.Instance.GetTranslation(key) }; ((LocalizedReference)val2.StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit(key)); TMP_Dropdown componentInChildren = ((Component)val).GetComponentInChildren(); componentInChildren.ClearOptions(); componentInChildren.AddOptions(options); return componentInChildren; } public static void OnClickConfigBase() { ToggleConfigType(ConfigTypeEnum.Base); } public static void OnClickConfigRolesVillagers() { ToggleConfigType(ConfigTypeEnum.RolesVillagers); } public static void OnClickConfigRolesEnemies() { ToggleConfigType(ConfigTypeEnum.RolesEnemies); } public static void OnClickConfigRolesSecondary() { ToggleConfigType(ConfigTypeEnum.RolesSecondary); } public static void OnClickConfigRolesDetails() { ToggleConfigType(ConfigTypeEnum.RolesDetails); } public static void OnClickConfigOthers() { ToggleConfigType(ConfigTypeEnum.Others); } public static void OnClickConfigPotions() { ToggleConfigType(ConfigTypeEnum.Potions); } public static void OnClickConfigGadgets() { ToggleConfigType(ConfigTypeEnum.Gadgets); } public static void OnClickConfigEvents() { ToggleConfigType(ConfigTypeEnum.Events); } private static void ToggleConfigType(ConfigTypeEnum configType) { try { Toggle[] componentsInChildren = GameSettingsObject.GetComponentsInChildren(true); TMP_Dropdown[] componentsInChildren2 = GameSettingsObject.GetComponentsInChildren(true); List list = new List(); Toggle[] array = componentsInChildren; foreach (Toggle val in array) { if (((Object)((Component)val).gameObject).name != "Item") { Transform parent = ((Component)val).transform.parent.parent.parent; list.Add(((Component)parent).gameObject); } } TMP_Dropdown[] array2 = componentsInChildren2; foreach (TMP_Dropdown val2 in array2) { Transform parent2 = ((Component)val2).transform.parent.parent.parent; list.Add(((Component)parent2).gameObject); } RoleVillagerConfigComponent roleVillagerConfigComponent = default(RoleVillagerConfigComponent); RoleEnemyConfigComponent roleEnemyConfigComponent = default(RoleEnemyConfigComponent); RoleSecondaryConfigComponent roleSecondaryConfigComponent = default(RoleSecondaryConfigComponent); RoleDetailsConfigComponent roleDetailsConfigComponent = default(RoleDetailsConfigComponent); OtherConfigComponent otherConfigComponent = default(OtherConfigComponent); PotionConfigComponent potionConfigComponent = default(PotionConfigComponent); GadgetConfigComponent gadgetConfigComponent = default(GadgetConfigComponent); EventConfigComponent eventConfigComponent = default(EventConfigComponent); foreach (GameObject item in list) { if (item.TryGetComponent(ref roleVillagerConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.RolesVillagers); } else if (item.TryGetComponent(ref roleEnemyConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.RolesEnemies); } else if (item.TryGetComponent(ref roleSecondaryConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.RolesSecondary); } else if (item.TryGetComponent(ref roleDetailsConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.RolesDetails); } else if (item.TryGetComponent(ref otherConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.Others); } else if (item.TryGetComponent(ref potionConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.Potions); } else if (item.TryGetComponent(ref gadgetConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.Gadgets); } else if (item.TryGetComponent(ref eventConfigComponent)) { item.SetActive(configType == ConfigTypeEnum.Events); } else { item.SetActive(configType == ConfigTypeEnum.Base); } } RoleInfoObject.SetActive(configType == ConfigTypeEnum.RolesVillagers || configType == ConfigTypeEnum.RolesEnemies || configType == ConfigTypeEnum.RolesSecondary); GadgetsInfoObject.SetActive(configType == ConfigTypeEnum.Gadgets); AccessoriesInfoObject.SetActive(configType == ConfigTypeEnum.Gadgets); } catch (Exception ex) { Plugin.Logger.LogError((object)("ToggleConfigType error: " + ex)); } } } [HarmonyPatch(typeof(GameSettingsUI), "Start")] internal class GameConfigAddNewSettingsPatch { [CompilerGenerated] private static class <>O { public static UnityAction <0>__UpdateDeceiverHasFlatulenceChance; public static UnityAction <1>__UpdateLoverWolfReplacesVillagerChance; public static UnityAction <2>__UpdateTrapsModified; public static UnityAction <3>__UpdateSmokeBoosted; public static UnityAction <4>__UpdateAnonymousVotes; public static UnityAction <5>__UpdateSabotagesAvailable; public static UnityAction <6>__UpdateDropItemsAvailable; public static UnityAction <7>__UpdateWolvesCanUseItems; public static UnityAction <8>__UpdateDraftMode; public static UnityAction <9>__UpdateAllowMayor; public static UnityAction <10>__UpdateShowLastGameSummary; public static UnityAction <11>__UpdateTenacityHubris; public static UnityAction <12>__OnClickConfigBase; public static UnityAction <13>__OnClickConfigRolesVillagers; public static UnityAction <14>__OnClickConfigRolesEnemies; public static UnityAction <15>__OnClickConfigRolesSecondary; public static UnityAction <16>__OnClickConfigRolesDetails; public static UnityAction <17>__OnClickConfigOthers; public static UnityAction <18>__OnClickConfigPotions; public static UnityAction <19>__OnClickConfigGadgets; public static UnityAction <20>__OnClickConfigEvents; } private static void Postfix(GameSettingsUI __instance) { //IL_00a7: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0869: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Unknown result type (might be due to invalid IL or missing references) //IL_09a9: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09b2: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09b8: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Expected I4, but got Unknown //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09df: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b9b: Unknown result type (might be due to invalid IL or missing references) //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) //IL_0be7: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0d0c: Unknown result type (might be due to invalid IL or missing references) //IL_0d85: Unknown result type (might be due to invalid IL or missing references) //IL_0d8f: Unknown result type (might be due to invalid IL or missing references) //IL_0da1: Unknown result type (might be due to invalid IL or missing references) //IL_0da6: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0e1f: Unknown result type (might be due to invalid IL or missing references) //IL_0e31: Unknown result type (might be due to invalid IL or missing references) //IL_0e36: Unknown result type (might be due to invalid IL or missing references) //IL_0e55: Unknown result type (might be due to invalid IL or missing references) //IL_0de4: Unknown result type (might be due to invalid IL or missing references) //IL_0de9: Unknown result type (might be due to invalid IL or missing references) //IL_0def: Expected O, but got Unknown //IL_0eaa: Unknown result type (might be due to invalid IL or missing references) //IL_0eb4: Unknown result type (might be due to invalid IL or missing references) //IL_0ec6: Unknown result type (might be due to invalid IL or missing references) //IL_0ecb: Unknown result type (might be due to invalid IL or missing references) //IL_0eea: Unknown result type (might be due to invalid IL or missing references) //IL_0e79: Unknown result type (might be due to invalid IL or missing references) //IL_0e7e: Unknown result type (might be due to invalid IL or missing references) //IL_0e84: Expected O, but got Unknown //IL_0f3f: Unknown result type (might be due to invalid IL or missing references) //IL_0f49: Unknown result type (might be due to invalid IL or missing references) //IL_0f5b: Unknown result type (might be due to invalid IL or missing references) //IL_0f60: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_0f0e: Unknown result type (might be due to invalid IL or missing references) //IL_0f13: Unknown result type (might be due to invalid IL or missing references) //IL_0f19: Expected O, but got Unknown //IL_0fd4: Unknown result type (might be due to invalid IL or missing references) //IL_0fde: Unknown result type (might be due to invalid IL or missing references) //IL_0ff0: Unknown result type (might be due to invalid IL or missing references) //IL_0ff5: Unknown result type (might be due to invalid IL or missing references) //IL_1014: Unknown result type (might be due to invalid IL or missing references) //IL_0fa3: Unknown result type (might be due to invalid IL or missing references) //IL_0fa8: Unknown result type (might be due to invalid IL or missing references) //IL_0fae: Expected O, but got Unknown //IL_1069: Unknown result type (might be due to invalid IL or missing references) //IL_1073: Unknown result type (might be due to invalid IL or missing references) //IL_1085: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_10a9: Unknown result type (might be due to invalid IL or missing references) //IL_1038: Unknown result type (might be due to invalid IL or missing references) //IL_103d: Unknown result type (might be due to invalid IL or missing references) //IL_1043: Expected O, but got Unknown //IL_10fe: Unknown result type (might be due to invalid IL or missing references) //IL_1108: Unknown result type (might be due to invalid IL or missing references) //IL_111a: Unknown result type (might be due to invalid IL or missing references) //IL_111f: Unknown result type (might be due to invalid IL or missing references) //IL_113e: Unknown result type (might be due to invalid IL or missing references) //IL_10cd: Unknown result type (might be due to invalid IL or missing references) //IL_10d2: Unknown result type (might be due to invalid IL or missing references) //IL_10d8: Expected O, but got Unknown //IL_1193: Unknown result type (might be due to invalid IL or missing references) //IL_119d: Unknown result type (might be due to invalid IL or missing references) //IL_11af: Unknown result type (might be due to invalid IL or missing references) //IL_11b4: Unknown result type (might be due to invalid IL or missing references) //IL_11d3: Unknown result type (might be due to invalid IL or missing references) //IL_1162: Unknown result type (might be due to invalid IL or missing references) //IL_1167: Unknown result type (might be due to invalid IL or missing references) //IL_116d: Expected O, but got Unknown //IL_1228: Unknown result type (might be due to invalid IL or missing references) //IL_1232: Unknown result type (might be due to invalid IL or missing references) //IL_1244: Unknown result type (might be due to invalid IL or missing references) //IL_1249: Unknown result type (might be due to invalid IL or missing references) //IL_1268: Unknown result type (might be due to invalid IL or missing references) //IL_11f7: Unknown result type (might be due to invalid IL or missing references) //IL_11fc: Unknown result type (might be due to invalid IL or missing references) //IL_1202: Expected O, but got Unknown //IL_1425: Unknown result type (might be due to invalid IL or missing references) //IL_128c: Unknown result type (might be due to invalid IL or missing references) //IL_1291: Unknown result type (might be due to invalid IL or missing references) //IL_1297: Expected O, but got Unknown try { GameConfig.SoloRolesConfig.Clear(); GameConfig.PrimaryRolePowerConfig.Clear(); GameConfig.SecondaryRolesConfig.Clear(); GameConfig.PotionsConfig.Clear(); GameConfig.GadgetsConfig.Clear(); GameConfig.AccessoriesConfig.Clear(); Transform parent = ((TMP_Text)Object.FindObjectsOfType(true).First((TextMeshProUGUI o) => ((Object)((Component)((TMP_Text)o).transform.parent).gameObject).name == "GameSettingsTitle")).transform.parent; Transform val = Object.Instantiate(parent, parent.parent); ((TMP_Text)((Component)val).GetComponentInChildren()).fontSize = 24f; ((LocalizedReference)((Component)val).GetComponentInChildren().StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit("NALES_CONFIG_ROLE_INFO")); GameConfig.RoleInfoObject = ((Component)val).gameObject; GameConfig.VillagerPowersChanceConfig = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_VILLAGER_COUNT", GameConfig.ConfigTypeEnum.RolesVillagers, GameConfig.ColorVillagerJob, 0, 100, 10); GameConfig.FillPrimaryRoleVillagerPowersChanceDropdown(); List list = (from PlayerCustom.PlayerPrimaryRolePower o in Enum.GetValues(typeof(PlayerCustom.PlayerPrimaryRolePower)) where o != 0 && PlayerCustom.IsPrimaryRolePowerForNormalVillagers(o) && !PlayerCustom.IsPrimaryRolePowerDisabled(o) && o != PlayerCustom.PlayerPrimaryRolePower.Avatar select o).ToList(); foreach (PlayerCustom.PlayerPrimaryRolePower item2 in list) { GameConfig.CreateAndAttachPrimaryRolePowerConfigToggle(__instance, item2, TranslationManager.Instance.GetTranslation("NALES_ROLE_" + PlayerCustom.GetPrimaryRolePowerString(item2))); } GameConfig.AvatarChanceConfig = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_AVATAR_CHANCE", GameConfig.ConfigTypeEnum.RolesVillagers, GameConfig.ColorVillagerJob, 0, 100, 10); GameConfig.FillPrimaryRoleAvatarChanceDropdown(); GameConfig.ElitesCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_ELITES", 3, GameConfig.ConfigTypeEnum.RolesVillagers, GameConfig.ColorVillagerJob); GameConfig.FillElitesCountDropdown(); List list2 = (from PlayerCustom.PlayerPrimaryRolePower o in Enum.GetValues(typeof(PlayerCustom.PlayerPrimaryRolePower)) where o != 0 && !PlayerCustom.IsPrimaryRolePowerDisabled(o) && PlayerCustom.IsPrimaryRolePowerForEliteVillagers(o) select o).ToList(); foreach (PlayerCustom.PlayerPrimaryRolePower item3 in list2) { GameConfig.CreateAndAttachPrimaryRolePowerConfigToggle(__instance, item3, TranslationManager.Instance.GetTranslation("NALES_ROLE_" + PlayerCustom.GetPrimaryRolePowerString(item3))); } GameConfig.GuardianAngelsCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_GUARDIAN_ANGELS", 6, GameConfig.ConfigTypeEnum.RolesVillagers, GameConfig.ColorVillagerJob); GameConfig.FillGuardianAngelsCountDropdown(); GameConfig.GhostsCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_GHOSTS", 6, GameConfig.ConfigTypeEnum.RolesVillagers, GameConfig.ColorVillagerJob); GameConfig.FillGhostsCountDropdown(); GameConfig.SoloRolesCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_SOLO_COUNT", 5, GameConfig.ConfigTypeEnum.RolesEnemies, GameConfig.ColorSoloRole); GameConfig.FillSoloRolesCountDropdown(); List list3 = (from PlayerCustom.PlayerNewPrimaryRole o in Enum.GetValues(typeof(PlayerCustom.PlayerNewPrimaryRole)) where o != 0 && o != PlayerCustom.PlayerNewPrimaryRole.Traitor && !PlayerCustom.IsNewPrimaryRoleDisabled(o) select o).ToList(); foreach (PlayerCustom.PlayerNewPrimaryRole item4 in list3) { GameConfig.CreateAndAttachSoloRoleConfigToggle(__instance, item4, TranslationManager.Instance.GetTranslation("NALES_ROLE_" + PlayerCustom.GetNewPrimaryRoleString(item4))); } GameConfig.TraitorsCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_TRAITOR_COUNT", 4, GameConfig.ConfigTypeEnum.RolesEnemies, GameConfig.ColorTraitor); GameConfig.FillTraitorsCountDropdown(); GameConfig.WolfPupsCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_WOLF_PUP_COUNT", 4, GameConfig.ConfigTypeEnum.RolesEnemies, GameConfig.ColorWolfPup); GameConfig.FillWolfPupsCountDropdown(); GameConfig.WolfPowersCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_TYPE_MAIN_WOLF_COUNT", 6, GameConfig.ConfigTypeEnum.RolesEnemies, GameConfig.ColorWolfPower); GameConfig.FillPrimaryRolePowersCountDropdown(); List list4 = (from PlayerCustom.PlayerPrimaryRolePower o in Enum.GetValues(typeof(PlayerCustom.PlayerPrimaryRolePower)) where o != 0 && PlayerCustom.IsPrimaryRolePowerForWolves(o) && !PlayerCustom.IsPrimaryRolePowerDisabled(o) select o).ToList(); foreach (PlayerCustom.PlayerPrimaryRolePower item5 in list4) { GameConfig.CreateAndAttachPrimaryRolePowerConfigToggle(__instance, item5, TranslationManager.Instance.GetTranslation("NALES_ROLE_" + PlayerCustom.GetPrimaryRolePowerString(item5))); } GameConfig.SpectersCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_SPECTERS", 3, GameConfig.ConfigTypeEnum.RolesEnemies, GameConfig.ColorWolfPower); GameConfig.FillSpectersCountDropdown(); GameConfig.SecondaryRolesCountConfig = GameConfig.CreateAndAttachConfigDropdownWithMax(__instance, "NALES_CONFIG_ROLE_TYPE_SECONDARY_COUNT", 15, GameConfig.ConfigTypeEnum.RolesSecondary, GameConfig.ColorSecondaryRole); GameConfig.FillSecondaryRolesCountDropdown(); List list5 = (from PlayerCustom.PlayerSecondaryRole o in Enum.GetValues(typeof(PlayerCustom.PlayerSecondaryRole)) where o != 0 && !PlayerCustom.IsSecondaryRoleDisabled(o) select o).ToList(); foreach (PlayerCustom.PlayerSecondaryRole item6 in list5) { GameConfig.CreateAndAttachSecondaryRoleConfigToggle(__instance, item6, TranslationManager.Instance.GetTranslation("NALES_ROLE_" + PlayerCustom.GetSecondaryRoleString(item6))); } GameConfig.SpyPercentageDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_CONFIG_SPY_AMOUNT", GameConfig.ConfigTypeEnum.RolesDetails, Color.white, 50, 150, 10); GameConfig.FillSpyPercentageDropdown(GameConfig.SpyPercentageDropdown); GameConfig.ScientistResearchSpeedDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_CONFIG_SCIENTIST_SPEED", GameConfig.ConfigTypeEnum.RolesDetails, Color.white, 50, 150, 10); GameConfig.FillScientistResearchSpeedDropdown(GameConfig.ScientistResearchSpeedDropdown); GameConfig.MercenaryPercentageDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_CONFIG_MERCENARY_AMOUNT", GameConfig.ConfigTypeEnum.RolesDetails, Color.white, 50, 150, 10); GameConfig.FillMercenaryPercentageDropdown(GameConfig.MercenaryPercentageDropdown); GameConfig.LoverVillagerHungerSpeedDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_CONFIG_LOVER_VILLAGER_HUNGER", GameConfig.ConfigTypeEnum.RolesDetails, Color.white, 50, 150, 10); GameConfig.FillLoverVillagerHungerSpeedDropdown(GameConfig.LoverVillagerHungerSpeedDropdown); GameConfig.CultistSpeedDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_ROLE_CONFIG_CULTIST_SPEED", GameConfig.ConfigTypeEnum.RolesDetails, Color.white, 50, 150, 10); GameConfig.FillCultistSpeedPercentageDropdown(GameConfig.CultistSpeedDropdown); GameConfig.DeceiverHasFlatulenceChanceToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_ROLE_CONFIG_DECEIVER_FLATULENCE", new List(), GameConfig.ConfigTypeEnum.RolesDetails, Color.white); ((UnityEvent)(object)GameConfig.DeceiverHasFlatulenceChanceToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateDeceiverHasFlatulenceChance); GameConfig.LoverWolfReplacesVillagerToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_ROLE_CONFIG_LOVER_WOLF", new List(), GameConfig.ConfigTypeEnum.RolesDetails, Color.white); ((UnityEvent)(object)GameConfig.LoverWolfReplacesVillagerToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateLoverWolfReplacesVillagerChance); GameConfig.TrapsModifiedToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_TRAP_CHANGES", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.TrapsModifiedToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateTrapsModified); GameConfig.SmokeBoostedToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_SMOKE_CHANGES", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.SmokeBoostedToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateSmokeBoosted); GameConfig.AnonymousVotesToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_ANONYMOUS_VOTES", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.AnonymousVotesToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateAnonymousVotes); GameConfig.SabotagesAvailableToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_SABOTAGES_AVAILABLE", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.SabotagesAvailableToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateSabotagesAvailable); GameConfig.DropItemsAvailableToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_DROP_ITEMS_AVAILABLE", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.DropItemsAvailableToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateDropItemsAvailable); GameConfig.NightFogDropdown = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_NIGHT_FOG", GameConfig.ConfigTypeEnum.Others, Color.white, 0, 100, 10); GameConfig.FillNightFogDropdown(GameConfig.NightFogDropdown); GameConfig.WolvesCanUseItemsToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_WOLVES_CAN_USE_ITEMS", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.WolvesCanUseItemsToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateWolvesCanUseItems); GameConfig.DraftModeToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_DRAFT_MODE", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.DraftModeToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateDraftMode); GameConfig.AllowMayorToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_ROLE_CONFIG_ALLOW_MAYOR", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.AllowMayorToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateAllowMayor); GameConfig.ShowLastGameSummaryToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_SHOW_LAST_GAME_SUMMARY", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.ShowLastGameSummaryToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateShowLastGameSummary); GameConfig.TenacityHubrisToggle = GameConfig.CreateAndAttachConfigToggle(__instance, "NALES_CONFIG_ROLE_CONFIG_TENACITY_HUBRIS", new List(), GameConfig.ConfigTypeEnum.Others, Color.white); ((UnityEvent)(object)GameConfig.TenacityHubrisToggle.onValueChanged).AddListener((UnityAction)GameConfig.UpdateTenacityHubris); EffectManager value = Traverse.Create(typeof(EffectManager)).Field("_instance").Value; Effect[] value2 = Traverse.Create((object)value).Field("effects").Value; foreach (Effect item7 in value2.OrderBy((Effect o) => o.GetEffectType())) { Color textColor = Color.white; EffectType effectType = item7.GetEffectType(); EffectType val2 = effectType; switch ((int)val2) { case 0: textColor = Color.green; break; case 1: textColor = Color.white; break; case 2: textColor = Color.red; break; } Toggle val3 = GameConfig.CreateAndAttachConfigToggle(__instance, item7.GetTranslateKey(), new List(), GameConfig.ConfigTypeEnum.Potions, textColor); GameConfig.PotionsConfig[item7.GetTranslateKey()] = val3; GameConfig.FillPotionToggle(val3, item7); } Transform parent2 = ((TMP_Text)Object.FindObjectsOfType(true).First((TextMeshProUGUI o) => ((Object)((Component)((TMP_Text)o).transform.parent).gameObject).name == "GameSettingsTitle")).transform.parent; Transform val4 = Object.Instantiate(parent, parent.parent); ((TMP_Text)((Component)val4).GetComponentInChildren()).fontSize = 24f; ((LocalizedReference)((Component)val4).GetComponentInChildren().StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit("NALES_CONFIG_GADGETS_LIST")); GameConfig.GadgetsInfoObject = ((Component)val4).gameObject; Item[] value3 = Traverse.Create((object)GameManager.Instance).Field("spawnableItemPrefabs").Value; Item[] array = value3; foreach (Item item in array) { string text = ItemUtility.ItemToTranslateKey(item); Toggle val5 = GameConfig.CreateAndAttachConfigToggle(__instance, text, new List(), GameConfig.ConfigTypeEnum.Gadgets, Color.white); GameConfig.GadgetsConfig[text] = val5; GameConfig.FillGadgetToggle(val5, text); } Transform parent3 = ((TMP_Text)Object.FindObjectsOfType(true).First((TextMeshProUGUI o) => ((Object)((Component)((TMP_Text)o).transform.parent).gameObject).name == "GameSettingsTitle")).transform.parent; Transform val6 = Object.Instantiate(parent, parent.parent); ((TMP_Text)((Component)val6).GetComponentInChildren()).fontSize = 24f; ((LocalizedReference)((Component)val6).GetComponentInChildren().StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit("NALES_CONFIG_ACCESSORIES_LIST")); GameConfig.AccessoriesInfoObject = ((Component)val6).gameObject; foreach (Accessory spawnableAccessory in GameManagerCustom.SpawnableAccessories) { string text2 = ItemUtility.ItemToTranslateKey((Item)(object)spawnableAccessory); Toggle val7 = GameConfig.CreateAndAttachConfigToggle(__instance, text2, new List(), GameConfig.ConfigTypeEnum.Gadgets, Color.white); GameConfig.AccessoriesConfig[text2] = val7; GameConfig.FillAccessoryToggle(val7, text2); } GameConfig.EventChanceConfig = GameConfig.CreateAndAttachConfigDropdownWithPercentages(__instance, "NALES_CONFIG_EVENTS_CHANCE", GameConfig.ConfigTypeEnum.Events, Color.green, 0, 100, 10); GameConfig.FillEventChanceDropdown(); List list6 = (from EventsManager.EventType o in Enum.GetValues(typeof(EventsManager.EventType)) where o != EventsManager.EventType.None select o).ToList(); foreach (EventsManager.EventType item8 in list6) { GameConfig.CreateAndAttachEventConfigToggle(__instance, item8); } Button val8 = (Resources.FindObjectsOfTypeAll(typeof(Button)) as Button[]).First((Button o) => ((Object)((Component)o).gameObject).name == "ResetButton"); ((Component)val8).GetComponent().sizeDelta = new Vector2(180f, 70f); GameConfig.GameSettingsObject = ((Component)((Component)val8).transform.parent.parent.parent.parent).gameObject; Transform transform = ((Component)val8).transform; Transform parent4 = ((Component)val8).transform.parent; ((HorizontalOrVerticalLayoutGroup)((Component)parent4).GetComponent()).spacing = 8f; Transform val9 = Object.Instantiate(transform, parent4); LocalizeStringEvent componentInChildren = ((Component)val9).GetComponentInChildren(); ((LocalizedReference)componentInChildren.StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit("NALES_CONFIG_BUTTON_BASE_GAME")); ColorBlock colors = ((Selectable)((Component)val9).GetComponent