Skip to content

Commit 9742ff0

Browse files
committed
Update to v4.8.0
1 parent 5443351 commit 9742ff0

37 files changed

+944
-110
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
4242
# Releases
4343
| Among Us - Version| Mod Version | Link |
4444
|----------|-------------|-----------------|
45+
| 2024.11.26| v4.8.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.7.0/TheOtherRoles.zip)
4546
| 2024.11.26| v4.7.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.7.0/TheOtherRoles.zip)
4647
| 2024.6.18| v4.6.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.6.0/TheOtherRoles.zip)
4748

@@ -135,6 +136,18 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
135136
# Changelog
136137
<details>
137138
<summary>Click to show the Changelog</summary>
139+
140+
**Version 4.8.0**
141+
- Added an optional Role Draft mode, where players can select their role out of some roles that are shown to them.
142+
- Added a new option to allow the medic to shift the medic shield as well - no more invincible medics.
143+
- Added partial key rebinding - all kill buttons will now use the vanilla kill button shortcut, same for vent and each roles first ability.
144+
- Fixed the way options view panel to match vanilla changes
145+
- Fixed options not showing/hiding sub-options when switching Presets
146+
- Fixed a bug where voting the witch would not save the target
147+
- Fixed a some bugs with the trapper, bomber and portal
148+
- Fixed a bug in PropHunt where you players could not transform into props
149+
- Fixed the summary button for the last game appearing outside the lobby sometimes
150+
- Changed the positioning of the ping tracker in meetings
138151

