diff --git a/Strings.xlsx b/Strings.xlsx index a1f8477..39e3458 100644 Binary files a/Strings.xlsx and b/Strings.xlsx differ diff --git a/TheOtherRoles/CustomGameModes/FreePlayGM.cs b/TheOtherRoles/CustomGameModes/FreePlayGM.cs index 4fcf0ec..c2eefd6 100644 --- a/TheOtherRoles/CustomGameModes/FreePlayGM.cs +++ b/TheOtherRoles/CustomGameModes/FreePlayGM.cs @@ -141,9 +141,7 @@ public static void removeModifier(RoleId modifierId) break; case RoleId.Chameleon: Chameleon.chameleon.RemoveAll(x => x.PlayerId == playerId); - break; - case RoleId.Mini: - Mini.mini = null; + Chameleon.lastMoved.Clear(); break; case RoleId.Invert: Invert.invert.RemoveAll(x => x.PlayerId == playerId); diff --git a/TheOtherRoles/CustomOptionHolder.cs b/TheOtherRoles/CustomOptionHolder.cs index 6a678d1..445239f 100644 --- a/TheOtherRoles/CustomOptionHolder.cs +++ b/TheOtherRoles/CustomOptionHolder.cs @@ -195,6 +195,7 @@ public class CustomOptionHolder { public static CustomOption sprinterCooldown; public static CustomOption sprinterDuration; public static CustomOption sprinterFadeTime; + public static CustomOption sprinterSpeedBonus; public static CustomOption fortuneTellerSpawnRate; public static CustomOption fortuneTellerNumTasks; @@ -947,6 +948,7 @@ public static void Load() { sprinterCooldown = CustomOption.Create(4006, Types.Crewmate, "sprinterCooldown", 30f, 2.5f, 60f, 2.5f, sprinterSpawnRate, false, "unitSeconds"); sprinterDuration = CustomOption.Create(4007, Types.Crewmate, "sprintDuration", 15f, 10f, 60f, 2.5f, sprinterSpawnRate, false, "unitSeconds"); sprinterFadeTime = CustomOption.Create(4008, Types.Crewmate, "sprintFadeTime", 0.5f, 0.0f, 2.5f, 0.5f, sprinterSpawnRate, false, "unitSeconds"); + sprinterSpeedBonus = CustomOption.Create(4009, Types.Crewmate, "sprinterSpeedBonus", 1.25f, 0.5f, 2f, 0.25f, sprinterSpawnRate, false, "unitTimes"); detectiveSpawnRate = CustomOption.Create(120, Types.Crewmate, cs(Detective.color, "detective"), rates, null, true); detectiveAnonymousFootprints = CustomOption.Create(121, Types.Crewmate, "detectiveAnonymousFootprints", false, detectiveSpawnRate); diff --git a/TheOtherRoles/Patches/UsablesPatch.cs b/TheOtherRoles/Patches/UsablesPatch.cs index 7bdb3dc..5d8c3d6 100644 --- a/TheOtherRoles/Patches/UsablesPatch.cs +++ b/TheOtherRoles/Patches/UsablesPatch.cs @@ -217,11 +217,12 @@ public static bool Prefix(KillButton __instance) { [HarmonyPatch(typeof(MapBehaviour), nameof(MapBehaviour.Show))] public static class MapBehaviourShowPatch { public static void Prefix(MapBehaviour __instance, ref MapOptions opts) { - bool blockSabotageJanitor = Janitor.janitor != null && Janitor.janitor == CachedPlayer.LocalPlayer.PlayerControl; - bool blockSabotageMafioso = Mafioso.mafioso != null && Mafioso.mafioso == CachedPlayer.LocalPlayer.PlayerControl && Godfather.godfather != null && !Godfather.godfather.Data.IsDead; - if (blockSabotageJanitor || blockSabotageMafioso) { + if (!CachedPlayer.LocalPlayer.PlayerControl.roleCanUseSabotage()) { if (opts.Mode == MapOptions.Modes.Sabotage) opts.Mode = MapOptions.Modes.Normal; } + else { + if (opts.Mode == MapOptions.Modes.Normal) opts.Mode = MapOptions.Modes.Sabotage; + } } } diff --git a/TheOtherRoles/Resources/stringData.json b/TheOtherRoles/Resources/stringData.json index cefb932..33d568f 100644 --- a/TheOtherRoles/Resources/stringData.json +++ b/TheOtherRoles/Resources/stringData.json @@ -4891,6 +4891,10 @@ "13": "\u5f57\u661f\u4e4b\u5b50\u9690\u8eab\u6240\u9700\u65f6\u95f4", "14": "\u5f57\u661f\u4e4b\u5b50\u96b1\u8eab\u6240\u9700\u6642\u9593" }, + "sprinterSpeedBonus": { + "0": "Sprinting Speed Bonus", + "13": "\u51b2\u523a\u65f6\u901f\u5ea6\u589e\u52a0\u500d\u7387" + }, "undertaker": { "0": "Undertaker", "11": "\u30a2\u30f3\u30c0\u30fc\u30c6\u30a4\u30ab\u30fc", diff --git a/TheOtherRoles/TheOtherRoles.cs b/TheOtherRoles/TheOtherRoles.cs index b4851a5..f4e60fd 100644 --- a/TheOtherRoles/TheOtherRoles.cs +++ b/TheOtherRoles/TheOtherRoles.cs @@ -5514,7 +5514,8 @@ public static class Sprinter public static float sprintCooldown = 30f; public static float sprintDuration = 15f; - public static float fadeTime = 0.5f; + public static float fadeTime = 0.5f; + public static float speedBonus = 0.25f; public static bool sprinting = false; @@ -5546,15 +5547,6 @@ public static float sprintFade(PlayerControl player) return 1.0f; } - public static bool isSprinting() - { - if (CachedPlayer.LocalPlayer.PlayerControl == sprinter && !sprinter.Data.IsDead) - { - return sprinting; - } - return false; - } - public static void setSprinting(PlayerControl player, bool sprinting = true) { if (player == sprinter && !sprinter.Data.IsDead) @@ -5582,7 +5574,8 @@ public static void clearAndReload() sprinting = false; sprintCooldown = CustomOptionHolder.sprinterCooldown.getFloat(); sprintDuration = CustomOptionHolder.sprinterDuration.getFloat(); - fadeTime = CustomOptionHolder.sprinterFadeTime.getFloat(); + fadeTime = CustomOptionHolder.sprinterFadeTime.getFloat(); + speedBonus = CustomOptionHolder.sprinterSpeedBonus.getFloat(); acTokenMove = null; } @@ -5592,7 +5585,8 @@ public static class PlayerPhysicsSprinterPatch public static void Postfix(PlayerPhysics __instance) { if (__instance.myPlayer == sprinter) - { + { + if (GameData.Instance && sprinting && __instance.AmOwner && __instance.myPlayer.CanMove) __instance.body.velocity *= 1 + speedBonus; var sprinter = __instance.myPlayer; if (sprinter == null || sprinter.Data.IsDead) return;