Skip to content

Commit

Permalink
Merge pull request TheOtherRolesAU#244 from Eisbison/Version-3.4.1
Browse files Browse the repository at this point in the history
Version 3.4.1
  • Loading branch information
dwd0tcom authored Jan 26, 2022
2 parents 9802544 + b5c35e6 commit 1797451
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 124 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
<details>
<summary>Click to show the Changelog</summary>

**Version 3.4.1**
- Added a new mod option "Show Lighter/Darker" for meetings
- Added options for choosing which maps are enabled for random maps thanks [EvilScum](https://github.com/JustASysAdmin)
- Added Jester option "Jester Has Impostor Vision" thanks [EvilScum](https://github.com/JustASysAdmin)
- Fixed a bug where the Bounty Hunter had no bounty
- Fixed a bug where the Guesser & Sheriff were not assigned properly (fingers crossed)
- Fixed a bug where Hacker buttons didn't work as intended with "random map" option
- Fixed a bug where the Security Guard could not access cams on Skeld, dlekS & Airship
- Changed Tracker update intervall to a minimum of 1 thanks [LaicosVK](https://github.com/LaicosVK)

**Version 3.4.0**
- Added new Role [Deputy](#deputy) thanks [gendelo3](https://github.com/gendelo3)
- Added Hacker option "Cant Move During Mobile Gadget Duration"
Expand All @@ -110,7 +120,6 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
- Fixed a bug where the spy had a white name for Impostors in chat
- Fixed a bug where the Guesser and Swapper UI in meetings was behind the visor cosmetics


**Version 3.3.3**
- Fixed a bug where a guessed Guesser could guess
- Fixed a bug where buttons were visible during the meeting
Expand Down Expand Up @@ -566,6 +575,7 @@ The mod adds a few new settings to Among Us (in addition to the role settings):
- **Dleks:** You are now able to select the Dleks map.
- **Task Counts:** You are now able to select more tasks.
- **Role Summary:** When a game ends there will be a list of all players and their roles and their task progress
- **Darker/Lighter:** Displays color type of each player in meetings

### Task Count Limits per map
You can configure:
Expand Down
7 changes: 4 additions & 3 deletions TheOtherRoles/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public static void Postfix(HudManager __instance)
engineerRepairButton = new CustomButton(
() => {
engineerRepairButton.Timer = 0f;

MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(usedRepairWriter);
RPCProcedure.engineerUsedRepair();
Expand Down Expand Up @@ -462,7 +461,7 @@ public static void Postfix(HudManager __instance)
Hacker.hackerTimer = Hacker.duration;
},
() => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
() => { return PlayerControl.LocalPlayer.CanMove; },
() => { return true; },
() => {
hackerButton.Timer = hackerButton.MaxTimer;
hackerButton.isEffectActive = false;
Expand All @@ -484,7 +483,6 @@ public static void Postfix(HudManager __instance)

if (Hacker.cantMove) PlayerControl.LocalPlayer.moveable = false;
PlayerControl.LocalPlayer.NetTransform.Halt(); // Stop current movement

Hacker.chargesAdminTable--;
},
() => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead;},
Expand Down Expand Up @@ -982,7 +980,10 @@ public static void Postfix(HudManager __instance)
() => {
if (PlayerControl.GameOptions.MapId != 1) {
if (SecurityGuard.minigame == null) {
byte mapId = PlayerControl.GameOptions.MapId;
var e = UnityEngine.Object.FindObjectsOfType<SystemConsole>().FirstOrDefault(x => x.gameObject.name.Contains("Surv_Panel"));
if (mapId == 0 || mapId == 3) e = UnityEngine.Object.FindObjectsOfType<SystemConsole>().FirstOrDefault(x => x.gameObject.name.Contains("SurvConsole"));
else if (mapId == 4) e = UnityEngine.Object.FindObjectsOfType<SystemConsole>().FirstOrDefault(x => x.gameObject.name.Contains("task_cams"));
if (e == null || Camera.main == null) return;
SecurityGuard.minigame = UnityEngine.Object.Instantiate(e.MinigamePrefab, Camera.main.transform, false);
}
Expand Down
18 changes: 16 additions & 2 deletions TheOtherRoles/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class CustomOptionHolder {

public static CustomOption jesterSpawnRate;
public static CustomOption jesterCanCallEmergency;
public static CustomOption jesterHasImpostorVision;

public static CustomOption arsonistSpawnRate;
public static CustomOption arsonistCooldown;
Expand Down Expand Up @@ -229,7 +230,13 @@ public class CustomOptionHolder {
public static CustomOption noVoteIsSelfVote;
public static CustomOption hidePlayerNames;
public static CustomOption allowParallelMedBayScans;

public static CustomOption dynamicMap;
public static CustomOption dynamicMapEnableSkeld;
public static CustomOption dynamicMapEnableMira;
public static CustomOption dynamicMapEnablePolus;
public static CustomOption dynamicMapEnableDleks;
public static CustomOption dynamicMapEnableAirShip;


internal static Dictionary<byte, byte[]> blockedRolePairings = new Dictionary<byte, byte[]>();
Expand Down Expand Up @@ -324,7 +331,8 @@ public static void Load() {
guesserCantGuessSnitchIfTaksDone = CustomOption.Create(318, "Guesser Can't Guess Snitch When Tasks Completed", true, guesserSpawnRate);

jesterSpawnRate = CustomOption.Create(60, cs(Jester.color, "Jester"), rates, null, true);
jesterCanCallEmergency = CustomOption.Create(61, "Jester can call emergency meeting", true, jesterSpawnRate);
jesterCanCallEmergency = CustomOption.Create(61, "Jester Can Call Emergency Meeting", true, jesterSpawnRate);
jesterCanCallEmergency = CustomOption.Create(62, "Jester Has Impostor Vision", false, jesterSpawnRate);

arsonistSpawnRate = CustomOption.Create(290, cs(Arsonist.color, "Arsonist"), rates, null, true);
arsonistCooldown = CustomOption.Create(291, "Arsonist Cooldown", 12.5f, 2.5f, 60f, 2.5f, arsonistSpawnRate);
Expand Down Expand Up @@ -420,7 +428,7 @@ public static void Load() {
hackerNoMove = CustomOption.Create(176, "Cant Move During Mobile Gadget Duration", true, hackerSpawnRate);

trackerSpawnRate = CustomOption.Create(200, cs(Tracker.color, "Tracker"), rates, null, true);
trackerUpdateIntervall = CustomOption.Create(201, "Tracker Update Intervall", 5f, 2.5f, 30f, 2.5f, trackerSpawnRate);
trackerUpdateIntervall = CustomOption.Create(201, "Tracker Update Intervall", 5f, 1f, 30f, 1f, trackerSpawnRate);
trackerResetTargetAfterMeeting = CustomOption.Create(202, "Tracker Reset Target After Meeting", false, trackerSpawnRate);
trackerCanTrackCorpses = CustomOption.Create(203, "Tracker Can Track Corpses", true, trackerSpawnRate);
trackerCorpsesTrackingCooldown = CustomOption.Create(204, "Corpses Tracking Cooldown", 30f, 5f, 120f, 5f, trackerCanTrackCorpses);
Expand Down Expand Up @@ -463,7 +471,13 @@ public static void Load() {
noVoteIsSelfVote = CustomOption.Create(5, "No Vote Is Self Vote", false, blockSkippingInEmergencyMeetings);
hidePlayerNames = CustomOption.Create(6, "Hide Player Names", false);
allowParallelMedBayScans = CustomOption.Create(7, "Allow Parallel MedBay Scans", false);

dynamicMap = CustomOption.Create(8, "Play On A Random Map", false, null, false);
dynamicMapEnableSkeld = CustomOption.Create(501, "Enable Skeld Rotation", true, dynamicMap, false);
dynamicMapEnableMira = CustomOption.Create(502, "Enable Mira Rotation", true, dynamicMap, false);
dynamicMapEnablePolus = CustomOption.Create(503, "Enable Polus Rotation", true, dynamicMap, false);
dynamicMapEnableAirShip = CustomOption.Create(504, "Enable Airship Rotation", true, dynamicMap, false);
dynamicMapEnableDleks = CustomOption.Create(505, "Enable dlekS Rotation", false, dynamicMap, false);

blockedRolePairings.Add((byte)RoleId.Vampire, new [] { (byte)RoleId.Warlock});
blockedRolePairings.Add((byte)RoleId.Warlock, new [] { (byte)RoleId.Vampire});
Expand Down
4 changes: 3 additions & 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.4.0";
public const string VersionString = "3.4.1";

public static System.Version Version = System.Version.Parse(VersionString);
internal static BepInEx.Logging.ManualLogSource Logger;
Expand All @@ -37,6 +37,7 @@ public class TheOtherRolesPlugin : BasePlugin
public static ConfigEntry<bool> GhostsSeeRoles { get; set; }
public static ConfigEntry<bool> GhostsSeeVotes{ get; set; }
public static ConfigEntry<bool> ShowRoleSummary { get; set; }
public static ConfigEntry<bool> ShowLighterDarker { get; set; }
public static ConfigEntry<string> StreamerModeReplacementText { get; set; }
public static ConfigEntry<string> StreamerModeReplacementColor { get; set; }
public static ConfigEntry<string> Ip { get; set; }
Expand Down Expand Up @@ -64,6 +65,7 @@ public override void Load() {
GhostsSeeRoles = Config.Bind("Custom", "Ghosts See Roles", true);
GhostsSeeVotes = Config.Bind("Custom", "Ghosts See Votes", true);
ShowRoleSummary = Config.Bind("Custom", "Show Role Summary", true);
ShowLighterDarker = Config.Bind("Custom", "Show Lighter / Darker", true);
ShowPopUpVersion = Config.Bind("Custom", "Show PopUp", "0");
StreamerModeReplacementText = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles");
StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");
Expand Down
4 changes: 3 additions & 1 deletion TheOtherRoles/MapOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static class MapOptions {
public static bool ghostsSeeVotes = true;
public static bool showRoleSummary = true;
public static bool allowParallelMedBayScans = false;
public static bool showLighterDarker = true;

// Updating values
public static int meetingsCount = 0;
Expand All @@ -38,6 +39,7 @@ public static void clearAndReloadMapOptions() {
ghostsSeeTasks = TheOtherRolesPlugin.GhostsSeeTasks.Value;
ghostsSeeVotes = TheOtherRolesPlugin.GhostsSeeVotes.Value;
showRoleSummary = TheOtherRolesPlugin.ShowRoleSummary.Value;
showLighterDarker = TheOtherRolesPlugin.ShowLighterDarker.Value;
}
}
}
}
2 changes: 1 addition & 1 deletion TheOtherRoles/Modules/ModUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ update to v{ver} is available</size>
}
}
} else {
announcement = $@"<size=150%>Version {ver}:</size>
announcement = $@"<size=150%><color=#FC0303>THE OTHER ROLES</color> Version {ver}:</size>
{announcement}";
}
Expand Down
1 change: 1 addition & 0 deletions TheOtherRoles/Patches/ClientOptionsPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static class ClientOptionsPatch
new SelectionBehaviour("Ghosts Can See Votes", () => MapOptions.ghostsSeeVotes = TheOtherRolesPlugin.GhostsSeeVotes.Value = !TheOtherRolesPlugin.GhostsSeeVotes.Value, TheOtherRolesPlugin.GhostsSeeVotes.Value),
new SelectionBehaviour("Ghosts Can See Roles", () => MapOptions.ghostsSeeRoles = TheOtherRolesPlugin.GhostsSeeRoles.Value = !TheOtherRolesPlugin.GhostsSeeRoles.Value, TheOtherRolesPlugin.GhostsSeeRoles.Value),
new SelectionBehaviour("Show Role Summary", () => MapOptions.showRoleSummary = TheOtherRolesPlugin.ShowRoleSummary.Value = !TheOtherRolesPlugin.ShowRoleSummary.Value, TheOtherRolesPlugin.ShowRoleSummary.Value),
new SelectionBehaviour("Show Lighter / Darker", () => MapOptions.showLighterDarker = TheOtherRolesPlugin.ShowLighterDarker.Value = !TheOtherRolesPlugin.ShowLighterDarker.Value, TheOtherRolesPlugin.ShowLighterDarker.Value),
};

private static GameObject popUp;
Expand Down
34 changes: 24 additions & 10 deletions TheOtherRoles/Patches/GameStartManagerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,32 @@ public static bool Prefix(GameStartManager __instance) {
break;
}
}
}

if (CustomOptionHolder.dynamicMap.getBool()) {
// 0 = Skeld
// 1 = Mira HQ
// 2 = Polus
// 3 = Dleks - deactivated
// 4 = Airship
List<byte> possibleMaps = new List<byte>(){0, 1, 2, 4};
PlayerControl.GameOptions.MapId = possibleMaps[TheOtherRoles.rnd.Next(possibleMaps.Count)];
if (CustomOptionHolder.dynamicMap.getBool() && continueStart) {
// 0 = Skeld
// 1 = Mira HQ
// 2 = Polus
// 3 = Dleks - deactivated
// 4 = Airship
List<byte> possibleMaps = new List<byte>();
if (CustomOptionHolder.dynamicMapEnableSkeld.getBool())
possibleMaps.Add(0);
if (CustomOptionHolder.dynamicMapEnableMira.getBool())
possibleMaps.Add(1);
if (CustomOptionHolder.dynamicMapEnablePolus.getBool())
possibleMaps.Add(2);
if (CustomOptionHolder.dynamicMapEnableDleks.getBool())
possibleMaps.Add(3);
if (CustomOptionHolder.dynamicMapEnableAirShip.getBool())
possibleMaps.Add(4);
byte chosenMapId = possibleMaps[TheOtherRoles.rnd.Next(possibleMaps.Count)];

MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.DynamicMapOption, Hazel.SendOption.Reliable, -1);
writer.Write(chosenMapId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.dynamicMapOption(chosenMapId);
}
}

return continueStart;
}
}
Expand Down
1 change: 0 additions & 1 deletion TheOtherRoles/Patches/PlayerControlPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ static void bountyHunterUpdate() {
BountyHunter.arrowUpdateTimer = 0f; // Force arrow to update
BountyHunter.bountyUpdateTimer = BountyHunter.bountyDuration;
var possibleTargets = new List<PlayerControl>();
if (Lovers.getPartner(BountyHunter.bountyHunter) != null)
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
if (!p.Data.IsDead && !p.Data.Disconnected && p != p.Data.Role.IsImpostor && p != Spy.spy && (p != Mini.mini || Mini.isGrownUp()) && (Lovers.getPartner(BountyHunter.bountyHunter) == null || p != Lovers.getPartner(BountyHunter.bountyHunter))) possibleTargets.Add(p);
}
Expand Down
Loading

0 comments on commit 1797451

Please sign in to comment.