Skip to content

Commit

Permalink
ReName
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Nov 29, 2024
1 parent 7980668 commit a46cce0
Show file tree
Hide file tree
Showing 121 changed files with 893 additions and 897 deletions.
152 changes: 76 additions & 76 deletions TheOtherRoles/Buttons/Buttons.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions TheOtherRoles/CustomGameModes/GuesserGM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
}
Expand Down
51 changes: 25 additions & 26 deletions TheOtherRoles/CustomGameModes/HideNSeekGM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using TheOtherRoles.Objects;
using TheOtherRoles.Utilities;
using TMPro;
using UnityEngine;
using Object = UnityEngine.Object;

namespace TheOtherRoles.CustomGameModes;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
}

Expand All @@ -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();
}
}

Expand Down
52 changes: 26 additions & 26 deletions TheOtherRoles/CustomGameModes/PropHunt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions TheOtherRoles/Helper/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions TheOtherRoles/Modules/ModTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<.*?>", "");
Expand Down Expand Up @@ -80,6 +80,6 @@ internal static class LanguageExtension
{
internal static string Translate(this string key)
{
return getString(key);
return GetString(key);
}
}
4 changes: 2 additions & 2 deletions TheOtherRoles/Objects/Map/AdditionalVents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)); // 样本室
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions TheOtherRoles/Objects/Map/Airship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<SpriteRenderer>().FirstOrDefault(x => x.name == "ladder_meeting").gameObject;
Expand Down
12 changes: 6 additions & 6 deletions TheOtherRoles/Objects/Map/BetterPolus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions TheOtherRoles/Objects/Map/FungleElectrical.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FungleShipStatus>();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Objects/Map/Mira.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Objects/NinjaTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<HudManager>.Instance.StartCoroutine(Effects.Lerp(colorDuration, new Action<float>(p =>
{
Color c = Palette.PlayerColors[Ninja.ninja.Data.DefaultOutfit.ColorId];
Expand Down
6 changes: 3 additions & 3 deletions TheOtherRoles/Options/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,18 +1220,18 @@ 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);
snitchTeamNeutraUseDifferentArrowColor = Create(30275, Types.Crewmate, "snitchTeamNeutraUseDifferentArrowColor", true, snitchIncludeNeutralTeam);

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);
Expand Down
Loading

0 comments on commit a46cce0

Please sign in to comment.