From a46cce090da34ccf576f2a9ff7c3dd2464c182c6 Mon Sep 17 00:00:00 2001 From: mxyx0412 Date: Thu, 28 Nov 2024 02:51:15 +0800 Subject: [PATCH] ReName --- TheOtherRoles/Buttons/Buttons.cs | 152 +++++----- TheOtherRoles/CustomGameModes/GuesserGM.cs | 4 +- TheOtherRoles/CustomGameModes/HideNSeekGM.cs | 51 ++-- TheOtherRoles/CustomGameModes/PropHunt.cs | 52 ++-- TheOtherRoles/Helper/Helpers.cs | 6 +- TheOtherRoles/Modules/ModTranslation.cs | 4 +- TheOtherRoles/Objects/Map/AdditionalVents.cs | 4 +- TheOtherRoles/Objects/Map/Airship.cs | 4 +- TheOtherRoles/Objects/Map/BetterPolus.cs | 12 +- TheOtherRoles/Objects/Map/FungleElectrical.cs | 4 +- TheOtherRoles/Objects/Map/Mira.cs | 2 +- TheOtherRoles/Objects/NinjaTrace.cs | 2 +- TheOtherRoles/Options/CustomOptionHolder.cs | 6 +- TheOtherRoles/Options/CustomOptions.cs | 38 +-- TheOtherRoles/Options/ModOption.cs | 57 ++-- TheOtherRoles/Patches/ClientOptionsPatch.cs | 32 +-- .../Patches/CreateOptionsPickerPatch.cs | 16 +- TheOtherRoles/Patches/CredentialsPatch.cs | 16 +- TheOtherRoles/Patches/ExileControllerPatch.cs | 4 +- .../Patches/GameStartManagerPatch.cs | 40 +-- .../Patches/HauntMenuMinigamePatch.cs | 2 +- TheOtherRoles/Patches/IntroPatch.cs | 10 +- TheOtherRoles/Patches/LobbyRoleList.cs | 10 +- TheOtherRoles/Patches/MainMenuPatch.cs | 10 +- TheOtherRoles/Patches/MapBehaviourPatch.cs | 4 +- TheOtherRoles/Patches/MeetingHudPatch.cs | 10 +- TheOtherRoles/Patches/PlayerControlPatch.cs | 4 +- TheOtherRoles/Patches/RoleAssignmentPatch.cs | 261 +++++++++--------- TheOtherRoles/Patches/SabotagePatch.cs | 32 +-- TheOtherRoles/Patches/ShipStatusPatch.cs | 9 +- TheOtherRoles/Patches/TaskCountPatch.cs | 2 +- TheOtherRoles/Patches/UpdatePatch.cs | 2 +- TheOtherRoles/Patches/UsablesPatch.cs | 20 +- TheOtherRoles/RPC.cs | 18 +- TheOtherRoles/Roles/Crewmate/Balancer.cs | 6 +- TheOtherRoles/Roles/Crewmate/BodyGuard.cs | 6 +- TheOtherRoles/Roles/Crewmate/Deputy.cs | 12 +- TheOtherRoles/Roles/Crewmate/Detective.cs | 10 +- TheOtherRoles/Roles/Crewmate/Engineer.cs | 12 +- TheOtherRoles/Roles/Crewmate/Hacker.cs | 18 +- TheOtherRoles/Roles/Crewmate/InfoSleuth.cs | 2 +- TheOtherRoles/Roles/Crewmate/Jumper.cs | 20 +- TheOtherRoles/Roles/Crewmate/Mayor.cs | 8 +- TheOtherRoles/Roles/Crewmate/Medic.cs | 18 +- TheOtherRoles/Roles/Crewmate/Medium.cs | 8 +- TheOtherRoles/Roles/Crewmate/Portalmaker.cs | 10 +- TheOtherRoles/Roles/Crewmate/Prophet.cs | 18 +- TheOtherRoles/Roles/Crewmate/Prosecutor.cs | 6 +- TheOtherRoles/Roles/Crewmate/SecurityGuard.cs | 20 +- TheOtherRoles/Roles/Crewmate/Seer.cs | 6 +- TheOtherRoles/Roles/Crewmate/Sheriff.cs | 30 +- TheOtherRoles/Roles/Crewmate/Snitch.cs | 8 +- TheOtherRoles/Roles/Crewmate/Spy.cs | 6 +- TheOtherRoles/Roles/Crewmate/Swapper.cs | 6 +- TheOtherRoles/Roles/Crewmate/TimeMaster.cs | 6 +- TheOtherRoles/Roles/Crewmate/Tracker.cs | 12 +- TheOtherRoles/Roles/Crewmate/Trapper.cs | 18 +- TheOtherRoles/Roles/Crewmate/Veteran.cs | 4 +- TheOtherRoles/Roles/Crewmate/Vigilante.cs | 6 +- TheOtherRoles/Roles/Guesser.cs | 8 +- TheOtherRoles/Roles/Impostor/Blackmailer.cs | 2 +- TheOtherRoles/Roles/Impostor/Bomber.cs | 12 +- TheOtherRoles/Roles/Impostor/BountyHunter.cs | 10 +- TheOtherRoles/Roles/Impostor/Butcher.cs | 4 +- TheOtherRoles/Roles/Impostor/Camouflager.cs | 4 +- TheOtherRoles/Roles/Impostor/Cleaner.cs | 2 +- TheOtherRoles/Roles/Impostor/Eraser.cs | 6 +- TheOtherRoles/Roles/Impostor/Escapist.cs | 4 +- TheOtherRoles/Roles/Impostor/EvilTrapper.cs | 16 +- TheOtherRoles/Roles/Impostor/Gambler.cs | 6 +- TheOtherRoles/Roles/Impostor/Grenadier.cs | 8 +- TheOtherRoles/Roles/Impostor/Miner.cs | 2 +- TheOtherRoles/Roles/Impostor/Morphling.cs | 4 +- TheOtherRoles/Roles/Impostor/Ninja.cs | 8 +- TheOtherRoles/Roles/Impostor/Poucher.cs | 2 +- TheOtherRoles/Roles/Impostor/Terrorist.cs | 12 +- TheOtherRoles/Roles/Impostor/Trickster.cs | 6 +- TheOtherRoles/Roles/Impostor/Undertaker.cs | 6 +- TheOtherRoles/Roles/Impostor/Vampire.cs | 10 +- TheOtherRoles/Roles/Impostor/Warlock.cs | 4 +- TheOtherRoles/Roles/Impostor/Witch.cs | 12 +- TheOtherRoles/Roles/Impostor/Yoyo.cs | 12 +- TheOtherRoles/Roles/Modifier/Assassin.cs | 12 +- TheOtherRoles/Roles/Modifier/Bait.cs | 8 +- TheOtherRoles/Roles/Modifier/Bloody.cs | 2 +- TheOtherRoles/Roles/Modifier/ButtonBarry.cs | 2 +- TheOtherRoles/Roles/Modifier/Chameleon.cs | 6 +- TheOtherRoles/Roles/Modifier/Cursed.cs | 2 +- TheOtherRoles/Roles/Modifier/Disperser.cs | 2 +- TheOtherRoles/Roles/Modifier/Flash.cs | 2 +- TheOtherRoles/Roles/Modifier/Giant.cs | 2 +- TheOtherRoles/Roles/Modifier/Invert.cs | 2 +- TheOtherRoles/Roles/Modifier/LastImpostor.cs | 4 +- TheOtherRoles/Roles/Modifier/Lovers.cs | 4 +- TheOtherRoles/Roles/Modifier/Mini.cs | 4 +- TheOtherRoles/Roles/Modifier/Shifter.cs | 4 +- TheOtherRoles/Roles/Modifier/Sunglasses.cs | 2 +- TheOtherRoles/Roles/Modifier/Torch.cs | 2 +- TheOtherRoles/Roles/Modifier/Vip.cs | 2 +- TheOtherRoles/Roles/Neutral/Akujo.cs | 12 +- TheOtherRoles/Roles/Neutral/Amnisiac.cs | 4 +- TheOtherRoles/Roles/Neutral/Arsonist.cs | 6 +- TheOtherRoles/Roles/Neutral/Doomsayer.cs | 12 +- TheOtherRoles/Roles/Neutral/Executioner.cs | 4 +- TheOtherRoles/Roles/Neutral/Jackal.cs | 24 +- TheOtherRoles/Roles/Neutral/Jester.cs | 6 +- TheOtherRoles/Roles/Neutral/Juggernaut.cs | 8 +- TheOtherRoles/Roles/Neutral/Lawyer.cs | 12 +- TheOtherRoles/Roles/Neutral/PartTimer.cs | 4 +- TheOtherRoles/Roles/Neutral/Pavlovsdogs.cs | 14 +- TheOtherRoles/Roles/Neutral/Pursuer.cs | 4 +- TheOtherRoles/Roles/Neutral/Sidekick.cs | 10 +- TheOtherRoles/Roles/Neutral/Survivor.cs | 12 +- TheOtherRoles/Roles/Neutral/Swooper.cs | 12 +- TheOtherRoles/Roles/Neutral/Thief.cs | 14 +- TheOtherRoles/Roles/Neutral/Vulture.cs | 8 +- TheOtherRoles/Roles/Neutral/Werewolf.cs | 6 +- TheOtherRoles/Roles/RoleHelpers.cs | 190 ++++++------- TheOtherRoles/Roles/RoleInfo.cs | 10 +- TheOtherRoles/Utilities/HandleGuesser.cs | 16 +- TheOtherRoles/Utilities/MapData.cs | 4 +- 121 files changed, 893 insertions(+), 897 deletions(-) diff --git a/TheOtherRoles/Buttons/Buttons.cs b/TheOtherRoles/Buttons/Buttons.cs index af2e91a1..8e4aa84e 100644 --- a/TheOtherRoles/Buttons/Buttons.cs +++ b/TheOtherRoles/Buttons/Buttons.cs @@ -469,10 +469,10 @@ public static void createButtonsPostfix(HudManager __instance) () => { toggleZoom(); }, () => { - if (!PlayerControl.LocalPlayer.IsDead() || CachedPlayer.LocalPlayer.Data.Role.IsImpostor && !CustomOptionHolder.deadImpsBlockSabotage.getBool()) return false; + if (!PlayerControl.LocalPlayer.IsDead() || CachedPlayer.LocalPlayer.Data.Role.IsImpostor && !CustomOptionHolder.deadImpsBlockSabotage.GetBool()) return false; var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); var numberOfLeftTasks = playerTotal - playerCompleted; - return numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool(); + return numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.GetBool(); }, () => { return true; }, () => { }, @@ -561,7 +561,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowRight, __instance, abilityInput.keyCode, - buttonText: getString("RepairText") + buttonText: GetString("RepairText") ); //Sheriff Kill @@ -627,7 +627,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Sheriff.currentTarget, sheriffKillButton, getString("killButtonText")); + showTargetNameOnButton(Sheriff.currentTarget, sheriffKillButton, GetString("killButtonText")); return Sheriff.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer; }, @@ -666,7 +666,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Deputy.currentTarget, deputyHandcuffButton, getString("HandcuffText")); + showTargetNameOnButton(Deputy.currentTarget, deputyHandcuffButton, GetString("HandcuffText")); if (deputyButtonHandcuffsText != null) deputyButtonHandcuffsText.text = $"{Deputy.remainingHandcuffs}"; return (Deputy.deputy != null && Deputy.deputy == CachedPlayer.LocalPlayer.PlayerControl && Deputy.currentTarget || @@ -723,7 +723,7 @@ public static void createButtonsPostfix(HudManager __instance) timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer; SoundEffectsManager.stop("timemasterShield"); }, - buttonText: getString("TimeShieldText") + buttonText: GetString("TimeShieldText") ); // Veteran Alert @@ -754,7 +754,7 @@ public static void createButtonsPostfix(HudManager __instance) true, Veteran.alertDuration, () => { veteranAlertButton.Timer = veteranAlertButton.MaxTimer; }, - buttonText: getString("AlertText") + buttonText: GetString("AlertText") ); // Medic Shield @@ -785,7 +785,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Medic.currentTarget, medicShieldButton, getString("ShieldText")); + showTargetNameOnButton(Medic.currentTarget, medicShieldButton, GetString("ShieldText")); return !Medic.usedShield && Medic.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => @@ -821,7 +821,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Doomsayer.currentTarget, doomsayerButton, getString("doomsayerText")); + showTargetNameOnButton(Doomsayer.currentTarget, doomsayerButton, GetString("doomsayerText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Doomsayer.currentTarget != null; }, () => { doomsayerButton.Timer = doomsayerButton.MaxTimer; }, @@ -883,7 +883,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowRight, __instance, abilityInput.keyCode, - buttonText: getString("AkujoHonmeiText") + buttonText: GetString("AkujoHonmeiText") ); akujoTimeRemainingText = Object.Instantiate(akujoHonmeiButton.actionButton.cooldownTimerText, __instance.transform); akujoTimeRemainingText.text = ""; @@ -925,7 +925,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowCenter, __instance, KeyCode.C, - buttonText: getString("AkujoBackupText") + buttonText: GetString("AkujoBackupText") ); akujoBackupLeftText = Object.Instantiate(akujoBackupButton.actionButton.cooldownTimerText, akujoBackupButton.actionButton.cooldownTimerText.transform.parent); akujoBackupLeftText.text = ""; @@ -956,7 +956,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowLeft, __instance, abilityInput.keyCode, - buttonText: getString("PlaceTrapText") + buttonText: GetString("PlaceTrapText") ); // Shifter shift @@ -979,7 +979,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Shifter.currentTarget, shifterShiftButton, getString("ShiftText")); + showTargetNameOnButton(Shifter.currentTarget, shifterShiftButton, GetString("ShiftText")); return Shifter.currentTarget && Shifter.futureShift == null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, @@ -1013,7 +1013,7 @@ public static void createButtonsPostfix(HudManager __instance) __instance, modifierAbilityInput.keyCode, true, - buttonText: getString("DisperseText") + buttonText: GetString("DisperseText") ); mayorMeetingButton = new CustomButton( @@ -1046,7 +1046,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - mayorMeetingButton.actionButton.OverrideText(getString("MayorButtonText") + "(" + Mayor.remoteMeetingsLeft + ")"); + mayorMeetingButton.actionButton.OverrideText(GetString("MayorButtonText") + "(" + Mayor.remoteMeetingsLeft + ")"); var sabotageActive = false; foreach (var task in CachedPlayer.LocalPlayer.PlayerControl.myTasks.GetFastEnumerator()) if ((task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || @@ -1065,7 +1065,7 @@ public static void createButtonsPostfix(HudManager __instance) 0f, () => { }, false, - buttonText: getString("MayorButtonText") + buttonText: GetString("MayorButtonText") ); // ButtonBarry Meetings @@ -1153,7 +1153,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - if (Morphling.sampledTarget == null) showTargetNameOnButton(Morphling.currentTarget, morphlingButton, getString("SampleText")); + if (Morphling.sampledTarget == null) showTargetNameOnButton(Morphling.currentTarget, morphlingButton, GetString("SampleText")); return (Morphling.currentTarget || Morphling.sampledTarget) && !isActiveCamoComms && CachedPlayer.LocalPlayer.PlayerControl.CanMove && !MushroomSabotageActive(); }, @@ -1249,7 +1249,7 @@ public static void createButtonsPostfix(HudManager __instance) true, 0f, () => { hackerButton.Timer = hackerButton.MaxTimer; }, - buttonText: getString("hackerButtonText") + buttonText: GetString("hackerButtonText") ); hackerAdminTableButton = new CustomButton( @@ -1296,7 +1296,7 @@ public static void createButtonsPostfix(HudManager __instance) if (MapBehaviour.Instance && MapBehaviour.Instance.isActiveAndEnabled) MapBehaviour.Instance.Close(); }, GameOptionsManager.Instance.currentNormalGameOptions.MapId == 3, - getString("AdminMapText") + GetString("AdminMapText") ); // Hacker Admin Table Charges @@ -1357,7 +1357,7 @@ public static void createButtonsPostfix(HudManager __instance) hackerVitalsChargesText.text = $"{Hacker.chargesVitals} / {Hacker.toolsNumber}"; hackerVitalsButton.actionButton.graphic.sprite = isMira ? Hacker.getLogSprite() : Hacker.getVitalsSprite(); - hackerVitalsButton.actionButton.OverrideText(isMira ? getString("hackerDoorLogText") : getString("hackerVitalText")); + hackerVitalsButton.actionButton.OverrideText(isMira ? GetString("hackerDoorLogText") : GetString("hackerVitalText")); return Hacker.chargesVitals > 0; }, () => @@ -1383,7 +1383,7 @@ public static void createButtonsPostfix(HudManager __instance) } }, false, - isMira ? getString("hackerDoorLogText") : getString("hackerVitalText") + isMira ? GetString("hackerDoorLogText") : GetString("hackerVitalText") ); // Hacker Vitals Charges @@ -1414,7 +1414,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - if (!Tracker.usedTracker) showTargetNameOnButton(Tracker.currentTarget, trackerTrackPlayerButton, getString("TrackerText")); + if (!Tracker.usedTracker) showTargetNameOnButton(Tracker.currentTarget, trackerTrackPlayerButton, GetString("TrackerText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Tracker.currentTarget != null && !Tracker.usedTracker; }, () => @@ -1452,7 +1452,7 @@ public static void createButtonsPostfix(HudManager __instance) true, Tracker.corpsesTrackingDuration, () => { trackerTrackCorpsesButton.Timer = trackerTrackCorpsesButton.MaxTimer; }, - buttonText: getString("TrackerCorpsesText") + buttonText: GetString("TrackerCorpsesText") ); bodyGuardGuardButton = new CustomButton( @@ -1474,7 +1474,7 @@ public static void createButtonsPostfix(HudManager __instance) () => { if (!BodyGuard.usedGuard) - showTargetNameOnButton(BodyGuard.currentTarget, bodyGuardGuardButton, getString("bodyGuardText")); + showTargetNameOnButton(BodyGuard.currentTarget, bodyGuardGuardButton, GetString("bodyGuardText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && BodyGuard.currentTarget != null && !BodyGuard.usedGuard; }, @@ -1586,9 +1586,9 @@ public static void createButtonsPostfix(HudManager __instance) () => { if (Vampire.targetNearGarlic) - showTargetNameOnButton(Vampire.currentTarget, vampireKillButton, getString("killButtonText")); + showTargetNameOnButton(Vampire.currentTarget, vampireKillButton, GetString("killButtonText")); else - showTargetNameOnButton(Vampire.currentTarget, vampireKillButton, getString("VampireText")); + showTargetNameOnButton(Vampire.currentTarget, vampireKillButton, GetString("VampireText")); if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics) { vampireKillButton.actionButton.graphic.sprite = __instance.KillButton.graphic.sprite; @@ -1651,7 +1651,7 @@ public static void createButtonsPostfix(HudManager __instance) __instance, null, true, - buttonText: getString("GarlicText") + buttonText: GetString("GarlicText") ); prophetButton = new CustomButton( @@ -1684,7 +1684,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.lowerRowRight, __instance, abilityInput.keyCode, - buttonText: getString("ProphetText") + buttonText: GetString("ProphetText") ); prophetButtonText = Object.Instantiate(prophetButton.actionButton.cooldownTimerText, prophetButton.actionButton.cooldownTimerText.transform.parent); prophetButtonText.text = ""; @@ -1721,7 +1721,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.lowerRowRight, __instance, abilityInput.keyCode, - buttonText: getString("PlacePortalText") + buttonText: GetString("PlacePortalText") ); usePortalButton = new CustomButton( @@ -1793,7 +1793,7 @@ public static void createButtonsPostfix(HudManager __instance) __instance, null, true, - buttonText: getString("usePortalText") + buttonText: GetString("usePortalText") ); portalmakerMoveToPortalButton = new CustomButton( @@ -1887,7 +1887,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Jackal.currentTarget, jackalSidekickButton, getString("jackalSidekickText")); // Show now text since the button already says sidekick + showTargetNameOnButton(Jackal.currentTarget, jackalSidekickButton, GetString("jackalSidekickText")); // Show now text since the button already says sidekick return Jackal.canCreateSidekick && Jackal.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, @@ -1916,7 +1916,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Jackal.currentTarget, jackalKillButton, getString("killButtonText")); + showTargetNameOnButton(Jackal.currentTarget, jackalKillButton, GetString("killButtonText")); return Jackal.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { jackalKillButton.Timer = jackalKillButton.MaxTimer; }, @@ -1960,7 +1960,7 @@ public static void createButtonsPostfix(HudManager __instance) true, Jackal.duration, () => { jackalSwoopButton.Timer = jackalSwoopButton.MaxTimer; }, - buttonText: getString("SwoopText") + buttonText: GetString("SwoopText") ); // Sidekick Kill @@ -1981,7 +1981,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Sidekick.currentTarget, sidekickKillButton, getString("killButtonText")); + showTargetNameOnButton(Sidekick.currentTarget, sidekickKillButton, GetString("killButtonText")); return Sidekick.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer; }, @@ -2003,7 +2003,7 @@ public static void createButtonsPostfix(HudManager __instance) Swooper.currentTarget = null; }, () => { return Swooper.swooper != null && Swooper.swooper == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, - () => { showTargetNameOnButton(Swooper.currentTarget, swooperKillButton, getString("killButtonText")); return Swooper.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, + () => { showTargetNameOnButton(Swooper.currentTarget, swooperKillButton, GetString("killButtonText")); return Swooper.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { swooperKillButton.Timer = swooperKillButton.MaxTimer; }, __instance.KillButton.graphic.sprite, ButtonPositions.upperRowCenter, @@ -2037,7 +2037,7 @@ public static void createButtonsPostfix(HudManager __instance) true, Swooper.duration, () => { swooperSwoopButton.Timer = swooperSwoopButton.MaxTimer; }, - buttonText: getString("SwoopText") + buttonText: GetString("SwoopText") ); pavlovsdogsKillButton = new CustomButton( @@ -2070,7 +2070,7 @@ public static void createButtonsPostfix(HudManager __instance) if (Pavlovsdogs.deathTime <= 0) PlayerControl.LocalPlayer.RpcMurderPlayer(PlayerControl.LocalPlayer, true); } - showTargetNameOnButton(Pavlovsdogs.killTarget, pavlovsdogsKillButton, getString("killButtonText")); return Pavlovsdogs.killTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; + showTargetNameOnButton(Pavlovsdogs.killTarget, pavlovsdogsKillButton, GetString("killButtonText")); return Pavlovsdogs.killTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { @@ -2118,7 +2118,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Pavlovsdogs.currentTarget, pavlovsownerCreateDogButton, getString("pavlovsCreateDogText")); + showTargetNameOnButton(Pavlovsdogs.currentTarget, pavlovsownerCreateDogButton, GetString("pavlovsCreateDogText")); // Show now text since the button already says sidekick return Pavlovsdogs.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, @@ -2179,7 +2179,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowLeft, //brb __instance, abilityInput.keyCode, - buttonText: getString("minerText") + buttonText: GetString("minerText") ); bomberBombButton = new CustomButton( @@ -2329,7 +2329,7 @@ public static void createButtonsPostfix(HudManager __instance) { grenadierFlashButton.Timer = grenadierFlashButton.MaxTimer; }, - buttonText: getString("FlashButton") + buttonText: GetString("FlashButton") ); // Werewolf Kill @@ -2350,7 +2350,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Werewolf.currentTarget, werewolfKillButton, getString("killButtonText")); + showTargetNameOnButton(Werewolf.currentTarget, werewolfKillButton, GetString("killButtonText")); return Werewolf.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { werewolfKillButton.Timer = werewolfKillButton.MaxTimer; }, @@ -2425,7 +2425,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Juggernaut.currentTarget, juggernautKillButton, getString("killButtonText")); + showTargetNameOnButton(Juggernaut.currentTarget, juggernautKillButton, GetString("killButtonText")); return Juggernaut.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { juggernautKillButton.Timer = juggernautKillButton.MaxTimer; }, @@ -2457,7 +2457,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Eraser.currentTarget, eraserButton, getString("EraserText")); + showTargetNameOnButton(Eraser.currentTarget, eraserButton, GetString("EraserText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Eraser.currentTarget != null; }, () => { eraserButton.Timer = eraserButton.MaxTimer; }, @@ -2489,7 +2489,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(PartTimer.currentTarget, partTimerButton, getString("partTimerButton")); + showTargetNameOnButton(PartTimer.currentTarget, partTimerButton, GetString("partTimerButton")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && PartTimer.currentTarget != null; ; }, () => { partTimerButton.Timer = partTimerButton.MaxTimer; }, @@ -2497,7 +2497,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowCenter, __instance, abilityInput.keyCode, - buttonText: getString("partTimerButton") + buttonText: GetString("partTimerButton") ); @@ -2532,7 +2532,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowLeft, __instance, abilityInput.keyCode, - buttonText: getString("TricksterPlaceText") + buttonText: GetString("TricksterPlaceText") ); lightsOutButton = new CustomButton( @@ -2572,7 +2572,7 @@ public static void createButtonsPostfix(HudManager __instance) lightsOutButton.Timer = lightsOutButton.MaxTimer; SoundEffectsManager.play("lighterLight"); }, - buttonText: getString("LightsOutText") + buttonText: GetString("LightsOutText") ); // Cleaner Clean @@ -2627,7 +2627,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowLeft, __instance, abilityInput.keyCode, - buttonText: getString("CleanText") + buttonText: GetString("CleanText") ); // Butcher Dissection @@ -2684,7 +2684,7 @@ public static void createButtonsPostfix(HudManager __instance) } } }, - buttonText: getString("DissectionText") + buttonText: GetString("DissectionText") ); // Undertaker Button @@ -2766,7 +2766,7 @@ public static void createButtonsPostfix(HudManager __instance) true, 0f, () => { }, - buttonText: getString("DragBodyText") + buttonText: GetString("DragBodyText") ); // Warlock curse @@ -2834,9 +2834,9 @@ public static void createButtonsPostfix(HudManager __instance) () => { if (Warlock.curseVictim != null) - showTargetNameOnButton(Warlock.currentTarget, warlockCurseButton, getString("CurseKillText")); + showTargetNameOnButton(Warlock.currentTarget, warlockCurseButton, GetString("CurseKillText")); else - showTargetNameOnButton(Warlock.currentTarget, warlockCurseButton, getString("CurseText")); + showTargetNameOnButton(Warlock.currentTarget, warlockCurseButton, GetString("CurseText")); return (Warlock.curseVictim == null && Warlock.currentTarget != null || Warlock.curseVictim != null && Warlock.curseVictimTarget != null) && CachedPlayer.LocalPlayer.PlayerControl.CanMove; @@ -2985,7 +2985,7 @@ public static void createButtonsPostfix(HudManager __instance) securityGuardCamButton.actionButton.graphic.sprite = isMira ? SecurityGuard.getLogSprite() : SecurityGuard.getCamSprite(); securityGuardCamButton.actionButton.OverrideText(isMira ? - getString("hackerDoorLogText") : getString("CamButtonText")); + GetString("hackerDoorLogText") : GetString("CamButtonText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && SecurityGuard.charges > 0; }, () => @@ -3007,7 +3007,7 @@ public static void createButtonsPostfix(HudManager __instance) CachedPlayer.LocalPlayer.PlayerControl.moveable = true; }, false, - isMira ? getString("hackerDoorLogText") : getString("CamButtonText") + isMira ? GetString("hackerDoorLogText") : GetString("CamButtonText") ); // Security Guard cam button charges @@ -3036,7 +3036,7 @@ public static void createButtonsPostfix(HudManager __instance) { var dousedEveryoneAlive = Arsonist.dousedEveryoneAlive(); if (!dousedEveryoneAlive) - showTargetNameOnButton(Arsonist.currentTarget, arsonistButton, getString("DouseText")); + showTargetNameOnButton(Arsonist.currentTarget, arsonistButton, GetString("DouseText")); if (arsonistButton.isEffectActive && Arsonist.douseTarget != Arsonist.currentTarget) { @@ -3100,7 +3100,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Arsonist.currentTarget2, arsonistKillButton, getString("IgniteText")); + showTargetNameOnButton(Arsonist.currentTarget2, arsonistKillButton, GetString("IgniteText")); return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Arsonist.currentTarget2 != null && Arsonist.dousedPlayers.Any(p => p == Arsonist.currentTarget2); }, () => @@ -3115,7 +3115,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowCenter, __instance, modKillInput.keyCode, - buttonText: getString("IgniteText") + buttonText: GetString("IgniteText") ); // Vulture Eat @@ -3170,7 +3170,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.lowerRowCenter, __instance, abilityInput.keyCode, - buttonText: getString("VultureText") + buttonText: GetString("VultureText") ); amnisiacRememberButton = new CustomButton( @@ -3220,7 +3220,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.lowerRowRight, //brb __instance, abilityInput.keyCode, - buttonText: getString("RememberText") + buttonText: GetString("RememberText") ); // Medium button @@ -3319,7 +3319,7 @@ public static void createButtonsPostfix(HudManager __instance) SoundEffectsManager.stop("mediumAsk"); }, - buttonText: getString("MediumText") + buttonText: GetString("MediumText") ); // Pursuer button @@ -3350,7 +3350,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Pursuer.target, pursuerButton, getString("PursuerText")); + showTargetNameOnButton(Pursuer.target, pursuerButton, GetString("PursuerText")); if (pursuerButtonBlanksText != null) pursuerButtonBlanksText.text = $"{Pursuer.blanksNumber - Pursuer.blanks}"; @@ -3406,7 +3406,7 @@ public static void createButtonsPostfix(HudManager __instance) true, Survivor.vestDuration, () => { survivorVestButton.Timer = survivorVestButton.MaxTimer; }, - buttonText: getString("VestButton") + buttonText: GetString("VestButton") ); // Pursuer button blanks left survivorVestButtonText = Object.Instantiate(survivorVestButton.actionButton.cooldownTimerText, @@ -3445,7 +3445,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(Survivor.target, survivorBlanksButton, getString("PursuerText")); + showTargetNameOnButton(Survivor.target, survivorBlanksButton, GetString("PursuerText")); if (survivorBlanksButtonText != null) survivorBlanksButtonText.text = $"{Survivor.remainingBlanks} / {Survivor.blanksNumber}"; return Survivor.blanksNumber > Survivor.blanksUsed && CachedPlayer.LocalPlayer.PlayerControl.CanMove && @@ -3496,7 +3496,7 @@ public static void createButtonsPostfix(HudManager __instance) }, () => { - showTargetNameOnButton(null, witchSpellButton, getString("WitchText")); + showTargetNameOnButton(null, witchSpellButton, GetString("WitchText")); witchSpellButton.Timer = witchSpellButton.MaxTimer; witchSpellButton.isEffectActive = false; Witch.spellCastingTarget = null; @@ -3766,7 +3766,7 @@ public static void createButtonsPostfix(HudManager __instance) () => { // CouldUse - showTargetNameOnButton(Ninja.currentTarget, ninjaButton, getString("NinjaText")); + showTargetNameOnButton(Ninja.currentTarget, ninjaButton, GetString("NinjaText")); ninjaButton.Sprite = Ninja.ninjaMarked != null ? Ninja.killButtonSprite : Ninja.markButtonSprite; @@ -3810,10 +3810,10 @@ public static void createButtonsPostfix(HudManager __instance) () => { // Could Use - var text = getString("BlackmailerText"); + var text = GetString("BlackmailerText"); if (Blackmailer.blackmailed != null) text = Blackmailer.blackmailed.Data.PlayerName; //Show target name under button if setting is true - showTargetNameOnButtonExplicit(Blackmailer.currentTarget, blackmailerButton, getString("BlackmailerText")); + showTargetNameOnButtonExplicit(Blackmailer.currentTarget, blackmailerButton, GetString("BlackmailerText")); return Blackmailer.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { blackmailerButton.Timer = blackmailerButton.MaxTimer; }, @@ -3860,7 +3860,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.lowerRowRight, __instance, abilityInput.keyCode, - buttonText: getString("trapperTrapText") + buttonText: GetString("trapperTrapText") ); // Terrorist button @@ -3920,7 +3920,7 @@ public static void createButtonsPostfix(HudManager __instance) terroristButton.isEffectActive = false; terroristButton.actionButton.cooldownTimerText.color = Palette.EnabledColor; }, - buttonText: Terrorist.selfExplosion ? getString("TerroristBombText2") : getString("TerroristBombText1") + buttonText: Terrorist.selfExplosion ? GetString("TerroristBombText2") : GetString("TerroristBombText1") ); defuseButton = new CustomButton( @@ -3961,7 +3961,7 @@ public static void createButtonsPostfix(HudManager __instance) Bomb.canDefuse = false; }, true, - buttonText: getString("defuseBombText") + buttonText: GetString("defuseBombText") ); thiefKillButton = new CustomButton( @@ -4018,7 +4018,7 @@ public static void createButtonsPostfix(HudManager __instance) ButtonPositions.upperRowRight, __instance, modKillInput.keyCode, - buttonText: getString("killButtonText") + buttonText: GetString("killButtonText") ); // Trapper Charges @@ -4202,7 +4202,7 @@ public static void createButtonsPostfix(HudManager __instance) hunterLighterButton.Timer = hunterLighterButton.MaxTimer; SoundEffectsManager.play("lighterLight"); }, - buttonText: getString("LighterText") + buttonText: GetString("LighterText") ); hunterAdminTableButton = new CustomButton( @@ -4243,7 +4243,7 @@ public static void createButtonsPostfix(HudManager __instance) if (MapBehaviour.Instance && MapBehaviour.Instance.isActiveAndEnabled) MapBehaviour.Instance.Close(); }, false, - getString("AdminMapText") + GetString("AdminMapText") ); hunterArrowButton = new CustomButton( @@ -4434,7 +4434,7 @@ public static void createButtonsPostfix(HudManager __instance) true, 5f, () => { propHuntRevealButton.Timer = propHuntRevealButton.MaxTimer; }, - buttonText: getString("揭示") + buttonText: GetString("揭示") ); propHuntInvisButton = new CustomButton( @@ -4465,7 +4465,7 @@ public static void createButtonsPostfix(HudManager __instance) SoundEffectsManager.play("morphlingMorph"); propHuntInvisButton.Timer = propHuntInvisButton.MaxTimer; }, - buttonText: getString("SwoopText") + buttonText: GetString("SwoopText") ); propHuntSpeedboostButton = new CustomButton( @@ -4535,7 +4535,7 @@ public static void createButtonsPostfix(HudManager __instance) if (MapBehaviour.Instance && MapBehaviour.Instance.isActiveAndEnabled) MapBehaviour.Instance.Close(); }, false, - getString("AdminMapText") + GetString("AdminMapText") ); propHuntFindButton = new CustomButton( () => { SoundEffectsManager.play("timemasterShield"); }, diff --git a/TheOtherRoles/CustomGameModes/GuesserGM.cs b/TheOtherRoles/CustomGameModes/GuesserGM.cs index cbdedf5d..c0174f84 100644 --- a/TheOtherRoles/CustomGameModes/GuesserGM.cs +++ b/TheOtherRoles/CustomGameModes/GuesserGM.cs @@ -11,7 +11,7 @@ internal class GuesserGM public static Color color = new Color32(255, 255, 0, byte.MaxValue); public PlayerControl guesser; - public int shots = Mathf.RoundToInt(CustomOptionHolder.guesserGamemodeNumberOfShots.getFloat()); + public int shots = CustomOptionHolder.guesserGamemodeNumberOfShots.GetInt(); public GuesserGM(PlayerControl player) { @@ -32,7 +32,7 @@ public static void clear(byte playerId) var g = guessers.FirstOrDefault(x => x.guesser.PlayerId == playerId); if (g != null) { - g.shots = Mathf.RoundToInt(CustomOptionHolder.guesserGamemodeNumberOfShots.getFloat()); + g.shots = CustomOptionHolder.guesserGamemodeNumberOfShots.GetInt(); guessers.Remove(g); } } diff --git a/TheOtherRoles/CustomGameModes/HideNSeekGM.cs b/TheOtherRoles/CustomGameModes/HideNSeekGM.cs index ff6fe403..46b50244 100644 --- a/TheOtherRoles/CustomGameModes/HideNSeekGM.cs +++ b/TheOtherRoles/CustomGameModes/HideNSeekGM.cs @@ -3,7 +3,6 @@ using TheOtherRoles.Objects; using TheOtherRoles.Utilities; using TMPro; -using UnityEngine; using Object = UnityEngine.Object; namespace TheOtherRoles.CustomGameModes; @@ -17,8 +16,8 @@ public static class HideNSeek public static bool isWaitingTimer = true; public static DateTime startTime = DateTime.UtcNow; - public static float hunterSpeed => CustomOptionHolder.hideHuntSpeed.getFloat(); - public static float crewSpeed => CustomOptionHolder.hideCrewSpeed.getFloat(); + public static float hunterSpeed => CustomOptionHolder.hideHuntSpeed.GetFloat(); + public static float crewSpeed => CustomOptionHolder.hideCrewSpeed.GetFloat(); public static float timer = 300f; public static float hunterVision = 0.5f; @@ -57,15 +56,15 @@ public static void clearAndReload() isWaitingTimer = true; startTime = DateTime.UtcNow; - timer = CustomOptionHolder.hideNSeekTimer.getFloat() * 60; - hunterVision = CustomOptionHolder.hideNSeekHunterVision.getFloat(); - huntedVision = CustomOptionHolder.hideNSeekHuntedVision.getFloat(); - taskWinPossible = CustomOptionHolder.hideNSeekTaskWin.getBool(); - taskPunish = CustomOptionHolder.hideNSeekTaskPunish.getFloat(); - impNumber = Mathf.RoundToInt(CustomOptionHolder.hideNSeekHunterCount.getFloat()); - canSabotage = CustomOptionHolder.hideNSeekCanSabotage.getBool(); - killCooldown = CustomOptionHolder.hideNSeekKillCooldown.getFloat(); - hunterWaitingTime = CustomOptionHolder.hideNSeekHunterWaiting.getFloat(); + timer = CustomOptionHolder.hideNSeekTimer.GetFloat() * 60; + hunterVision = CustomOptionHolder.hideNSeekHunterVision.GetFloat(); + huntedVision = CustomOptionHolder.hideNSeekHuntedVision.GetFloat(); + taskWinPossible = CustomOptionHolder.hideNSeekTaskWin.GetBool(); + taskPunish = CustomOptionHolder.hideNSeekTaskPunish.GetFloat(); + impNumber = CustomOptionHolder.hideNSeekHunterCount.GetInt(); + canSabotage = CustomOptionHolder.hideNSeekCanSabotage.GetBool(); + killCooldown = CustomOptionHolder.hideNSeekKillCooldown.GetFloat(); + hunterWaitingTime = CustomOptionHolder.hideNSeekHunterWaiting.GetFloat(); Hunter.clearAndReload(); Hunted.clearAndReload(); @@ -107,16 +106,16 @@ public static void clearAndReload() lightActive.Clear(); arrowActive = false; - lightCooldown = CustomOptionHolder.hunterLightCooldown.getFloat(); - lightDuration = CustomOptionHolder.hunterLightDuration.getFloat(); - lightVision = CustomOptionHolder.hunterLightVision.getFloat(); - lightPunish = CustomOptionHolder.hunterLightPunish.getFloat(); - AdminCooldown = CustomOptionHolder.hunterAdminCooldown.getFloat(); - AdminDuration = CustomOptionHolder.hunterAdminDuration.getFloat(); - AdminPunish = CustomOptionHolder.hunterAdminPunish.getFloat(); - ArrowCooldown = CustomOptionHolder.hunterArrowCooldown.getFloat(); - ArrowDuration = CustomOptionHolder.hunterArrowDuration.getFloat(); - ArrowPunish = CustomOptionHolder.hunterArrowPunish.getFloat(); + lightCooldown = CustomOptionHolder.hunterLightCooldown.GetFloat(); + lightDuration = CustomOptionHolder.hunterLightDuration.GetFloat(); + lightVision = CustomOptionHolder.hunterLightVision.GetFloat(); + lightPunish = CustomOptionHolder.hunterLightPunish.GetFloat(); + AdminCooldown = CustomOptionHolder.hunterAdminCooldown.GetFloat(); + AdminDuration = CustomOptionHolder.hunterAdminDuration.GetFloat(); + AdminPunish = CustomOptionHolder.hunterAdminPunish.GetFloat(); + ArrowCooldown = CustomOptionHolder.hunterArrowCooldown.GetFloat(); + ArrowDuration = CustomOptionHolder.hunterArrowDuration.GetFloat(); + ArrowPunish = CustomOptionHolder.hunterArrowPunish.GetFloat(); } } @@ -135,10 +134,10 @@ public static void clearAndReload() timeshieldActive.Clear(); taskPunish = false; - shieldCount = Mathf.RoundToInt(CustomOptionHolder.huntedShieldNumber.getFloat()); - shieldCooldown = CustomOptionHolder.huntedShieldCooldown.getFloat(); - shieldDuration = CustomOptionHolder.huntedShieldDuration.getFloat(); - shieldRewindTime = CustomOptionHolder.huntedShieldRewindTime.getFloat(); + shieldCount = CustomOptionHolder.huntedShieldNumber.GetInt(); + shieldCooldown = CustomOptionHolder.huntedShieldCooldown.GetFloat(); + shieldDuration = CustomOptionHolder.huntedShieldDuration.GetFloat(); + shieldRewindTime = CustomOptionHolder.huntedShieldRewindTime.GetFloat(); } } diff --git a/TheOtherRoles/CustomGameModes/PropHunt.cs b/TheOtherRoles/CustomGameModes/PropHunt.cs index 8aa3cee6..ea8e27ab 100644 --- a/TheOtherRoles/CustomGameModes/PropHunt.cs +++ b/TheOtherRoles/CustomGameModes/PropHunt.cs @@ -44,8 +44,8 @@ internal class PropHunt public static float speedboostDuration; public static float speedboostRatio; - public static float hunterSpeed => CustomOptionHolder.propHuntSpeed.getFloat(); - public static float propSpeed => CustomOptionHolder.propPropSpeed.getFloat(); + public static float hunterSpeed => CustomOptionHolder.propHuntSpeed.GetFloat(); + public static float propSpeed => CustomOptionHolder.propPropSpeed.GetFloat(); public static float adminCooldown = 5f; public static float adminDuration = 10f; @@ -87,31 +87,31 @@ public static void clearAndReload() { remainingShots.Clear(); isPropHuntGM = ModOption.gameMode == CustomGamemodes.PropHunt; - numberOfHunters = CustomOptionHolder.propHuntNumberOfHunters.getQuantity(); - initialBlackoutTime = CustomOptionHolder.hunterInitialBlackoutTime.getFloat(); + numberOfHunters = CustomOptionHolder.propHuntNumberOfHunters.GetQuantity(); + initialBlackoutTime = CustomOptionHolder.hunterInitialBlackoutTime.GetFloat(); //maxMissesBeforeDeath = CustomOptionHolder.hunterMaxMissesBeforeDeath.getQuantity(); - propBecomesHunterWhenFound = CustomOptionHolder.propBecomesHunterWhenFound.getBool(); - killCooldownMiss = CustomOptionHolder.hunterMissCooldown.getFloat(); - killCooldownHit = CustomOptionHolder.hunterHitCooldown.getFloat(); - hunterVision = CustomOptionHolder.propHunterVision.getFloat(); - propVision = CustomOptionHolder.propVision.getFloat(); - timer = CustomOptionHolder.propHuntTimer.getFloat() * 60; - revealDuration = CustomOptionHolder.propHuntRevealDuration.getFloat(); - revealCooldown = CustomOptionHolder.propHuntRevealCooldown.getFloat(); - revealPunish = CustomOptionHolder.propHuntRevealPunish.getFloat(); - enableUnstuck = CustomOptionHolder.propHuntEnableUnstuck.getSelection(); - unstuckDuration = CustomOptionHolder.propHuntUnstuckDuration.getFloat(); - unstuckCooldown = CustomOptionHolder.propHuntUnstuckCooldown.getFloat(); - invisCooldown = CustomOptionHolder.propHuntInvisCooldown.getFloat(); - invisDuration = CustomOptionHolder.propHuntInvisDuration.getFloat(); - speedboostCooldown = CustomOptionHolder.propHuntSpeedboostCooldown.getFloat(); - speedboostDuration = CustomOptionHolder.propHuntSpeedboostDuration.getFloat(); - speedboostRatio = CustomOptionHolder.propHuntSpeedboostSpeed.getFloat(); - enableSpeedboost = CustomOptionHolder.propHuntSpeedboostEnabled.getBool(); - enableInvis = CustomOptionHolder.propHuntInvisEnabled.getBool(); - adminCooldown = CustomOptionHolder.propHuntAdminCooldown.getFloat(); - findCooldown = CustomOptionHolder.propHuntFindCooldown.getFloat(); - findDuration = CustomOptionHolder.propHuntFindDuration.getFloat(); + propBecomesHunterWhenFound = CustomOptionHolder.propBecomesHunterWhenFound.GetBool(); + killCooldownMiss = CustomOptionHolder.hunterMissCooldown.GetFloat(); + killCooldownHit = CustomOptionHolder.hunterHitCooldown.GetFloat(); + hunterVision = CustomOptionHolder.propHunterVision.GetFloat(); + propVision = CustomOptionHolder.propVision.GetFloat(); + timer = CustomOptionHolder.propHuntTimer.GetFloat() * 60; + revealDuration = CustomOptionHolder.propHuntRevealDuration.GetFloat(); + revealCooldown = CustomOptionHolder.propHuntRevealCooldown.GetFloat(); + revealPunish = CustomOptionHolder.propHuntRevealPunish.GetFloat(); + enableUnstuck = CustomOptionHolder.propHuntEnableUnstuck.GetSelection(); + unstuckDuration = CustomOptionHolder.propHuntUnstuckDuration.GetFloat(); + unstuckCooldown = CustomOptionHolder.propHuntUnstuckCooldown.GetFloat(); + invisCooldown = CustomOptionHolder.propHuntInvisCooldown.GetFloat(); + invisDuration = CustomOptionHolder.propHuntInvisDuration.GetFloat(); + speedboostCooldown = CustomOptionHolder.propHuntSpeedboostCooldown.GetFloat(); + speedboostDuration = CustomOptionHolder.propHuntSpeedboostDuration.GetFloat(); + speedboostRatio = CustomOptionHolder.propHuntSpeedboostSpeed.GetFloat(); + enableSpeedboost = CustomOptionHolder.propHuntSpeedboostEnabled.GetBool(); + enableInvis = CustomOptionHolder.propHuntInvisEnabled.GetBool(); + adminCooldown = CustomOptionHolder.propHuntAdminCooldown.GetFloat(); + findCooldown = CustomOptionHolder.propHuntFindCooldown.GetFloat(); + findDuration = CustomOptionHolder.propHuntFindDuration.GetFloat(); timerRunning = false; timerText?.Destroy(); timerText = null; diff --git a/TheOtherRoles/Helper/Helpers.cs b/TheOtherRoles/Helper/Helpers.cs index 242ee939..35fd80b2 100644 --- a/TheOtherRoles/Helper/Helpers.cs +++ b/TheOtherRoles/Helper/Helpers.cs @@ -121,7 +121,7 @@ public static bool killingCrewAlive() { var powerCrewAlive = false; // This functions blocks the game from ending if specified crewmate roles are alive - if (!CustomOptionHolder.blockGameEnd.getBool()) return false; + if (!CustomOptionHolder.blockGameEnd.GetBool()) return false; if (isRoleAlive(Sheriff.sheriff)) powerCrewAlive = true; if (isRoleAlive(Deputy.deputy)) powerCrewAlive = true; @@ -423,7 +423,7 @@ public static IEnumerator BlackmailShhh() HudManager.Instance.shhhEmblem.transform.localPosition.x, HudManager.Instance.shhhEmblem.transform.localPosition.y, HudManager.Instance.FullScreen.transform.position.z + 1f); - HudManager.Instance.shhhEmblem.TextImage.text = getString("BlackmailShhhText"); + HudManager.Instance.shhhEmblem.TextImage.text = ModTranslation.GetString("BlackmailShhhText"); HudManager.Instance.shhhEmblem.HoldDuration = 3f; yield return HudManager.Instance.ShowEmblem(true); HudManager.Instance.shhhEmblem.transform.localPosition = TempPosition; @@ -466,7 +466,7 @@ public static void turnToImpostor(PlayerControl player) public static void showTargetNameOnButton(PlayerControl target, CustomButton button, string defaultText) { - if (CustomOptionHolder.showButtonTarget.getBool()) + if (CustomOptionHolder.showButtonTarget.GetBool()) { // Should the button show the target name option string text; diff --git a/TheOtherRoles/Modules/ModTranslation.cs b/TheOtherRoles/Modules/ModTranslation.cs index f251aad0..b2c4f9ac 100644 --- a/TheOtherRoles/Modules/ModTranslation.cs +++ b/TheOtherRoles/Modules/ModTranslation.cs @@ -51,7 +51,7 @@ public static void Load() } } - public static string getString(string key, string def = null) + public static string GetString(string key, string def = null) { // Strip out color tags. string keyClean = Regex.Replace(key, "<.*?>", ""); @@ -80,6 +80,6 @@ internal static class LanguageExtension { internal static string Translate(this string key) { - return getString(key); + return GetString(key); } } \ No newline at end of file diff --git a/TheOtherRoles/Objects/Map/AdditionalVents.cs b/TheOtherRoles/Objects/Map/AdditionalVents.cs index 055f93b0..8bb95822 100644 --- a/TheOtherRoles/Objects/Map/AdditionalVents.cs +++ b/TheOtherRoles/Objects/Map/AdditionalVents.cs @@ -44,7 +44,7 @@ public static void AddAdditionalVents() switch (GameOptionsManager.Instance.currentNormalGameOptions.MapId) { // Polus管道追加 - case 2 when CustomOptionHolder.enableBetterPolus.getBool() && CustomOptionHolder.addPolusVents.getBool(): + case 2 when CustomOptionHolder.enableBetterPolus.GetBool() && CustomOptionHolder.addPolusVents.GetBool(): { var position = PlayerControl.LocalPlayer.transform.position; AdditionalVents vents1 = new(new Vector3(36.54f, -21.77f, position.z + 1f)); // 样本室 @@ -59,7 +59,7 @@ public static void AddAdditionalVents() break; } // AirShip管道追加 - case 4 when CustomOptionHolder.enableAirShipModify.getBool() && CustomOptionHolder.addAirShipVents.getBool(): + case 4 when CustomOptionHolder.enableAirShipModify.GetBool() && CustomOptionHolder.addAirShipVents.GetBool(): { var transform = CachedPlayer.LocalPlayer.PlayerControl.transform; var position = transform.position; diff --git a/TheOtherRoles/Objects/Map/Airship.cs b/TheOtherRoles/Objects/Map/Airship.cs index 47bcaacd..59bcfe1f 100644 --- a/TheOtherRoles/Objects/Map/Airship.cs +++ b/TheOtherRoles/Objects/Map/Airship.cs @@ -19,7 +19,7 @@ public static void Postfix(ShipStatus __instance) public static void optimizeMap(int mapId) { - if (!CustomOptionHolder.airshipOptimize.getBool()) return; + if (!CustomOptionHolder.airshipOptimize.GetBool()) return; if (mapId == 4) { var obj = ShipStatus.Instance.FastRooms[SystemTypes.GapRoom].gameObject; @@ -56,7 +56,7 @@ public static void addLadder(int mapId) { GameObject meetingRoom = ShipStatus.Instance.FastRooms[SystemTypes.MeetingRoom].gameObject; GameObject gapRoom = ShipStatus.Instance.FastRooms[SystemTypes.GapRoom].gameObject; - if (CustomOptionHolder.airshipLadder.getBool()) + if (CustomOptionHolder.airshipLadder.GetBool()) { // 梯子追加 GameObject ladder = meetingRoom.GetComponentsInChildren().FirstOrDefault(x => x.name == "ladder_meeting").gameObject; diff --git a/TheOtherRoles/Objects/Map/BetterPolus.cs b/TheOtherRoles/Objects/Map/BetterPolus.cs index 3b155e1b..5784ff87 100644 --- a/TheOtherRoles/Objects/Map/BetterPolus.cs +++ b/TheOtherRoles/Objects/Map/BetterPolus.cs @@ -66,20 +66,20 @@ public static void FindPolusObjects() public static void AdjustPolus() { - if (!CustomOptionHolder.enableBetterPolus.getBool()) return; + if (!CustomOptionHolder.enableBetterPolus.GetBool()) return; if (IsObjectsFetched && IsRoomsFetched) { - if (CustomOptionHolder.movePolusVitals.getBool()) MoveVitals(); - if (CustomOptionHolder.swapNavWifi.getBool()) SwitchNavWifi(); - if (CustomOptionHolder.movePolusVitals.getBool() && !CustomOptionHolder.moveColdTemp.getBool()) MoveTempCold(); - if (CustomOptionHolder.moveColdTemp.getBool()) MoveTempColdDV(); + if (CustomOptionHolder.movePolusVitals.GetBool()) MoveVitals(); + if (CustomOptionHolder.swapNavWifi.GetBool()) SwitchNavWifi(); + if (CustomOptionHolder.movePolusVitals.GetBool() && !CustomOptionHolder.moveColdTemp.GetBool()) MoveTempCold(); + if (CustomOptionHolder.moveColdTemp.GetBool()) MoveTempColdDV(); } else { Warn("[BetterPolus] Couldn't move elements as not all of them have been fetched."); } - if (CustomOptionHolder.movePolusVents.getBool()) AdjustVents(); // Programed + if (CustomOptionHolder.movePolusVents.GetBool()) AdjustVents(); // Programed IsAdjustmentsDone = true; } diff --git a/TheOtherRoles/Objects/Map/FungleElectrical.cs b/TheOtherRoles/Objects/Map/FungleElectrical.cs index 3edc8fd5..28594eef 100644 --- a/TheOtherRoles/Objects/Map/FungleElectrical.cs +++ b/TheOtherRoles/Objects/Map/FungleElectrical.cs @@ -9,7 +9,7 @@ public static class FungleAdditionalElectrical { public static void CreateElectrical() { - if (!isFungle || !CustomOptionHolder.fungleElectrical.getBool() || !CustomOptionHolder.enableFungleModify.getBool()) + if (!isFungle || !CustomOptionHolder.fungleElectrical.GetBool() || !CustomOptionHolder.enableFungleModify.GetBool()) return; FungleShipStatus fungleShipStatus = ShipStatus.Instance.CastFast(); @@ -44,7 +44,7 @@ private class MapBehaviourAwakePatch { public static void Postfix(MapBehaviour __instance) { - if (!isFungle || !CustomOptionHolder.fungleElectrical.getBool()) + if (!isFungle || !CustomOptionHolder.fungleElectrical.GetBool()) return; MapRoom mapRoom = Object.Instantiate(MapLoader.Airship.MapPrefab.infectedOverlay.rooms.FirstOrDefault(x => x.room == SystemTypes.Electrical), __instance.infectedOverlay.transform); diff --git a/TheOtherRoles/Objects/Map/Mira.cs b/TheOtherRoles/Objects/Map/Mira.cs index 783664ee..f52f891a 100644 --- a/TheOtherRoles/Objects/Map/Mira.cs +++ b/TheOtherRoles/Objects/Map/Mira.cs @@ -6,7 +6,7 @@ public class AddVitals { public static void AddVital() { - if (isMira && CustomOptionHolder.miraVitals.getBool() && CustomOptionHolder.enableMiraModify.getBool()) + if (isMira && CustomOptionHolder.miraVitals.GetBool() && CustomOptionHolder.enableMiraModify.GetBool()) { Transform Vital = Object.Instantiate(PolusObject.transform.FindChild("Office").FindChild("panel_vitals"), GameObject.Find("MiraShip(Clone)").transform); diff --git a/TheOtherRoles/Objects/NinjaTrace.cs b/TheOtherRoles/Objects/NinjaTrace.cs index c7412f8b..8cf3e644 100644 --- a/TheOtherRoles/Objects/NinjaTrace.cs +++ b/TheOtherRoles/Objects/NinjaTrace.cs @@ -30,7 +30,7 @@ public NinjaTrace(Vector2 p, float duration = 1f) timeRemaining = duration; // display the ninjas color in the trace - var colorDuration = CustomOptionHolder.ninjaTraceColorTime.getFloat(); + var colorDuration = CustomOptionHolder.ninjaTraceColorTime.GetFloat(); FastDestroyableSingleton.Instance.StartCoroutine(Effects.Lerp(colorDuration, new Action(p => { Color c = Palette.PlayerColors[Ninja.ninja.Data.DefaultOutfit.ColorId]; diff --git a/TheOtherRoles/Options/CustomOptionHolder.cs b/TheOtherRoles/Options/CustomOptionHolder.cs index 4440c9c6..5b2b488a 100644 --- a/TheOtherRoles/Options/CustomOptionHolder.cs +++ b/TheOtherRoles/Options/CustomOptionHolder.cs @@ -1220,7 +1220,7 @@ public static void Load() ["trackerTrackingMethod1", "trackerTrackingMethod2", "trackerTrackingMethod3"], trackerSpawnRate); snitchSpawnRate = Create(30270, Types.Crewmate, cs(Snitch.color, "Snitch"), rates, null, true); - snitchLeftTasksForReveal = Create(30271, Types.Crewmate, "snitchLeftTasksForReveal", 1f, 0f, 10f, 1f, snitchSpawnRate); + snitchLeftTasksForReveal = Create(30271, Types.Crewmate, "snitchLeftTasksForReveal", 1, 0, 10, 1, snitchSpawnRate); snitchSeeMeeting = Create(30272, Types.Crewmate, "snitchSeeMeeting", true, snitchSpawnRate); snitchIncludeNeutralTeam = Create(30274, Types.Crewmate, "snitchIncludeNeutralTeam", ["optionOff", "snitchIncludeNeutralTeam2", "snitchIncludeNeutralTeam3", "snitchIncludeNeutralTeam4"], snitchSpawnRate); @@ -1228,10 +1228,10 @@ public static void Load() prophetSpawnRate = Create(30360, Types.Crewmate, cs(Prophet.color, "Prophet"), rates, null, true); prophetCooldown = Create(30361, Types.Crewmate, "prophetCooldown", 20f, 5f, 60f, 2.5f, prophetSpawnRate); - prophetNumExamines = Create(30362, Types.Crewmate, "prophetNumExamines", 4f, 1f, 10f, 1f, prophetSpawnRate); + prophetNumExamines = Create(30362, Types.Crewmate, "prophetNumExamines", 4, 1, 10, 1, prophetSpawnRate); prophetCanCallEmergency = Create(30363, Types.Crewmate, "prophetCanCallEmergency", true, prophetSpawnRate); prophetIsRevealed = Create(30364, Types.Crewmate, "prophetIsRevealed", false, prophetSpawnRate); - prophetExaminesToBeRevealed = Create(30365, Types.Crewmate, "prophetExaminesToBeRevealed", 3f, 1f, 10f, 1f, prophetIsRevealed); + prophetExaminesToBeRevealed = Create(30365, Types.Crewmate, "prophetExaminesToBeRevealed", 3, 1, 10, 1, prophetIsRevealed); prophetKillCrewAsRed = Create(30366, Types.Crewmate, "prophetKillCrewAsRed", false, prophetSpawnRate); prophetBenignNeutralAsRed = Create(30367, Types.Crewmate, "prophetBenignNeutralAsRed", false, prophetSpawnRate); prophetEvilNeutralAsRed = Create(30368, Types.Crewmate, "prophetEvilNeutralAsRed", true, prophetSpawnRate); diff --git a/TheOtherRoles/Options/CustomOptions.cs b/TheOtherRoles/Options/CustomOptions.cs index 49b262a1..5b1a2a7e 100644 --- a/TheOtherRoles/Options/CustomOptions.cs +++ b/TheOtherRoles/Options/CustomOptions.cs @@ -180,27 +180,27 @@ public static void ShareOptionSelections() // Getter - public int getSelection() + public int GetSelection() { return selection; } - public bool getBool() + public bool GetBool() { return selection > 0; } - public float getFloat() + public float GetFloat() { return (float)selections[selection]; } public int GetInt() { - return (int)getFloat(); + return (int)GetFloat(); } - public int getQuantity() + public int GetQuantity() { return selection + 1; } @@ -1149,10 +1149,10 @@ private static string buildModifierExtras(CustomOption customOption) // find options children with quantity var children = options.Where(o => o.parent == customOption); var quantity = children.Where(o => o.name.Contains("Quantity")).ToList(); - if (customOption.getSelection() == 0) return ""; - if (quantity.Count == 1) return $" ({quantity[0].getQuantity()})"; + if (customOption.GetSelection() == 0) return ""; + if (quantity.Count == 1) return $" ({quantity[0].GetQuantity()})"; if (customOption == CustomOptionHolder.modifierLover) - return $" (1 {"EvilLove".Translate()}: {CustomOptionHolder.modifierLoverImpLoverRate.getSelection() * 10}%)"; + return $" (1 {"EvilLove".Translate()}: {CustomOptionHolder.modifierLoverImpLoverRate.GetSelection() * 10}%)"; return ""; } @@ -1188,7 +1188,7 @@ private static string buildOptionsOfType(CustomOptionType type, bool headerOnly) if (type == CustomOptionType.Modifier) line += buildModifierExtras(option); sb.AppendLine(line); } - else if (option.parent.getSelection() > 0) + else if (option.parent.GetSelection() > 0) { if (option.id == 30170) //Deputy sb.AppendLine($"- {cs(Deputy.color, "Deputy".Translate())}: {option.getString()}"); @@ -1209,8 +1209,8 @@ private static string buildOptionsOfType(CustomOptionType type, bool headerOnly) option.type != CustomOptionType.PropHunt) continue; if (option.parent != null) { - var isIrrelevant = option.parent.getSelection() == 0 || - (option.parent.parent != null && option.parent.parent.getSelection() == 0); + var isIrrelevant = option.parent.GetSelection() == 0 || + (option.parent.parent != null && option.parent.parent.GetSelection() == 0); var c = isIrrelevant ? Color.grey : Color.white; // No use for now if (isIrrelevant) continue; @@ -1221,8 +1221,8 @@ private static string buildOptionsOfType(CustomOptionType type, bool headerOnly) if (option == CustomOptionHolder.neutralRolesCountMin) { var optionName = cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "CrewmateRolesText".Translate()); - var neutralMin = CustomOptionHolder.neutralRolesCountMin.getSelection(); - var neutralMax = CustomOptionHolder.neutralRolesCountMax.getSelection(); + var neutralMin = CustomOptionHolder.neutralRolesCountMin.GetSelection(); + var neutralMax = CustomOptionHolder.neutralRolesCountMax.GetSelection(); var min = Math.Max(0, PlayerControl.AllPlayerControls.Count - neutralMax - ModOption.NumImpostors); var max = Math.Max(0, PlayerControl.AllPlayerControls.Count - neutralMin - ModOption.NumImpostors); @@ -1232,13 +1232,13 @@ private static string buildOptionsOfType(CustomOptionType type, bool headerOnly) else if (option == CustomOptionHolder.neutralRolesCountMax) { var optionName = cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "NeutralRolesText".Translate()); - var min = CustomOptionHolder.neutralRolesCountMin.getSelection(); - var max = CustomOptionHolder.neutralRolesCountMax.getSelection(); + var min = CustomOptionHolder.neutralRolesCountMin.GetSelection(); + var max = CustomOptionHolder.neutralRolesCountMax.GetSelection(); if (min > max) min = max; var optionValue = min == max ? $"{min}" : $"{min} ~ {max}"; - var killerMin = CustomOptionHolder.killerNeutralRolesCountMin.getSelection(); - var killerMax = CustomOptionHolder.killerNeutralRolesCountMax.getSelection(); + var killerMin = CustomOptionHolder.killerNeutralRolesCountMin.GetSelection(); + var killerMax = CustomOptionHolder.killerNeutralRolesCountMax.GetSelection(); var min2 = Mathf.Min(killerMin, min); var max2 = Mathf.Min(killerMax, max); if (min2 > max2) min2 = max2; @@ -1255,8 +1255,8 @@ private static string buildOptionsOfType(CustomOptionType type, bool headerOnly) else if (option == CustomOptionHolder.modifiersCountMin) { var optionName = cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "ModifierRolesText".Translate()); - var min = CustomOptionHolder.modifiersCountMin.getSelection(); - var max = CustomOptionHolder.modifiersCountMax.getSelection(); + var min = CustomOptionHolder.modifiersCountMin.GetSelection(); + var max = CustomOptionHolder.modifiersCountMax.GetSelection(); if (min > max) min = max; var optionValue = min == max ? $"{max}" : $"{min} ~ {max}"; sb.AppendLine($"{optionName}: {optionValue}"); diff --git a/TheOtherRoles/Options/ModOption.cs b/TheOtherRoles/Options/ModOption.cs index 20ddf46b..44766f15 100644 --- a/TheOtherRoles/Options/ModOption.cs +++ b/TheOtherRoles/Options/ModOption.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; using AmongUs.GameOptions; using TheOtherRoles.Utilities; -using UnityEngine; namespace TheOtherRoles.Options; internal class ModOption { - public static float ButtonCooldown => CustomOptionHolder.resteButtonCooldown.getFloat(); - public static bool PreventTaskEnd => CustomOptionHolder.disableTaskGameEnd.getBool(); + public static float ButtonCooldown => CustomOptionHolder.resteButtonCooldown.GetFloat(); + public static bool PreventTaskEnd => CustomOptionHolder.disableTaskGameEnd.GetBool(); public static float KillCooddown => GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown; public static int NumImpostors => GameOptionsManager.Instance.currentNormalGameOptions.NumImpostors; - public static bool DebugMode => CustomOptionHolder.debugMode.getBool(); - public static bool DisableGameEnd => DebugMode && CustomOptionHolder.disableGameEnd.getBool(); + public static bool DebugMode => CustomOptionHolder.debugMode.GetBool(); + public static bool DisableGameEnd => DebugMode && CustomOptionHolder.disableGameEnd.GetBool(); public static NormalGameOptionsV07 NormalOptions => GameOptionsManager.Instance.currentNormalGameOptions; // Set values @@ -91,32 +90,32 @@ public static void clearAndReloadMapOptions() ventsToSeal = []; playerIcons = new Dictionary(); - maxNumberOfMeetings = Mathf.RoundToInt(CustomOptionHolder.maxNumberOfMeetings.getSelection()); - blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool(); - blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool(); - noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.getBool(); - hidePlayerNames = CustomOptionHolder.hidePlayerNames.getBool(); - hideOutOfSightNametags = CustomOptionHolder.hideOutOfSightNametags.getBool(); - hideVentAnim = CustomOptionHolder.hideVentAnimOnShadows.getBool(); - allowParallelMedBayScans = CustomOptionHolder.allowParallelMedBayScans.getBool(); - disableMedscanWalking = CustomOptionHolder.disableMedbayWalk.getBool(); - camoComms = CustomOptionHolder.enableCamoComms.getBool(); + maxNumberOfMeetings = CustomOptionHolder.maxNumberOfMeetings.GetInt(); + blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.GetBool(); + blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.GetBool(); + noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.GetBool(); + hidePlayerNames = CustomOptionHolder.hidePlayerNames.GetBool(); + hideOutOfSightNametags = CustomOptionHolder.hideOutOfSightNametags.GetBool(); + hideVentAnim = CustomOptionHolder.hideVentAnimOnShadows.GetBool(); + allowParallelMedBayScans = CustomOptionHolder.allowParallelMedBayScans.GetBool(); + disableMedscanWalking = CustomOptionHolder.disableMedbayWalk.GetBool(); + camoComms = CustomOptionHolder.enableCamoComms.GetBool(); fungleDisableCamoComms = false; - shieldFirstKill = CustomOptionHolder.shieldFirstKill.getBool(); - impostorSeeRoles = CustomOptionHolder.impostorSeeRoles.getBool(); - transparentTasks = CustomOptionHolder.transparentTasks.getBool(); - restrictDevices = CustomOptionHolder.restrictDevices.getSelection(); + shieldFirstKill = CustomOptionHolder.shieldFirstKill.GetBool(); + impostorSeeRoles = CustomOptionHolder.impostorSeeRoles.GetBool(); + transparentTasks = CustomOptionHolder.transparentTasks.GetBool(); + restrictDevices = CustomOptionHolder.restrictDevices.GetSelection(); //restrictAdminTime = restrictAdminTimeMax = CustomOptionHolder.restrictAdmin.getFloat(); - restrictCamerasTime = restrictCamerasTimeMax = CustomOptionHolder.restrictCameras.getFloat(); - restrictVitalsTime = restrictVitalsTimeMax = CustomOptionHolder.restrictVents.getFloat(); - disableCamsRoundOne = CustomOptionHolder.disableCamsRound1.getBool(); - randomGameStartPosition = CustomOptionHolder.randomGameStartPosition.getBool(); - ShowVentsOnMap = CustomOptionHolder.ShowVentsOnMap.getBool(); - ShowVentsOnMeetingMap = CustomOptionHolder.ShowVentsOnMeetingMap.getBool(); - randomLigherPlayer = CustomOptionHolder.randomLigherPlayer.getBool(); - allowModGuess = CustomOptionHolder.allowModGuess.getBool(); - CursedTasks = CustomOptionHolder.enableCursedTasks.getBool(); - disableSabotage = CustomOptionHolder.disableSabotage.getBool(); + restrictCamerasTime = restrictCamerasTimeMax = CustomOptionHolder.restrictCameras.GetFloat(); + restrictVitalsTime = restrictVitalsTimeMax = CustomOptionHolder.restrictVents.GetFloat(); + disableCamsRoundOne = CustomOptionHolder.disableCamsRound1.GetBool(); + randomGameStartPosition = CustomOptionHolder.randomGameStartPosition.GetBool(); + ShowVentsOnMap = CustomOptionHolder.ShowVentsOnMap.GetBool(); + ShowVentsOnMeetingMap = CustomOptionHolder.ShowVentsOnMeetingMap.GetBool(); + randomLigherPlayer = CustomOptionHolder.randomLigherPlayer.GetBool(); + allowModGuess = CustomOptionHolder.allowModGuess.GetBool(); + CursedTasks = CustomOptionHolder.enableCursedTasks.GetBool(); + disableSabotage = CustomOptionHolder.disableSabotage.GetBool(); firstKillPlayer = null; isRoundOne = true; isCanceled = false; diff --git a/TheOtherRoles/Patches/ClientOptionsPatch.cs b/TheOtherRoles/Patches/ClientOptionsPatch.cs index 5dffda7a..39a197d6 100644 --- a/TheOtherRoles/Patches/ClientOptionsPatch.cs +++ b/TheOtherRoles/Patches/ClientOptionsPatch.cs @@ -98,7 +98,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) //EnableSoundEffects enableSoundEffects = AddButton(new Vector2(0, 0), "EnableSoundEffects", () => { - enableSoundEffects.UpdateToggleText(!enableSoundEffects.onState, getString("EnableSoundEffectsText")); + enableSoundEffects.UpdateToggleText(!enableSoundEffects.onState, GetString("EnableSoundEffectsText")); ModOption.enableSoundEffects = Main.EnableSoundEffects.Value = enableSoundEffects.onState; }, nebulaTab, toggleButtonTemplate); @@ -106,7 +106,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) toggleCursor = AddButton(new Vector2(0, 1), "ToggleCursor", () => { enableCursor(false); - toggleCursor.UpdateToggleText(!toggleCursor.onState, getString("ToggleCursorText")); + toggleCursor.UpdateToggleText(!toggleCursor.onState, GetString("ToggleCursorText")); ModOption.toggleCursor = Main.ToggleCursor.Value = toggleCursor.onState; Message($"toggleCursor: {toggleCursor.onState}"); }, nebulaTab, toggleButtonTemplate); @@ -114,21 +114,21 @@ public static void Postfix(OptionsMenuBehaviour __instance) //ShowFPS showKeyReminder = AddButton(new Vector2(1, 0), "ShowKeyReminder", () => { - showKeyReminder.UpdateToggleText(!showKeyReminder.onState, getString("ShowKeyReminder")); + showKeyReminder.UpdateToggleText(!showKeyReminder.onState, GetString("ShowKeyReminder")); ModOption.showKeyReminder = Main.ShowKeyReminder.Value = showKeyReminder.onState; }, nebulaTab, toggleButtonTemplate); //ShowFPS showFPS = AddButton(new Vector2(1, 1), "ShowFPS", () => { - showFPS.UpdateToggleText(!showFPS.onState, getString("ShowFPS")); + showFPS.UpdateToggleText(!showFPS.onState, GetString("ShowFPS")); ModOption.showFPS = Main.ShowFPS.Value = showFPS.onState; }, nebulaTab, toggleButtonTemplate); //LocalHats localHats = AddButton(new Vector2(0, 2), "LocalHats", () => { - localHats.UpdateToggleText(!localHats.onState, getString("LocalHatsText")); + localHats.UpdateToggleText(!localHats.onState, GetString("LocalHatsText")); ModOption.localHats = Main.LocalHats.Value = localHats.onState; }, nebulaTab, toggleButtonTemplate); @@ -145,7 +145,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) defaultButton.name = "RestoreDefaultsButton"; defaultButton.transform.GetChild(0).GetComponent().size = new Vector2(2.25f, 0.4f); TextObject = defaultButton.transform.FindChild("Text_TMP").gameObject; - TextObject.GetComponent().text = getString("keyBinding.restoreDefaults"); + TextObject.GetComponent().text = GetString("keyBinding.restoreDefaults"); TextObject.GetComponent().rectTransform.sizeDelta *= 2; TextObject.GetComponent().enabled = false; passiveButton = defaultButton.GetComponent(); @@ -159,7 +159,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) { ModInputManager.ModInput input = ModInputManager.allInputs[i]; input.resetToDefault(); - allKeyBindingButtons[i].UpdateCustomText(Color.white, getString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey); + allKeyBindingButtons[i].UpdateCustomText(Color.white, GetString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey); } } )); @@ -175,7 +175,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) inputButton.name = input.identifier; ToggleButtonBehaviour inputToggleButton = inputButton.GetComponent(); inputToggleButton.BaseText = 0; - inputToggleButton.Text.text = getString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey; + inputToggleButton.Text.text = GetString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey; passiveButton = inputButton.GetComponent(); passiveButton.OnClick = new ButtonClickedEvent(); passiveButton.OnClick.AddListener((UnityAction)(() => @@ -189,7 +189,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) { selectedKeyBinding = index; allKeyBindingButtons[selectedKeyBinding].UpdateCustomText(Color.yellow, - getString($"{getString($"keyBinding.{input.identifier}")}: {getString("keyBinding.recording")}")); + GetString($"{GetString($"keyBinding.{input.identifier}")}: {GetString("keyBinding.recording")}")); inputToggleButton.UpdateCustomText(Color.yellow, null); } })); @@ -204,7 +204,7 @@ public static void Postfix(OptionsMenuBehaviour __instance) keyBindingButton.name = "KeyBindingButton"; keyBindingButton.transform.GetChild(0).GetComponent().size = new Vector2(2.25f, 0.4f); TextObject = keyBindingButton.transform.FindChild("Text_TMP").gameObject; - TextObject.GetComponent().text = getString("keyBinding"); + TextObject.GetComponent().text = GetString("keyBinding"); TextObject.GetComponent().rectTransform.sizeDelta *= 2; TextObject.GetComponent().enabled = false; passiveButton = keyBindingButton.GetComponent(); @@ -237,7 +237,7 @@ IEnumerator getEnumerator() ModInputManager.ModInput input = ModInputManager.allInputs[selectedKeyBinding]; input.changeKeyCode(entry.Key); - allKeyBindingButtons[selectedKeyBinding].UpdateCustomText(Color.white, getString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey); + allKeyBindingButtons[selectedKeyBinding].UpdateCustomText(Color.white, GetString("keyBinding." + input.identifier) + ": " + ModInputManager.allKeyCodes[input.keyCode].displayKey); selectedKeyBinding = -1; break; } @@ -282,11 +282,11 @@ IEnumerator getEnumerator() { __instance.OpenTabGroup(tabs.Count - 2); - showFPS.UpdateToggleText(Main.ShowFPS.Value, getString("ShowFPS")); - enableSoundEffects.UpdateToggleText(Main.EnableSoundEffects.Value, getString("EnableSoundEffectsText")); - showKeyReminder.UpdateToggleText(Main.ShowKeyReminder.Value, getString("ShowKeyReminder")); - toggleCursor.UpdateToggleText(Main.ToggleCursor.Value, getString("ToggleCursorText")); - localHats.UpdateToggleText(Main.LocalHats.Value, getString("LocalHatsText")); + showFPS.UpdateToggleText(Main.ShowFPS.Value, GetString("ShowFPS")); + enableSoundEffects.UpdateToggleText(Main.EnableSoundEffects.Value, GetString("EnableSoundEffectsText")); + showKeyReminder.UpdateToggleText(Main.ShowKeyReminder.Value, GetString("ShowKeyReminder")); + toggleCursor.UpdateToggleText(Main.ToggleCursor.Value, GetString("ToggleCursorText")); + localHats.UpdateToggleText(Main.LocalHats.Value, GetString("LocalHatsText")); passiveButton.OnMouseOver.Invoke(); } diff --git a/TheOtherRoles/Patches/CreateOptionsPickerPatch.cs b/TheOtherRoles/Patches/CreateOptionsPickerPatch.cs index 760493c0..5f1ded73 100644 --- a/TheOtherRoles/Patches/CreateOptionsPickerPatch.cs +++ b/TheOtherRoles/Patches/CreateOptionsPickerPatch.cs @@ -25,15 +25,15 @@ public static bool Prefix(CreateOptionsPicker __instance, ref GameModes mode) switch (gm) { case CustomGamemodes.Guesser: - __instance.GameModeText.text = getString("isGuesserGm"); + __instance.GameModeText.text = GetString("isGuesserGm"); ModOption.gameMode = CustomGamemodes.Guesser; break; case CustomGamemodes.HideNSeek: - __instance.GameModeText.text = getString("isHideNSeekGM"); + __instance.GameModeText.text = GetString("isHideNSeekGM"); ModOption.gameMode = CustomGamemodes.HideNSeek; break; case CustomGamemodes.PropHunt: - __instance.GameModeText.text = getString("isPropHuntGM"); + __instance.GameModeText.text = GetString("isPropHuntGM"); ModOption.gameMode = CustomGamemodes.PropHunt; break; } @@ -47,9 +47,9 @@ public static void Postfix(CreateOptionsPicker __instance) { __instance.GameModeText.text = ModOption.gameMode switch { - CustomGamemodes.Guesser => getString("isGuesserGm"), - CustomGamemodes.HideNSeek => getString("isHideNSeekGM"), - CustomGamemodes.PropHunt => getString("isPropHuntGM"), + CustomGamemodes.Guesser => GetString("isGuesserGm"), + CustomGamemodes.HideNSeek => GetString("isHideNSeekGM"), + CustomGamemodes.PropHunt => GetString("isPropHuntGM"), _ => __instance.GameModeText.text }; } @@ -81,9 +81,9 @@ public static bool Prefix(GameModeMenu __instance) } else { - chatLanguageButton.Text.text = i == 3 ? getString("isGuesserGm") : getString("isHideNSeekGM"); + chatLanguageButton.Text.text = i == 3 ? GetString("isGuesserGm") : GetString("isHideNSeekGM"); if (i == 5) - chatLanguageButton.Text.text = getString("isPropHuntGM"); + chatLanguageButton.Text.text = GetString("isPropHuntGM"); } chatLanguageButton.Button.OnClick.RemoveAllListeners(); diff --git a/TheOtherRoles/Patches/CredentialsPatch.cs b/TheOtherRoles/Patches/CredentialsPatch.cs index 790afcf8..3fa46c7e 100644 --- a/TheOtherRoles/Patches/CredentialsPatch.cs +++ b/TheOtherRoles/Patches/CredentialsPatch.cs @@ -8,13 +8,13 @@ namespace TheOtherRoles.Patches; [HarmonyPatch] public static class CredentialsPatch { - public static string fullCredentialsVersion = $"{getString("TouTitle")} v{Main.Version + (Main.betaDays > 0 ? "-Beta" : "")}"; + public static string fullCredentialsVersion = $"{GetString("TouTitle")} v{Main.Version + (Main.betaDays > 0 ? "-Beta" : "")}"; - public static string fullCredentials = getString("fullCredentials"); + public static string fullCredentials = GetString("fullCredentials"); - public static string mainMenuCredentials = getString("mainMenuCredentials"); + public static string mainMenuCredentials = GetString("mainMenuCredentials"); - public static string contributorsCredentials = getString("contributorsCredentials"); + public static string contributorsCredentials = GetString("contributorsCredentials"); [HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))] internal static class PingTrackerPatch @@ -34,16 +34,16 @@ private static void Postfix(PingTracker __instance) var position = __instance.GetComponent(); var gameModeText = ModOption.gameMode switch { - CustomGamemodes.HideNSeek => getString("isHideNSeekGM"), - CustomGamemodes.Guesser => getString("isGuesserGm"), - CustomGamemodes.PropHunt => getString("isPropHuntGM"), + CustomGamemodes.HideNSeek => GetString("isHideNSeekGM"), + CustomGamemodes.Guesser => GetString("isGuesserGm"), + CustomGamemodes.PropHunt => GetString("isPropHuntGM"), _ => "" }; if (ModOption.DebugMode) gameModeText += "(Debug Mode)"; if (gameModeText != "") gameModeText = cs(Color.yellow, gameModeText) + "\n"; if (AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started) { - __instance.text.text = $"{getString("TouTitle")} v{Main.Version + "\n" + getString("inGameTitle")}\n{PingText}\n{gameModeText}"; + __instance.text.text = $"{GetString("TouTitle")} v{Main.Version + "\n" + GetString("inGameTitle")}\n{PingText}\n{gameModeText}"; position.DistanceFromEdge = new Vector3(2.25f, 0.1f, 0); } else diff --git a/TheOtherRoles/Patches/ExileControllerPatch.cs b/TheOtherRoles/Patches/ExileControllerPatch.cs index b27e23ac..1018ad3a 100644 --- a/TheOtherRoles/Patches/ExileControllerPatch.cs +++ b/TheOtherRoles/Patches/ExileControllerPatch.cs @@ -238,7 +238,7 @@ public static void Postfix(ExileController __instance) if (Balancer.currentAbilityUser != null && Balancer.IsDoubleExile && __instance.exiled?.PlayerId == Balancer.targetplayerleft.PlayerId) { - __instance.completeString = getString("二者一同放逐"); + __instance.completeString = GetString("二者一同放逐"); } } @@ -430,7 +430,7 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled) // AntiTeleport set position AntiTeleport.setPosition(); - if (CustomOptionHolder.randomGameStartPosition.getBool()) MapData.RandomSpawnPlayers(); + if (CustomOptionHolder.randomGameStartPosition.GetBool()) MapData.RandomSpawnPlayers(); // Invert add meeting if (Invert.meetings > 0) Invert.meetings--; diff --git a/TheOtherRoles/Patches/GameStartManagerPatch.cs b/TheOtherRoles/Patches/GameStartManagerPatch.cs index 8438c315..7c460100 100644 --- a/TheOtherRoles/Patches/GameStartManagerPatch.cs +++ b/TheOtherRoles/Patches/GameStartManagerPatch.cs @@ -95,7 +95,7 @@ public static void Postfix(GameStartManager __instance) else if (!playerVersions.ContainsKey(client.Id)) { versionMismatch = true; - message += $"{string.Format(getString("errorNotInstalled"), $"{client.Character.Data.PlayerName}")}\n"; + message += $"{string.Format(GetString("errorNotInstalled"), $"{client.Character.Data.PlayerName}")}\n"; } else { @@ -103,18 +103,18 @@ public static void Postfix(GameStartManager __instance) int diff = TheOtherRolesPlugin.Version.CompareTo(PV.version); if (diff > 0) { - message += $"{string.Format(getString("errorOlderVersion"), $"{client.Character.Data.PlayerName}")} (v{playerVersions[client.Id].version})\n"; + message += $"{string.Format(GetString("errorOlderVersion"), $"{client.Character.Data.PlayerName}")} (v{playerVersions[client.Id].version})\n"; versionMismatch = true; } else if (diff < 0) { - message += $"{string.Format(getString("errorNewerVersion"), $"{client.Character.Data.PlayerName}")} (v{playerVersions[client.Id].version})\n"; + message += $"{string.Format(GetString("errorNewerVersion"), $"{client.Character.Data.PlayerName}")} (v{playerVersions[client.Id].version})\n"; versionMismatch = true; } else if (!PV.GuidMatches()) { // version presumably matches, check if Guid matches - message += $"{string.Format(getString("errorWrongVersion"), $"{client.Character.Data.PlayerName}")} v{playerVersions[client.Id].version} ({PV.guid})\n"; + message += $"{string.Format(GetString("errorWrongVersion"), $"{client.Character.Data.PlayerName}")} v{playerVersions[client.Id].version} ({PV.guid})\n"; versionMismatch = true; } } @@ -150,7 +150,7 @@ public static void Postfix(GameStartManager __instance) copiedStartButton.GetComponent().sprite = UnityHelper.loadSpriteFromResources("TheOtherRoles.Resources.StopClean.png", 180f); copiedStartButton.SetActive(true); var startButtonText = copiedStartButton.GetComponentInChildren(); - startButtonText.text = getString("stopGameStartText"); + startButtonText.text = GetString("stopGameStartText"); startButtonText.fontSize *= 0.62f; startButtonText.fontSizeMax = startButtonText.fontSize; startButtonText.gameObject.transform.localPosition = Vector3.zero; @@ -185,12 +185,12 @@ void StopStartFunc() SceneChanger.ChangeScene("MainMenu"); } - __instance.GameStartText.text = $"{string.Format(getString("errorHostNoVersion"), Math.Round(10 - kickingTimer))}"; + __instance.GameStartText.text = $"{string.Format(GetString("errorHostNoVersion"), Math.Round(10 - kickingTimer))}"; __instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2; } else if (versionMismatch) { - __instance.GameStartText.text = $"{getString("errorDifferentVersion")}\n" + message; + __instance.GameStartText.text = $"{GetString("errorDifferentVersion")}\n" + message; __instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2; } else @@ -202,9 +202,9 @@ void StopStartFunc() } } - if (!__instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", "")) || !CustomOptionHolder.anyPlayerCanStopStart.getBool()) + if (!__instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", "")) || !CustomOptionHolder.anyPlayerCanStopStart.GetBool()) copiedStartButton?.Destroy(); - if (CustomOptionHolder.anyPlayerCanStopStart.getBool() && copiedStartButton == null && __instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", ""))) + if (CustomOptionHolder.anyPlayerCanStopStart.GetBool() && copiedStartButton == null && __instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", ""))) { // Activate Stop-Button @@ -236,7 +236,7 @@ void StopStartFunc() }))); } - if (__instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", "")) && CustomOptionHolder.anyPlayerCanStopStart.getBool()) + if (__instance.GameStartText.text.StartsWith(FastDestroyableSingleton.Instance.GetString(StringNames.GameStarting).Replace("{0}", "")) && CustomOptionHolder.anyPlayerCanStopStart.GetBool()) __instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 0.6f; } @@ -306,8 +306,8 @@ public static bool Prefix(GameStartManager __instance) if (continueStart && (ModOption.gameMode == CustomGamemodes.HideNSeek || ModOption.gameMode == CustomGamemodes.PropHunt) && GameOptionsManager.Instance.CurrentGameOptions.MapId != 6) { byte mapId = 0; - if (ModOption.gameMode == CustomGamemodes.HideNSeek) mapId = (byte)CustomOptionHolder.hideNSeekMap.getSelection(); - else if (ModOption.gameMode == CustomGamemodes.PropHunt) mapId = (byte)CustomOptionHolder.propHuntMap.getSelection(); + if (ModOption.gameMode == CustomGamemodes.HideNSeek) mapId = (byte)CustomOptionHolder.hideNSeekMap.GetSelection(); + else if (ModOption.gameMode == CustomGamemodes.PropHunt) mapId = (byte)CustomOptionHolder.propHuntMap.GetSelection(); if (mapId >= 3) mapId++; var writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.DynamicMapOption, SendOption.Reliable, -1); @@ -315,7 +315,7 @@ public static bool Prefix(GameStartManager __instance) AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.dynamicMapOption(mapId); } - else if (CustomOptionHolder.dynamicMap.getBool() && continueStart) + else if (CustomOptionHolder.dynamicMap.GetBool() && continueStart) { // 0 = Skeld // 1 = Mira HQ @@ -327,12 +327,12 @@ public static bool Prefix(GameStartManager __instance) byte chosenMapId = 0; List probabilities = [ - CustomOptionHolder.dynamicMapEnableSkeld.getSelection() / 10f, - CustomOptionHolder.dynamicMapEnableMira.getSelection() / 10f, - CustomOptionHolder.dynamicMapEnablePolus.getSelection() / 10f, - CustomOptionHolder.dynamicMapEnableAirShip.getSelection() / 10f, - CustomOptionHolder.dynamicMapEnableFungle.getSelection() / 10f, - CustomOptionHolder.dynamicMapEnableSubmerged.getSelection() / 10f, + CustomOptionHolder.dynamicMapEnableSkeld.GetSelection() / 10f, + CustomOptionHolder.dynamicMapEnableMira.GetSelection() / 10f, + CustomOptionHolder.dynamicMapEnablePolus.GetSelection() / 10f, + CustomOptionHolder.dynamicMapEnableAirShip.GetSelection() / 10f, + CustomOptionHolder.dynamicMapEnableFungle.GetSelection() / 10f, + CustomOptionHolder.dynamicMapEnableSubmerged.GetSelection() / 10f, ]; // if any map is at 100%, remove all maps that are not! @@ -363,7 +363,7 @@ public static bool Prefix(GameStartManager __instance) } // Translate chosen map to presets page and use that maps random map preset page - if (CustomOptionHolder.dynamicMapSeparateSettings.getBool()) + if (CustomOptionHolder.dynamicMapSeparateSettings.GetBool()) CustomOptionHolder.presetSelection.updateSelection(chosenMapId + 3); if (chosenMapId >= 3) chosenMapId++; // Skip dlekS diff --git a/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs b/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs index 7d882b8e..7849678f 100644 --- a/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs +++ b/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs @@ -90,7 +90,7 @@ public static void showOrHideAbilityButtonPostfix(AbilityButton __instance) { var isGameMode = GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek || PropHunt.isPropHuntGM || HideNSeek.isHideNSeekGM; - if (CachedPlayer.LocalPlayer.Data.IsDead && (CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool() || isGameMode)) + if (CachedPlayer.LocalPlayer.Data.IsDead && (CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.GetBool() || isGameMode)) { // player has haunt button. var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); diff --git a/TheOtherRoles/Patches/IntroPatch.cs b/TheOtherRoles/Patches/IntroPatch.cs index bfe7c81a..4cc2096a 100644 --- a/TheOtherRoles/Patches/IntroPatch.cs +++ b/TheOtherRoles/Patches/IntroPatch.cs @@ -110,7 +110,7 @@ public static void Prefix(IntroCutscene __instance) AntiTeleport.setPosition(); - if (CustomOptionHolder.randomGameStartPosition.getBool()) MapData.RandomSpawnPlayers(); + if (CustomOptionHolder.randomGameStartPosition.GetBool()) MapData.RandomSpawnPlayers(); if (AmongUsClient.Instance.AmHost) { @@ -169,7 +169,7 @@ public static void Prefix(IntroCutscene __instance) if (p == 1f) { player.moveable = true; - HideNSeek.timer = CustomOptionHolder.hideNSeekTimer.getFloat() * 60; + HideNSeek.timer = CustomOptionHolder.hideNSeekTimer.GetFloat() * 60; HideNSeek.isWaitingTimer = false; } }))); @@ -207,11 +207,11 @@ public static void Prefix(IntroCutscene __instance) GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown; GameOptionsManager.Instance.currentNormalGameOptions.ImpostorLightMod = - CustomOptionHolder.hideNSeekHunterVision.getFloat(); + CustomOptionHolder.hideNSeekHunterVision.GetFloat(); GameOptionsManager.Instance.currentNormalGameOptions.CrewLightMod = - CustomOptionHolder.hideNSeekHuntedVision.getFloat(); + CustomOptionHolder.hideNSeekHuntedVision.GetFloat(); GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown = - CustomOptionHolder.hideNSeekKillCooldown.getFloat(); + CustomOptionHolder.hideNSeekKillCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Patches/LobbyRoleList.cs b/TheOtherRoles/Patches/LobbyRoleList.cs index 7d1d8d39..2dfb5ce9 100644 --- a/TheOtherRoles/Patches/LobbyRoleList.cs +++ b/TheOtherRoles/Patches/LobbyRoleList.cs @@ -49,7 +49,7 @@ public static void RoleSummaryOnClick() TextMeshPro textTemplate = HudManager.Instance.TaskPanel.taskText; TextMeshPro newtitle = Object.Instantiate(textTemplate, container.transform); - newtitle.text = getString("lobbyInfoSummary"); + newtitle.text = GetString("lobbyInfoSummary"); newtitle.color = Color.white; newtitle.outlineWidth = 0.01f; newtitle.transform.localPosition = new Vector3(1f, 0.17f, -2f); @@ -64,19 +64,19 @@ public static void RoleSummaryOnClick() switch (Teams[i]) { case "Impostors": - team = cs(Palette.ImpostorRed, getString("ImpostorRolesText")); + team = cs(Palette.ImpostorRed, GetString("ImpostorRolesText")); teamid = RoleType.Impostor; break; case "Neutrals": - team = cs(new Color32(76, 84, 78, 255), getString("NeutralRolesText")); + team = cs(new Color32(76, 84, 78, 255), GetString("NeutralRolesText")); teamid = RoleType.Neutral; break; case "Crewmates": - team = cs(Palette.CrewmateBlue, getString("CrewmateRolesText")); + team = cs(Palette.CrewmateBlue, GetString("CrewmateRolesText")); teamid = RoleType.Crewmate; break; case "Modifiers": - team = cs(Color.yellow, getString("ModifierRolesText")); + team = cs(Color.yellow, GetString("ModifierRolesText")); teamid = RoleType.Modifier; break; } diff --git a/TheOtherRoles/Patches/MainMenuPatch.cs b/TheOtherRoles/Patches/MainMenuPatch.cs index e11df1d6..3eb05bb6 100644 --- a/TheOtherRoles/Patches/MainMenuPatch.cs +++ b/TheOtherRoles/Patches/MainMenuPatch.cs @@ -76,7 +76,7 @@ private static void Prefix(MainMenuManager __instance) var textCreditsButton = creditsButton.transform.GetComponentInChildren(); __instance.StartCoroutine(Effects.Lerp(0.5f, - new Action(p => { textCreditsButton.SetText(getString("Credits")); }))); + new Action(p => { textCreditsButton.SetText(GetString("Credits")); }))); var passiveCreditsButton = creditsButton.GetComponent(); passiveCreditsButton.OnClick = new ButtonClickedEvent(); @@ -95,7 +95,7 @@ private static void Prefix(MainMenuManager __instance) popUp = Object.Instantiate(popUpTemplate); popUp.gameObject.SetActive(true); - var creditsString = getString("creditsString1"); + var creditsString = GetString("creditsString1"); creditsString += @" Other Credits & Resources: @@ -199,9 +199,9 @@ public static void addSceneChangeCallbacks() template.StartCoroutine(Effects.Lerp(0.1f, new Action(p => { - guesserButtonText.SetText(getString("isGuesserGm")); - HideNSeekButtonText.SetText(getString("isHideNSeekGM")); - PropHuntButtonText.SetText(getString("isPropHuntGM")); + guesserButtonText.SetText(GetString("isGuesserGm")); + HideNSeekButtonText.SetText(GetString("isHideNSeekGM")); + PropHuntButtonText.SetText(GetString("isPropHuntGM")); }))); })); } diff --git a/TheOtherRoles/Patches/MapBehaviourPatch.cs b/TheOtherRoles/Patches/MapBehaviourPatch.cs index 65f3152b..0bcb6daf 100644 --- a/TheOtherRoles/Patches/MapBehaviourPatch.cs +++ b/TheOtherRoles/Patches/MapBehaviourPatch.cs @@ -33,12 +33,12 @@ public static void clearAndReload() [HarmonyPatch(typeof(MapBehaviour), nameof(MapBehaviour.FixedUpdate))] private static void Postfix(MapBehaviour __instance) { - if (__instance.infectedOverlay.gameObject.active && PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.getBool()) + if (__instance.infectedOverlay.gameObject.active && PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.GetBool()) { __instance.Close(); } // Show location of all players on the map for ghosts! - if (PlayerControl.LocalPlayer.Data.IsDead && (!PlayerControl.LocalPlayer.Data.Role.IsImpostor || CustomOptionHolder.deadImpsBlockSabotage.getBool())) + if (PlayerControl.LocalPlayer.Data.IsDead && (!PlayerControl.LocalPlayer.Data.Role.IsImpostor || CustomOptionHolder.deadImpsBlockSabotage.GetBool())) { foreach (PlayerControl player in CachedPlayer.AllPlayers) { diff --git a/TheOtherRoles/Patches/MeetingHudPatch.cs b/TheOtherRoles/Patches/MeetingHudPatch.cs index 917bbb1d..3405d8e7 100644 --- a/TheOtherRoles/Patches/MeetingHudPatch.cs +++ b/TheOtherRoles/Patches/MeetingHudPatch.cs @@ -299,24 +299,24 @@ public static void updateMeetingText(MeetingHud __instance) ? HandleGuesser.remainingShots(CachedPlayer.LocalPlayer.PlayerControl.PlayerId) : 0; if (numGuesses > 0) { - meetingInfoText = string.Format(getString("guesserGuessesLeft"), numGuesses); + meetingInfoText = string.Format(GetString("guesserGuessesLeft"), numGuesses); } if (CachedPlayer.LocalPlayer.PlayerControl == Akujo.akujo && Akujo.timeLeft > 0) { - meetingInfoText = string.Format(getString("akujoTimeRemaining"), $"{TimeSpan.FromSeconds(Akujo.timeLeft):mm\\:ss}"); + meetingInfoText = string.Format(GetString("akujoTimeRemaining"), $"{TimeSpan.FromSeconds(Akujo.timeLeft):mm\\:ss}"); } else if (CachedPlayer.LocalPlayer.PlayerControl == Doomsayer.doomsayer) { - meetingInfoText = string.Format(getString("DoomsayerKilledToWin"), Doomsayer.killToWin - Doomsayer.killedToWin); + meetingInfoText = string.Format(GetString("DoomsayerKilledToWin"), Doomsayer.killToWin - Doomsayer.killedToWin); } else if (CachedPlayer.LocalPlayer.PlayerControl == Swapper.swapper) { - meetingInfoText = string.Format(getString("SwapperCharges"), Swapper.charges); + meetingInfoText = string.Format(GetString("SwapperCharges"), Swapper.charges); } else if (CachedPlayer.LocalPlayer.PlayerControl == PartTimer.partTimer && PartTimer.target == null) { - meetingInfoText = string.Format(getString("PartTimerMeetingInfo"), Swapper.charges); + meetingInfoText = string.Format(GetString("PartTimerMeetingInfo"), Swapper.charges); } if (meetingInfoText == "") return; diff --git a/TheOtherRoles/Patches/PlayerControlPatch.cs b/TheOtherRoles/Patches/PlayerControlPatch.cs index d209e8d5..275e380c 100644 --- a/TheOtherRoles/Patches/PlayerControlPatch.cs +++ b/TheOtherRoles/Patches/PlayerControlPatch.cs @@ -1228,7 +1228,7 @@ public static void evilTrapperUpdate() gameObject.transform.localPosition = new Vector3(0, -1.8f, gameObject.transform.localPosition.z); gameObject.transform.localScale = Vector3.one * 2f; text = gameObject.GetComponent(); - text.text = string.Format(getString("trapperGotTrapText"), p.Data.PlayerName); + text.text = string.Format(GetString("trapperGotTrapText"), p.Data.PlayerName); FastDestroyableSingleton.Instance.StartCoroutine(Effects.Lerp(3f, new Action((p) => { if (p == 1f && text != null && text.gameObject != null) @@ -2212,7 +2212,7 @@ public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)] Player if (Seer.seer != null && (CachedPlayer.LocalPlayer.PlayerControl == Seer.seer || shouldShowGhostInfo()) && !Seer.seer.Data.IsDead && Seer.seer != target && Seer.mode <= 1) - showFlash(new Color(42f / 255f, 187f / 255f, 245f / 255f), message: getString("seerShowInfoText")); + showFlash(new Color(42f / 255f, 187f / 255f, 245f / 255f), message: GetString("seerShowInfoText")); Seer.deadBodyPositions?.Add(target.transform.position); // Tracker store body positions diff --git a/TheOtherRoles/Patches/RoleAssignmentPatch.cs b/TheOtherRoles/Patches/RoleAssignmentPatch.cs index e65b231c..dbbe8952 100644 --- a/TheOtherRoles/Patches/RoleAssignmentPatch.cs +++ b/TheOtherRoles/Patches/RoleAssignmentPatch.cs @@ -29,8 +29,8 @@ public static void Postfix(ref int __result) if (ModOption.gameMode is CustomGamemodes.HideNSeek or CustomGamemodes.PropHunt) { var impCount = ModOption.gameMode == CustomGamemodes.HideNSeek - ? Mathf.RoundToInt(CustomOptionHolder.hideNSeekHunterCount.getFloat()) - : CustomOptionHolder.propHuntNumberOfHunters.getQuantity(); + ? CustomOptionHolder.hideNSeekHunterCount.GetInt() + : CustomOptionHolder.propHuntNumberOfHunters.GetQuantity(); __result = impCount; ; // Set Imp Num } @@ -50,7 +50,7 @@ public static void Postfix(GameOptionsData __instance) if (ModOption.gameMode == CustomGamemodes.HideNSeek || GameOptionsManager.Instance.CurrentGameOptions.GameMode != GameModes.Normal) return; if (ModOption.gameMode == CustomGamemodes.PropHunt) - __instance.NumImpostors = CustomOptionHolder.propHuntNumberOfHunters.getQuantity(); + __instance.NumImpostors = CustomOptionHolder.propHuntNumberOfHunters.GetQuantity(); __instance.NumImpostors = GameOptionsManager.Instance.CurrentGameOptions.NumImpostors; } } @@ -100,10 +100,10 @@ public static RoleAssignmentData getRoleAssignmentData() var impostors = PlayerControl.AllPlayerControls.ToList().OrderBy(x => Guid.NewGuid()).ToList(); impostors.RemoveAll(x => !x.Data.Role.IsImpostor); - var neutralMin = CustomOptionHolder.neutralRolesCountMin.getSelection(); - var neutralMax = CustomOptionHolder.neutralRolesCountMax.getSelection(); - var killerNeutralMin = CustomOptionHolder.killerNeutralRolesCountMin.getSelection(); - var killerNeutralMax = CustomOptionHolder.killerNeutralRolesCountMax.getSelection(); + var neutralMin = CustomOptionHolder.neutralRolesCountMin.GetSelection(); + var neutralMax = CustomOptionHolder.neutralRolesCountMax.GetSelection(); + var killerNeutralMin = CustomOptionHolder.killerNeutralRolesCountMin.GetSelection(); + var killerNeutralMax = CustomOptionHolder.killerNeutralRolesCountMax.GetSelection(); var impostorNum = ModOption.NumImpostors; // Make sure min is less or equal to max @@ -129,47 +129,47 @@ public static RoleAssignmentData getRoleAssignmentData() var killerNeutralSettings = new Dictionary(); var crewSettings = new Dictionary(); - impSettings.Add((byte)RoleId.Morphling, CustomOptionHolder.morphlingSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Camouflager, CustomOptionHolder.camouflagerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Vampire, CustomOptionHolder.vampireSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Eraser, CustomOptionHolder.eraserSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Trickster, CustomOptionHolder.tricksterSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Cleaner, CustomOptionHolder.cleanerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Undertaker, CustomOptionHolder.undertakerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Miner, CustomOptionHolder.minerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Butcher, CustomOptionHolder.butcherSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Warlock, CustomOptionHolder.warlockSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.BountyHunter, CustomOptionHolder.bountyHunterSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Witch, CustomOptionHolder.witchSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Escapist, CustomOptionHolder.escapistSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Ninja, CustomOptionHolder.ninjaSpawnRate.getSelection()); - if (!Poucher.spawnModifier) impSettings.Add((byte)RoleId.Poucher, CustomOptionHolder.poucherSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Mimic, CustomOptionHolder.mimicSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Terrorist, CustomOptionHolder.terroristSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Bomber, CustomOptionHolder.bomberSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Blackmailer, CustomOptionHolder.blackmailerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Yoyo, CustomOptionHolder.yoyoSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.EvilTrapper, CustomOptionHolder.evilTrapperSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Gambler, CustomOptionHolder.gamblerSpawnRate.getSelection()); - impSettings.Add((byte)RoleId.Grenadier, CustomOptionHolder.grenadierSpawnRate.getSelection()); - - neutralSettings.Add((byte)RoleId.Survivor, CustomOptionHolder.survivorSpawnRate.getSelection()); + impSettings.Add((byte)RoleId.Morphling, CustomOptionHolder.morphlingSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Camouflager, CustomOptionHolder.camouflagerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Vampire, CustomOptionHolder.vampireSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Eraser, CustomOptionHolder.eraserSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Trickster, CustomOptionHolder.tricksterSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Cleaner, CustomOptionHolder.cleanerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Undertaker, CustomOptionHolder.undertakerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Miner, CustomOptionHolder.minerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Butcher, CustomOptionHolder.butcherSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Warlock, CustomOptionHolder.warlockSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.BountyHunter, CustomOptionHolder.bountyHunterSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Witch, CustomOptionHolder.witchSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Escapist, CustomOptionHolder.escapistSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Ninja, CustomOptionHolder.ninjaSpawnRate.GetSelection()); + if (!Poucher.spawnModifier) impSettings.Add((byte)RoleId.Poucher, CustomOptionHolder.poucherSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Mimic, CustomOptionHolder.mimicSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Terrorist, CustomOptionHolder.terroristSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Bomber, CustomOptionHolder.bomberSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Blackmailer, CustomOptionHolder.blackmailerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Yoyo, CustomOptionHolder.yoyoSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.EvilTrapper, CustomOptionHolder.evilTrapperSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Gambler, CustomOptionHolder.gamblerSpawnRate.GetSelection()); + impSettings.Add((byte)RoleId.Grenadier, CustomOptionHolder.grenadierSpawnRate.GetSelection()); + + neutralSettings.Add((byte)RoleId.Survivor, CustomOptionHolder.survivorSpawnRate.GetSelection()); //neutralSettings.Add((byte)RoleId.Pursuer, CustomOptionHolder.pursuerSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Amnisiac, CustomOptionHolder.amnisiacSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.PartTimer, CustomOptionHolder.partTimerSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Jester, CustomOptionHolder.jesterSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Lawyer, CustomOptionHolder.lawyerSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Executioner, CustomOptionHolder.executionerSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Vulture, CustomOptionHolder.vultureSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Doomsayer, CustomOptionHolder.doomsayerSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Akujo, CustomOptionHolder.akujoSpawnRate.getSelection()); - neutralSettings.Add((byte)RoleId.Thief, CustomOptionHolder.thiefSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Arsonist, CustomOptionHolder.arsonistSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Jackal, CustomOptionHolder.jackalSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Pavlovsowner, CustomOptionHolder.pavlovsownerSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Werewolf, CustomOptionHolder.werewolfSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Juggernaut, CustomOptionHolder.juggernautSpawnRate.getSelection()); - killerNeutralSettings.Add((byte)RoleId.Swooper, CustomOptionHolder.swooperSpawnRate.getSelection()); + neutralSettings.Add((byte)RoleId.Amnisiac, CustomOptionHolder.amnisiacSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.PartTimer, CustomOptionHolder.partTimerSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Jester, CustomOptionHolder.jesterSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Lawyer, CustomOptionHolder.lawyerSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Executioner, CustomOptionHolder.executionerSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Vulture, CustomOptionHolder.vultureSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Doomsayer, CustomOptionHolder.doomsayerSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Akujo, CustomOptionHolder.akujoSpawnRate.GetSelection()); + neutralSettings.Add((byte)RoleId.Thief, CustomOptionHolder.thiefSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Arsonist, CustomOptionHolder.arsonistSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Jackal, CustomOptionHolder.jackalSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Pavlovsowner, CustomOptionHolder.pavlovsownerSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Werewolf, CustomOptionHolder.werewolfSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Juggernaut, CustomOptionHolder.juggernautSpawnRate.GetSelection()); + killerNeutralSettings.Add((byte)RoleId.Swooper, CustomOptionHolder.swooperSpawnRate.GetSelection()); // Check if killerNeutralMin and killerNeutralMax are 0 if (killerNeutralMin + killerNeutralMax == 0) @@ -184,32 +184,32 @@ public static RoleAssignmentData getRoleAssignmentData() maxNeutralRoles = Math.Min(maxNeutralRoles - killerNeutralCount, neutralMax); } - crewSettings.Add((byte)RoleId.Mayor, CustomOptionHolder.mayorSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Prosecutor, CustomOptionHolder.prosecutorSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Portalmaker, CustomOptionHolder.portalmakerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Engineer, CustomOptionHolder.engineerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.BodyGuard, CustomOptionHolder.bodyGuardSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Detective, CustomOptionHolder.detectiveSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.TimeMaster, CustomOptionHolder.timeMasterSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Veteran, CustomOptionHolder.veteranSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Medic, CustomOptionHolder.medicSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Swapper, CustomOptionHolder.swapperSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Seer, CustomOptionHolder.seerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Hacker, CustomOptionHolder.hackerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.InfoSleuth, CustomOptionHolder.infoSleuthSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Balancer, CustomOptionHolder.balancerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Tracker, CustomOptionHolder.trackerSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Snitch, CustomOptionHolder.snitchSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Medium, CustomOptionHolder.mediumSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Prophet, CustomOptionHolder.prophetSpawnRate.getSelection()); + crewSettings.Add((byte)RoleId.Mayor, CustomOptionHolder.mayorSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Prosecutor, CustomOptionHolder.prosecutorSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Portalmaker, CustomOptionHolder.portalmakerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Engineer, CustomOptionHolder.engineerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.BodyGuard, CustomOptionHolder.bodyGuardSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Detective, CustomOptionHolder.detectiveSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.TimeMaster, CustomOptionHolder.timeMasterSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Veteran, CustomOptionHolder.veteranSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Medic, CustomOptionHolder.medicSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Swapper, CustomOptionHolder.swapperSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Seer, CustomOptionHolder.seerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Hacker, CustomOptionHolder.hackerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.InfoSleuth, CustomOptionHolder.infoSleuthSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Balancer, CustomOptionHolder.balancerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Tracker, CustomOptionHolder.trackerSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Snitch, CustomOptionHolder.snitchSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Medium, CustomOptionHolder.mediumSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Prophet, CustomOptionHolder.prophetSpawnRate.GetSelection()); if (!isGuesserGamemode) - crewSettings.Add((byte)RoleId.Vigilante, CustomOptionHolder.guesserSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Trapper, CustomOptionHolder.trapperSpawnRate.getSelection()); + crewSettings.Add((byte)RoleId.Vigilante, CustomOptionHolder.guesserSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Trapper, CustomOptionHolder.trapperSpawnRate.GetSelection()); if (impostors.Count > 1) // Only add Spy if more than 1 impostor as the spy role is otherwise useless - crewSettings.Add((byte)RoleId.Spy, CustomOptionHolder.spySpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.SecurityGuard, CustomOptionHolder.securityGuardSpawnRate.getSelection()); - crewSettings.Add((byte)RoleId.Jumper, CustomOptionHolder.jumperSpawnRate.getSelection()); + crewSettings.Add((byte)RoleId.Spy, CustomOptionHolder.spySpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.SecurityGuard, CustomOptionHolder.securityGuardSpawnRate.GetSelection()); + crewSettings.Add((byte)RoleId.Jumper, CustomOptionHolder.jumperSpawnRate.GetSelection()); return new RoleAssignmentData { crewmates = crewmates, @@ -228,10 +228,10 @@ public static RoleAssignmentData getRoleAssignmentData() private static void selectFactionForFactionIndependentRoles(RoleAssignmentData data) { // Assign Sheriff - if ((CustomOptionHolder.deputySpawnRate.getSelection() > 0 && - CustomOptionHolder.sheriffSpawnRate.getSelection() == 10) || - CustomOptionHolder.deputySpawnRate.getSelection() == 0) - data.crewSettings.Add((byte)RoleId.Sheriff, CustomOptionHolder.sheriffSpawnRate.getSelection()); + if ((CustomOptionHolder.deputySpawnRate.GetSelection() > 0 && + CustomOptionHolder.sheriffSpawnRate.GetSelection() == 10) || + CustomOptionHolder.deputySpawnRate.GetSelection() == 0) + data.crewSettings.Add((byte)RoleId.Sheriff, CustomOptionHolder.sheriffSpawnRate.GetSelection()); crewValues = data.crewSettings.Values.ToList().Sum(); impValues = data.impSettings.Values.ToList().Sum(); @@ -317,8 +317,8 @@ private static void assignDependentRoles(RoleAssignmentData data) // Roles that prob have a dependent role //bool guesserFlag = CustomOptionHolder.guesserSpawnBothRate.getSelection() > 0 // && CustomOptionHolder.guesserSpawnRate.getSelection() > 0; - var sheriffFlag = CustomOptionHolder.deputySpawnRate.getSelection() > 0 - && CustomOptionHolder.sheriffSpawnRate.getSelection() > 0; + var sheriffFlag = CustomOptionHolder.deputySpawnRate.GetSelection() > 0 + && CustomOptionHolder.sheriffSpawnRate.GetSelection() > 0; //if (isGuesserGamemode) guesserFlag = false; // if (!guesserFlag && !sheriffFlag) return; // assignDependentRoles is not needed @@ -338,7 +338,7 @@ private static void assignDependentRoles(RoleAssignmentData data) // --- Simulate Crew & Imp ticket system --- while (crew > 0 && !isSheriff /* || (!isEvilGuesser && !isGuesser)*/) { - if (!isSheriff && rnd.Next(crewValues) < CustomOptionHolder.sheriffSpawnRate.getSelection()) + if (!isSheriff && rnd.Next(crewValues) < CustomOptionHolder.sheriffSpawnRate.GetSelection()) isSheriff = true; crew--; crewValues -= crewSteps; @@ -358,7 +358,7 @@ private static void assignDependentRoles(RoleAssignmentData data) if (Sheriff.sheriff != null) { // Deputy - if (CustomOptionHolder.deputySpawnRate.getSelection() == 10 && data.crewmates.Count > 0 && + if (CustomOptionHolder.deputySpawnRate.GetSelection() == 10 && data.crewmates.Count > 0 && data.maxCrewmateRoles > 0) { // Force Deputy @@ -366,10 +366,10 @@ private static void assignDependentRoles(RoleAssignmentData data) data.crewmates.ToList().RemoveAll(x => x.PlayerId == deputy); data.maxCrewmateRoles--; } - else if (CustomOptionHolder.deputySpawnRate.getSelection() < + else if (CustomOptionHolder.deputySpawnRate.GetSelection() < 10) // Dont force, add Deputy to the ticket system { - data.crewSettings.Add((byte)RoleId.Deputy, CustomOptionHolder.deputySpawnRate.getSelection()); + data.crewSettings.Add((byte)RoleId.Deputy, CustomOptionHolder.deputySpawnRate.GetSelection()); } } @@ -505,12 +505,12 @@ private static void assignRoleTargets(RoleAssignmentData data) private static void assignModifiers() { - var modifierMin = CustomOptionHolder.modifiersCountMin.getSelection(); - var modifierMax = CustomOptionHolder.modifiersCountMax.getSelection(); + var modifierMin = CustomOptionHolder.modifiersCountMin.GetSelection(); + var modifierMax = CustomOptionHolder.modifiersCountMax.GetSelection(); if (modifierMin > modifierMax) modifierMin = modifierMax; var modifierCountSettings = rnd.Next(modifierMin, modifierMax + 1); var players = PlayerControl.AllPlayerControls.ToArray().ToList(); - if (isGuesserGamemode && !CustomOptionHolder.guesserGamemodeHaveModifier.getBool()) + if (isGuesserGamemode && !CustomOptionHolder.guesserGamemodeHaveModifier.GetBool()) players.RemoveAll(x => GuesserGM.isGuesser(x.PlayerId)); var impPlayer = new List(players); @@ -568,10 +568,10 @@ private static void assignModifiers() RoleId.Assassin ]); - if (rnd.Next(1, 101) <= CustomOptionHolder.modifierLover.getSelection() * 10) + if (rnd.Next(1, 101) <= CustomOptionHolder.modifierLover.GetSelection() * 10) { // Assign lover - var isEvilLover = rnd.Next(1, 101) <= CustomOptionHolder.modifierLoverImpLoverRate.getSelection() * 10; + var isEvilLover = rnd.Next(1, 101) <= CustomOptionHolder.modifierLoverImpLoverRate.GetSelection() * 10; byte firstLoverId; if (isEvilLover) firstLoverId = setModifierToRandomPlayer((byte)RoleId.Lover, impPlayerL); @@ -646,14 +646,14 @@ private static void assignGuesserGamemode() neutralPlayer.RemoveAll(x => !isNeutral(x) || x == Doomsayer.doomsayer); crewPlayer.RemoveAll(x => x.Data.Role.IsImpostor || isNeutral(x)); assignGuesserGamemodeToPlayers(crewPlayer, - Mathf.RoundToInt(CustomOptionHolder.guesserGamemodeCrewNumber.getFloat())); + CustomOptionHolder.guesserGamemodeCrewNumber.GetInt()); assignGuesserGamemodeToPlayers(neutralPlayer, - Mathf.RoundToInt(CustomOptionHolder.guesserGamemodeNeutralNumber.getFloat()), - CustomOptionHolder.guesserForceJackalGuesser.getBool(), - CustomOptionHolder.guesserForceThiefGuesser.getBool(), - CustomOptionHolder.guesserForcePavlovsGuesser.getBool()); + CustomOptionHolder.guesserGamemodeNeutralNumber.GetInt(), + CustomOptionHolder.guesserForceJackalGuesser.GetBool(), + CustomOptionHolder.guesserForceThiefGuesser.GetBool(), + CustomOptionHolder.guesserForcePavlovsGuesser.GetBool()); assignGuesserGamemodeToPlayers(impPlayer, - Mathf.RoundToInt(CustomOptionHolder.guesserGamemodeImpNumber.getFloat())); + CustomOptionHolder.guesserGamemodeImpNumber.GetInt()); } private static void assignGuesserGamemodeToPlayers(List playerList, int count, @@ -809,7 +809,7 @@ private static void assignModifiersToPlayers(List modifiers, List x.PlayerId == playerId); - playerList.RemoveAll(x => x.PlayerId == playerId); + playerList.RemoveAll(x => x.PlayerId == playerId); } modifiers.Remove(RoleId.Cursed); } @@ -960,103 +960,104 @@ private static int getSelectionForRoleId(RoleId roleId, bool multiplyQuantity = switch (roleId) { case RoleId.Lover: - selection = CustomOptionHolder.modifierLover.getSelection(); + selection = CustomOptionHolder.modifierLover.GetSelection(); break; case RoleId.Tiebreaker: - selection = CustomOptionHolder.modifierTieBreaker.getSelection(); + selection = CustomOptionHolder.modifierTieBreaker.GetSelection(); break; case RoleId.Indomitable: - selection = CustomOptionHolder.modifierIndomitable.getSelection(); + selection = CustomOptionHolder.modifierIndomitable.GetSelection(); break; case RoleId.Cursed: - selection = CustomOptionHolder.modifierCursed.getSelection(); + selection = CustomOptionHolder.modifierCursed.GetSelection(); break; case RoleId.Slueth: - selection = CustomOptionHolder.modifierSlueth.getSelection(); + selection = CustomOptionHolder.modifierSlueth.GetSelection(); break; case RoleId.Blind: - selection = CustomOptionHolder.modifierBlind.getSelection(); + selection = CustomOptionHolder.modifierBlind.GetSelection(); break; case RoleId.Watcher: - selection = CustomOptionHolder.modifierWatcher.getSelection(); + selection = CustomOptionHolder.modifierWatcher.GetSelection(); break; case RoleId.Radar: - selection = CustomOptionHolder.modifierRadar.getSelection(); + selection = CustomOptionHolder.modifierRadar.GetSelection(); break; case RoleId.Disperser: - selection = CustomOptionHolder.modifierDisperser.getSelection(); + selection = CustomOptionHolder.modifierDisperser.GetSelection(); break; case RoleId.Specoality: - selection = CustomOptionHolder.modifierSpecoality.getSelection(); + selection = CustomOptionHolder.modifierSpecoality.GetSelection(); break; case RoleId.PoucherModifier: - if (Poucher.spawnModifier) selection = CustomOptionHolder.poucherSpawnRate.getSelection(); + if (Poucher.spawnModifier) selection = CustomOptionHolder.poucherSpawnRate.GetSelection(); break; case RoleId.Mini: - selection = CustomOptionHolder.modifierMini.getSelection(); + selection = CustomOptionHolder.modifierMini.GetSelection(); break; case RoleId.Giant: if (isFungle) break; - selection = CustomOptionHolder.modifierGiant.getSelection(); + selection = CustomOptionHolder.modifierGiant.GetSelection(); break; case RoleId.Aftermath: - selection = CustomOptionHolder.modifierAftermath.getSelection(); + selection = CustomOptionHolder.modifierAftermath.GetSelection(); break; case RoleId.Bait: - selection = CustomOptionHolder.modifierBait.getSelection(); + selection = CustomOptionHolder.modifierBait.GetSelection(); break; case RoleId.Bloody: - selection = CustomOptionHolder.modifierBloody.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierBloodyQuantity.getQuantity(); + selection = CustomOptionHolder.modifierBloody.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierBloodyQuantity.GetQuantity(); break; case RoleId.AntiTeleport: if (isFungle) break; - selection = CustomOptionHolder.modifierAntiTeleport.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierAntiTeleportQuantity.getQuantity(); + selection = CustomOptionHolder.modifierAntiTeleport.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierAntiTeleportQuantity.GetQuantity(); break; case RoleId.Tunneler: - selection = CustomOptionHolder.modifierTunneler.getSelection(); + selection = CustomOptionHolder.modifierTunneler.GetSelection(); break; case RoleId.ButtonBarry: - selection = CustomOptionHolder.modifierButtonBarry.getSelection(); + selection = CustomOptionHolder.modifierButtonBarry.GetSelection(); break; case RoleId.Sunglasses: - selection = CustomOptionHolder.modifierSunglasses.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierSunglassesQuantity.getQuantity(); + selection = CustomOptionHolder.modifierSunglasses.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierSunglassesQuantity.GetQuantity(); break; case RoleId.Torch: - selection = CustomOptionHolder.modifierTorch.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierTorchQuantity.getQuantity(); + selection = CustomOptionHolder.modifierTorch.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierTorchQuantity.GetQuantity(); break; case RoleId.Flash: - selection = CustomOptionHolder.modifierFlash.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierFlashQuantity.getQuantity(); + selection = CustomOptionHolder.modifierFlash.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierFlashQuantity.GetQuantity(); break; case RoleId.Multitasker: - selection = CustomOptionHolder.modifierMultitasker.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierMultitaskerQuantity.getQuantity(); + if (isFungle) break; + selection = CustomOptionHolder.modifierMultitasker.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierMultitaskerQuantity.GetQuantity(); break; case RoleId.Vip: - selection = CustomOptionHolder.modifierVip.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierVipQuantity.getQuantity(); + selection = CustomOptionHolder.modifierVip.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierVipQuantity.GetQuantity(); break; case RoleId.Invert: - selection = CustomOptionHolder.modifierInvert.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierInvertQuantity.getQuantity(); + selection = CustomOptionHolder.modifierInvert.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierInvertQuantity.GetQuantity(); break; case RoleId.Chameleon: - selection = CustomOptionHolder.modifierChameleon.getSelection(); - if (multiplyQuantity) selection *= CustomOptionHolder.modifierChameleonQuantity.getQuantity(); + selection = CustomOptionHolder.modifierChameleon.GetSelection(); + if (multiplyQuantity) selection *= CustomOptionHolder.modifierChameleonQuantity.GetQuantity(); break; case RoleId.Shifter: - selection = CustomOptionHolder.modifierShifter.getSelection(); + selection = CustomOptionHolder.modifierShifter.GetSelection(); break; case RoleId.Assassin: if (!isGuesserGamemode) { - selection = CustomOptionHolder.modifierAssassin.getSelection(); + selection = CustomOptionHolder.modifierAssassin.GetSelection(); if (multiplyQuantity) - selection *= CustomOptionHolder.modifierAssassinQuantity.getQuantity(); + selection *= CustomOptionHolder.modifierAssassinQuantity.GetQuantity(); } break; } diff --git a/TheOtherRoles/Patches/SabotagePatch.cs b/TheOtherRoles/Patches/SabotagePatch.cs index 172c51e1..d3329482 100644 --- a/TheOtherRoles/Patches/SabotagePatch.cs +++ b/TheOtherRoles/Patches/SabotagePatch.cs @@ -12,7 +12,7 @@ public static class ElectricPatch public static void Reset() { onTask = false; - IsReactorDurationSetting = CustomOptionHolder.IsReactorDurationSetting.getBool(); + IsReactorDurationSetting = CustomOptionHolder.IsReactorDurationSetting.GetBool(); } public static bool onTask; public static bool done; @@ -59,11 +59,11 @@ public static void Prefix(LifeSuppSystemType __instance, float deltaTime) return; switch (MapUtilities.CachedShipStatus.Type) { - case ShipStatus.MapType.Ship when __instance.Countdown >= CustomOptionHolder.SkeldLifeSuppTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.SkeldLifeSuppTimeLimit.getFloat(); + case ShipStatus.MapType.Ship when __instance.Countdown >= CustomOptionHolder.SkeldLifeSuppTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.SkeldLifeSuppTimeLimit.GetFloat(); return; - case ShipStatus.MapType.Hq when __instance.Countdown >= CustomOptionHolder.MiraLifeSuppTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.MiraLifeSuppTimeLimit.getFloat(); + case ShipStatus.MapType.Hq when __instance.Countdown >= CustomOptionHolder.MiraLifeSuppTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.MiraLifeSuppTimeLimit.GetFloat(); return; default: return; @@ -83,17 +83,17 @@ public static void Prefix(ReactorSystemType __instance, float deltaTime) if (!__instance.IsActive) return; switch (MapUtilities.CachedShipStatus.Type) { - case ShipStatus.MapType.Ship when __instance.Countdown >= CustomOptionHolder.SkeldReactorTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.SkeldReactorTimeLimit.getFloat(); + case ShipStatus.MapType.Ship when __instance.Countdown >= CustomOptionHolder.SkeldReactorTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.SkeldReactorTimeLimit.GetFloat(); return; - case ShipStatus.MapType.Hq when __instance.Countdown >= CustomOptionHolder.MiraReactorTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.MiraReactorTimeLimit.getFloat(); + case ShipStatus.MapType.Hq when __instance.Countdown >= CustomOptionHolder.MiraReactorTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.MiraReactorTimeLimit.GetFloat(); return; - case ShipStatus.MapType.Pb when __instance.Countdown >= CustomOptionHolder.PolusReactorTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.PolusReactorTimeLimit.getFloat(); + case ShipStatus.MapType.Pb when __instance.Countdown >= CustomOptionHolder.PolusReactorTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.PolusReactorTimeLimit.GetFloat(); return; - case ShipStatus.MapType.Fungle when __instance.Countdown >= CustomOptionHolder.FungleReactorTimeLimit.getFloat(): - __instance.Countdown = CustomOptionHolder.FungleReactorTimeLimit.getFloat(); + case ShipStatus.MapType.Fungle when __instance.Countdown >= CustomOptionHolder.FungleReactorTimeLimit.GetFloat(): + __instance.Countdown = CustomOptionHolder.FungleReactorTimeLimit.GetFloat(); return; default: return; @@ -108,15 +108,15 @@ public static class HeliMeltdownBooster { public static void Prefix(HeliSabotageSystem __instance) { - if (CustomOptionHolder.IsReactorDurationSetting.getBool()) + if (CustomOptionHolder.IsReactorDurationSetting.GetBool()) { if (!__instance.IsActive) return; if (MapUtilities.CachedShipStatus != null) { - if (__instance.Countdown >= CustomOptionHolder.AirshipReactorTimeLimit.getFloat()) - __instance.Countdown = CustomOptionHolder.AirshipReactorTimeLimit.getFloat(); + if (__instance.Countdown >= CustomOptionHolder.AirshipReactorTimeLimit.GetFloat()) + __instance.Countdown = CustomOptionHolder.AirshipReactorTimeLimit.GetFloat(); } } } diff --git a/TheOtherRoles/Patches/ShipStatusPatch.cs b/TheOtherRoles/Patches/ShipStatusPatch.cs index 3e763f4f..ef036a95 100644 --- a/TheOtherRoles/Patches/ShipStatusPatch.cs +++ b/TheOtherRoles/Patches/ShipStatusPatch.cs @@ -175,12 +175,9 @@ public static bool Prefix(ShipStatus __instance) } else { - GameOptionsManager.Instance.currentNormalGameOptions.NumCommonTasks = - Mathf.RoundToInt(CustomOptionHolder.hideNSeekCommonTasks.getFloat()); - GameOptionsManager.Instance.currentNormalGameOptions.NumShortTasks = - Mathf.RoundToInt(CustomOptionHolder.hideNSeekShortTasks.getFloat()); - GameOptionsManager.Instance.currentNormalGameOptions.NumLongTasks = - Mathf.RoundToInt(CustomOptionHolder.hideNSeekLongTasks.getFloat()); + GameOptionsManager.Instance.currentNormalGameOptions.NumCommonTasks = CustomOptionHolder.hideNSeekCommonTasks.GetInt(); + GameOptionsManager.Instance.currentNormalGameOptions.NumShortTasks = CustomOptionHolder.hideNSeekShortTasks.GetInt(); + GameOptionsManager.Instance.currentNormalGameOptions.NumLongTasks = CustomOptionHolder.hideNSeekLongTasks.GetInt(); } MapBehaviourPatch.VentNetworks.Clear(); diff --git a/TheOtherRoles/Patches/TaskCountPatch.cs b/TheOtherRoles/Patches/TaskCountPatch.cs index 2f144a9b..43df43b4 100644 --- a/TheOtherRoles/Patches/TaskCountPatch.cs +++ b/TheOtherRoles/Patches/TaskCountPatch.cs @@ -10,7 +10,7 @@ namespace TheOtherRoles.Patches; internal class TaskCount { - public static bool WireTaskIsRandom => CustomOptionHolder.WireTaskIsRandomOption.getBool(); + public static bool WireTaskIsRandom => CustomOptionHolder.WireTaskIsRandomOption.GetBool(); public static int WireTaskNum => CustomOptionHolder.WireTaskNumOption.GetInt(); [HarmonyPatch(typeof(NormalPlayerTask), nameof(NormalPlayerTask.Initialize))] diff --git a/TheOtherRoles/Patches/UpdatePatch.cs b/TheOtherRoles/Patches/UpdatePatch.cs index 75a7f881..def934e0 100644 --- a/TheOtherRoles/Patches/UpdatePatch.cs +++ b/TheOtherRoles/Patches/UpdatePatch.cs @@ -468,7 +468,7 @@ private static void updateSabotageButton(HudManager __instance) { if (MeetingHud.Instance || ModOption.gameMode == CustomGamemodes.HideNSeek || ModOption.gameMode == CustomGamemodes.PropHunt) __instance.SabotageButton.Hide(); - if (PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.getBool()) __instance.SabotageButton.Hide(); + if (PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.GetBool()) __instance.SabotageButton.Hide(); } private static void updateMapButton(HudManager __instance) diff --git a/TheOtherRoles/Patches/UsablesPatch.cs b/TheOtherRoles/Patches/UsablesPatch.cs index 0c181647..4102cc32 100644 --- a/TheOtherRoles/Patches/UsablesPatch.cs +++ b/TheOtherRoles/Patches/UsablesPatch.cs @@ -391,7 +391,7 @@ private static void Postfix(EmergencyMinigame __instance) !Swapper.canCallEmergency) { roleCanCallEmergency = false; - statusText = getString("swapperMeetingButton"); + statusText = GetString("swapperMeetingButton"); } // Potentially deactivate emergency button for Jester @@ -399,7 +399,7 @@ private static void Postfix(EmergencyMinigame __instance) !Jester.canCallEmergency) { roleCanCallEmergency = false; - statusText = getString("jesterMeetingButton"); + statusText = GetString("jesterMeetingButton"); } // Potentially deactivate emergency button for Jester @@ -407,7 +407,7 @@ private static void Postfix(EmergencyMinigame __instance) !Prosecutor.canCallEmergency) { roleCanCallEmergency = false; - statusText = getString("prosecutorMeetingButton"); + statusText = GetString("prosecutorMeetingButton"); } // Potentially deactivate emergency button for Jester @@ -415,7 +415,7 @@ private static void Postfix(EmergencyMinigame __instance) !Lawyer.canCallEmergency) { roleCanCallEmergency = false; - statusText = getString("lawyerMeetingButton"); + statusText = GetString("lawyerMeetingButton"); } // Potentially deactivate emergency button for Lawyer/Prosecutor @@ -423,14 +423,14 @@ private static void Postfix(EmergencyMinigame __instance) !Executioner.canCallEmergency) { roleCanCallEmergency = false; - if (Executioner.executioner) statusText = getString("executionerMeetingButton"); + if (Executioner.executioner) statusText = GetString("executionerMeetingButton"); } // Potentially deactivate emergency button for Prophet if (Prophet.prophet != null && Prophet.prophet == CachedPlayer.LocalPlayer.PlayerControl && !Prophet.canCallEmergency) { roleCanCallEmergency = false; - statusText = getString("prophetMeetingButton"); + statusText = GetString("prophetMeetingButton"); } if (!roleCanCallEmergency) @@ -450,7 +450,7 @@ private static void Postfix(EmergencyMinigame __instance) var teamRemaining = Mathf.Max(0, maxNumberOfMeetings - meetingsCount); var remaining = Mathf.Min(localRemaining, Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl ? 1 : teamRemaining); - __instance.NumberText.text = string.Format(getString("meetingCount"), localRemaining.ToString(), teamRemaining.ToString()); + __instance.NumberText.text = string.Format(GetString("meetingCount"), localRemaining.ToString(), teamRemaining.ToString()); __instance.ButtonActive = remaining > 0; __instance.ClosedLid.gameObject.SetActive(!__instance.ButtonActive); __instance.OpenLid.gameObject.SetActive(__instance.ButtonActive); @@ -804,10 +804,10 @@ private static void nightVisionUpdate(SurveillanceMinigame SkeldCamsMinigame = n CachedPlayer.LocalPlayer.PlayerControl.myTasks.ToArray().Any(x => x.name.Contains("FixLightsTask")) || Trickster.lightsOutTimer > 0; var ignoreNightVision = - (CustomOptionHolder.camsNoNightVisionIfImpVision.getBool() && + (CustomOptionHolder.camsNoNightVisionIfImpVision.GetBool() && hasImpVision(GameData.Instance.GetPlayerById(CachedPlayer.LocalPlayer.PlayerId))) || CachedPlayer.LocalPlayer.Data.IsDead; - var nightVisionEnabled = CustomOptionHolder.camsNightVision.getBool(); + var nightVisionEnabled = CustomOptionHolder.camsNightVision.GetBool(); if (isLightsOut && !nightVisionIsActive && nightVisionEnabled && !ignoreNightVision) { @@ -1041,7 +1041,7 @@ private static bool Prefix(MapBehaviour __instance) if (HideNSeek.isHideNSeekGM) return HideNSeek.canSabotage; if (PropHunt.isPropHuntGM) return false; - if (PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.getBool()) + if (PlayerControl.LocalPlayer.Data.IsDead && CustomOptionHolder.deadImpsBlockSabotage.GetBool()) { __instance.ShowNormalMap(); return false; diff --git a/TheOtherRoles/RPC.cs b/TheOtherRoles/RPC.cs index 8f68027a..fc98f804 100644 --- a/TheOtherRoles/RPC.cs +++ b/TheOtherRoles/RPC.cs @@ -337,7 +337,7 @@ public static void shareGameMode(byte gm) public static void stopStart(byte playerId) { - if (AmongUsClient.Instance.AmHost && CustomOptionHolder.anyPlayerCanStopStart.getBool()) + if (AmongUsClient.Instance.AmHost && CustomOptionHolder.anyPlayerCanStopStart.GetBool()) { GameStartManager.Instance.ResetStartState(); PlayerControl.LocalPlayer.RpcSendChat($"{playerById(playerId).Data.PlayerName} 阻止游戏开始"); @@ -1593,7 +1593,7 @@ public static void shieldedMurderAttempt(byte blank) var isMedicAndShow = Medic.medic == CachedPlayer.LocalPlayer.PlayerControl && Medic.showAttemptToMedic; if (isShieldedAndShow || isMedicAndShow || shouldShowGhostInfo()) - showFlash(Palette.ImpostorRed, 1.5f, getString("medicShowAttemptText")); + showFlash(Palette.ImpostorRed, 1.5f, GetString("medicShowAttemptText")); } public static void hostKill(byte targetId) @@ -1849,7 +1849,7 @@ public static void jackalCreatesSidekick(byte targetId) Sidekick.wasImpostor = wasImpostor; } if (target == CachedPlayer.LocalPlayer.PlayerControl) SoundEffectsManager.play("jackalSidekick"); - if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodeSidekickIsAlwaysGuesser.getBool() && !HandleGuesser.isGuesser(targetId)) + if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodeSidekickIsAlwaysGuesser.GetBool() && !HandleGuesser.isGuesser(targetId)) setGuesserGm(targetId); Jackal.canCreateSidekick = false; @@ -1873,8 +1873,8 @@ public static void removeCurrentJackal() Jackal.formerJackals.Add(Jackal.jackal); Jackal.jackal = null; Jackal.currentTarget = null; - Jackal.cooldown = CustomOptionHolder.jackalKillCooldown.getFloat(); - Jackal.createSidekickCooldown = CustomOptionHolder.jackalCreateSidekickCooldown.getFloat(); + Jackal.cooldown = CustomOptionHolder.jackalKillCooldown.GetFloat(); + Jackal.createSidekickCooldown = CustomOptionHolder.jackalCreateSidekickCooldown.GetFloat(); } public static void jackalCanSwooper(bool chance) @@ -1914,7 +1914,7 @@ public static void pavlovsCreateDog(byte targetId) if (player.PlayerId == CachedPlayer.LocalPlayer.PlayerId) CachedPlayer.LocalPlayer.PlayerControl.moveable = true; if (player == CachedPlayer.LocalPlayer.PlayerControl) SoundEffectsManager.play("jackalSidekick"); - if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodePavlovsdogIsAlwaysGuesser.getBool() && !HandleGuesser.isGuesser(targetId)) + if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodePavlovsdogIsAlwaysGuesser.GetBool() && !HandleGuesser.isGuesser(targetId)) setGuesserGm(targetId); } @@ -2832,7 +2832,7 @@ public static void blackmailPlayer(byte playerId) public static void showBodyGuardFlash() { - if (CustomOptionHolder.bodyGuardFlash.getBool()) showFlash(BodyGuard.color); + if (CustomOptionHolder.bodyGuardFlash.GetBool()) showFlash(BodyGuard.color); } public static void bodyGuardGuardPlayer(byte targetId) @@ -2918,14 +2918,14 @@ public static void thiefStealsRole(byte playerId) { Sidekick.sidekick = thief; Jackal.formerJackals.Add(target); - if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodeSidekickIsAlwaysGuesser.getBool() && !HandleGuesser.isGuesser(thief.PlayerId)) + if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodeSidekickIsAlwaysGuesser.GetBool() && !HandleGuesser.isGuesser(thief.PlayerId)) setGuesserGm(thief.PlayerId); } if (target == Pavlovsdogs.pavlovsowner) { Pavlovsdogs.pavlovsdogs.Add(target); Pavlovsdogs.pavlovsowner = thief; - if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodePavlovsdogIsAlwaysGuesser.getBool() && !HandleGuesser.isGuesser(thief.PlayerId)) + if (HandleGuesser.isGuesserGm && CustomOptionHolder.guesserGamemodePavlovsdogIsAlwaysGuesser.GetBool() && !HandleGuesser.isGuesser(thief.PlayerId)) setGuesserGm(thief.PlayerId); } if (Pavlovsdogs.pavlovsdogs.Any(x => x == target)) diff --git a/TheOtherRoles/Roles/Crewmate/Balancer.cs b/TheOtherRoles/Roles/Crewmate/Balancer.cs index dd910ca6..d55c0365 100644 --- a/TheOtherRoles/Roles/Crewmate/Balancer.cs +++ b/TheOtherRoles/Roles/Crewmate/Balancer.cs @@ -214,7 +214,7 @@ public static void Update() MeetingHud.Instance.TitleText.GetComponent().enabled = false; MeetingHud.Instance.TitleText.transform.localPosition = new(0, 2, -1); MeetingHud.Instance.TitleText.transform.localScale = Vector3.one * 2f; - MeetingHud.Instance.TitleText.text = getString("BalancerTitleTextYouVoteEither"); + MeetingHud.Instance.TitleText.text = GetString("BalancerTitleTextYouVoteEither"); leftplayerarea.transform.localPosition = leftpos; rightplayerarea.transform.localPosition = rightpos; MeetingHud.Instance.discussionTimer = GameOptionsManager.Instance.CurrentGameOptions.GetInt(AmongUs.GameOptions.Int32OptionNames.VotingTime) - BalancerVoteTime; @@ -323,9 +323,9 @@ public static void StartAbility(PlayerControl source, PlayerControl player1, Pla ChainObjects.Add((createchain(Random.Range(1.8f, -1.7f), Random.Range(-15f, 15f)), 0f, 0)); } ChainObjects.Add((createchain(0, 0, -12f), 0f, 0)); - textuseability = createtext(new(0, 2.1f, -30), getString("BalancerAbilityUseText"), 12); + textuseability = createtext(new(0, 2.1f, -30), GetString("BalancerAbilityUseText"), 12); textuseability.enabled = false; - textpleasevote = createtext(new(0, -1f, -30f), getString("BalancerVoteText"), 8); + textpleasevote = createtext(new(0, -1f, -30f), GetString("BalancerVoteText"), 8); textpleasevote.enabled = false; textpleasetimer = 0.35f; SoundManager.Instance.PlaySound(UnityHelper.loadAudioClipFromResources("TheOtherRoles.Resources.Balancer.chain.raw"), false); diff --git a/TheOtherRoles/Roles/Crewmate/BodyGuard.cs b/TheOtherRoles/Roles/Crewmate/BodyGuard.cs index 5c2477d7..c4132e39 100644 --- a/TheOtherRoles/Roles/Crewmate/BodyGuard.cs +++ b/TheOtherRoles/Roles/Crewmate/BodyGuard.cs @@ -23,9 +23,9 @@ public static void resetGuarded() public static void clearAndReload() { bodyguard = null; - showShielded = CustomOptionHolder.bodyGuardShowShielded.getBool(); - guardFlash = CustomOptionHolder.bodyGuardFlash.getBool(); - reset = CustomOptionHolder.bodyGuardResetTargetAfterMeeting.getBool(); + showShielded = CustomOptionHolder.bodyGuardShowShielded.GetBool(); + guardFlash = CustomOptionHolder.bodyGuardFlash.GetBool(); + reset = CustomOptionHolder.bodyGuardResetTargetAfterMeeting.GetBool(); guarded = null; usedGuard = false; } diff --git a/TheOtherRoles/Roles/Crewmate/Deputy.cs b/TheOtherRoles/Roles/Crewmate/Deputy.cs index a08ecf63..f12d9d0e 100644 --- a/TheOtherRoles/Roles/Crewmate/Deputy.cs +++ b/TheOtherRoles/Roles/Crewmate/Deputy.cs @@ -62,11 +62,11 @@ public static void clearAndReload(bool resetCuffs = true) handcuffedPlayers = []; handcuffedKnows = []; HudManagerStartPatch.setAllButtonsHandcuffedStatus(false, true); - promotesToSheriff = CustomOptionHolder.deputyGetsPromoted.getSelection(); - remainingHandcuffs = CustomOptionHolder.deputyNumberOfHandcuffs.getFloat(); - handcuffCooldown = CustomOptionHolder.deputyHandcuffCooldown.getFloat(); - keepsHandcuffsOnPromotion = CustomOptionHolder.deputyKeepsHandcuffs.getBool(); - handcuffDuration = CustomOptionHolder.deputyHandcuffDuration.getFloat(); - knowsSheriff = CustomOptionHolder.deputyKnowsSheriff.getBool(); + promotesToSheriff = CustomOptionHolder.deputyGetsPromoted.GetSelection(); + remainingHandcuffs = CustomOptionHolder.deputyNumberOfHandcuffs.GetFloat(); + handcuffCooldown = CustomOptionHolder.deputyHandcuffCooldown.GetFloat(); + keepsHandcuffsOnPromotion = CustomOptionHolder.deputyKeepsHandcuffs.GetBool(); + handcuffDuration = CustomOptionHolder.deputyHandcuffDuration.GetFloat(); + knowsSheriff = CustomOptionHolder.deputyKnowsSheriff.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Detective.cs b/TheOtherRoles/Roles/Crewmate/Detective.cs index 694f07af..641f6a4e 100644 --- a/TheOtherRoles/Roles/Crewmate/Detective.cs +++ b/TheOtherRoles/Roles/Crewmate/Detective.cs @@ -19,11 +19,11 @@ public static class Detective public static void clearAndReload() { detective = null; - anonymousFootprints = CustomOptionHolder.detectiveAnonymousFootprints.getSelection(); - footprintIntervall = CustomOptionHolder.detectiveFootprintIntervall.getFloat(); - footprintDuration = CustomOptionHolder.detectiveFootprintDuration.getFloat(); - reportNameDuration = CustomOptionHolder.detectiveReportNameDuration.getFloat(); - reportColorDuration = CustomOptionHolder.detectiveReportColorDuration.getFloat(); + anonymousFootprints = CustomOptionHolder.detectiveAnonymousFootprints.GetSelection(); + footprintIntervall = CustomOptionHolder.detectiveFootprintIntervall.GetFloat(); + footprintDuration = CustomOptionHolder.detectiveFootprintDuration.GetFloat(); + reportNameDuration = CustomOptionHolder.detectiveReportNameDuration.GetFloat(); + reportColorDuration = CustomOptionHolder.detectiveReportColorDuration.GetFloat(); timer = 6.2f; //reportRoleDuration = CustomOptionHolder.detectiveReportRoleDuration.getFloat(); //reportInfoDuration = CustomOptionHolder.detectiveReportInfoDuration.getFloat(); diff --git a/TheOtherRoles/Roles/Crewmate/Engineer.cs b/TheOtherRoles/Roles/Crewmate/Engineer.cs index e12c274d..600fb2d0 100644 --- a/TheOtherRoles/Roles/Crewmate/Engineer.cs +++ b/TheOtherRoles/Roles/Crewmate/Engineer.cs @@ -18,18 +18,18 @@ public class Engineer public static void resetFixes() { - remainingFixes = Mathf.RoundToInt(CustomOptionHolder.engineerNumberOfFixes.getFloat()); + remainingFixes = CustomOptionHolder.engineerNumberOfFixes.GetInt(); } public static void clearAndReload() { engineer = null; - remoteFix = CustomOptionHolder.engineerRemoteFix.getBool(); + remoteFix = CustomOptionHolder.engineerRemoteFix.GetBool(); //expertRepairs = CustomOptionHolder.engineerExpertRepairs.getBool(); - resetFixAfterMeeting = CustomOptionHolder.engineerResetFixAfterMeeting.getBool(); - remainingFixes = Mathf.RoundToInt(CustomOptionHolder.engineerNumberOfFixes.getFloat()); - highlightForImpostors = CustomOptionHolder.engineerHighlightForImpostors.getBool(); - highlightForTeamJackal = CustomOptionHolder.engineerHighlightForTeamJackal.getBool(); + resetFixAfterMeeting = CustomOptionHolder.engineerResetFixAfterMeeting.GetBool(); + remainingFixes = CustomOptionHolder.engineerNumberOfFixes.GetInt(); + highlightForImpostors = CustomOptionHolder.engineerHighlightForImpostors.GetBool(); + highlightForTeamJackal = CustomOptionHolder.engineerHighlightForTeamJackal.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Hacker.cs b/TheOtherRoles/Roles/Crewmate/Hacker.cs index 5dc8f0e1..e5ee548f 100644 --- a/TheOtherRoles/Roles/Crewmate/Hacker.cs +++ b/TheOtherRoles/Roles/Crewmate/Hacker.cs @@ -68,14 +68,14 @@ public static void clearAndReload() doorLog = null; hackerTimer = 0f; adminSprite = null; - cooldown = CustomOptionHolder.hackerCooldown.getFloat(); - duration = CustomOptionHolder.hackerHackeringDuration.getFloat(); - onlyColorType = CustomOptionHolder.hackerOnlyColorType.getBool(); - toolsNumber = CustomOptionHolder.hackerToolsNumber.getFloat(); - rechargeTasksNumber = Mathf.RoundToInt(CustomOptionHolder.hackerRechargeTasksNumber.getFloat()); - rechargedTasks = Mathf.RoundToInt(CustomOptionHolder.hackerRechargeTasksNumber.getFloat()); - chargesVitals = Mathf.RoundToInt(CustomOptionHolder.hackerToolsNumber.getFloat()) / 2; - chargesAdminTable = Mathf.RoundToInt(CustomOptionHolder.hackerToolsNumber.getFloat()) / 2; - cantMove = CustomOptionHolder.hackerNoMove.getBool(); + cooldown = CustomOptionHolder.hackerCooldown.GetFloat(); + duration = CustomOptionHolder.hackerHackeringDuration.GetFloat(); + onlyColorType = CustomOptionHolder.hackerOnlyColorType.GetBool(); + toolsNumber = CustomOptionHolder.hackerToolsNumber.GetFloat(); + rechargeTasksNumber = CustomOptionHolder.hackerRechargeTasksNumber.GetInt(); + rechargedTasks = CustomOptionHolder.hackerRechargeTasksNumber.GetInt(); + chargesVitals = CustomOptionHolder.hackerToolsNumber.GetInt() / 2; + chargesAdminTable = CustomOptionHolder.hackerToolsNumber.GetInt() / 2; + cantMove = CustomOptionHolder.hackerNoMove.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/InfoSleuth.cs b/TheOtherRoles/Roles/Crewmate/InfoSleuth.cs index 6cb51f58..f1235863 100644 --- a/TheOtherRoles/Roles/Crewmate/InfoSleuth.cs +++ b/TheOtherRoles/Roles/Crewmate/InfoSleuth.cs @@ -14,6 +14,6 @@ public static void clearAndReload() { infoSleuth = null; target = null; - infoType = CustomOptionHolder.infoSleuthInfoType.getSelection(); + infoType = CustomOptionHolder.infoSleuthInfoType.GetSelection(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Crewmate/Jumper.cs b/TheOtherRoles/Roles/Crewmate/Jumper.cs index 999133dc..dc0b58c4 100644 --- a/TheOtherRoles/Roles/Crewmate/Jumper.cs +++ b/TheOtherRoles/Roles/Crewmate/Jumper.cs @@ -8,13 +8,13 @@ public static class Jumper public static Color color = new Color32(204, 155, 20, byte.MaxValue); // mint public static float JumpTime = 30f; - public static float ChargesOnPlace = 1f; + public static int ChargesOnPlace = 1; public static bool resetPlaceAfterMeeting; - public static float ChargesGainOnMeeting = 2f; + public static int ChargesGainOnMeeting = 2; public static float MaxCharges = 3f; - public static float Charges = 1f; + public static int Charges = 1; public static Vector3 jumpLocation; @@ -24,7 +24,7 @@ public static class Jumper public static void resetPlaces() { - Charges = Mathf.RoundToInt(ChargesOnPlace); + Charges = ChargesOnPlace; jumpLocation = Vector3.zero; usedPlace = false; } @@ -34,12 +34,12 @@ public static void clearAndReload() resetPlaces(); jumpLocation = Vector3.zero; jumper = null; - resetPlaceAfterMeeting = CustomOptionHolder.jumperResetPlaceAfterMeeting.getBool(); - Charges = CustomOptionHolder.jumperMaxCharges.getFloat(); - JumpTime = CustomOptionHolder.jumperJumpTime.getFloat(); - ChargesOnPlace = 1f; - ChargesGainOnMeeting = CustomOptionHolder.jumperChargesGainOnMeeting.getFloat(); - MaxCharges = CustomOptionHolder.jumperMaxCharges.getFloat(); + resetPlaceAfterMeeting = CustomOptionHolder.jumperResetPlaceAfterMeeting.GetBool(); + Charges = CustomOptionHolder.jumperMaxCharges.GetInt(); + JumpTime = CustomOptionHolder.jumperJumpTime.GetFloat(); + ChargesOnPlace = 1; + ChargesGainOnMeeting = CustomOptionHolder.jumperChargesGainOnMeeting.GetInt(); + MaxCharges = CustomOptionHolder.jumperMaxCharges.GetFloat(); usedPlace = false; } } diff --git a/TheOtherRoles/Roles/Crewmate/Mayor.cs b/TheOtherRoles/Roles/Crewmate/Mayor.cs index a41c81a9..977f19e6 100644 --- a/TheOtherRoles/Roles/Crewmate/Mayor.cs +++ b/TheOtherRoles/Roles/Crewmate/Mayor.cs @@ -20,9 +20,9 @@ public static void clearAndReload() mayor = null; Revealed = false; Vote = CustomOptionHolder.mayorVote.GetInt(); - meetingButton = CustomOptionHolder.mayorMeetingButton.getBool(); - remoteMeetingsLeft = Mathf.RoundToInt(CustomOptionHolder.mayorMaxRemoteMeetings.getFloat()); - SabotageRemoteMeetings = CustomOptionHolder.mayorSabotageRemoteMeetings.getBool(); - vision = CustomOptionHolder.mayorRevealVision.getSelection() + 2; + meetingButton = CustomOptionHolder.mayorMeetingButton.GetBool(); + remoteMeetingsLeft = CustomOptionHolder.mayorMaxRemoteMeetings.GetInt(); + SabotageRemoteMeetings = CustomOptionHolder.mayorSabotageRemoteMeetings.GetBool(); + vision = CustomOptionHolder.mayorRevealVision.GetSelection() + 2; } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Crewmate/Medic.cs b/TheOtherRoles/Roles/Crewmate/Medic.cs index 00320418..0ddee774 100644 --- a/TheOtherRoles/Roles/Crewmate/Medic.cs +++ b/TheOtherRoles/Roles/Crewmate/Medic.cs @@ -60,15 +60,15 @@ public static void clearAndReload() futureShielded = null; currentTarget = null; usedShield = false; - reset = CustomOptionHolder.medicResetTargetAfterMeeting.getBool(); - showShielded = CustomOptionHolder.medicShowShielded.getSelection(); - showAttemptToShielded = CustomOptionHolder.medicShowAttemptToShielded.getBool(); - unbreakableShield = CustomOptionHolder.medicBreakShield.getBool(); - showAttemptToMedic = CustomOptionHolder.medicShowAttemptToMedic.getBool(); - setShieldAfterMeeting = CustomOptionHolder.medicSetOrShowShieldAfterMeeting.getSelection() == 2; - showShieldAfterMeeting = CustomOptionHolder.medicSetOrShowShieldAfterMeeting.getSelection() == 1; - ReportNameDuration = CustomOptionHolder.medicReportNameDuration.getFloat(); - ReportColorDuration = CustomOptionHolder.medicReportColorDuration.getFloat(); + reset = CustomOptionHolder.medicResetTargetAfterMeeting.GetBool(); + showShielded = CustomOptionHolder.medicShowShielded.GetSelection(); + showAttemptToShielded = CustomOptionHolder.medicShowAttemptToShielded.GetBool(); + unbreakableShield = CustomOptionHolder.medicBreakShield.GetBool(); + showAttemptToMedic = CustomOptionHolder.medicShowAttemptToMedic.GetBool(); + setShieldAfterMeeting = CustomOptionHolder.medicSetOrShowShieldAfterMeeting.GetSelection() == 2; + showShieldAfterMeeting = CustomOptionHolder.medicSetOrShowShieldAfterMeeting.GetSelection() == 1; + ReportNameDuration = CustomOptionHolder.medicReportNameDuration.GetFloat(); + ReportColorDuration = CustomOptionHolder.medicReportColorDuration.GetFloat(); meetingAfterShielding = false; } } diff --git a/TheOtherRoles/Roles/Crewmate/Medium.cs b/TheOtherRoles/Roles/Crewmate/Medium.cs index f67c2044..15c2d92a 100644 --- a/TheOtherRoles/Roles/Crewmate/Medium.cs +++ b/TheOtherRoles/Roles/Crewmate/Medium.cs @@ -34,10 +34,10 @@ public static void clearAndReload() futureDeadBodies.Clear(); souls.Clear(); meetingStartTime = DateTime.UtcNow; - cooldown = CustomOptionHolder.mediumCooldown.getFloat(); - duration = CustomOptionHolder.mediumDuration.getFloat(); - oneTimeUse = CustomOptionHolder.mediumOneTimeUse.getBool(); - chanceAdditionalInfo = CustomOptionHolder.mediumChanceAdditionalInfo.getSelection() / 10f; + cooldown = CustomOptionHolder.mediumCooldown.GetFloat(); + duration = CustomOptionHolder.mediumDuration.GetFloat(); + oneTimeUse = CustomOptionHolder.mediumOneTimeUse.GetBool(); + chanceAdditionalInfo = CustomOptionHolder.mediumChanceAdditionalInfo.GetSelection() / 10f; } public static string getInfo(PlayerControl target, PlayerControl killer) { diff --git a/TheOtherRoles/Roles/Crewmate/Portalmaker.cs b/TheOtherRoles/Roles/Crewmate/Portalmaker.cs index 333b2883..6f13cad2 100644 --- a/TheOtherRoles/Roles/Crewmate/Portalmaker.cs +++ b/TheOtherRoles/Roles/Crewmate/Portalmaker.cs @@ -19,10 +19,10 @@ public static class Portalmaker public static void clearAndReload() { portalmaker = null; - cooldown = CustomOptionHolder.portalmakerCooldown.getFloat(); - usePortalCooldown = CustomOptionHolder.portalmakerUsePortalCooldown.getFloat(); - logOnlyHasColors = CustomOptionHolder.portalmakerLogOnlyColorType.getBool(); - logShowsTime = CustomOptionHolder.portalmakerLogHasTime.getBool(); - canPortalFromAnywhere = CustomOptionHolder.portalmakerCanPortalFromAnywhere.getBool(); + cooldown = CustomOptionHolder.portalmakerCooldown.GetFloat(); + usePortalCooldown = CustomOptionHolder.portalmakerUsePortalCooldown.GetFloat(); + logOnlyHasColors = CustomOptionHolder.portalmakerLogOnlyColorType.GetBool(); + logShowsTime = CustomOptionHolder.portalmakerLogHasTime.GetBool(); + canPortalFromAnywhere = CustomOptionHolder.portalmakerCanPortalFromAnywhere.GetBool(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Crewmate/Prophet.cs b/TheOtherRoles/Roles/Crewmate/Prophet.cs index 8b94b446..e6e07d30 100644 --- a/TheOtherRoles/Roles/Crewmate/Prophet.cs +++ b/TheOtherRoles/Roles/Crewmate/Prophet.cs @@ -45,15 +45,15 @@ public static void clearAndReload() currentTarget = null; isRevealed = false; examined.Clear(); - revealProphet = CustomOptionHolder.prophetIsRevealed.getBool(); - cooldown = CustomOptionHolder.prophetCooldown.getFloat(); - examineNum = Mathf.RoundToInt(CustomOptionHolder.prophetNumExamines.getFloat()); - killCrewAsRed = CustomOptionHolder.prophetKillCrewAsRed.getBool(); - benignNeutralAsRed = CustomOptionHolder.prophetBenignNeutralAsRed.getBool(); - evilNeutralAsRed = CustomOptionHolder.prophetEvilNeutralAsRed.getBool(); - killNeutralAsRed = CustomOptionHolder.prophetKillNeutralAsRed.getBool(); - canCallEmergency = CustomOptionHolder.prophetCanCallEmergency.getBool(); - examinesToBeRevealed = Math.Min(examineNum, Mathf.RoundToInt(CustomOptionHolder.prophetExaminesToBeRevealed.getFloat())); + revealProphet = CustomOptionHolder.prophetIsRevealed.GetBool(); + cooldown = CustomOptionHolder.prophetCooldown.GetFloat(); + examineNum = CustomOptionHolder.prophetNumExamines.GetInt(); + killCrewAsRed = CustomOptionHolder.prophetKillCrewAsRed.GetBool(); + benignNeutralAsRed = CustomOptionHolder.prophetBenignNeutralAsRed.GetBool(); + evilNeutralAsRed = CustomOptionHolder.prophetEvilNeutralAsRed.GetBool(); + killNeutralAsRed = CustomOptionHolder.prophetKillNeutralAsRed.GetBool(); + canCallEmergency = CustomOptionHolder.prophetCanCallEmergency.GetBool(); + examinesToBeRevealed = Math.Min(examineNum, CustomOptionHolder.prophetExaminesToBeRevealed.GetInt()); examinesLeft = examineNum; if (arrows != null) { diff --git a/TheOtherRoles/Roles/Crewmate/Prosecutor.cs b/TheOtherRoles/Roles/Crewmate/Prosecutor.cs index 341b0076..9bc4f2d3 100644 --- a/TheOtherRoles/Roles/Crewmate/Prosecutor.cs +++ b/TheOtherRoles/Roles/Crewmate/Prosecutor.cs @@ -26,10 +26,10 @@ public static void clearAndReload() ProsecuteThisMeeting = false; StartProsecute = false; Prosecuted = false; - canSeeVoteColors = CustomOptionHolder.prosecutorCanSeeVoteColors.getBool(); + canSeeVoteColors = CustomOptionHolder.prosecutorCanSeeVoteColors.GetBool(); tasksNeededToSeeVoteColors = CustomOptionHolder.prosecutorTasksNeededToSeeVoteColors.GetInt(); - diesOnIncorrectPros = CustomOptionHolder.prosecutorDiesOnIncorrectPros.getBool(); - canCallEmergency = CustomOptionHolder.prosecutorCanCallEmergency.getBool(); + diesOnIncorrectPros = CustomOptionHolder.prosecutorDiesOnIncorrectPros.GetBool(); + canCallEmergency = CustomOptionHolder.prosecutorCanCallEmergency.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/SecurityGuard.cs b/TheOtherRoles/Roles/Crewmate/SecurityGuard.cs index b682b6d7..638c4f84 100644 --- a/TheOtherRoles/Roles/Crewmate/SecurityGuard.cs +++ b/TheOtherRoles/Roles/Crewmate/SecurityGuard.cs @@ -69,16 +69,16 @@ public static void clearAndReload() securityGuard = null; ventTarget = null; minigame = null; - duration = CustomOptionHolder.securityGuardCamDuration.getFloat(); - maxCharges = Mathf.RoundToInt(CustomOptionHolder.securityGuardCamMaxCharges.getFloat()); - rechargeTasksNumber = Mathf.RoundToInt(CustomOptionHolder.securityGuardCamRechargeTasksNumber.getFloat()); - rechargedTasks = Mathf.RoundToInt(CustomOptionHolder.securityGuardCamRechargeTasksNumber.getFloat()); - charges = Mathf.RoundToInt(CustomOptionHolder.securityGuardCamMaxCharges.getFloat()) / 2; + duration = CustomOptionHolder.securityGuardCamDuration.GetFloat(); + maxCharges = CustomOptionHolder.securityGuardCamMaxCharges.GetInt(); + rechargeTasksNumber = CustomOptionHolder.securityGuardCamRechargeTasksNumber.GetInt(); + rechargedTasks = CustomOptionHolder.securityGuardCamRechargeTasksNumber.GetInt(); + charges = CustomOptionHolder.securityGuardCamMaxCharges.GetInt() / 2; placedCameras = 0; - cooldown = CustomOptionHolder.securityGuardCooldown.getFloat(); - totalScrews = remainingScrews = Mathf.RoundToInt(CustomOptionHolder.securityGuardTotalScrews.getFloat()); - camPrice = Mathf.RoundToInt(CustomOptionHolder.securityGuardCamPrice.getFloat()); - ventPrice = Mathf.RoundToInt(CustomOptionHolder.securityGuardVentPrice.getFloat()); - cantMove = CustomOptionHolder.securityGuardNoMove.getBool(); + cooldown = CustomOptionHolder.securityGuardCooldown.GetFloat(); + totalScrews = remainingScrews = CustomOptionHolder.securityGuardTotalScrews.GetInt(); + camPrice = CustomOptionHolder.securityGuardCamPrice.GetInt(); + ventPrice = CustomOptionHolder.securityGuardVentPrice.GetInt(); + cantMove = CustomOptionHolder.securityGuardNoMove.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Seer.cs b/TheOtherRoles/Roles/Crewmate/Seer.cs index b27f4336..7ee68743 100644 --- a/TheOtherRoles/Roles/Crewmate/Seer.cs +++ b/TheOtherRoles/Roles/Crewmate/Seer.cs @@ -19,8 +19,8 @@ public static void clearAndReload() { seer = null; deadBodyPositions.Clear(); - limitSoulDuration = CustomOptionHolder.seerLimitSoulDuration.getBool(); - soulDuration = CustomOptionHolder.seerSoulDuration.getFloat(); - mode = CustomOptionHolder.seerMode.getSelection(); + limitSoulDuration = CustomOptionHolder.seerLimitSoulDuration.GetBool(); + soulDuration = CustomOptionHolder.seerSoulDuration.GetFloat(); + mode = CustomOptionHolder.seerMode.GetSelection(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Sheriff.cs b/TheOtherRoles/Roles/Crewmate/Sheriff.cs index 4556aa4c..f734ded7 100644 --- a/TheOtherRoles/Roles/Crewmate/Sheriff.cs +++ b/TheOtherRoles/Roles/Crewmate/Sheriff.cs @@ -33,7 +33,7 @@ public static void replaceCurrentSheriff(PlayerControl deputy) if (!formerSheriff) formerSheriff = sheriff; sheriff = deputy; currentTarget = null; - cooldown = CustomOptionHolder.sheriffCooldown.getFloat(); + cooldown = CustomOptionHolder.sheriffCooldown.GetFloat(); } public static bool sheriffCanKillNeutral(PlayerControl target) @@ -68,19 +68,19 @@ public static void clearAndReload() currentTarget = null; formerDeputy = null; formerSheriff = null; - misfireKills = CustomOptionHolder.sheriffMisfireKills.getSelection(); - cooldown = CustomOptionHolder.sheriffCooldown.getFloat(); - canKillNeutrals = CustomOptionHolder.sheriffCanKillNeutrals.getBool(); - canKillSurvivor = CustomOptionHolder.sheriffCanKillSurvivor.getBool(); - canKillLawyer = CustomOptionHolder.sheriffCanKillLawyer.getBool(); - canKillJester = CustomOptionHolder.sheriffCanKillJester.getBool(); - canKillPursuer = CustomOptionHolder.sheriffCanKillPursuer.getBool(); - canKillPartTimer = CustomOptionHolder.sheriffCanKillPartTimer.getBool(); - canKillVulture = CustomOptionHolder.sheriffCanKillVulture.getBool(); - canKillThief = CustomOptionHolder.sheriffCanKillThief.getBool(); - canKillAmnesiac = CustomOptionHolder.sheriffCanKillAmnesiac.getBool(); - canKillExecutioner = CustomOptionHolder.sheriffCanKillExecutioner.getBool(); - spyCanDieToSheriff = CustomOptionHolder.spyCanDieToSheriff.getBool(); - canKillDoomsayer = CustomOptionHolder.sheriffCanKillDoomsayer.getBool(); + misfireKills = CustomOptionHolder.sheriffMisfireKills.GetSelection(); + cooldown = CustomOptionHolder.sheriffCooldown.GetFloat(); + canKillNeutrals = CustomOptionHolder.sheriffCanKillNeutrals.GetBool(); + canKillSurvivor = CustomOptionHolder.sheriffCanKillSurvivor.GetBool(); + canKillLawyer = CustomOptionHolder.sheriffCanKillLawyer.GetBool(); + canKillJester = CustomOptionHolder.sheriffCanKillJester.GetBool(); + canKillPursuer = CustomOptionHolder.sheriffCanKillPursuer.GetBool(); + canKillPartTimer = CustomOptionHolder.sheriffCanKillPartTimer.GetBool(); + canKillVulture = CustomOptionHolder.sheriffCanKillVulture.GetBool(); + canKillThief = CustomOptionHolder.sheriffCanKillThief.GetBool(); + canKillAmnesiac = CustomOptionHolder.sheriffCanKillAmnesiac.GetBool(); + canKillExecutioner = CustomOptionHolder.sheriffCanKillExecutioner.GetBool(); + spyCanDieToSheriff = CustomOptionHolder.spyCanDieToSheriff.GetBool(); + canKillDoomsayer = CustomOptionHolder.sheriffCanKillDoomsayer.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Snitch.cs b/TheOtherRoles/Roles/Crewmate/Snitch.cs index 9b08d75d..764c383c 100644 --- a/TheOtherRoles/Roles/Crewmate/Snitch.cs +++ b/TheOtherRoles/Roles/Crewmate/Snitch.cs @@ -38,15 +38,15 @@ public static void clearAndReload() Object.Destroy(arrow.arrow); } localArrows.Clear(); - taskCountForReveal = Mathf.RoundToInt(CustomOptionHolder.snitchLeftTasksForReveal.getFloat()); - seeInMeeting = CustomOptionHolder.snitchSeeMeeting.getBool(); + taskCountForReveal = CustomOptionHolder.snitchLeftTasksForReveal.GetInt(); + seeInMeeting = CustomOptionHolder.snitchSeeMeeting.GetBool(); if (text != null) Object.Destroy(text); text = null; needsUpdate = true; //canSeeRoles = CustomOptionHolder.snitchCanSeeRoles.getBool(); - Team = (includeNeutralTeam)CustomOptionHolder.snitchIncludeNeutralTeam.getSelection(); - teamNeutraUseDifferentArrowColor = CustomOptionHolder.snitchTeamNeutraUseDifferentArrowColor.getBool(); + Team = (includeNeutralTeam)CustomOptionHolder.snitchIncludeNeutralTeam.GetSelection(); + teamNeutraUseDifferentArrowColor = CustomOptionHolder.snitchTeamNeutraUseDifferentArrowColor.GetBool(); snitch = null; } } diff --git a/TheOtherRoles/Roles/Crewmate/Spy.cs b/TheOtherRoles/Roles/Crewmate/Spy.cs index 0606d068..a5796f59 100644 --- a/TheOtherRoles/Roles/Crewmate/Spy.cs +++ b/TheOtherRoles/Roles/Crewmate/Spy.cs @@ -14,8 +14,8 @@ public static class Spy public static void clearAndReload() { spy = null; - impostorsCanKillAnyone = CustomOptionHolder.spyImpostorsCanKillAnyone.getBool(); - canEnterVents = CustomOptionHolder.spyCanEnterVents.getBool(); - hasImpostorVision = CustomOptionHolder.spyHasImpostorVision.getBool(); + impostorsCanKillAnyone = CustomOptionHolder.spyImpostorsCanKillAnyone.GetBool(); + canEnterVents = CustomOptionHolder.spyCanEnterVents.GetBool(); + hasImpostorVision = CustomOptionHolder.spyHasImpostorVision.GetBool(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Swapper.cs b/TheOtherRoles/Roles/Crewmate/Swapper.cs index 1f379ea5..9ce5d199 100644 --- a/TheOtherRoles/Roles/Crewmate/Swapper.cs +++ b/TheOtherRoles/Roles/Crewmate/Swapper.cs @@ -23,9 +23,9 @@ public static void clearAndReload() swapper = null; playerId1 = byte.MaxValue; playerId2 = byte.MaxValue; - canCallEmergency = CustomOptionHolder.swapperCanCallEmergency.getBool(); - canOnlySwapOthers = CustomOptionHolder.swapperCanOnlySwapOthers.getBool(); - canFixSabotages = CustomOptionHolder.swapperCanFixSabotages.getBool(); + canCallEmergency = CustomOptionHolder.swapperCanCallEmergency.GetBool(); + canOnlySwapOthers = CustomOptionHolder.swapperCanOnlySwapOthers.GetBool(); + canFixSabotages = CustomOptionHolder.swapperCanFixSabotages.GetBool(); charges = CustomOptionHolder.swapperSwapsNumber.GetInt(); rechargeTasksNumber = CustomOptionHolder.swapperRechargeTasksNumber.GetInt(); rechargedTasks = CustomOptionHolder.swapperRechargeTasksNumber.GetInt(); diff --git a/TheOtherRoles/Roles/Crewmate/TimeMaster.cs b/TheOtherRoles/Roles/Crewmate/TimeMaster.cs index ce036c0a..16bdc638 100644 --- a/TheOtherRoles/Roles/Crewmate/TimeMaster.cs +++ b/TheOtherRoles/Roles/Crewmate/TimeMaster.cs @@ -22,8 +22,8 @@ public static void clearAndReload() timeMaster = null; isRewinding = false; shieldActive = false; - rewindTime = CustomOptionHolder.timeMasterRewindTime.getFloat(); - shieldDuration = CustomOptionHolder.timeMasterShieldDuration.getFloat(); - cooldown = CustomOptionHolder.timeMasterCooldown.getFloat(); + rewindTime = CustomOptionHolder.timeMasterRewindTime.GetFloat(); + shieldDuration = CustomOptionHolder.timeMasterShieldDuration.GetFloat(); + cooldown = CustomOptionHolder.timeMasterCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Tracker.cs b/TheOtherRoles/Roles/Crewmate/Tracker.cs index 47bcce6d..3745b275 100644 --- a/TheOtherRoles/Roles/Crewmate/Tracker.cs +++ b/TheOtherRoles/Roles/Crewmate/Tracker.cs @@ -48,8 +48,8 @@ public static void clearAndReload() tracker = null; resetTracked(); timeUntilUpdate = 0f; - updateIntervall = CustomOptionHolder.trackerUpdateIntervall.getFloat(); - resetTargetAfterMeeting = CustomOptionHolder.trackerResetTargetAfterMeeting.getBool(); + updateIntervall = CustomOptionHolder.trackerUpdateIntervall.GetFloat(); + resetTargetAfterMeeting = CustomOptionHolder.trackerResetTargetAfterMeeting.GetBool(); if (localArrows != null) { foreach (Arrow arrow in localArrows) @@ -58,10 +58,10 @@ public static void clearAndReload() } deadBodyPositions.Clear(); corpsesTrackingTimer = 0f; - corpsesTrackingCooldown = CustomOptionHolder.trackerCorpsesTrackingCooldown.getFloat(); - corpsesTrackingDuration = CustomOptionHolder.trackerCorpsesTrackingDuration.getFloat(); - canTrackCorpses = CustomOptionHolder.trackerCanTrackCorpses.getBool(); - trackingMode = CustomOptionHolder.trackerTrackingMethod.getSelection(); + corpsesTrackingCooldown = CustomOptionHolder.trackerCorpsesTrackingCooldown.GetFloat(); + corpsesTrackingDuration = CustomOptionHolder.trackerCorpsesTrackingDuration.GetFloat(); + canTrackCorpses = CustomOptionHolder.trackerCanTrackCorpses.GetBool(); + trackingMode = CustomOptionHolder.trackerTrackingMethod.GetSelection(); if (DangerMeterParent) { Meter.gameObject.Destroy(); diff --git a/TheOtherRoles/Roles/Crewmate/Trapper.cs b/TheOtherRoles/Roles/Crewmate/Trapper.cs index 05d679d0..fb45023b 100644 --- a/TheOtherRoles/Roles/Crewmate/Trapper.cs +++ b/TheOtherRoles/Roles/Crewmate/Trapper.cs @@ -24,15 +24,15 @@ public static class Trapper public static void clearAndReload() { trapper = null; - cooldown = CustomOptionHolder.trapperCooldown.getFloat(); - maxCharges = Mathf.RoundToInt(CustomOptionHolder.trapperMaxCharges.getFloat()); - rechargeTasksNumber = Mathf.RoundToInt(CustomOptionHolder.trapperRechargeTasksNumber.getFloat()); - rechargedTasks = Mathf.RoundToInt(CustomOptionHolder.trapperRechargeTasksNumber.getFloat()); - charges = Mathf.RoundToInt(CustomOptionHolder.trapperMaxCharges.getFloat()) / 2; - trapCountToReveal = Mathf.RoundToInt(CustomOptionHolder.trapperTrapNeededTriggerToReveal.getFloat()); + cooldown = CustomOptionHolder.trapperCooldown.GetFloat(); + maxCharges = CustomOptionHolder.trapperMaxCharges.GetInt(); + rechargeTasksNumber = CustomOptionHolder.trapperRechargeTasksNumber.GetInt(); + rechargedTasks = CustomOptionHolder.trapperRechargeTasksNumber.GetInt(); + charges = CustomOptionHolder.trapperMaxCharges.GetInt() / 2; + trapCountToReveal = CustomOptionHolder.trapperTrapNeededTriggerToReveal.GetInt(); playersOnMap = new List(); - anonymousMap = CustomOptionHolder.trapperAnonymousMap.getBool(); - infoType = CustomOptionHolder.trapperInfoType.getSelection(); - trapDuration = CustomOptionHolder.trapperTrapDuration.getFloat(); + anonymousMap = CustomOptionHolder.trapperAnonymousMap.GetBool(); + infoType = CustomOptionHolder.trapperInfoType.GetSelection(); + trapDuration = CustomOptionHolder.trapperTrapDuration.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Veteran.cs b/TheOtherRoles/Roles/Crewmate/Veteran.cs index 9754e1d1..645eae5b 100644 --- a/TheOtherRoles/Roles/Crewmate/Veteran.cs +++ b/TheOtherRoles/Roles/Crewmate/Veteran.cs @@ -18,7 +18,7 @@ public static void clearAndReload() { veteran = null; alertActive = false; - alertDuration = CustomOptionHolder.veteranAlertDuration.getFloat(); - cooldown = CustomOptionHolder.veteranCooldown.getFloat(); + alertDuration = CustomOptionHolder.veteranAlertDuration.GetFloat(); + cooldown = CustomOptionHolder.veteranCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Crewmate/Vigilante.cs b/TheOtherRoles/Roles/Crewmate/Vigilante.cs index 88004134..75df9710 100644 --- a/TheOtherRoles/Roles/Crewmate/Vigilante.cs +++ b/TheOtherRoles/Roles/Crewmate/Vigilante.cs @@ -14,8 +14,8 @@ public static void clearAndReload() { vigilante = null; - remainingShotsNiceGuesser = Mathf.RoundToInt(CustomOptionHolder.guesserNumberOfShots.getFloat()); - hasMultipleShotsPerMeeting = CustomOptionHolder.guesserHasMultipleShotsPerMeeting.getBool(); - killsThroughShield = CustomOptionHolder.guesserKillsThroughShield.getBool(); + remainingShotsNiceGuesser = CustomOptionHolder.guesserNumberOfShots.GetInt(); + hasMultipleShotsPerMeeting = CustomOptionHolder.guesserHasMultipleShotsPerMeeting.GetBool(); + killsThroughShield = CustomOptionHolder.guesserKillsThroughShield.GetBool(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Guesser.cs b/TheOtherRoles/Roles/Guesser.cs index edc4af07..24f299a7 100644 --- a/TheOtherRoles/Roles/Guesser.cs +++ b/TheOtherRoles/Roles/Guesser.cs @@ -142,7 +142,7 @@ public static void guesserOnClick(int buttonTarget, MeetingHud __instance) TeambuttonParent.localScale = new(0.55f, 0.55f, 1f); Teamlabel.color = getTeamColor((RoleType)index); //Info($"{Teamlabel.color} {(RoleTeam)index}"); - Teamlabel.text = getString(((RoleType)index is RoleType.Crewmate ? "Crewmate" : ((RoleType)index).ToString()) + "RolesText"); + Teamlabel.text = GetString(((RoleType)index is RoleType.Crewmate ? "Crewmate" : ((RoleType)index).ToString()) + "RolesText"); Teamlabel.alignment = TextAlignmentOptions.Center; Teamlabel.transform.localPosition = new Vector3(0, 0, Teamlabel.transform.localPosition.z); Teamlabel.transform.localScale *= 1.6f; @@ -203,7 +203,7 @@ static void CreatePage(bool IsNext, MeetingHud __instance, Transform container) PagebuttonParent.localPosition = IsNext ? new(3.535f, -2.2f, -200) : new(-3.475f, -2.2f, -200); PagebuttonParent.localScale = new(0.55f, 0.55f, 1f); Pagelabel.color = Color.white; - Pagelabel.text = getString(IsNext ? "下一页" : "上一页"); + Pagelabel.text = GetString(IsNext ? "下一页" : "上一页"); Pagelabel.alignment = TextAlignmentOptions.Center; Pagelabel.transform.localPosition = new Vector3(0, 0, Pagelabel.transform.localPosition.z); Pagelabel.transform.localScale *= 1.6f; @@ -264,9 +264,9 @@ static void CreatePage(bool IsNext, MeetingHud __instance, Transform container) continue; case RoleId.Vigilante when HandleGuesser.isGuesserGm || CachedPlayer.LocalPlayer.PlayerId == Vigilante.vigilante?.PlayerId: continue; - case RoleId.Sidekick when !CustomOptionHolder.jackalCanCreateSidekick.getBool(): + case RoleId.Sidekick when !CustomOptionHolder.jackalCanCreateSidekick.GetBool(): continue; - case RoleId.Deputy when CustomOptionHolder.sheriffSpawnRate.getSelection() == 0: + case RoleId.Deputy when CustomOptionHolder.sheriffSpawnRate.GetSelection() == 0: continue; case RoleId.Doomsayer when CachedPlayer.LocalPlayer.PlayerId == Doomsayer.doomsayer?.PlayerId: continue; diff --git a/TheOtherRoles/Roles/Impostor/Blackmailer.cs b/TheOtherRoles/Roles/Impostor/Blackmailer.cs index 85e0dde5..b86d5db6 100644 --- a/TheOtherRoles/Roles/Impostor/Blackmailer.cs +++ b/TheOtherRoles/Roles/Impostor/Blackmailer.cs @@ -20,6 +20,6 @@ public static void clearAndReload() blackmailer = null; currentTarget = null; blackmailed = null; - cooldown = CustomOptionHolder.blackmailerCooldown.getFloat(); + cooldown = CustomOptionHolder.blackmailerCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Bomber.cs b/TheOtherRoles/Roles/Impostor/Bomber.cs index 9ff86630..8f9035e2 100644 --- a/TheOtherRoles/Roles/Impostor/Bomber.cs +++ b/TheOtherRoles/Roles/Impostor/Bomber.cs @@ -32,11 +32,11 @@ public static void clearAndReload() currentBombTarget = null; hasBombPlayer = null; bombActive = false; - cooldown = CustomOptionHolder.bomberBombCooldown.getFloat(); - bombDelay = CustomOptionHolder.bomberDelay.getFloat(); - bombTimer = CustomOptionHolder.bomberTimer.getFloat(); - triggerBothCooldowns = CustomOptionHolder.bomberTriggerBothCooldowns.getBool(); - canGiveToBomber = CustomOptionHolder.bomberCanGiveToBomber.getBool(); - hotPotatoMode = CustomOptionHolder.bomberHotPotatoMode.getBool(); + cooldown = CustomOptionHolder.bomberBombCooldown.GetFloat(); + bombDelay = CustomOptionHolder.bomberDelay.GetFloat(); + bombTimer = CustomOptionHolder.bomberTimer.GetFloat(); + triggerBothCooldowns = CustomOptionHolder.bomberTriggerBothCooldowns.GetBool(); + canGiveToBomber = CustomOptionHolder.bomberCanGiveToBomber.GetBool(); + hotPotatoMode = CustomOptionHolder.bomberHotPotatoMode.GetBool(); } } diff --git a/TheOtherRoles/Roles/Impostor/BountyHunter.cs b/TheOtherRoles/Roles/Impostor/BountyHunter.cs index 308157d1..9a2c011f 100644 --- a/TheOtherRoles/Roles/Impostor/BountyHunter.cs +++ b/TheOtherRoles/Roles/Impostor/BountyHunter.cs @@ -38,10 +38,10 @@ public static void clearAndReload() p.gameObject.SetActive(false); - bountyDuration = CustomOptionHolder.bountyHunterBountyDuration.getFloat(); - bountyKillCooldown = CustomOptionHolder.bountyHunterReducedCooldown.getFloat(); - punishmentTime = CustomOptionHolder.bountyHunterPunishmentTime.getFloat(); - showArrow = CustomOptionHolder.bountyHunterShowArrow.getBool(); - arrowUpdateIntervall = CustomOptionHolder.bountyHunterArrowUpdateIntervall.getFloat(); + bountyDuration = CustomOptionHolder.bountyHunterBountyDuration.GetFloat(); + bountyKillCooldown = CustomOptionHolder.bountyHunterReducedCooldown.GetFloat(); + punishmentTime = CustomOptionHolder.bountyHunterPunishmentTime.GetFloat(); + showArrow = CustomOptionHolder.bountyHunterShowArrow.GetBool(); + arrowUpdateIntervall = CustomOptionHolder.bountyHunterArrowUpdateIntervall.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Butcher.cs b/TheOtherRoles/Roles/Impostor/Butcher.cs index 3df3da3c..f3f21372 100644 --- a/TheOtherRoles/Roles/Impostor/Butcher.cs +++ b/TheOtherRoles/Roles/Impostor/Butcher.cs @@ -21,8 +21,8 @@ public static void clearAndReload() butcher = null; dissected = null; canDissection = true; - dissectionCooldown = CustomOptionHolder.butcherDissectionCooldown.getFloat(); - dissectionDuration = CustomOptionHolder.butcherDissectionDuration.getFloat(); + dissectionCooldown = CustomOptionHolder.butcherDissectionCooldown.GetFloat(); + dissectionDuration = CustomOptionHolder.butcherDissectionDuration.GetFloat(); dissectedBodyCount = CustomOptionHolder.butcherDissectedBodyCount.GetInt(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Impostor/Camouflager.cs b/TheOtherRoles/Roles/Impostor/Camouflager.cs index 8226ec59..7b267bda 100644 --- a/TheOtherRoles/Roles/Impostor/Camouflager.cs +++ b/TheOtherRoles/Roles/Impostor/Camouflager.cs @@ -36,7 +36,7 @@ public static void clearAndReload() camoComms = false; camouflager = null; camouflageTimer = 0f; - cooldown = CustomOptionHolder.camouflagerCooldown.getFloat(); - duration = CustomOptionHolder.camouflagerDuration.getFloat(); + cooldown = CustomOptionHolder.camouflagerCooldown.GetFloat(); + duration = CustomOptionHolder.camouflagerDuration.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Cleaner.cs b/TheOtherRoles/Roles/Impostor/Cleaner.cs index 451e3ade..7c7819aa 100644 --- a/TheOtherRoles/Roles/Impostor/Cleaner.cs +++ b/TheOtherRoles/Roles/Impostor/Cleaner.cs @@ -14,6 +14,6 @@ public static class Cleaner public static void clearAndReload() { cleaner = null; - cooldown = CustomOptionHolder.cleanerCooldown.getFloat(); + cooldown = CustomOptionHolder.cleanerCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Eraser.cs b/TheOtherRoles/Roles/Impostor/Eraser.cs index 666c431e..8853c290 100644 --- a/TheOtherRoles/Roles/Impostor/Eraser.cs +++ b/TheOtherRoles/Roles/Impostor/Eraser.cs @@ -23,9 +23,9 @@ public static void clearAndReload() eraser = null; futureErased.Clear(); currentTarget = null; - cooldown = CustomOptionHolder.eraserCooldown.getFloat(); - canEraseAnyone = CustomOptionHolder.eraserCanEraseAnyone.getBool(); - canEraseGuess = CustomOptionHolder.erasercanEraseGuess.getBool(); + cooldown = CustomOptionHolder.eraserCooldown.GetFloat(); + canEraseAnyone = CustomOptionHolder.eraserCanEraseAnyone.GetBool(); + canEraseGuess = CustomOptionHolder.erasercanEraseGuess.GetBool(); alreadyErased.Clear(); } } diff --git a/TheOtherRoles/Roles/Impostor/Escapist.cs b/TheOtherRoles/Roles/Impostor/Escapist.cs index 4b7b3384..f2849ca3 100644 --- a/TheOtherRoles/Roles/Impostor/Escapist.cs +++ b/TheOtherRoles/Roles/Impostor/Escapist.cs @@ -29,8 +29,8 @@ public static void clearAndReload() resetPlaces(); escapeLocation = Vector3.zero; escapist = null; - resetPlaceAfterMeeting = CustomOptionHolder.escapistResetPlaceAfterMeeting.getBool(); - EscapeTime = CustomOptionHolder.escapistEscapeTime.getFloat(); + resetPlaceAfterMeeting = CustomOptionHolder.escapistResetPlaceAfterMeeting.GetBool(); + EscapeTime = CustomOptionHolder.escapistEscapeTime.GetFloat(); usedPlace = false; } } diff --git a/TheOtherRoles/Roles/Impostor/EvilTrapper.cs b/TheOtherRoles/Roles/Impostor/EvilTrapper.cs index 953ee78e..cab3ac3b 100644 --- a/TheOtherRoles/Roles/Impostor/EvilTrapper.cs +++ b/TheOtherRoles/Roles/Impostor/EvilTrapper.cs @@ -42,14 +42,14 @@ public static void setTrap() public static void clearAndReload() { evilTrapper = null; - numTrap = (int)CustomOptionHolder.evilTrapperNumTrap.getFloat(); - extensionTime = CustomOptionHolder.evilTrapperExtensionTime.getFloat(); - killTimer = CustomOptionHolder.evilTrapperKillTimer.getFloat(); - cooldown = CustomOptionHolder.evilTrapperCooldown.getFloat(); - maxDistance = CustomOptionHolder.evilTrapperMaxDistance.getFloat(); - trapRange = CustomOptionHolder.evilTrapperTrapRange.getFloat(); - penaltyTime = CustomOptionHolder.evilTrapperPenaltyTime.getFloat(); - bonusTime = CustomOptionHolder.evilTrapperBonusTime.getFloat(); + numTrap = (int)CustomOptionHolder.evilTrapperNumTrap.GetFloat(); + extensionTime = CustomOptionHolder.evilTrapperExtensionTime.GetFloat(); + killTimer = CustomOptionHolder.evilTrapperKillTimer.GetFloat(); + cooldown = CustomOptionHolder.evilTrapperCooldown.GetFloat(); + maxDistance = CustomOptionHolder.evilTrapperMaxDistance.GetFloat(); + trapRange = CustomOptionHolder.evilTrapperTrapRange.GetFloat(); + penaltyTime = CustomOptionHolder.evilTrapperPenaltyTime.GetFloat(); + bonusTime = CustomOptionHolder.evilTrapperBonusTime.GetFloat(); meetingFlag = false; KillTrap.clearAllTraps(); } diff --git a/TheOtherRoles/Roles/Impostor/Gambler.cs b/TheOtherRoles/Roles/Impostor/Gambler.cs index 19cd82ca..678bd18c 100644 --- a/TheOtherRoles/Roles/Impostor/Gambler.cs +++ b/TheOtherRoles/Roles/Impostor/Gambler.cs @@ -20,9 +20,9 @@ public static bool GetSuc() public static void clearAndReload() { gambler = null; - minCooldown = CustomOptionHolder.gamblerMinCooldown.getFloat(); - maxCooldown = CustomOptionHolder.gamblerMaxCooldown.getFloat(); - successRate = CustomOptionHolder.gamblerSuccessRate.getSelection() * 10; + minCooldown = CustomOptionHolder.gamblerMinCooldown.GetFloat(); + maxCooldown = CustomOptionHolder.gamblerMaxCooldown.GetFloat(); + successRate = CustomOptionHolder.gamblerSuccessRate.GetSelection() * 10; } } diff --git a/TheOtherRoles/Roles/Impostor/Grenadier.cs b/TheOtherRoles/Roles/Impostor/Grenadier.cs index 9218f630..77786c04 100644 --- a/TheOtherRoles/Roles/Impostor/Grenadier.cs +++ b/TheOtherRoles/Roles/Impostor/Grenadier.cs @@ -81,9 +81,9 @@ public static void clearAndReload() { grenadier = null; controls.Clear(); - cooldown = CustomOptionHolder.grenadierCooldown.getFloat(); - duration = CustomOptionHolder.grenadierDuration.getFloat() + 0.5f; - radius = CustomOptionHolder.grenadierFlashRadius.getFloat(); - indicatorsMode = CustomOptionHolder.grenadierTeamIndicators.getSelection(); + cooldown = CustomOptionHolder.grenadierCooldown.GetFloat(); + duration = CustomOptionHolder.grenadierDuration.GetFloat() + 0.5f; + radius = CustomOptionHolder.grenadierFlashRadius.GetFloat(); + indicatorsMode = CustomOptionHolder.grenadierTeamIndicators.GetSelection(); } } diff --git a/TheOtherRoles/Roles/Impostor/Miner.cs b/TheOtherRoles/Roles/Impostor/Miner.cs index e4bf5c41..8bd8062c 100644 --- a/TheOtherRoles/Roles/Impostor/Miner.cs +++ b/TheOtherRoles/Roles/Impostor/Miner.cs @@ -21,6 +21,6 @@ public class Miner public static void clearAndReload() { miner = null; - cooldown = CustomOptionHolder.minerCooldown.getFloat(); + cooldown = CustomOptionHolder.minerCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Morphling.cs b/TheOtherRoles/Roles/Impostor/Morphling.cs index 1744b8c2..6a52d7ac 100644 --- a/TheOtherRoles/Roles/Impostor/Morphling.cs +++ b/TheOtherRoles/Roles/Impostor/Morphling.cs @@ -33,7 +33,7 @@ public static void clearAndReload() sampledTarget = null; morphTarget = null; morphTimer = 0f; - cooldown = CustomOptionHolder.morphlingCooldown.getFloat(); - duration = CustomOptionHolder.morphlingDuration.getFloat(); + cooldown = CustomOptionHolder.morphlingCooldown.GetFloat(); + duration = CustomOptionHolder.morphlingDuration.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Ninja.cs b/TheOtherRoles/Roles/Impostor/Ninja.cs index f6aab957..90fa63d4 100644 --- a/TheOtherRoles/Roles/Impostor/Ninja.cs +++ b/TheOtherRoles/Roles/Impostor/Ninja.cs @@ -26,10 +26,10 @@ public static void clearAndReload() { ninja = null; currentTarget = ninjaMarked = null; - cooldown = CustomOptionHolder.ninjaCooldown.getFloat(); - knowsTargetLocation = CustomOptionHolder.ninjaKnowsTargetLocation.getBool(); - traceTime = CustomOptionHolder.ninjaTraceTime.getFloat(); - invisibleDuration = CustomOptionHolder.ninjaInvisibleDuration.getFloat(); + cooldown = CustomOptionHolder.ninjaCooldown.GetFloat(); + knowsTargetLocation = CustomOptionHolder.ninjaKnowsTargetLocation.GetBool(); + traceTime = CustomOptionHolder.ninjaTraceTime.GetFloat(); + invisibleDuration = CustomOptionHolder.ninjaInvisibleDuration.GetFloat(); invisibleTimer = 0f; isInvisble = false; if (arrow?.arrow != null) Object.Destroy(arrow.arrow); diff --git a/TheOtherRoles/Roles/Impostor/Poucher.cs b/TheOtherRoles/Roles/Impostor/Poucher.cs index 7323c22c..02bde7e3 100644 --- a/TheOtherRoles/Roles/Impostor/Poucher.cs +++ b/TheOtherRoles/Roles/Impostor/Poucher.cs @@ -15,6 +15,6 @@ public static void clearAndReload() { poucher = null; killed.Clear(); - spawnModifier = CustomOptionHolder.poucherSpawnModifier.getBool(); + spawnModifier = CustomOptionHolder.poucherSpawnModifier.GetBool(); } } diff --git a/TheOtherRoles/Roles/Impostor/Terrorist.cs b/TheOtherRoles/Roles/Impostor/Terrorist.cs index eee0bea0..f4648df7 100644 --- a/TheOtherRoles/Roles/Impostor/Terrorist.cs +++ b/TheOtherRoles/Roles/Impostor/Terrorist.cs @@ -43,12 +43,12 @@ public static void clearAndReload() bomb = null; isPlanted = false; isActive = false; - destructionTime = CustomOptionHolder.terroristBombDestructionTime.getFloat(); - destructionRange = CustomOptionHolder.terroristBombDestructionRange.getFloat() / 10; - hearRange = CustomOptionHolder.terroristBombHearRange.getFloat() / 10; - defuseDuration = CustomOptionHolder.terroristDefuseDuration.getFloat(); - bombCooldown = CustomOptionHolder.terroristBombCooldown.getFloat(); - bombActiveAfter = CustomOptionHolder.terroristBombActiveAfter.getFloat(); + destructionTime = CustomOptionHolder.terroristBombDestructionTime.GetFloat(); + destructionRange = CustomOptionHolder.terroristBombDestructionRange.GetFloat() / 10; + hearRange = CustomOptionHolder.terroristBombHearRange.GetFloat() / 10; + defuseDuration = CustomOptionHolder.terroristDefuseDuration.GetFloat(); + bombCooldown = CustomOptionHolder.terroristBombCooldown.GetFloat(); + bombActiveAfter = CustomOptionHolder.terroristBombActiveAfter.GetFloat(); Bomb.clearBackgroundSprite(); } } diff --git a/TheOtherRoles/Roles/Impostor/Trickster.cs b/TheOtherRoles/Roles/Impostor/Trickster.cs index 54c1abde..13d52205 100644 --- a/TheOtherRoles/Roles/Impostor/Trickster.cs +++ b/TheOtherRoles/Roles/Impostor/Trickster.cs @@ -20,9 +20,9 @@ public static void clearAndReload() { trickster = null; lightsOutTimer = 0f; - placeBoxCooldown = CustomOptionHolder.tricksterPlaceBoxCooldown.getFloat(); - lightsOutCooldown = CustomOptionHolder.tricksterLightsOutCooldown.getFloat(); - lightsOutDuration = CustomOptionHolder.tricksterLightsOutDuration.getFloat(); + placeBoxCooldown = CustomOptionHolder.tricksterPlaceBoxCooldown.GetFloat(); + lightsOutCooldown = CustomOptionHolder.tricksterLightsOutCooldown.GetFloat(); + lightsOutDuration = CustomOptionHolder.tricksterLightsOutDuration.GetFloat(); JackInTheBox.UpdateStates(); // if the role is erased, we might have to update the state of the created objects } } diff --git a/TheOtherRoles/Roles/Impostor/Undertaker.cs b/TheOtherRoles/Roles/Impostor/Undertaker.cs index 91aecdd3..d54da52e 100644 --- a/TheOtherRoles/Roles/Impostor/Undertaker.cs +++ b/TheOtherRoles/Roles/Impostor/Undertaker.cs @@ -21,9 +21,9 @@ public static void clearAndReload() { undertaker = null; isDraging = false; - canDragAndVent = CustomOptionHolder.undertakerCanDragAndVent.getBool(); + canDragAndVent = CustomOptionHolder.undertakerCanDragAndVent.GetBool(); deadBodyDraged = null; - velocity = CustomOptionHolder.undertakerDragingAfterVelocity.getFloat(); - dragingDelaiAfterKill = CustomOptionHolder.undertakerDragingDelaiAfterKill.getFloat(); + velocity = CustomOptionHolder.undertakerDragingAfterVelocity.GetFloat(); + dragingDelaiAfterKill = CustomOptionHolder.undertakerDragingDelaiAfterKill.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Impostor/Vampire.cs b/TheOtherRoles/Roles/Impostor/Vampire.cs index 9454a0ba..d87f0001 100644 --- a/TheOtherRoles/Roles/Impostor/Vampire.cs +++ b/TheOtherRoles/Roles/Impostor/Vampire.cs @@ -29,10 +29,10 @@ public static void clearAndReload() targetNearGarlic = false; localPlacedGarlic = false; currentTarget = null; - garlicsActive = CustomOptionHolder.vampireSpawnRate.getSelection() > 0; - delay = CustomOptionHolder.vampireKillDelay.getFloat(); - cooldown = CustomOptionHolder.vampireCooldown.getFloat(); - canKillNearGarlics = CustomOptionHolder.vampireCanKillNearGarlics.getBool(); - garlicButton = CustomOptionHolder.vampireGarlicButton.getBool(); + garlicsActive = CustomOptionHolder.vampireSpawnRate.GetSelection() > 0; + delay = CustomOptionHolder.vampireKillDelay.GetFloat(); + cooldown = CustomOptionHolder.vampireCooldown.GetFloat(); + canKillNearGarlics = CustomOptionHolder.vampireCanKillNearGarlics.GetBool(); + garlicButton = CustomOptionHolder.vampireGarlicButton.GetBool(); } } diff --git a/TheOtherRoles/Roles/Impostor/Warlock.cs b/TheOtherRoles/Roles/Impostor/Warlock.cs index cfdfb415..a7560cbf 100644 --- a/TheOtherRoles/Roles/Impostor/Warlock.cs +++ b/TheOtherRoles/Roles/Impostor/Warlock.cs @@ -24,8 +24,8 @@ public static void clearAndReload() currentTarget = null; curseVictim = null; curseVictimTarget = null; - cooldown = CustomOptionHolder.warlockCooldown.getFloat(); - rootTime = CustomOptionHolder.warlockRootTime.getFloat(); + cooldown = CustomOptionHolder.warlockCooldown.GetFloat(); + rootTime = CustomOptionHolder.warlockRootTime.GetFloat(); } public static void resetCurse() diff --git a/TheOtherRoles/Roles/Impostor/Witch.cs b/TheOtherRoles/Roles/Impostor/Witch.cs index 54d98010..6de71c89 100644 --- a/TheOtherRoles/Roles/Impostor/Witch.cs +++ b/TheOtherRoles/Roles/Impostor/Witch.cs @@ -28,12 +28,12 @@ public static void clearAndReload() witch = null; futureSpelled.Clear(); currentTarget = spellCastingTarget = null; - cooldown = CustomOptionHolder.witchCooldown.getFloat(); - cooldownAddition = CustomOptionHolder.witchAdditionalCooldown.getFloat(); + cooldown = CustomOptionHolder.witchCooldown.GetFloat(); + cooldownAddition = CustomOptionHolder.witchAdditionalCooldown.GetFloat(); currentCooldownAddition = 0f; - canSpellAnyone = CustomOptionHolder.witchCanSpellAnyone.getBool(); - spellCastingDuration = CustomOptionHolder.witchSpellCastingDuration.getFloat(); - triggerBothCooldowns = CustomOptionHolder.witchTriggerBothCooldowns.getBool(); - witchVoteSavesTargets = CustomOptionHolder.witchVoteSavesTargets.getBool(); + canSpellAnyone = CustomOptionHolder.witchCanSpellAnyone.GetBool(); + spellCastingDuration = CustomOptionHolder.witchSpellCastingDuration.GetFloat(); + triggerBothCooldowns = CustomOptionHolder.witchTriggerBothCooldowns.GetBool(); + witchVoteSavesTargets = CustomOptionHolder.witchVoteSavesTargets.GetBool(); } } diff --git a/TheOtherRoles/Roles/Impostor/Yoyo.cs b/TheOtherRoles/Roles/Impostor/Yoyo.cs index 65650dfe..3e39376e 100644 --- a/TheOtherRoles/Roles/Impostor/Yoyo.cs +++ b/TheOtherRoles/Roles/Impostor/Yoyo.cs @@ -28,12 +28,12 @@ public static void markLocation(Vector3 position) public static void clearAndReload() { yoyo = null; - blinkDuration = CustomOptionHolder.yoyoBlinkDuration.getFloat(); - markCooldown = CustomOptionHolder.yoyoMarkCooldown.getFloat(); - markStaysOverMeeting = CustomOptionHolder.yoyoMarkStaysOverMeeting.getBool(); - hasAdminTable = CustomOptionHolder.yoyoHasAdminTable.getBool(); - adminCooldown = CustomOptionHolder.yoyoAdminTableCooldown.getFloat(); - silhouetteVisibility = CustomOptionHolder.yoyoSilhouetteVisibility.getSelection() / 10f; + blinkDuration = CustomOptionHolder.yoyoBlinkDuration.GetFloat(); + markCooldown = CustomOptionHolder.yoyoMarkCooldown.GetFloat(); + markStaysOverMeeting = CustomOptionHolder.yoyoMarkStaysOverMeeting.GetBool(); + hasAdminTable = CustomOptionHolder.yoyoHasAdminTable.GetBool(); + adminCooldown = CustomOptionHolder.yoyoAdminTableCooldown.GetFloat(); + silhouetteVisibility = CustomOptionHolder.yoyoSilhouetteVisibility.GetSelection() / 10f; markedLocation = null; diff --git a/TheOtherRoles/Roles/Modifier/Assassin.cs b/TheOtherRoles/Roles/Modifier/Assassin.cs index fc4b9466..f16232c1 100644 --- a/TheOtherRoles/Roles/Modifier/Assassin.cs +++ b/TheOtherRoles/Roles/Modifier/Assassin.cs @@ -17,11 +17,11 @@ public class Assassin public static void clearAndReload() { assassin.Clear(); - remainingShotsEvilGuesser = Mathf.RoundToInt(CustomOptionHolder.modifierAssassinNumberOfShots.getFloat()); - assassinMultipleShotsPerMeeting = CustomOptionHolder.modifierAssassinMultipleShotsPerMeeting.getBool(); - assassinKillsThroughShield = CustomOptionHolder.modifierAssassinKillsThroughShield.getBool(); - evilGuesserCanGuessCrewmate = CustomOptionHolder.guesserEvilCanKillCrewmate.getBool(); - evilGuesserCanGuessSpy = CustomOptionHolder.guesserEvilCanKillSpy.getBool(); - guesserCantGuessSnitch = CustomOptionHolder.guesserCantGuessSnitchIfTaksDone.getBool(); + remainingShotsEvilGuesser = CustomOptionHolder.modifierAssassinNumberOfShots.GetInt(); + assassinMultipleShotsPerMeeting = CustomOptionHolder.modifierAssassinMultipleShotsPerMeeting.GetBool(); + assassinKillsThroughShield = CustomOptionHolder.modifierAssassinKillsThroughShield.GetBool(); + evilGuesserCanGuessCrewmate = CustomOptionHolder.guesserEvilCanKillCrewmate.GetBool(); + evilGuesserCanGuessSpy = CustomOptionHolder.guesserEvilCanKillSpy.GetBool(); + guesserCantGuessSnitch = CustomOptionHolder.guesserCantGuessSnitchIfTaksDone.GetBool(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Modifier/Bait.cs b/TheOtherRoles/Roles/Modifier/Bait.cs index 9ff456ef..c2d4b377 100644 --- a/TheOtherRoles/Roles/Modifier/Bait.cs +++ b/TheOtherRoles/Roles/Modifier/Bait.cs @@ -21,11 +21,11 @@ public static void clearAndReload() { bait.Clear(); active.Clear(); - reportDelayMin = CustomOptionHolder.modifierBaitReportDelayMin.getFloat(); - reportDelayMax = CustomOptionHolder.modifierBaitReportDelayMax.getFloat(); + reportDelayMin = CustomOptionHolder.modifierBaitReportDelayMin.GetFloat(); + reportDelayMax = CustomOptionHolder.modifierBaitReportDelayMax.GetFloat(); if (reportDelayMin > reportDelayMax) reportDelayMin = reportDelayMax; - showKillFlash = CustomOptionHolder.modifierBaitShowKillFlash.getBool(); - SwapCrewmate = CustomOptionHolder.modifierBaitSwapCrewmate.getBool(); + showKillFlash = CustomOptionHolder.modifierBaitShowKillFlash.GetBool(); + SwapCrewmate = CustomOptionHolder.modifierBaitSwapCrewmate.GetBool(); //SwapNeutral = CustomOptionHolder.modifierBaitSwapNeutral.getBool(); //SwapImpostor = CustomOptionHolder.modifierBaitSwapImpostor.getBool(); } diff --git a/TheOtherRoles/Roles/Modifier/Bloody.cs b/TheOtherRoles/Roles/Modifier/Bloody.cs index ae02f3bb..9d6c016f 100644 --- a/TheOtherRoles/Roles/Modifier/Bloody.cs +++ b/TheOtherRoles/Roles/Modifier/Bloody.cs @@ -15,6 +15,6 @@ public static void clearAndReload() bloody.Clear(); active.Clear(); bloodyKillerMap.Clear(); - duration = CustomOptionHolder.modifierBloodyDuration.getFloat(); + duration = CustomOptionHolder.modifierBloodyDuration.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Modifier/ButtonBarry.cs b/TheOtherRoles/Roles/Modifier/ButtonBarry.cs index c8e47e80..a183f78a 100644 --- a/TheOtherRoles/Roles/Modifier/ButtonBarry.cs +++ b/TheOtherRoles/Roles/Modifier/ButtonBarry.cs @@ -14,6 +14,6 @@ public static void clearAndReload() remoteMeetingsLeft = 1; //SabotageRemoteMeetings = false; - SabotageRemoteMeetings = CustomOptionHolder.modifierButtonSabotageRemoteMeetings.getBool(); + SabotageRemoteMeetings = CustomOptionHolder.modifierButtonSabotageRemoteMeetings.GetBool(); } } diff --git a/TheOtherRoles/Roles/Modifier/Chameleon.cs b/TheOtherRoles/Roles/Modifier/Chameleon.cs index 8f5779b2..a5905920 100644 --- a/TheOtherRoles/Roles/Modifier/Chameleon.cs +++ b/TheOtherRoles/Roles/Modifier/Chameleon.cs @@ -16,9 +16,9 @@ public static void clearAndReload() { chameleon.Clear(); lastMoved = new(); - holdDuration = CustomOptionHolder.modifierChameleonHoldDuration.getFloat(); - fadeDuration = CustomOptionHolder.modifierChameleonFadeDuration.getFloat(); - minVisibility = CustomOptionHolder.modifierChameleonMinVisibility.getSelection() / 10f; + holdDuration = CustomOptionHolder.modifierChameleonHoldDuration.GetFloat(); + fadeDuration = CustomOptionHolder.modifierChameleonFadeDuration.GetFloat(); + minVisibility = CustomOptionHolder.modifierChameleonMinVisibility.GetSelection() / 10f; } public static float visibility(byte playerId) diff --git a/TheOtherRoles/Roles/Modifier/Cursed.cs b/TheOtherRoles/Roles/Modifier/Cursed.cs index c043f081..8e2e5d0d 100644 --- a/TheOtherRoles/Roles/Modifier/Cursed.cs +++ b/TheOtherRoles/Roles/Modifier/Cursed.cs @@ -13,6 +13,6 @@ public static class Cursed public static void clearAndReload() { cursed = null; - hideModifier = CustomOptionHolder.modifierHideCursed.getBool(); + hideModifier = CustomOptionHolder.modifierHideCursed.GetBool(); } } diff --git a/TheOtherRoles/Roles/Modifier/Disperser.cs b/TheOtherRoles/Roles/Modifier/Disperser.cs index 706283a4..ead4b5f1 100644 --- a/TheOtherRoles/Roles/Modifier/Disperser.cs +++ b/TheOtherRoles/Roles/Modifier/Disperser.cs @@ -15,6 +15,6 @@ public static void clearAndReload() disperser = null; remainingDisperses = 1; //remainingDisperses = CustomOptionHolder.modifierDisperserRemainingDisperses.GetInt(); - DispersesToVent = CustomOptionHolder.modifierDisperserDispersesToVent.getBool(); + DispersesToVent = CustomOptionHolder.modifierDisperserDispersesToVent.GetBool(); } } diff --git a/TheOtherRoles/Roles/Modifier/Flash.cs b/TheOtherRoles/Roles/Modifier/Flash.cs index ebc7b55e..52ebf632 100644 --- a/TheOtherRoles/Roles/Modifier/Flash.cs +++ b/TheOtherRoles/Roles/Modifier/Flash.cs @@ -10,6 +10,6 @@ public static class Flash public static void clearAndReload() { flash.Clear(); - speed = CustomOptionHolder.modifierFlashSpeed.getFloat(); + speed = CustomOptionHolder.modifierFlashSpeed.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Modifier/Giant.cs b/TheOtherRoles/Roles/Modifier/Giant.cs index 49262045..491f70f7 100644 --- a/TheOtherRoles/Roles/Modifier/Giant.cs +++ b/TheOtherRoles/Roles/Modifier/Giant.cs @@ -9,6 +9,6 @@ public static class Giant public static void clearAndReload() { giant = null; - speed = CustomOptionHolder.modifierGiantSpped.getFloat(); + speed = CustomOptionHolder.modifierGiantSpped.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Modifier/Invert.cs b/TheOtherRoles/Roles/Modifier/Invert.cs index 4b94898e..41a8477f 100644 --- a/TheOtherRoles/Roles/Modifier/Invert.cs +++ b/TheOtherRoles/Roles/Modifier/Invert.cs @@ -10,6 +10,6 @@ public static class Invert public static void clearAndReload() { invert.Clear(); - meetings = (int)CustomOptionHolder.modifierInvertDuration.getFloat(); + meetings = (int)CustomOptionHolder.modifierInvertDuration.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Modifier/LastImpostor.cs b/TheOtherRoles/Roles/Modifier/LastImpostor.cs index e9f3e1c3..0847a0c7 100644 --- a/TheOtherRoles/Roles/Modifier/LastImpostor.cs +++ b/TheOtherRoles/Roles/Modifier/LastImpostor.cs @@ -33,7 +33,7 @@ public static void promoteToLastImpostor() public static void clearAndReload() { lastImpostor = null; - deduce = CustomOptionHolder.modifierLastImpostorDeduce.getFloat(); - isEnable = CustomOptionHolder.modifierLastImpostor.getBool(); + deduce = CustomOptionHolder.modifierLastImpostorDeduce.GetFloat(); + isEnable = CustomOptionHolder.modifierLastImpostor.GetBool(); } } diff --git a/TheOtherRoles/Roles/Modifier/Lovers.cs b/TheOtherRoles/Roles/Modifier/Lovers.cs index e0357aff..0876b6dd 100644 --- a/TheOtherRoles/Roles/Modifier/Lovers.cs +++ b/TheOtherRoles/Roles/Modifier/Lovers.cs @@ -56,8 +56,8 @@ public static void clearAndReload() lover1 = null; lover2 = null; notAckedExiledIsLover = false; - bothDie = CustomOptionHolder.modifierLoverBothDie.getBool(); - enableChat = CustomOptionHolder.modifierLoverEnableChat.getBool(); + bothDie = CustomOptionHolder.modifierLoverBothDie.GetBool(); + enableChat = CustomOptionHolder.modifierLoverEnableChat.GetBool(); } public static PlayerControl getPartner(this PlayerControl player) diff --git a/TheOtherRoles/Roles/Modifier/Mini.cs b/TheOtherRoles/Roles/Modifier/Mini.cs index 8a267363..654a2766 100644 --- a/TheOtherRoles/Roles/Modifier/Mini.cs +++ b/TheOtherRoles/Roles/Modifier/Mini.cs @@ -21,8 +21,8 @@ public static void clearAndReload() { mini = null; triggerMiniLose = false; - growingUpDuration = CustomOptionHolder.modifierMiniGrowingUpDuration.getFloat(); - isGrowingUpInMeeting = CustomOptionHolder.modifierMiniGrowingUpInMeeting.getBool(); + growingUpDuration = CustomOptionHolder.modifierMiniGrowingUpDuration.GetFloat(); + isGrowingUpInMeeting = CustomOptionHolder.modifierMiniGrowingUpInMeeting.GetBool(); timeOfGrowthStart = DateTime.UtcNow; } diff --git a/TheOtherRoles/Roles/Modifier/Shifter.cs b/TheOtherRoles/Roles/Modifier/Shifter.cs index 84ccfdc2..0c37d246 100644 --- a/TheOtherRoles/Roles/Modifier/Shifter.cs +++ b/TheOtherRoles/Roles/Modifier/Shifter.cs @@ -261,7 +261,7 @@ public static void clearAndReload() shifter = null; futureShift = null; currentTarget = null; - shiftNeutral = CustomOptionHolder.modifierShiftNeutral.getBool(); - shiftALLNeutra = CustomOptionHolder.modifierShiftALLNeutral.getBool(); + shiftNeutral = CustomOptionHolder.modifierShiftNeutral.GetBool(); + shiftALLNeutra = CustomOptionHolder.modifierShiftALLNeutral.GetBool(); } } \ No newline at end of file diff --git a/TheOtherRoles/Roles/Modifier/Sunglasses.cs b/TheOtherRoles/Roles/Modifier/Sunglasses.cs index 8bef3f49..b44e16de 100644 --- a/TheOtherRoles/Roles/Modifier/Sunglasses.cs +++ b/TheOtherRoles/Roles/Modifier/Sunglasses.cs @@ -10,6 +10,6 @@ public static class Sunglasses public static void clearAndReload() { sunglasses.Clear(); - vision = CustomOptionHolder.modifierSunglassesVision.getSelection() + 1; + vision = CustomOptionHolder.modifierSunglassesVision.GetSelection() + 1; } } diff --git a/TheOtherRoles/Roles/Modifier/Torch.cs b/TheOtherRoles/Roles/Modifier/Torch.cs index 3371676f..56edeff5 100644 --- a/TheOtherRoles/Roles/Modifier/Torch.cs +++ b/TheOtherRoles/Roles/Modifier/Torch.cs @@ -10,6 +10,6 @@ public static class Torch public static void clearAndReload() { torch.Clear(); - vision = CustomOptionHolder.modifierTorchVision.getFloat(); + vision = CustomOptionHolder.modifierTorchVision.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Modifier/Vip.cs b/TheOtherRoles/Roles/Modifier/Vip.cs index 09eda7eb..d39fa64f 100644 --- a/TheOtherRoles/Roles/Modifier/Vip.cs +++ b/TheOtherRoles/Roles/Modifier/Vip.cs @@ -10,6 +10,6 @@ public static class Vip public static void clearAndReload() { vip.Clear(); - showColor = CustomOptionHolder.modifierVipShowColor.getBool(); + showColor = CustomOptionHolder.modifierVipShowColor.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Akujo.cs b/TheOtherRoles/Roles/Neutral/Akujo.cs index d15a3b8b..b9734cf0 100644 --- a/TheOtherRoles/Roles/Neutral/Akujo.cs +++ b/TheOtherRoles/Roles/Neutral/Akujo.cs @@ -51,13 +51,13 @@ public static void clearAndReload() keeps.Clear(); currentTarget = null; startTime = DateTime.UtcNow; - timeLimit = CustomOptionHolder.akujoTimeLimit.getFloat(); - forceKeeps = CustomOptionHolder.akujoForceKeeps.getBool(); - knowsRoles = CustomOptionHolder.akujoKnowsRoles.getBool(); - honmeiCannotFollowWin = CustomOptionHolder.akujoHonmeiCannotFollowWin.getBool(); - honmeiOptimizeWin = CustomOptionHolder.akujoHonmeiOptimizeWin.getBool(); + timeLimit = CustomOptionHolder.akujoTimeLimit.GetFloat(); + forceKeeps = CustomOptionHolder.akujoForceKeeps.GetBool(); + knowsRoles = CustomOptionHolder.akujoKnowsRoles.GetBool(); + honmeiCannotFollowWin = CustomOptionHolder.akujoHonmeiCannotFollowWin.GetBool(); + honmeiOptimizeWin = CustomOptionHolder.akujoHonmeiOptimizeWin.GetBool(); timeLeft = (int)Math.Ceiling(timeLimit - (DateTime.UtcNow - startTime).TotalSeconds); - numKeeps = Math.Min((int)CustomOptionHolder.akujoNumKeeps.getFloat(), PlayerControl.AllPlayerControls.Count - 2); + numKeeps = Math.Min(CustomOptionHolder.akujoNumKeeps.GetInt(), PlayerControl.AllPlayerControls.Count - 2); keepsLeft = numKeeps; } } diff --git a/TheOtherRoles/Roles/Neutral/Amnisiac.cs b/TheOtherRoles/Roles/Neutral/Amnisiac.cs index 629e46ec..c8d646a8 100644 --- a/TheOtherRoles/Roles/Neutral/Amnisiac.cs +++ b/TheOtherRoles/Roles/Neutral/Amnisiac.cs @@ -20,8 +20,8 @@ public class Amnisiac public static void clearAndReload() { amnisiac = null; - showArrows = CustomOptionHolder.amnisiacShowArrows.getBool(); - resetRole = CustomOptionHolder.amnisiacResetRole.getBool(); + showArrows = CustomOptionHolder.amnisiacShowArrows.GetBool(); + resetRole = CustomOptionHolder.amnisiacResetRole.GetBool(); if (localArrows != null) foreach (var arrow in localArrows) if (arrow?.arrow != null) diff --git a/TheOtherRoles/Roles/Neutral/Arsonist.cs b/TheOtherRoles/Roles/Neutral/Arsonist.cs index be2c74e5..16ac2894 100644 --- a/TheOtherRoles/Roles/Neutral/Arsonist.cs +++ b/TheOtherRoles/Roles/Neutral/Arsonist.cs @@ -43,8 +43,8 @@ public static void clearAndReload() if (p != null && p.gameObject != null) p.gameObject.SetActive(false); - cooldown = CustomOptionHolder.arsonistCooldown.getFloat(); - duration = CustomOptionHolder.arsonistDuration.getFloat(); - igniteCooldownRemoved = CustomOptionHolder.arsonistIgniteCdRemoved.getBool(); + cooldown = CustomOptionHolder.arsonistCooldown.GetFloat(); + duration = CustomOptionHolder.arsonistDuration.GetFloat(); + igniteCooldownRemoved = CustomOptionHolder.arsonistIgniteCdRemoved.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Doomsayer.cs b/TheOtherRoles/Roles/Neutral/Doomsayer.cs index 67ad0499..ff73919e 100644 --- a/TheOtherRoles/Roles/Neutral/Doomsayer.cs +++ b/TheOtherRoles/Roles/Neutral/Doomsayer.cs @@ -82,12 +82,12 @@ public static void clearAndReload() killedToWin = 0; canGuess = true; triggerDoomsayerrWin = false; - cooldown = CustomOptionHolder.doomsayerCooldown.getFloat(); - hasMultipleShotsPerMeeting = CustomOptionHolder.doomsayerHasMultipleShotsPerMeeting.getBool(); - canGuessNeutral = CustomOptionHolder.doomsayerCanGuessNeutral.getBool(); - canGuessImpostor = CustomOptionHolder.doomsayerCanGuessImpostor.getBool(); + cooldown = CustomOptionHolder.doomsayerCooldown.GetFloat(); + hasMultipleShotsPerMeeting = CustomOptionHolder.doomsayerHasMultipleShotsPerMeeting.GetBool(); + canGuessNeutral = CustomOptionHolder.doomsayerCanGuessNeutral.GetBool(); + canGuessImpostor = CustomOptionHolder.doomsayerCanGuessImpostor.GetBool(); formationNum = CustomOptionHolder.doomsayerDormationNum.GetInt(); - killToWin = CustomOptionHolder.doomsayerKillToWin.getFloat(); - onlineTarger = CustomOptionHolder.doomsayerOnlineTarger.getBool(); + killToWin = CustomOptionHolder.doomsayerKillToWin.GetFloat(); + onlineTarger = CustomOptionHolder.doomsayerOnlineTarger.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Executioner.cs b/TheOtherRoles/Roles/Neutral/Executioner.cs index 4225a179..9f8c9343 100644 --- a/TheOtherRoles/Roles/Neutral/Executioner.cs +++ b/TheOtherRoles/Roles/Neutral/Executioner.cs @@ -30,8 +30,8 @@ public static void clearAndReload(bool clearTarget = true) } executioner = null; triggerExecutionerWin = false; - promotesToLawyer = CustomOptionHolder.executionerPromotesToLawyer.getBool(); - canCallEmergency = CustomOptionHolder.executionerCanCallEmergency.getBool(); + promotesToLawyer = CustomOptionHolder.executionerPromotesToLawyer.GetBool(); + canCallEmergency = CustomOptionHolder.executionerCanCallEmergency.GetBool(); //role = (targetDeadBecame)CustomOptionHolder.executionerOnTargetDead.getSelection(); } } diff --git a/TheOtherRoles/Roles/Neutral/Jackal.cs b/TheOtherRoles/Roles/Neutral/Jackal.cs index 9ccb1c7d..50de8072 100644 --- a/TheOtherRoles/Roles/Neutral/Jackal.cs +++ b/TheOtherRoles/Roles/Neutral/Jackal.cs @@ -51,18 +51,18 @@ public static void clearAndReload() formerJackals.Clear(); currentTarget = null; isInvisable = false; - cooldown = CustomOptionHolder.jackalKillCooldown.getFloat(); - swoopCooldown = CustomOptionHolder.jackalSwooperCooldown.getFloat(); - duration = CustomOptionHolder.jackalSwooperDuration.getFloat(); - createSidekickCooldown = CustomOptionHolder.jackalCreateSidekickCooldown.getFloat(); - canUseVents = CustomOptionHolder.jackalCanUseVents.getBool(); - canSabotage = CustomOptionHolder.jackalCanUseSabo.getBool(); - CanImpostorFindSidekick = CustomOptionHolder.jackalCanImpostorFindSidekick.getBool(); - canCreateSidekick = CustomOptionHolder.jackalCanCreateSidekick.getBool(); - jackalPromotedFromSidekickCanCreateSidekick = CustomOptionHolder.jackalPromotedFromSidekickCanCreateSidekick.getBool(); - hasImpostorVision = CustomOptionHolder.jackalAndSidekickHaveImpostorVision.getBool(); - killFakeImpostor = CustomOptionHolder.jackalkillFakeImpostor.getBool(); + cooldown = CustomOptionHolder.jackalKillCooldown.GetFloat(); + swoopCooldown = CustomOptionHolder.jackalSwooperCooldown.GetFloat(); + duration = CustomOptionHolder.jackalSwooperDuration.GetFloat(); + createSidekickCooldown = CustomOptionHolder.jackalCreateSidekickCooldown.GetFloat(); + canUseVents = CustomOptionHolder.jackalCanUseVents.GetBool(); + canSabotage = CustomOptionHolder.jackalCanUseSabo.GetBool(); + CanImpostorFindSidekick = CustomOptionHolder.jackalCanImpostorFindSidekick.GetBool(); + canCreateSidekick = CustomOptionHolder.jackalCanCreateSidekick.GetBool(); + jackalPromotedFromSidekickCanCreateSidekick = CustomOptionHolder.jackalPromotedFromSidekickCanCreateSidekick.GetBool(); + hasImpostorVision = CustomOptionHolder.jackalAndSidekickHaveImpostorVision.GetBool(); + killFakeImpostor = CustomOptionHolder.jackalkillFakeImpostor.GetBool(); wasTeamRed = wasImpostor = wasSpy = false; - chanceSwoop = CustomOptionHolder.jackalChanceSwoop.getSelection() / 10f; + chanceSwoop = CustomOptionHolder.jackalChanceSwoop.GetSelection() / 10f; } } diff --git a/TheOtherRoles/Roles/Neutral/Jester.cs b/TheOtherRoles/Roles/Neutral/Jester.cs index 683b718d..2b53e8b0 100644 --- a/TheOtherRoles/Roles/Neutral/Jester.cs +++ b/TheOtherRoles/Roles/Neutral/Jester.cs @@ -16,8 +16,8 @@ public static void clearAndReload() { jester = null; triggerJesterWin = false; - canCallEmergency = CustomOptionHolder.jesterCanCallEmergency.getBool(); - canUseVents = CustomOptionHolder.jesterCanVent.getBool(); - hasImpostorVision = CustomOptionHolder.jesterHasImpostorVision.getBool(); + canCallEmergency = CustomOptionHolder.jesterCanCallEmergency.GetBool(); + canUseVents = CustomOptionHolder.jesterCanVent.GetBool(); + hasImpostorVision = CustomOptionHolder.jesterHasImpostorVision.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Juggernaut.cs b/TheOtherRoles/Roles/Neutral/Juggernaut.cs index 137c0c8d..94710fa8 100644 --- a/TheOtherRoles/Roles/Neutral/Juggernaut.cs +++ b/TheOtherRoles/Roles/Neutral/Juggernaut.cs @@ -17,9 +17,9 @@ public static void clearAndReload() { juggernaut = null; currentTarget = null; - hasImpostorVision = CustomOptionHolder.juggernautHasImpVision.getBool(); - canUseVents = CustomOptionHolder.juggernautCanUseVents.getBool(); - cooldown = CustomOptionHolder.juggernautCooldown.getFloat(); - reducedkill = CustomOptionHolder.juggernautReducedkillEach.getFloat(); + hasImpostorVision = CustomOptionHolder.juggernautHasImpVision.GetBool(); + canUseVents = CustomOptionHolder.juggernautCanUseVents.GetBool(); + cooldown = CustomOptionHolder.juggernautCooldown.GetFloat(); + reducedkill = CustomOptionHolder.juggernautReducedkillEach.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Neutral/Lawyer.cs b/TheOtherRoles/Roles/Neutral/Lawyer.cs index 44a6a5a3..f5e2e13b 100644 --- a/TheOtherRoles/Roles/Neutral/Lawyer.cs +++ b/TheOtherRoles/Roles/Neutral/Lawyer.cs @@ -26,11 +26,11 @@ public static void clearAndReload(bool clearTarget = true) targetWasGuessed = false; } - vision = CustomOptionHolder.lawyerVision.getFloat(); - targetKnows = CustomOptionHolder.lawyerTargetKnows.getBool(); - lawyerKnowsRole = CustomOptionHolder.lawyerKnowsRole.getBool(); - targetCanBeJester = CustomOptionHolder.lawyerTargetCanBeJester.getBool(); - stolenWin = CustomOptionHolder.lawyerStolenWin.getBool(); - canCallEmergency = CustomOptionHolder.lawyerCanCallEmergency.getBool(); + vision = CustomOptionHolder.lawyerVision.GetFloat(); + targetKnows = CustomOptionHolder.lawyerTargetKnows.GetBool(); + lawyerKnowsRole = CustomOptionHolder.lawyerKnowsRole.GetBool(); + targetCanBeJester = CustomOptionHolder.lawyerTargetCanBeJester.GetBool(); + stolenWin = CustomOptionHolder.lawyerStolenWin.GetBool(); + canCallEmergency = CustomOptionHolder.lawyerCanCallEmergency.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/PartTimer.cs b/TheOtherRoles/Roles/Neutral/PartTimer.cs index 78b6fa6b..f98445a0 100644 --- a/TheOtherRoles/Roles/Neutral/PartTimer.cs +++ b/TheOtherRoles/Roles/Neutral/PartTimer.cs @@ -21,8 +21,8 @@ public static void clearAndReload() partTimer = null; currentTarget = null; target = null; - cooldown = CustomOptionHolder.partTimerCooldown.getFloat(); + cooldown = CustomOptionHolder.partTimerCooldown.GetFloat(); deathTurn = DeathDefaultTurn = CustomOptionHolder.partTimerDeathTurn.GetInt(); - knowsRole = CustomOptionHolder.partTimerKnowsRole.getBool(); + knowsRole = CustomOptionHolder.partTimerKnowsRole.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Pavlovsdogs.cs b/TheOtherRoles/Roles/Neutral/Pavlovsdogs.cs index c2914958..eb266fa9 100644 --- a/TheOtherRoles/Roles/Neutral/Pavlovsdogs.cs +++ b/TheOtherRoles/Roles/Neutral/Pavlovsdogs.cs @@ -47,14 +47,14 @@ public static void clearAndReload() killTarget = null; deathTime = CustomOptionHolder.pavlovsownerRampageDeathTime.GetInt(); - cooldown = CustomOptionHolder.pavlovsownerKillCooldown.getFloat(); - createDogCooldown = CustomOptionHolder.pavlovsownerCreateDogCooldown.getFloat(); + cooldown = CustomOptionHolder.pavlovsownerKillCooldown.GetFloat(); + createDogCooldown = CustomOptionHolder.pavlovsownerCreateDogCooldown.GetFloat(); createDogNum = CustomOptionHolder.pavlovsownerCreateDogNum.GetInt(); - canUseVents = CustomOptionHolder.pavlovsownerCanUseVents.getSelection(); - canSabotage = CustomOptionHolder.pavlovsownerCanUseSabo.getBool(); - hasImpostorVision = CustomOptionHolder.pavlovsownerHasImpostorVision.getBool(); - enableRampage = CustomOptionHolder.pavlovsownerRampage.getBool(); - rampageKillCooldown = CustomOptionHolder.pavlovsownerRampageKillCooldown.getFloat(); + canUseVents = CustomOptionHolder.pavlovsownerCanUseVents.GetSelection(); + canSabotage = CustomOptionHolder.pavlovsownerCanUseSabo.GetBool(); + hasImpostorVision = CustomOptionHolder.pavlovsownerHasImpostorVision.GetBool(); + enableRampage = CustomOptionHolder.pavlovsownerRampage.GetBool(); + rampageKillCooldown = CustomOptionHolder.pavlovsownerRampageKillCooldown.GetFloat(); rampageDeathTime = CustomOptionHolder.pavlovsownerRampageDeathTime.GetInt(); } } diff --git a/TheOtherRoles/Roles/Neutral/Pursuer.cs b/TheOtherRoles/Roles/Neutral/Pursuer.cs index 8efe46d1..72a4b2bf 100644 --- a/TheOtherRoles/Roles/Neutral/Pursuer.cs +++ b/TheOtherRoles/Roles/Neutral/Pursuer.cs @@ -24,7 +24,7 @@ public static void clearAndReload() blankedList.Clear(); blanks = 0; - cooldown = CustomOptionHolder.pursuerBlanksCooldown.getFloat(); - blanksNumber = Mathf.RoundToInt(CustomOptionHolder.pursuerBlanksNumber.getFloat()); + cooldown = CustomOptionHolder.pursuerBlanksCooldown.GetFloat(); + blanksNumber = CustomOptionHolder.pursuerBlanksNumber.GetInt(); } } diff --git a/TheOtherRoles/Roles/Neutral/Sidekick.cs b/TheOtherRoles/Roles/Neutral/Sidekick.cs index c65616c5..9e1eb489 100644 --- a/TheOtherRoles/Roles/Neutral/Sidekick.cs +++ b/TheOtherRoles/Roles/Neutral/Sidekick.cs @@ -23,11 +23,11 @@ public static void clearAndReload() { sidekick = null; currentTarget = null; - cooldown = CustomOptionHolder.jackalKillCooldown.getFloat(); - canUseVents = CustomOptionHolder.sidekickCanUseVents.getBool(); - canKill = CustomOptionHolder.sidekickCanKill.getBool(); - promotesToJackal = CustomOptionHolder.sidekickPromotesToJackal.getBool(); - hasImpostorVision = CustomOptionHolder.jackalAndSidekickHaveImpostorVision.getBool(); + cooldown = CustomOptionHolder.jackalKillCooldown.GetFloat(); + canUseVents = CustomOptionHolder.sidekickCanUseVents.GetBool(); + canKill = CustomOptionHolder.sidekickCanKill.GetBool(); + promotesToJackal = CustomOptionHolder.sidekickPromotesToJackal.GetBool(); + hasImpostorVision = CustomOptionHolder.jackalAndSidekickHaveImpostorVision.GetBool(); wasTeamRed = wasImpostor = wasSpy = false; } } diff --git a/TheOtherRoles/Roles/Neutral/Survivor.cs b/TheOtherRoles/Roles/Neutral/Survivor.cs index 9ad8416b..9a218827 100644 --- a/TheOtherRoles/Roles/Neutral/Survivor.cs +++ b/TheOtherRoles/Roles/Neutral/Survivor.cs @@ -34,13 +34,13 @@ public static void clearAndReload() vestActive = false; blanksUsed = 0; vestUsed = 0; - vestEnable = CustomOptionHolder.survivorVestEnable.getBool(); + vestEnable = CustomOptionHolder.survivorVestEnable.GetBool(); vestNumber = CustomOptionHolder.survivorVestNumber.GetInt(); - vestCooldown = CustomOptionHolder.survivorVestCooldown.getFloat(); - vestDuration = CustomOptionHolder.survivorVestDuration.getFloat(); - vestResetCooldown = CustomOptionHolder.survivorVestResetCooldown.getFloat(); - blanksEnable = CustomOptionHolder.survivorBlanksEnable.getBool(); + vestCooldown = CustomOptionHolder.survivorVestCooldown.GetFloat(); + vestDuration = CustomOptionHolder.survivorVestDuration.GetFloat(); + vestResetCooldown = CustomOptionHolder.survivorVestResetCooldown.GetFloat(); + blanksEnable = CustomOptionHolder.survivorBlanksEnable.GetBool(); blanksNumber = CustomOptionHolder.survivorBlanksNumber.GetInt(); - blanksCooldown = CustomOptionHolder.survivorBlanksCooldown.getFloat(); + blanksCooldown = CustomOptionHolder.survivorBlanksCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/Neutral/Swooper.cs b/TheOtherRoles/Roles/Neutral/Swooper.cs index cf9554da..be40a55f 100644 --- a/TheOtherRoles/Roles/Neutral/Swooper.cs +++ b/TheOtherRoles/Roles/Neutral/Swooper.cs @@ -22,11 +22,11 @@ public static void clearAndReload() { swooper = null; isInvisable = false; - cooldown = CustomOptionHolder.swooperKillCooldown.getFloat(); - swoopCooldown = CustomOptionHolder.swooperCooldown.getFloat(); - duration = CustomOptionHolder.swooperDuration.getFloat(); - hasImpVision = CustomOptionHolder.swooperHasImpVision.getBool(); - swoopSpeed = CustomOptionHolder.swooperSpeed.getFloat(); - canUseVents = CustomOptionHolder.swooperCanUseVents.getBool(); + cooldown = CustomOptionHolder.swooperKillCooldown.GetFloat(); + swoopCooldown = CustomOptionHolder.swooperCooldown.GetFloat(); + duration = CustomOptionHolder.swooperDuration.GetFloat(); + hasImpVision = CustomOptionHolder.swooperHasImpVision.GetBool(); + swoopSpeed = CustomOptionHolder.swooperSpeed.GetFloat(); + canUseVents = CustomOptionHolder.swooperCanUseVents.GetBool(); } } diff --git a/TheOtherRoles/Roles/Neutral/Thief.cs b/TheOtherRoles/Roles/Neutral/Thief.cs index 8cff5391..7c503e9a 100644 --- a/TheOtherRoles/Roles/Neutral/Thief.cs +++ b/TheOtherRoles/Roles/Neutral/Thief.cs @@ -27,13 +27,13 @@ public static void clearAndReload() suicideFlag = false; currentTarget = null; formerThief = null; - hasImpostorVision = CustomOptionHolder.thiefHasImpVision.getBool(); - cooldown = CustomOptionHolder.thiefCooldown.getFloat(); - canUseVents = CustomOptionHolder.thiefCanUseVents.getBool(); - canKillSheriff = CustomOptionHolder.thiefCanKillSheriff.getBool(); - canKillDeputy = CustomOptionHolder.thiefCanKillDeputy.getBool(); - canKillVeteran = CustomOptionHolder.thiefCanKillVeteran.getBool(); - canStealWithGuess = CustomOptionHolder.thiefCanStealWithGuess.getBool(); + hasImpostorVision = CustomOptionHolder.thiefHasImpVision.GetBool(); + cooldown = CustomOptionHolder.thiefCooldown.GetFloat(); + canUseVents = CustomOptionHolder.thiefCanUseVents.GetBool(); + canKillSheriff = CustomOptionHolder.thiefCanKillSheriff.GetBool(); + canKillDeputy = CustomOptionHolder.thiefCanKillDeputy.GetBool(); + canKillVeteran = CustomOptionHolder.thiefCanKillVeteran.GetBool(); + canStealWithGuess = CustomOptionHolder.thiefCanStealWithGuess.GetBool(); } public static bool tiefCanKill(PlayerControl target, PlayerControl killer) diff --git a/TheOtherRoles/Roles/Neutral/Vulture.cs b/TheOtherRoles/Roles/Neutral/Vulture.cs index 0b51a483..96336c4f 100644 --- a/TheOtherRoles/Roles/Neutral/Vulture.cs +++ b/TheOtherRoles/Roles/Neutral/Vulture.cs @@ -21,12 +21,12 @@ public static class Vulture public static void clearAndReload() { vulture = null; - vultureNumberToWin = Mathf.RoundToInt(CustomOptionHolder.vultureNumberToWin.getFloat()); + vultureNumberToWin = CustomOptionHolder.vultureNumberToWin.GetInt(); eatenBodies = 0; - cooldown = CustomOptionHolder.vultureCooldown.getFloat(); + cooldown = CustomOptionHolder.vultureCooldown.GetFloat(); triggerVultureWin = false; - canUseVents = CustomOptionHolder.vultureCanUseVents.getBool(); - showArrows = CustomOptionHolder.vultureShowArrows.getBool(); + canUseVents = CustomOptionHolder.vultureCanUseVents.GetBool(); + showArrows = CustomOptionHolder.vultureShowArrows.GetBool(); if (localArrows != null) foreach (var arrow in localArrows) if (arrow?.arrow != null) diff --git a/TheOtherRoles/Roles/Neutral/Werewolf.cs b/TheOtherRoles/Roles/Neutral/Werewolf.cs index 871cc3fb..a8c2a259 100644 --- a/TheOtherRoles/Roles/Neutral/Werewolf.cs +++ b/TheOtherRoles/Roles/Neutral/Werewolf.cs @@ -24,8 +24,8 @@ public static void clearAndReload() canUseVents = false; canKill = false; hasImpostorVision = false; - rampageCooldown = CustomOptionHolder.werewolfRampageCooldown.getFloat(); - rampageDuration = CustomOptionHolder.werewolfRampageDuration.getFloat(); - killCooldown = CustomOptionHolder.werewolfKillCooldown.getFloat(); + rampageCooldown = CustomOptionHolder.werewolfRampageCooldown.GetFloat(); + rampageDuration = CustomOptionHolder.werewolfRampageDuration.GetFloat(); + killCooldown = CustomOptionHolder.werewolfKillCooldown.GetFloat(); } } diff --git a/TheOtherRoles/Roles/RoleHelpers.cs b/TheOtherRoles/Roles/RoleHelpers.cs index 49dbfba8..5fef0c19 100644 --- a/TheOtherRoles/Roles/RoleHelpers.cs +++ b/TheOtherRoles/Roles/RoleHelpers.cs @@ -41,7 +41,7 @@ public static void blockRole() blockedRolePairings.Add((byte)RoleId.Witch, [(byte)RoleId.Warlock]); blockedRolePairings.Add((byte)RoleId.Warlock, [(byte)RoleId.Vampire]); - if (CustomOptionHolder.pavlovsownerAndJackalAsWell.getBool()) + if (CustomOptionHolder.pavlovsownerAndJackalAsWell.GetBool()) { blockedRolePairings.Add((byte)RoleId.Jackal, [(byte)RoleId.Pavlovsowner]); blockedRolePairings.Add((byte)RoleId.Pavlovsowner, [(byte)RoleId.Jackal]); @@ -66,103 +66,103 @@ public static void ResetRoleSelection() RoleIsEnable.Clear(); RoleIsEnable.AddRange(new() { - { RoleId.Sheriff, CustomOptionHolder.sheriffSpawnRate.getSelection() }, - { RoleId.Deputy, CustomOptionHolder.deputySpawnRate.getSelection() }, - { RoleId.BodyGuard, CustomOptionHolder.bodyGuardSpawnRate.getSelection() }, - { RoleId.Balancer, CustomOptionHolder.balancerSpawnRate.getSelection() }, - { RoleId.Detective, CustomOptionHolder.detectiveSpawnRate.getSelection() }, - { RoleId.Engineer, CustomOptionHolder.engineerSpawnRate.getSelection() }, - { RoleId.Hacker, CustomOptionHolder.hackerSpawnRate.getSelection() }, - { RoleId.InfoSleuth, CustomOptionHolder.infoSleuthSpawnRate.getSelection() }, - { RoleId.Jumper, CustomOptionHolder.jumperSpawnRate.getSelection() }, - { RoleId.Mayor, CustomOptionHolder.mayorSpawnRate.getSelection() }, - { RoleId.Medic, CustomOptionHolder.medicSpawnRate.getSelection() }, - { RoleId.Medium, CustomOptionHolder.mediumSpawnRate.getSelection() }, - { RoleId.Portalmaker, CustomOptionHolder.portalmakerSpawnRate.getSelection() }, - { RoleId.Prophet, CustomOptionHolder.prophetSpawnRate.getSelection() }, - { RoleId.Prosecutor, CustomOptionHolder.prosecutorSpawnRate.getSelection() }, - { RoleId.SecurityGuard, CustomOptionHolder.securityGuardSpawnRate.getSelection() }, - { RoleId.Seer, CustomOptionHolder.seerSpawnRate.getSelection() }, - { RoleId.Snitch, CustomOptionHolder.snitchSpawnRate.getSelection() }, - { RoleId.Spy, CustomOptionHolder.spySpawnRate.getSelection() }, - { RoleId.Swapper, CustomOptionHolder.swapperSpawnRate.getSelection() }, - { RoleId.TimeMaster, CustomOptionHolder.timeMasterSpawnRate.getSelection() }, - { RoleId.Tracker, CustomOptionHolder.trackerSpawnRate.getSelection() }, - { RoleId.Trapper, CustomOptionHolder.trapperSpawnRate.getSelection() }, - { RoleId.Veteran, CustomOptionHolder.veteranSpawnRate.getSelection() }, - { RoleId.Vigilante, CustomOptionHolder.guesserSpawnRate.getSelection() }, + { RoleId.Sheriff, CustomOptionHolder.sheriffSpawnRate.GetSelection() }, + { RoleId.Deputy, CustomOptionHolder.deputySpawnRate.GetSelection() }, + { RoleId.BodyGuard, CustomOptionHolder.bodyGuardSpawnRate.GetSelection() }, + { RoleId.Balancer, CustomOptionHolder.balancerSpawnRate.GetSelection() }, + { RoleId.Detective, CustomOptionHolder.detectiveSpawnRate.GetSelection() }, + { RoleId.Engineer, CustomOptionHolder.engineerSpawnRate.GetSelection() }, + { RoleId.Hacker, CustomOptionHolder.hackerSpawnRate.GetSelection() }, + { RoleId.InfoSleuth, CustomOptionHolder.infoSleuthSpawnRate.GetSelection() }, + { RoleId.Jumper, CustomOptionHolder.jumperSpawnRate.GetSelection() }, + { RoleId.Mayor, CustomOptionHolder.mayorSpawnRate.GetSelection() }, + { RoleId.Medic, CustomOptionHolder.medicSpawnRate.GetSelection() }, + { RoleId.Medium, CustomOptionHolder.mediumSpawnRate.GetSelection() }, + { RoleId.Portalmaker, CustomOptionHolder.portalmakerSpawnRate.GetSelection() }, + { RoleId.Prophet, CustomOptionHolder.prophetSpawnRate.GetSelection() }, + { RoleId.Prosecutor, CustomOptionHolder.prosecutorSpawnRate.GetSelection() }, + { RoleId.SecurityGuard, CustomOptionHolder.securityGuardSpawnRate.GetSelection() }, + { RoleId.Seer, CustomOptionHolder.seerSpawnRate.GetSelection() }, + { RoleId.Snitch, CustomOptionHolder.snitchSpawnRate.GetSelection() }, + { RoleId.Spy, CustomOptionHolder.spySpawnRate.GetSelection() }, + { RoleId.Swapper, CustomOptionHolder.swapperSpawnRate.GetSelection() }, + { RoleId.TimeMaster, CustomOptionHolder.timeMasterSpawnRate.GetSelection() }, + { RoleId.Tracker, CustomOptionHolder.trackerSpawnRate.GetSelection() }, + { RoleId.Trapper, CustomOptionHolder.trapperSpawnRate.GetSelection() }, + { RoleId.Veteran, CustomOptionHolder.veteranSpawnRate.GetSelection() }, + { RoleId.Vigilante, CustomOptionHolder.guesserSpawnRate.GetSelection() }, - { RoleId.Blackmailer, CustomOptionHolder.blackmailerSpawnRate.getSelection() }, - { RoleId.Bomber, CustomOptionHolder.bomberSpawnRate.getSelection() }, - { RoleId.BountyHunter, CustomOptionHolder.bountyHunterSpawnRate.getSelection() }, - { RoleId.Butcher, CustomOptionHolder.butcherSpawnRate.getSelection() }, - { RoleId.Camouflager, CustomOptionHolder.camouflagerSpawnRate.getSelection() }, - { RoleId.Cleaner, CustomOptionHolder.cleanerSpawnRate.getSelection() }, - { RoleId.Eraser, CustomOptionHolder.eraserSpawnRate.getSelection() }, - { RoleId.Escapist, CustomOptionHolder.escapistSpawnRate.getSelection() }, - { RoleId.EvilTrapper, CustomOptionHolder.evilTrapperSpawnRate.getSelection() }, - { RoleId.Gambler, CustomOptionHolder.gamblerSpawnRate.getSelection() }, - { RoleId.Mimic, CustomOptionHolder.mimicSpawnRate.getSelection() }, - { RoleId.Miner, CustomOptionHolder.minerSpawnRate.getSelection() }, - { RoleId.Morphling, CustomOptionHolder.morphlingSpawnRate.getSelection() }, - { RoleId.Ninja, CustomOptionHolder.ninjaSpawnRate.getSelection() }, - { RoleId.Poucher, CustomOptionHolder.poucherSpawnRate.getSelection() }, - { RoleId.Terrorist, CustomOptionHolder.terroristSpawnRate.getSelection() }, - { RoleId.Trickster, CustomOptionHolder.tricksterSpawnRate.getSelection() }, - { RoleId.Undertaker, CustomOptionHolder.undertakerSpawnRate.getSelection() }, - { RoleId.Vampire, CustomOptionHolder.vampireSpawnRate.getSelection() }, - { RoleId.Warlock, CustomOptionHolder.warlockSpawnRate.getSelection() }, - { RoleId.Witch, CustomOptionHolder.witchSpawnRate.getSelection() }, - { RoleId.Yoyo, CustomOptionHolder.yoyoSpawnRate.getSelection() }, - { RoleId.Grenadier, CustomOptionHolder.grenadierSpawnRate.getSelection() }, + { RoleId.Blackmailer, CustomOptionHolder.blackmailerSpawnRate.GetSelection() }, + { RoleId.Bomber, CustomOptionHolder.bomberSpawnRate.GetSelection() }, + { RoleId.BountyHunter, CustomOptionHolder.bountyHunterSpawnRate.GetSelection() }, + { RoleId.Butcher, CustomOptionHolder.butcherSpawnRate.GetSelection() }, + { RoleId.Camouflager, CustomOptionHolder.camouflagerSpawnRate.GetSelection() }, + { RoleId.Cleaner, CustomOptionHolder.cleanerSpawnRate.GetSelection() }, + { RoleId.Eraser, CustomOptionHolder.eraserSpawnRate.GetSelection() }, + { RoleId.Escapist, CustomOptionHolder.escapistSpawnRate.GetSelection() }, + { RoleId.EvilTrapper, CustomOptionHolder.evilTrapperSpawnRate.GetSelection() }, + { RoleId.Gambler, CustomOptionHolder.gamblerSpawnRate.GetSelection() }, + { RoleId.Mimic, CustomOptionHolder.mimicSpawnRate.GetSelection() }, + { RoleId.Miner, CustomOptionHolder.minerSpawnRate.GetSelection() }, + { RoleId.Morphling, CustomOptionHolder.morphlingSpawnRate.GetSelection() }, + { RoleId.Ninja, CustomOptionHolder.ninjaSpawnRate.GetSelection() }, + { RoleId.Poucher, CustomOptionHolder.poucherSpawnRate.GetSelection() }, + { RoleId.Terrorist, CustomOptionHolder.terroristSpawnRate.GetSelection() }, + { RoleId.Trickster, CustomOptionHolder.tricksterSpawnRate.GetSelection() }, + { RoleId.Undertaker, CustomOptionHolder.undertakerSpawnRate.GetSelection() }, + { RoleId.Vampire, CustomOptionHolder.vampireSpawnRate.GetSelection() }, + { RoleId.Warlock, CustomOptionHolder.warlockSpawnRate.GetSelection() }, + { RoleId.Witch, CustomOptionHolder.witchSpawnRate.GetSelection() }, + { RoleId.Yoyo, CustomOptionHolder.yoyoSpawnRate.GetSelection() }, + { RoleId.Grenadier, CustomOptionHolder.grenadierSpawnRate.GetSelection() }, - { RoleId.Akujo, CustomOptionHolder.akujoSpawnRate.getSelection() }, - { RoleId.Amnisiac, CustomOptionHolder.amnisiacSpawnRate.getSelection() }, - { RoleId.Arsonist, CustomOptionHolder.arsonistSpawnRate.getSelection() }, - { RoleId.Doomsayer, CustomOptionHolder.doomsayerSpawnRate.getSelection() }, - { RoleId.Executioner, CustomOptionHolder.executionerSpawnRate.getSelection() }, - { RoleId.Jackal, CustomOptionHolder.jackalSpawnRate.getSelection() }, - { RoleId.Sidekick, CustomOptionHolder.jackalSpawnRate.getSelection() }, - { RoleId.Jester, CustomOptionHolder.jesterSpawnRate.getSelection() }, - { RoleId.Juggernaut, CustomOptionHolder.juggernautSpawnRate.getSelection() }, - { RoleId.Lawyer, CustomOptionHolder.lawyerSpawnRate.getSelection() }, - { RoleId.PartTimer, CustomOptionHolder.partTimerSpawnRate.getSelection() }, - { RoleId.Pavlovsowner, CustomOptionHolder.pavlovsownerSpawnRate.getSelection() }, - { RoleId.Pavlovsdogs, CustomOptionHolder.pavlovsownerSpawnRate.getSelection() }, - { RoleId.Survivor, CustomOptionHolder.survivorSpawnRate.getSelection() }, - { RoleId.Swooper, CustomOptionHolder.swooperSpawnRate.getSelection() }, - { RoleId.Thief, CustomOptionHolder.thiefSpawnRate.getSelection() }, - { RoleId.Vulture, CustomOptionHolder.vultureSpawnRate.getSelection() }, - { RoleId.Werewolf, CustomOptionHolder.werewolfSpawnRate.getSelection() }, - { RoleId.Pursuer, CustomOptionHolder.lawyerSpawnRate.getSelection() + CustomOptionHolder.executionerSpawnRate.getSelection() }, + { RoleId.Akujo, CustomOptionHolder.akujoSpawnRate.GetSelection() }, + { RoleId.Amnisiac, CustomOptionHolder.amnisiacSpawnRate.GetSelection() }, + { RoleId.Arsonist, CustomOptionHolder.arsonistSpawnRate.GetSelection() }, + { RoleId.Doomsayer, CustomOptionHolder.doomsayerSpawnRate.GetSelection() }, + { RoleId.Executioner, CustomOptionHolder.executionerSpawnRate.GetSelection() }, + { RoleId.Jackal, CustomOptionHolder.jackalSpawnRate.GetSelection() }, + { RoleId.Sidekick, CustomOptionHolder.jackalSpawnRate.GetSelection() }, + { RoleId.Jester, CustomOptionHolder.jesterSpawnRate.GetSelection() }, + { RoleId.Juggernaut, CustomOptionHolder.juggernautSpawnRate.GetSelection() }, + { RoleId.Lawyer, CustomOptionHolder.lawyerSpawnRate.GetSelection() }, + { RoleId.PartTimer, CustomOptionHolder.partTimerSpawnRate.GetSelection() }, + { RoleId.Pavlovsowner, CustomOptionHolder.pavlovsownerSpawnRate.GetSelection() }, + { RoleId.Pavlovsdogs, CustomOptionHolder.pavlovsownerSpawnRate.GetSelection() }, + { RoleId.Survivor, CustomOptionHolder.survivorSpawnRate.GetSelection() }, + { RoleId.Swooper, CustomOptionHolder.swooperSpawnRate.GetSelection() }, + { RoleId.Thief, CustomOptionHolder.thiefSpawnRate.GetSelection() }, + { RoleId.Vulture, CustomOptionHolder.vultureSpawnRate.GetSelection() }, + { RoleId.Werewolf, CustomOptionHolder.werewolfSpawnRate.GetSelection() }, + { RoleId.Pursuer, CustomOptionHolder.lawyerSpawnRate.GetSelection() + CustomOptionHolder.executionerSpawnRate.GetSelection() }, - { RoleId.Lover, CustomOptionHolder.modifierLover.getSelection() }, - { RoleId.Aftermath, CustomOptionHolder.modifierAftermath.getSelection() }, - { RoleId.AntiTeleport, CustomOptionHolder.modifierAntiTeleport.getSelection() }, - { RoleId.Assassin, CustomOptionHolder.modifierAssassin.getSelection() }, - { RoleId.Bait, CustomOptionHolder.modifierBait.getSelection() }, - { RoleId.Blind, CustomOptionHolder.modifierBlind.getSelection() }, - { RoleId.Bloody, CustomOptionHolder.modifierBloody.getSelection() }, - { RoleId.ButtonBarry, CustomOptionHolder.modifierButtonBarry.getSelection() }, - { RoleId.Chameleon, CustomOptionHolder.modifierChameleon.getSelection() }, - { RoleId.Cursed, CustomOptionHolder.modifierCursed.getSelection() }, - { RoleId.Disperser, CustomOptionHolder.modifierDisperser.getSelection() }, - { RoleId.Flash, CustomOptionHolder.modifierFlash.getSelection() }, - { RoleId.Giant, CustomOptionHolder.modifierGiant.getSelection() }, - { RoleId.Indomitable, CustomOptionHolder.modifierIndomitable.getSelection() }, - { RoleId.Invert, CustomOptionHolder.modifierInvert.getSelection() }, - { RoleId.LastImpostor, CustomOptionHolder.modifierLastImpostor.getSelection() }, - { RoleId.Mini, CustomOptionHolder.modifierMini.getSelection() }, - { RoleId.Multitasker, CustomOptionHolder.modifierMultitasker.getSelection() }, - { RoleId.Radar, CustomOptionHolder.modifierRadar.getSelection() }, - { RoleId.Shifter, CustomOptionHolder.modifierShifter.getSelection() }, - { RoleId.Slueth, CustomOptionHolder.modifierSlueth.getSelection() }, - { RoleId.Specoality, CustomOptionHolder.modifierSpecoality.getSelection() }, - { RoleId.Tiebreaker, CustomOptionHolder.modifierTieBreaker.getSelection() }, - { RoleId.Torch, CustomOptionHolder.modifierTorch.getSelection() }, - { RoleId.Tunneler, CustomOptionHolder.modifierTunneler.getSelection() }, - { RoleId.Vip, CustomOptionHolder.modifierVip.getSelection() }, - { RoleId.Watcher, CustomOptionHolder.modifierWatcher.getSelection()} + { RoleId.Lover, CustomOptionHolder.modifierLover.GetSelection() }, + { RoleId.Aftermath, CustomOptionHolder.modifierAftermath.GetSelection() }, + { RoleId.AntiTeleport, CustomOptionHolder.modifierAntiTeleport.GetSelection() }, + { RoleId.Assassin, CustomOptionHolder.modifierAssassin.GetSelection() }, + { RoleId.Bait, CustomOptionHolder.modifierBait.GetSelection() }, + { RoleId.Blind, CustomOptionHolder.modifierBlind.GetSelection() }, + { RoleId.Bloody, CustomOptionHolder.modifierBloody.GetSelection() }, + { RoleId.ButtonBarry, CustomOptionHolder.modifierButtonBarry.GetSelection() }, + { RoleId.Chameleon, CustomOptionHolder.modifierChameleon.GetSelection() }, + { RoleId.Cursed, CustomOptionHolder.modifierCursed.GetSelection() }, + { RoleId.Disperser, CustomOptionHolder.modifierDisperser.GetSelection() }, + { RoleId.Flash, CustomOptionHolder.modifierFlash.GetSelection() }, + { RoleId.Giant, CustomOptionHolder.modifierGiant.GetSelection() }, + { RoleId.Indomitable, CustomOptionHolder.modifierIndomitable.GetSelection() }, + { RoleId.Invert, CustomOptionHolder.modifierInvert.GetSelection() }, + { RoleId.LastImpostor, CustomOptionHolder.modifierLastImpostor.GetSelection() }, + { RoleId.Mini, CustomOptionHolder.modifierMini.GetSelection() }, + { RoleId.Multitasker, CustomOptionHolder.modifierMultitasker.GetSelection() }, + { RoleId.Radar, CustomOptionHolder.modifierRadar.GetSelection() }, + { RoleId.Shifter, CustomOptionHolder.modifierShifter.GetSelection() }, + { RoleId.Slueth, CustomOptionHolder.modifierSlueth.GetSelection() }, + { RoleId.Specoality, CustomOptionHolder.modifierSpecoality.GetSelection() }, + { RoleId.Tiebreaker, CustomOptionHolder.modifierTieBreaker.GetSelection() }, + { RoleId.Torch, CustomOptionHolder.modifierTorch.GetSelection() }, + { RoleId.Tunneler, CustomOptionHolder.modifierTunneler.GetSelection() }, + { RoleId.Vip, CustomOptionHolder.modifierVip.GetSelection() }, + { RoleId.Watcher, CustomOptionHolder.modifierWatcher.GetSelection()} }); } diff --git a/TheOtherRoles/Roles/RoleInfo.cs b/TheOtherRoles/Roles/RoleInfo.cs index 1ceebd25..b2e8582f 100644 --- a/TheOtherRoles/Roles/RoleInfo.cs +++ b/TheOtherRoles/Roles/RoleInfo.cs @@ -9,10 +9,10 @@ namespace TheOtherRoles.Roles; public class RoleInfo(string name, Color color, RoleId roleId, RoleType roleTeam, bool isGuessable = false) { - public string Name => getString(nameKey); - public string IntroDescription => getString(nameKey + "IntroDesc"); - public string ShortDescription => getString(nameKey + "ShortDesc"); - public string FullDescription => getString(nameKey + "FullDesc"); + public string Name => GetString(nameKey); + public string IntroDescription => GetString(nameKey + "IntroDesc"); + public string ShortDescription => GetString(nameKey + "ShortDesc"); + public string FullDescription => GetString(nameKey + "FullDesc"); public Color color = color; public RoleId roleId = roleId; @@ -242,7 +242,7 @@ public static List getRoleInfoForPlayer(PlayerControl p, bool showModi if (showModifier) { // after dead modifier - if (!CustomOptionHolder.modifiersAreHidden.getBool() || CachedPlayer.LocalPlayer.IsDead || + if (!CustomOptionHolder.modifiersAreHidden.GetBool() || CachedPlayer.LocalPlayer.IsDead || AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Ended) { if (Bait.bait.Any(x => x.PlayerId == p.PlayerId)) infos.Add(bait); diff --git a/TheOtherRoles/Utilities/HandleGuesser.cs b/TheOtherRoles/Utilities/HandleGuesser.cs index 68d30a68..36a8ba2c 100644 --- a/TheOtherRoles/Utilities/HandleGuesser.cs +++ b/TheOtherRoles/Utilities/HandleGuesser.cs @@ -38,17 +38,17 @@ public static void clearAndReload() isGuesserGm = ModOption.gameMode == CustomGamemodes.Guesser; if (isGuesserGm) { - guesserCantGuessSnitch = CustomOptionHolder.guesserGamemodeCantGuessSnitchIfTaksDone.getBool(); - hasMultipleShotsPerMeeting = CustomOptionHolder.guesserGamemodeHasMultipleShotsPerMeeting.getBool(); - killsThroughShield = CustomOptionHolder.guesserGamemodeKillsThroughShield.getBool(); - evilGuesserCanGuessSpy = CustomOptionHolder.guesserGamemodeEvilCanKillSpy.getBool(); + guesserCantGuessSnitch = CustomOptionHolder.guesserGamemodeCantGuessSnitchIfTaksDone.GetBool(); + hasMultipleShotsPerMeeting = CustomOptionHolder.guesserGamemodeHasMultipleShotsPerMeeting.GetBool(); + killsThroughShield = CustomOptionHolder.guesserGamemodeKillsThroughShield.GetBool(); + evilGuesserCanGuessSpy = CustomOptionHolder.guesserGamemodeEvilCanKillSpy.GetBool(); } else { - guesserCantGuessSnitch = CustomOptionHolder.guesserCantGuessSnitchIfTaksDone.getBool(); - hasMultipleShotsPerMeeting = CustomOptionHolder.guesserHasMultipleShotsPerMeeting.getBool(); - killsThroughShield = CustomOptionHolder.guesserKillsThroughShield.getBool(); - evilGuesserCanGuessSpy = CustomOptionHolder.guesserEvilCanKillSpy.getBool(); + guesserCantGuessSnitch = CustomOptionHolder.guesserCantGuessSnitchIfTaksDone.GetBool(); + hasMultipleShotsPerMeeting = CustomOptionHolder.guesserHasMultipleShotsPerMeeting.GetBool(); + killsThroughShield = CustomOptionHolder.guesserKillsThroughShield.GetBool(); + evilGuesserCanGuessSpy = CustomOptionHolder.guesserEvilCanKillSpy.GetBool(); } } } \ No newline at end of file diff --git a/TheOtherRoles/Utilities/MapData.cs b/TheOtherRoles/Utilities/MapData.cs index 76157824..554fa681 100644 --- a/TheOtherRoles/Utilities/MapData.cs +++ b/TheOtherRoles/Utilities/MapData.cs @@ -232,7 +232,7 @@ public static void RandomSpawnPlayers() { if (AntiTeleport.antiTeleport.Any(x => x == PlayerControl.LocalPlayer)) return; Vector3 newPosition; - if (CustomOptionHolder.randomGameStartToVents.getBool()) + if (CustomOptionHolder.randomGameStartToVents.GetBool()) { newPosition = FindVentSpawnPositions()[rnd.Next(FindVentSpawnPositions().Count)]; CachedPlayer.LocalPlayer.PlayerControl.NetTransform.RpcSnapTo(FindVentSpawnPositions()[rnd.Next(FindVentSpawnPositions().Count)]); @@ -253,7 +253,7 @@ public static void RandomSpawnPlayers() public static void RandomSpawnPlayers(IEnumerable players) { - if (CustomOptionHolder.randomGameStartToVents.getBool()) RandomSpawnToVent(players); + if (CustomOptionHolder.randomGameStartToVents.GetBool()) RandomSpawnToVent(players); else RandomSpawnToMap(players); }