Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
few fixes from 3.5.5
Browse files Browse the repository at this point in the history
* fix a bug that prevented jackal/fox/eraser from being able to create sidekicks/erase roles
* implemented sc translation for sprinter
* pass information about what role we're changing into when erasing old role info
  • Loading branch information
yukinogatari committed Apr 12, 2022
1 parent c9134e3 commit 05d13c2
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 82 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
# Releases
| Among Us - Version | Mod Version | Link |
|----------|-------------|-----------------|
| 2022.3.29s | v3.5.5.1 GM | [Download](https://github.com/yukinogatari/TheOtherRoles-GM/releases/download/v3.5.5.1/TheOtherRoles-GM.v3.5.5.1.zip)
| 2022.3.29s | v3.5.5 GM | [Download](https://github.com/yukinogatari/TheOtherRoles-GM/releases/download/v3.5.5/TheOtherRoles-GM.v3.5.5.zip)
| 2022.2.24s | v3.5.4 GM | [Download](https://github.com/yukinogatari/TheOtherRoles-GM/releases/download/v3.5.4/TheOtherRoles-GM.v3.5.4.zip)
| 2022.2.24s | v3.5.3 GM | [Download](https://github.com/yukinogatari/TheOtherRoles-GM/releases/download/v3.5.3/TheOtherRoles-GM.v3.5.3.zip)
Expand Down
Binary file modified Strings.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions TheOtherRoles/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public static void Load() {
janitorCanRepair = CustomOption.Create(16, "janitorCanRepair", false, mafiaSpawnRate);
janitorCanVent = CustomOption.Create(17, "janitorCanVent", false, mafiaSpawnRate);

morphlingSpawnRate = new CustomRoleOption(20, "morphling", Morphling.color, 1, roleEnabled: true);
morphlingSpawnRate = new CustomRoleOption(20, "morphling", Morphling.color, 1);
morphlingCooldown = CustomOption.Create(21, "morphlingCooldown", 30f, 2.5f, 60f, 2.5f, morphlingSpawnRate, format: "unitSeconds");
morphlingDuration = CustomOption.Create(22, "morphlingDuration", 10f, 1f, 20f, 0.5f, morphlingSpawnRate, format: "unitSeconds");

Expand Down Expand Up @@ -692,7 +692,7 @@ public static void Load() {
refundVotesOnDeath = CustomOption.Create(551, "refundVotesOnDeath", true, specialOptions);
allowParallelMedBayScans = CustomOption.Create(540, "parallelMedbayScans", false, specialOptions);
hideSettings = CustomOption.Create(520, "hideSettings", false, specialOptions);
enabledHorseMode = CustomOption.Create(552, "ƒEƒ}ƒ“ƒOƒAƒX", false, specialOptions);
enabledHorseMode = CustomOption.Create(552, "enabledHorseMode", false, specialOptions);

restrictDevices = CustomOption.Create(510, "restrictDevices", new string[] { "optionOff", "restrictPerTurn", "restrictPerGame" }, specialOptions);
restrictAdmin = CustomOption.Create(501, "disableAdmin", 30f, 0f, 600f, 5f, restrictDevices, format: "unitSeconds");
Expand Down
14 changes: 14 additions & 0 deletions TheOtherRoles/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,20 @@ public static bool isAkujoLover(this PlayerControl player)
player.hasModifier(ModifierType.AkujoKeep));
}

public static bool isAkujoPartners(this PlayerControl player, PlayerControl partner)
{
foreach (var akujo in Akujo.players)
{
if ((akujo.player == player && akujo.isPartner(partner)) ||
(akujo.player == partner && akujo.isPartner(player)))
{
return true;
}
}

return false;
}

public static PlayerControl getPartner(this PlayerControl player)
{
return Lovers.getPartner(player);
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace TheOtherRoles
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
public const string VersionString = "3.5.5";
public const string VersionString = "3.5.5.1";
public static System.Version Version = System.Version.Parse(VersionString);
internal static BepInEx.Logging.ManualLogSource Logger;

Expand Down
9 changes: 9 additions & 0 deletions TheOtherRoles/Modules/CustomOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,15 @@ public static void Postfix(GameSettingMenu __instance)
}
mapNameTransform.GetComponent<KeyValueOption>().Values = options;
mapNameTransform.gameObject.active = true;

foreach (Transform i in __instance.AllItems.ToList())
{
float num = -0.5f;
if (i.name.Equals("MapName", StringComparison.OrdinalIgnoreCase)) num = -0.25f;
if (i.name.Equals("NumImpostors", StringComparison.OrdinalIgnoreCase) || i.name.Equals("ResetToDefault", StringComparison.OrdinalIgnoreCase)) num = 0f;
i.position += new Vector3(0, num, 0);
}
__instance.Scroller.ContentYBounds.max += 0.5F;
}
}

Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Patches/PlayerControlPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public static void updatePlayerInfo()
{
if (p == null) continue;

bool isAkujo = PlayerControl.LocalPlayer.isRole(RoleType.Akujo) && (p.hasModifier(ModifierType.AkujoHonmei) || p.hasModifier(ModifierType.AkujoKeep));
bool isAkujo = Akujo.isPartner(PlayerControl.LocalPlayer, p);

bool canSeeInfo =
canSeeEverything || isAkujo ||
Expand Down
1 change: 1 addition & 0 deletions TheOtherRoles/Patches/UpdatePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ static void setNameTags() {

else if (PlayerControl.LocalPlayer == akujo.honmei?.player || akujo.keeps.Any(x => PlayerControl.LocalPlayer == x?.player))
{
PlayerControl.LocalPlayer.nameText.text += suffix;
if (!Helpers.hidePlayerName(akujo.player))
akujo.player.nameText.text += suffix;

Expand Down
8 changes: 4 additions & 4 deletions TheOtherRoles/RPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public static void jackalCreatesSidekick(byte targetId)
Jackal.fakeSidekick = player;
}else {
DestroyableSingleton<RoleManager>.Instance.SetRole(player, RoleTypes.Crewmate);
erasePlayerRoles(player.PlayerId, true);
erasePlayerRoles(player.PlayerId, RoleType.Sidekick);
Sidekick.sidekick = player;
if (player.PlayerId == PlayerControl.LocalPlayer.PlayerId) PlayerControl.LocalPlayer.moveable = true;
if(Fox.exists && !Fox.isFoxAlive())
Expand All @@ -526,7 +526,7 @@ public static void sidekickPromotes()
return;
}

public static void erasePlayerRoles(byte playerId, bool roleChange = false)
public static void erasePlayerRoles(byte playerId, RoleType newRole = RoleType.NoRole)
{
PlayerControl player = Helpers.playerById(playerId);
if (player == null) return;
Expand All @@ -536,7 +536,7 @@ public static void erasePlayerRoles(byte playerId, bool roleChange = false)
player.clearAllTasks();

player.eraseAllRoles();
player.eraseAllModifiers(roleChange);
player.eraseAllModifiers(newRole);
}

public static void setFutureErased(byte playerId)
Expand Down Expand Up @@ -821,7 +821,7 @@ public static void foxCreatesImmoralist(byte targetId)
{
PlayerControl player = Helpers.playerById(targetId);
DestroyableSingleton<RoleManager>.Instance.SetRole(player, RoleTypes.Crewmate);
erasePlayerRoles(player.PlayerId, true);
erasePlayerRoles(player.PlayerId, RoleType.Immoralist);
player.setRole(RoleType.Immoralist);
player.clearAllTasks();
}
Expand Down
122 changes: 76 additions & 46 deletions TheOtherRoles/Resources/stringData.json
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,40 @@
"11": "\u30fb\u4f1a\u8b70\u4e2d\u3001\u5168\u54e1\u306e\u6295\u7968\u5148\u304c\u898b\u3048\u308b",
"13": "\u7aa5\u89c6\u8005\u53ef\u4ee5\u770b\u5230\u4f1a\u8bae\u4e2d\u6240\u6709\u4eba\u7684\u6295\u7968\u60c5\u51b5\u3002"
},
"sprinter": {
"0": "Sprinter",
"11": "\u30b9\u30d7\u30ea\u30f3\u30bf\u30fc",
"13": "\u98de\u6bdb\u817f"
},
"sprinterIntroDesc": {
"0": "Run from the Impostors",
"11": "\u8d70\u3063\u3066\u30a4\u30f3\u30dd\u30b9\u30bf\u30fc\u304b\u3089\u9003\u3052\u3088\u3046",
"13": "\u53ea\u8981\u4e0d\u505c\u4e0b\u6765\uff0c\u9053\u8def\u5c31\u4f1a\u4e0d\u65ad\u5ef6\u4f38"
},
"sprinterShortDesc": {
"0": "Run from the Impostors",
"11": "\u8d70\u3063\u3066\u30a4\u30f3\u30dd\u30b9\u30bf\u30fc\u304b\u3089\u9003\u3052\u3088\u3046",
"13": "\u4ece\u5185\u9b3c\u8eab\u8fb9\u6e9c\u8d70"
},
"sprinterFullDesc": {
"0": "A Crewmate who can run at super high speeds.",
"11": "\u30fb\u80fd\u529b\u3092\u4f7f\u3046\u3068\u79fb\u52d5\u901f\u5ea6\u304c\u4e0a\u304c\u308b"
},
"sprinterCooldown": {
"0": "Sprint Cooldown",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u30af\u30fc\u30eb\u30c0\u30a6\u30f3",
"13": "\u98de\u6bdb\u817f\u51b2\u523a\u51b7\u5374"
},
"sprinterDuration": {
"0": "Sprint Duration",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u6301\u7d9a\u6642\u9593",
"13": "\u98de\u6bdb\u817f\u51b2\u523a\u6301\u7eed\u65f6\u95f4"
},
"sprinterSpeedBonus": {
"0": "Sprint Speed Bonus",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u4e2d\u79fb\u52d5\u901f\u5ea6",
"13": "\u6bdb\u817f\u51b2\u523a\u6301\u7eed\u65f6\u95f4\u5185\u79fb\u52a8\u901f\u5ea6\u589e\u5e45"
},
"husk": {
"0": "Husk",
"11": "\u306a\u308c\u306e\u679c\u3066",
Expand Down Expand Up @@ -2394,6 +2428,10 @@
"11": "\u6295\u7968\u5148\u304c\u6b7b\u4ea1\u3057\u305f\u3089\u3001\u6295\u7968\u6a29\u3092\u8fd4\u3059",
"13": "\u7ed9\u5728\u4f1a\u8bae\u4e2d\u6b7b\u4ea1\u73a9\u5bb6\u6295\u7968\u7684\u73a9\u5bb6\u53ef\u4ee5\u6536\u56de\u6295\u7968"
},
"enabledHorseMode": {
"0": "Horse Around",
"11": "\u30a6\u30de\u30f3\u30b0\u30a2\u30b9"
},
"restrictDevices": {
"0": "Restrict Special Devices",
"11": "\u7279\u6b8a\u88c5\u7f6e\u306e\u5236\u9650",
Expand Down Expand Up @@ -3655,6 +3693,16 @@
"11": "\u80cc\u5fb3\u8005",
"13": "\u8bf1\u60d1"
},
"SprinterText": {
"0": "Sprint",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8",
"13": "\u51b2\u523a"
},
"SprinterStopText": {
"0": "Rest",
"11": "\u4f11\u3080",
"13": "\u505c\u4e0b"
},
"colorSalmon": {
"0": "Salmon",
"11": "\u30b5\u30fc\u30e2\u30f3",
Expand Down Expand Up @@ -3770,90 +3818,72 @@
"11": "GM\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3\u9650\u5b9a",
"13": "GM\u7248\u9650\u5b9a"
},
"sprinter": {
"0": "Sprinter",
"11": "\u30b9\u30d7\u30ea\u30f3\u30bf\u30fc"
},
"sprinterIntroDesc": {
"0": "Run from the Impostors",
"11": "\u8d70\u3063\u3066\u30a4\u30f3\u30dd\u30b9\u30bf\u30fc\u304b\u3089\u9003\u3052\u3088\u3046"
},
"sprinterShortDesc": {
"0": "Run from the Impostors",
"11": "\u8d70\u3063\u3066\u30a4\u30f3\u30dd\u30b9\u30bf\u30fc\u304b\u3089\u9003\u3052\u3088\u3046"
},
"sprinterCooldown": {
"0": "Sprint Cooldown",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u30af\u30fc\u30eb\u30c0\u30a6\u30f3"
},
"sprinterDuration": {
"0": "Sprint Duration",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u6301\u7d9a\u6642\u9593"
},
"sprinterSpeedBonus": {
"0": "Sprint Speed Bonus",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8\u4e2d\u79fb\u52d5\u901f\u5ea6"
},
"SprinterText": {
"0": "Sprint",
"11": "\u30b9\u30d7\u30ea\u30f3\u30c8"
},
"SprinterStopText": {
"0": "Rest",
"11": "\u4f11\u3080"
},
"akujo": {
"0": "Akujo",
"11": "\u60aa\u5973"
"11": "\u60aa\u5973",
"13": "\u9b45\u9b54"
},
"akujoIntroDesc": {
"11": "\u30af\u30eb\u30fc\u3092\u8a91\u304b\u3057\u3066\u6700\u5f8c\u307e\u3067\u751f\u304d\u6b8b\u308d\u3046"
"11": "\u30af\u30eb\u30fc\u3092\u8a91\u304b\u3057\u3066\u6700\u5f8c\u307e\u3067\u751f\u304d\u6b8b\u308d\u3046",
"13": "\u5438\u53d6\u5176\u4ed6\u73a9\u5bb6\u7684\u7cbe\u6c14\u6d3b\u5230\u6700\u540e"
},
"akujoShortDesc": {
"11": "\u30af\u30eb\u30fc\u3092\u8a91\u304b\u3057\u3066\u6700\u5f8c\u307e\u3067\u751f\u304d\u6b8b\u308d\u3046"
"11": "\u30af\u30eb\u30fc\u3092\u8a91\u304b\u3057\u3066\u6700\u5f8c\u307e\u3067\u751f\u304d\u6b8b\u308d\u3046",
"13": "\u5438\u53d6\u5176\u4ed6\u73a9\u5bb6\u7684\u7cbe\u6c14\u6d3b\u5230\u6700\u540e"
},
"akujoTimeLimit": {
"0": "Time Limit",
"11": "\u30d1\u30fc\u30c8\u30ca\u30fc\u9078\u3073\u306e\u6642\u9593\u5236\u9650"
"11": "\u30d1\u30fc\u30c8\u30ca\u30fc\u9078\u3073\u306e\u6642\u9593\u5236\u9650",
"13": "\u9b45\u9b54\u5438\u53d6\u7cbe\u6c14\u7684\u65f6\u95f4\u9650\u5236"
},
"akujoKnowsRoles": {
"0": "Knows Partners' Roles",
"11": "\u30d1\u30fc\u30c8\u30ca\u30fc\u306e\u30ed\u30fc\u30eb\u304c\u898b\u3048\u308b"
"11": "\u30d1\u30fc\u30c8\u30ca\u30fc\u306e\u30ed\u30fc\u30eb\u304c\u898b\u3048\u308b",
"13": "\u9b45\u9b54\u77e5\u9053\u4f34\u4fa3\u7684\u804c\u4e1a"
},
"akujoNumKeeps": {
"0": "Max Keeps",
"11": "\u30ad\u30fc\u30d7\u306e\u6700\u5927\u4eba\u6570"
"11": "\u30ad\u30fc\u30d7\u306e\u6700\u5927\u4eba\u6570",
"13": "\u9b45\u9b54\u6700\u5927\u53ef\u9b45\u60d1\u4eba\u6570"
},
"akujoHonmei": {
"0": "Honmei",
"11": "\u672c\u547d"
"11": "\u672c\u547d",
"13": "\u771f\u7231"
},
"akujoKeep": {
"0": "Keep",
"11": "\u30ad\u30fc\u30d7"
"11": "\u30ad\u30fc\u30d7",
"13": "\u9b45\u60d1"
},
"akujoKeepsLeft": {
"0": "Keeps Left: {0}",
"11": "\u6b8b\u308a {0}\u4eba"
"11": "\u6b8b\u308a {0}\u4eba",
"13": "\u5269\u4f59\u9b45\u60d1\u6570 {0}"
},
"AkujoHonmeiText": {
"0": "Honmei",
"11": "\u672c\u547d\u306b\u3059\u308b"
"11": "\u672c\u547d\u306b\u3059\u308b",
"13": "\u771f\u7231"
},
"AkujoKeepText": {
"0": "Keep",
"11": "\u30ad\u30fc\u30d7\u306b\u3059\u308b"
"11": "\u30ad\u30fc\u30d7\u306b\u3059\u308b",
"13": "\u9b45\u60d1"
},
"akujoWin": {
"0": "Akujo Wins",
"11": "\u60aa\u5973\u52dd\u5229"
"11": "\u60aa\u5973\u52dd\u5229",
"13": "\u574f\u5973\u4eba\uff01"
},
"akujoWinExtra": {
"0": "Akujo {0} Win",
"11": "\u60aa\u5973{0}\u52dd\u5229"
"11": "\u60aa\u5973{0}\u52dd\u5229",
"13": "\u9b45\u9b54{0}\u80dc\u5229"
},
"roleSummaryLoneliness": {
"0": "Alone",
"11": "\u5b64\u72ec\u6b7b"
"11": "\u5b64\u72ec\u6b7b",
"13": "\u67af\u7aed"
}
}
38 changes: 27 additions & 11 deletions TheOtherRoles/Roles/Akujo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@ public void setKeep(PlayerControl target)
keeps.Add(keep);
}

public static bool isPartner(PlayerControl player, PlayerControl partner)
{
Akujo akujo = getRole(player);
if (akujo != null)
{
return akujo.isPartner(partner);
}
return false;
}

public bool isPartner(PlayerControl partner)
{
return honmei?.player == partner || keeps.Any(x => x.player == partner);
}

public static Color getAvailableColor()
{
var availableColors = new List<Color>(iconColors);
Expand Down Expand Up @@ -301,9 +316,12 @@ public class AkujoHonmei : ModifierBase<AkujoHonmei>
public AkujoHonmei()
{
ModType = modId = ModifierType.AkujoHonmei;
persistRoleChange.sidekick = true;
persistRoleChange.immoralist = true;
persistRoleChange.shifter = true;

persistRoleChange = new List<RoleType>() {
RoleType.Sidekick,
RoleType.Immoralist,
RoleType.Shifter
};
}

public override void OnMeetingStart() { }
Expand Down Expand Up @@ -356,9 +374,12 @@ public class AkujoKeep : ModifierBase<AkujoKeep>
public AkujoKeep()
{
ModType = modId = ModifierType.AkujoKeep;
persistRoleChange.sidekick = true;
persistRoleChange.immoralist = true;
persistRoleChange.shifter = true;

persistRoleChange = new List<RoleType>() {
RoleType.Sidekick,
RoleType.Immoralist,
RoleType.Shifter
};
}

public override void OnMeetingStart() { }
Expand All @@ -369,11 +390,6 @@ public override void OnDeath(PlayerControl killer = null) { }

public override void HandleDisconnect(PlayerControl player, DisconnectReasons reason) { }

public override void ResetModifier()
{
base.ResetModifier();
}

public override string modifyNameText(string nameText)
{
return nameText + Helpers.cs(color, " ♥");
Expand Down
Loading

1 comment on commit 05d13c2

@asfsdasdadfadgf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Please sign in to comment.