139152
**Version 4.7.0**
140153
- Updated to Among Us version 2024.11.26 (Vanilla Updates)
@@ -904,6 +917,7 @@ Thanks to miniduikboot & GD for hosting modded servers (and so much more)
904917
[TheEpicRoles](https://github.com/LaicosVK/TheEpicRoles) - Idea for the first kill shield (partly) and the tabbed option menu (fully + some code), by **LaicosVK** **DasMonschta** **Nova**\
905918
[Ninja](#ninja), [Thief](#thief), [Lawyer](#lawyer) / [Pursuer](#pursuer), [Deputy](#deputy), [Portalmaker](#portalmaker), [Guesser Modifier](#guesser-modifier) - Idea: [K3ndo](https://github.com/K3ndoo) ; Developed by [Gendelo](https://github.com/gendelo3) & [Mallöris](https://github.com/Mallaris) \
906919
[ugackMiner53](https://github.com/ugackMiner53/PropHunt) - Idea and core code for the Prop Hunt game mode
920+
Role Draft Music: [Unreal Superhero 3 by Kenët & Rez](https://www.youtube.com/watch?v=9STiQ8cCIo0)
907921

908922
# Settings
909923
The mod adds a few new settings to Among Us (in addition to the role settings):

TheOtherRoles/Buttons.cs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static class HudManagerStartPatch
7272
private static CustomButton propHuntSpeedboostButton;
7373
public static CustomButton propHuntAdminButton;
7474
public static CustomButton propHuntFindButton;
75+
public static CustomButton eventKickButton;
7576

7677
public static Dictionary<byte, List<CustomButton>> deputyHandcuffedButtons = null;
7778
public static PoolablePlayer targetDisplay;
@@ -658,7 +659,7 @@ public static void createButtonsPostfix(HudManager __instance) {
658659
Hacker.getAdminSprite(),
659660
CustomButton.ButtonPositions.lowerRowRight,
660661
__instance,
661-
KeyCode.Q,
662+
KeyCode.G,
662663
true,
663664
0f,
664665
() => {
@@ -719,7 +720,7 @@ public static void createButtonsPostfix(HudManager __instance) {
719720
Hacker.getVitalsSprite(),
720721
CustomButton.ButtonPositions.lowerRowCenter,
721722
__instance,
722-
KeyCode.Q,
723+
KeyCode.H,
723724
true,
724725
0f,
725726
() => {
@@ -773,7 +774,7 @@ public static void createButtonsPostfix(HudManager __instance) {
773774
Tracker.getTrackCorpsesButtonSprite(),
774775
CustomButton.ButtonPositions.lowerRowCenter,
775776
__instance,
776-
KeyCode.Q,
777+
KeyCode.G,
777778
true,
778779
Tracker.corpsesTrackingDuration,
779780
() => {
@@ -964,7 +965,7 @@ public static void createButtonsPostfix(HudManager __instance) {
964965
Portalmaker.getUsePortalButtonSprite(),
965966
new Vector3(0.9f, -0.06f, 0),
966967
__instance,
967-
KeyCode.H,
968+
KeyCode.J,
968969
mirror: true
969970
);
970971

@@ -1004,7 +1005,7 @@ public static void createButtonsPostfix(HudManager __instance) {
10041005
Portalmaker.getUsePortalButtonSprite(),
10051006
new Vector3(0.9f, 1f, 0),
10061007
__instance,
1007-
KeyCode.J,
1008+
KeyCode.G,
10081009
mirror: true
10091010
);
10101011

@@ -1360,7 +1361,7 @@ public static void createButtonsPostfix(HudManager __instance) {
13601361
SecurityGuard.getCamSprite(),
13611362
CustomButton.ButtonPositions.lowerRowRight,
13621363
__instance,
1363-
KeyCode.Q,
1364+
KeyCode.G,
13641365
true,
13651366
0f,
13661367
() => {
@@ -2390,6 +2391,26 @@ public static void createButtonsPostfix(HudManager __instance) {
23902391
buttonText: "FIND"
23912392
);
23922393

2394+
eventKickButton = new CustomButton(
2395+
() => {
2396+
EventUtility.kickTarget();
2397+
},
2398+
() => { return EventUtility.isEnabled && Mini.mini != null && !Mini.mini.Data.IsDead && PlayerControl.LocalPlayer != Mini.mini; },
2399+
() => { return EventUtility.currentTarget != null; },
2400+
() => { },
2401+
EventUtility.getKickButtonSprite(),
2402+
CustomButton.ButtonPositions.highRowRight,
2403+
__instance,
2404+
KeyCode.K,
2405+
true,
2406+
3f,
2407+
() => {
2408+
// onEffectEnds
2409+
eventKickButton.Timer = 69;
2410+
},
2411+
buttonText: "KICK"
2412+
);
2413+
23932414
// Set the default (or settings from the previous game) timers / durations when spawning the buttons
23942415
initialized = true;
23952416
setCustomButtonCooldowns();

TheOtherRoles/CustomGameModes/PropHunt.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
using TMPro;
1414
using UnityEngine;
1515
using UnityEngine.Video;
16-
using static TheOtherRoles.Snitch;
17-
using static UnityEngine.GraphicsBuffer;
1816

1917
namespace TheOtherRoles.CustomGameModes {
2018
[HarmonyPatch]
@@ -78,7 +76,6 @@ class PropHunt {
7876
public static float dangerMeterActive = 0f;
7977

8078
private static List<GameObject> duplicatedCollider = new();
81-
private static GameObject introObject;
8279

8380
public static void clearAndReload() {
8481
remainingShots.Clear();
@@ -368,7 +365,7 @@ public static GameObject FindClosestDisguiseObject(GameObject origin, float radi
368365
}
369366
bool whiteListed = false;
370367
foreach (var whiteListedWord in whitelistedObjects) {
371-
if (collider.gameObject.name.Contains(whiteListedWord)) whiteListed = true;
368+
if ((bool)(collider.gameObject?.name?.Contains(whiteListedWord))) whiteListed = true;
372369
}
373370
if (collider.GetComponent<Console>() != null || whiteListed) {
374371
float dist = Vector2.Distance(origin.transform.position, collider.transform.position);
@@ -379,7 +376,9 @@ public static GameObject FindClosestDisguiseObject(GameObject origin, float radi
379376
}
380377
}
381378
return bestCollider.gameObject;
382-
} catch { return null; }
379+
} catch (Exception e) {
380+
TheOtherRolesPlugin.Logger.LogError($"Error in find closest disguise object: {e}");
381+
return null; }
383382
}
384383

385384
public static GameObject FindPropByNameAndPos(string propName, float posX) {
@@ -450,7 +449,6 @@ public static void IntroCutsceneDestroyPatch(IntroCutscene __instance) {
450449
HudManager.Instance.FullScreen.enabled = false;
451450
videoPlayer.Destroy();
452451
assetBundle.Unload(false);
453-
introObject.Destroy();
454452
} else {
455453
HudManager.Instance.FullScreen.enabled = true;
456454
HudManager.Instance.FullScreen.gameObject.SetActive(true);
@@ -523,14 +521,15 @@ public static void MakePropImpostorPatch(PlayerControl __instance) {
523521
[HarmonyPostfix]
524522
public static void MapSetPostfix() { // Make sure the map in the settings is in sync with the map from li
525523
if (TORMapOptions.gameMode != CustomGamemodes.PropHunt && TORMapOptions.gameMode != CustomGamemodes.HideNSeek || AmongUsClient.Instance.IsGameStarted) return;
526-
int map = GameOptionsManager.Instance.currentGameOptions.MapId;
524+
int? map = GameOptionsManager.Instance?.currentGameOptions?.MapId;
525+
if (map == null) return;
527526
if (map > 3) map--;
528527
if (TORMapOptions.gameMode == CustomGamemodes.HideNSeek)
529528
if (CustomOptionHolder.hideNSeekMap.selection != map)
530-
CustomOptionHolder.hideNSeekMap.updateSelection(map);
529+
CustomOptionHolder.hideNSeekMap.updateSelection((int)map);
531530
if (TORMapOptions.gameMode == CustomGamemodes.PropHunt)
532531
if (CustomOptionHolder.propHuntMap.selection != map)
533-
CustomOptionHolder.propHuntMap.updateSelection(map);
532+
CustomOptionHolder.propHuntMap.updateSelection((int)map);
534533
}
535534

536535

TheOtherRoles/CustomOptionHolder.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,18 @@ public class CustomOptionHolder {
2121
public static CustomOption modifiersCountMin;
2222
public static CustomOption modifiersCountMax;
2323

24+
public static CustomOption isDraftMode;
25+
public static CustomOption draftModeAmountOfChoices;
26+
public static CustomOption draftModeTimeToChoose;
27+
public static CustomOption draftModeShowRoles;
28+
public static CustomOption draftModeHideImpRoles;
29+
public static CustomOption draftModeHideNeutralRoles;
30+
2431
public static CustomOption anyPlayerCanStopStart;
2532
public static CustomOption enableEventMode;
33+
public static CustomOption eventReallyNoMini;
34+
public static CustomOption eventKicksPerRound;
35+
public static CustomOption eventHeavyAge;
2636
public static CustomOption deadImpsBlockSabotage;
2737

2838
public static CustomOption mafiaSpawnRate;
@@ -315,6 +325,7 @@ public class CustomOptionHolder {
315325
public static CustomOption modifierArmored;
316326

317327
public static CustomOption modifierShifter;
328+
public static CustomOption modifierShifterShiftsMedicShield;
318329

319330
public static CustomOption maxNumberOfMeetings;
320331
public static CustomOption blockSkippingInEmergencyMeetings;
@@ -433,6 +444,13 @@ public static void Load() {
433444

434445
if (Utilities.EventUtility.canBeEnabled) enableEventMode = CustomOption.Create(10423, Types.General, cs(Color.green, "Enable Special Mode"), true, null, true);
435446

447+
isDraftMode = CustomOption.Create(600, Types.General, cs(Color.yellow, "Enable Role Draft"), false, null, true, null, "Role Draft");
448+
draftModeAmountOfChoices = CustomOption.Create(601, Types.General, cs(Color.yellow, "Max Amount Of Roles\nTo Choose From"), 5f, 2f, 15f, 1f, isDraftMode, false);
449+
draftModeTimeToChoose = CustomOption.Create(602, Types.General, cs(Color.yellow, "Time For Selection"), 5f, 3f, 20f, 1f, isDraftMode, false);
450+
draftModeShowRoles = CustomOption.Create(603, Types.General, cs(Color.yellow, "Show Picked Roles"), false, isDraftMode, false);
451+
draftModeHideImpRoles = CustomOption.Create(604, Types.General, cs(Color.yellow, "Hide Impostor Roles"), false, draftModeShowRoles, false);
452+
draftModeHideNeutralRoles = CustomOption.Create(605, Types.General, cs(Color.yellow, "Hide Neutral Roles"), false, draftModeShowRoles, false);
453+
436454
// Using new id's for the options to not break compatibilty with older versions
437455
crewmateRolesCountMin = CustomOption.Create(300, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Crewmate Roles"), 15f, 0f, 15f, 1f, null, true, heading: "Min/Max Roles");
438456
crewmateRolesCountMax = CustomOption.Create(301, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Crewmate Roles"), 15f, 0f, 15f, 1f);
@@ -718,6 +736,11 @@ public static void Load() {
718736
modifierMini = CustomOption.Create(1061, Types.Modifier, cs(Color.yellow, "Mini"), rates, null, true);
719737
modifierMiniGrowingUpDuration = CustomOption.Create(1062, Types.Modifier, "Mini Growing Up Duration", 400f, 100f, 1500f, 100f, modifierMini);
720738
modifierMiniGrowingUpInMeeting = CustomOption.Create(1063, Types.Modifier, "Mini Grows Up In Meeting", true, modifierMini);
739+
if (Utilities.EventUtility.canBeEnabled || Utilities.EventUtility.isEnabled) {
740+
eventKicksPerRound = CustomOption.Create(10424, Types.Modifier, cs(Color.green, "Maximum Kicks Mini Suffers"), 4f, 0f, 14f, 1f, modifierMini);
741+
eventHeavyAge = CustomOption.Create(10425, Types.Modifier, cs(Color.green, "Age At Which Mini Is Heavy"), 12f, 6f, 18f, 0.5f, modifierMini);
742+
eventReallyNoMini = CustomOption.Create(10426, Types.Modifier, cs(Color.green, "Really No Mini :("), false, modifierMini, invertedParent: true);
743+
}
721744

722745
modifierVip = CustomOption.Create(1070, Types.Modifier, cs(Color.yellow, "VIP"), rates, null, true);
723746
modifierVipQuantity = CustomOption.Create(1071, Types.Modifier, cs(Color.yellow, "VIP Quantity"), ratesModifier, modifierVip);
@@ -736,6 +759,7 @@ public static void Load() {
736759
modifierArmored = CustomOption.Create(1101, Types.Modifier, cs(Color.yellow, "Armored"), rates, null, true);
737760

738761
modifierShifter = CustomOption.Create(1100, Types.Modifier, cs(Color.yellow, "Shifter"), rates, null, true);
762+
modifierShifterShiftsMedicShield = CustomOption.Create(1102, Types.Modifier, "Can Shift Medic Shield", false, modifierShifter);
739763

740764
// Guesser Gamemode (2000 - 2999)
741765
guesserGamemodeCrewNumber = CustomOption.Create(2001, Types.Guesser, cs(Guesser.color, "Number of Crew Guessers"), 15f, 0f, 15f, 1f, null, true, heading: "Amount of Guessers");

TheOtherRoles/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public enum CustomGamemodes {
3333
}
3434
public static class Helpers
3535
{
36-
36+
public static string previousEndGameSummary = "";
3737
public static Dictionary<string, Sprite> CachedSprites = new();
3838

3939
public static Sprite loadSpriteFromResources(string path, float pixelsPerUnit, bool cache=true) {

TheOtherRoles/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace TheOtherRoles
3232
public class TheOtherRolesPlugin : BasePlugin
3333
{
3434
public const string Id = "me.eisbison.theotherroles";
35-
public const string VersionString = "4.7.0";
35+
public const string VersionString = "4.8.0";
3636
public static uint betaDays = 0; // amount of days for the build to be usable (0 for infinite!)
3737

3838
public static Version Version = Version.Parse(VersionString);

TheOtherRoles/Modules/CustomColors.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ public static bool Prefix(ChatNotification __instance, PlayerControl sender, str
204204
str = ColorUtility.ToHtmlStringRGB(c);
205205

206206
color = c.r + c.g + c.b > 180 ? Palette.Black : Palette.White;
207-
TheOtherRolesPlugin.Logger.LogMessage($"{c.r}, {c.g}, {c.b}");
208207
}
209208
__instance.playerColorText.text = __instance.player.ColorBlindName;
210209
__instance.playerNameText.text = "<color=#" + str + ">" + (string.IsNullOrEmpty(sender.Data.PlayerName) ? "..." : sender.Data.PlayerName);

0 commit comments

Comments
 (0)