Skip to content

Commit

Permalink
Preparation vor Update v4.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gendelo3 committed May 15, 2024
1 parent 8c55511 commit 9c36355
Show file tree
Hide file tree
Showing 31 changed files with 654 additions and 76 deletions.
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Even more roles are coming soon. :)
| [Witch](#witch) | [Tracker](#tracker) | | |
| [Ninja](#ninja) | [Snitch](#snitch) | | |
| [Bomber](#bomber) | [Spy](#spy) | | |
| [Evil Guesser](#guesser) | [Portalmaker](#portalmaker) | | |
| | [Security Guard](#security-guard) | | |
| [Yo-Yo](#yoyo) | [Portalmaker](#portalmaker) | | |
| [Evil Guesser](#guesser) | [Security Guard](#security-guard) | | |
| | [Medium](#medium) | | |
| | [Trapper](#trapper) | | |
| | [Nice Guesser](#guesser) | | |
Expand All @@ -42,6 +42,7 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
# Releases
| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
| 2024.3.5s| v4.5.3| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.3/TheOtherRoles.zip)
| 2024.3.5s| v4.5.2| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.2/TheOtherRoles.zip)
| 2023.11.28s| v4.5.1| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.1/TheOtherRoles.zip)

Expand Down Expand Up @@ -132,6 +133,19 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
<details>
<summary>Click to show the Changelog</summary>

**Version 4.5.3**
- Added a new role: Yo-Yo (Impostor) - Mark and blink to a position, then blink back to the start of the blink!
- Added a new option to Jackal And Sidekick: Jackal / Sidekick can sabotage lights (cooldown syncs with Imp Sabotages)
- Added a new option: Block Dead Impostor From Sabotaging
- Added a new option to the Tracker: Tracking Type: Arrow, Proximity Meter, Both
- Added a new feature: The host is always displayed to all players, in the meeting ui and ping tracker text
- Added a new feature: Ghosts see the icons of all players on their map
- Fixed the chat command to ban a player from the lobby `/ban`
- Fixed an issue where killing in PropHunt crashed the lobby
- Fixed an issue with the very short kill distance in Vanilla HideNSeek
- Changed trapper trap: is now visible with transparency to the trapper while inactive


**Version 4.5.2**
- Updated to Among Us version 2024.3.5s (various small / "long" features and bugfixes)
- Updated BepInEx dependency to 688
Expand Down Expand Up @@ -1228,6 +1242,31 @@ Crewmates can defuse a bomb depending on the settings.
| Bomb Is Active After |
-----------------------

## YoYo
### **Team: Impostors**
The Yo-Yo is an Impostor who has the ability mark a position and later blink (teleport) to this position.\
After the initial blink, the Yo-Yo has a fixed amount of time (option) to do whatever they want, before automatically blinking back to the starting point of the first blink.\
Each blink leaves behind a silhouette with configurable transparency. The silhouette is very hard to see.\
The Yo-Yo may also have access to a mobile admin table, depending on the settings.

**NOTE:**

- The marked position for the first jump's target is displayed to the Yo-Yo and ghosts only.
- The silhouette of the first blink stays (almost) until the Yo-Yo returns
- The silhouette of the second blink (return) stays for 5 seconds

### Game Options
| Name | Description |
|----------|:-------------:|
| Yo-Yo Spawn Chance | -
| Blink Duration | -
| Mark Location Cooldown | -
| Marked Location Stays After Meeting | -
| Has Admin Table | -
| Admin Table Cooldown | -
| Silhouette Visibility | -
-----------------------

## Guesser
### **Team: Crewmates or Impostors**
The Guesser can be a Crewmate or an Impostor (depending on the settings).\
Expand Down Expand Up @@ -1321,7 +1360,12 @@ If both Impostors and Jackals are in the game, the game continues even if all Cr
| Jackal/Sidekick Kill Cooldown | Kill cooldown |
| Jackal Create Sidekick Cooldown | Cooldown before a Sidekick can be created |
| Jackal can use vents | Yes/No |
| Jackal can sabotage Lights | Yes/No |
| Jackal can create a Sidekick | Yes/No |
| Sidekick gets promoted to Jackal on Jackal Death | Yes/No |
| Sidekick can kill | Yes/No |
| Sidekick can Vent | Yes/No |
| Jackal can sabotage Lights | Yes/No |
| Jackals promoted from Sidekick can create a Sidekick | Yes/No (to prevent the Jackal team from growing) |
| Jackals can make an Impostor to their Sidekick | Yes/No (to prevent a Jackal from turning an Impostor into a Sidekick, if they use the ability on an Impostor they see the Impostor as Sidekick, but the Impostor isn't converted to Sidekick. If this option is set to "No" Jackal and Sidekick can kill each other.) |
| Jackal and Sidekick have Impostor vision | - |
Expand Down Expand Up @@ -1685,6 +1729,7 @@ While accessing those mobile gadgets, the Hacker is not able to move.
The Tracker can select one player to track. Depending on the options the Tracker can track a different person after each meeting or the Tracker tracks the same person for the whole game.\
An arrow points to the last tracked position of the player.\
The arrow updates its position every few seconds (configurable).\
By an option, the arrow can be replaced or combined with the Proximity Tracker from Hide N Seek.\
Depending on the options, the Tracker has another ability: They can track all corpses on the map for a set amount of time. They will keep tracking corpses, even if they were cleaned or eaten by the Vulture.

**NOTE**
Expand All @@ -1699,6 +1744,7 @@ Depending on the options, the Tracker has another ability: They can track all co
| Tracker Can Track Corpses | -
| Corpses Tracking Cooldown | -
| Corpses Tracking Duration | -
| How Tracker Gets Target Location| -
-----------------------

## Snitch
Expand Down
159 changes: 158 additions & 1 deletion TheOtherRoles/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static class HudManagerStartPatch
public static CustomButton jackalKillButton;
public static CustomButton sidekickKillButton;
private static CustomButton jackalSidekickButton;
public static CustomButton jackalAndSidekickSabotageLightsButton;
private static CustomButton eraserButton;
private static CustomButton placeJackInTheBoxButton;
private static CustomButton lightsOutButton;
Expand All @@ -57,6 +58,8 @@ static class HudManagerStartPatch
public static CustomButton thiefKillButton;
public static CustomButton trapperButton;
public static CustomButton bomberButton;
public static CustomButton yoyoButton;
public static CustomButton yoyoAdminTableButton;
public static CustomButton defuseButton;
public static CustomButton zoomOutButton;
private static CustomButton hunterLighterButton;
Expand Down Expand Up @@ -136,6 +139,9 @@ public static void setCustomButtonCooldowns() {
mayorMeetingButton.MaxTimer = GameManager.Instance.LogicOptions.GetEmergencyCooldown();
trapperButton.MaxTimer = Trapper.cooldown;
bomberButton.MaxTimer = Bomber.bombCooldown;
yoyoButton.MaxTimer = Yoyo.markCooldown;
yoyoAdminTableButton.MaxTimer = Yoyo.adminCooldown;
yoyoAdminTableButton.EffectDuration = 10f;
hunterLighterButton.MaxTimer = Hunter.lightCooldown;
hunterAdminTableButton.MaxTimer = Hunter.AdminCooldown;
hunterArrowButton.MaxTimer = Hunter.ArrowCooldown;
Expand Down Expand Up @@ -1065,6 +1071,27 @@ public static void createButtonsPostfix(HudManager __instance) {
KeyCode.Q
);

jackalAndSidekickSabotageLightsButton = new CustomButton(
() => {
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.Sabotage, (byte)SystemTypes.Electrical);
},
() => {
return (Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && Jackal.canSabotageLights ||
Sidekick.sidekick != null && Sidekick.sidekick == CachedPlayer.LocalPlayer.PlayerControl && Sidekick.canSabotageLights) && !CachedPlayer.LocalPlayer.Data.IsDead;
},
() => {
if (Helpers.sabotageTimer() > jackalAndSidekickSabotageLightsButton.Timer || Helpers.sabotageActive())
jackalAndSidekickSabotageLightsButton.Timer = Helpers.sabotageTimer() + 5f; // this will give imps time to do another sabotage.
return Helpers.canUseSabotage();},
() => {
jackalAndSidekickSabotageLightsButton.Timer = Helpers.sabotageTimer() + 5f;
},
Trickster.getLightsOutButtonSprite(),
CustomButton.ButtonPositions.upperRowCenter,
__instance,
KeyCode.G
);

// Eraser erase button
eraserButton = new CustomButton(
() => {
Expand Down Expand Up @@ -1894,10 +1921,140 @@ public static void createButtonsPostfix(HudManager __instance) {
trapperChargesText.transform.localScale = Vector3.one * 0.5f;
trapperChargesText.transform.localPosition += new Vector3(-0.05f, 0.7f, 0);


// Yoyo button
yoyoButton = new CustomButton(
() => {
var pos = CachedPlayer.LocalPlayer.transform.position;
byte[] buff = new byte[sizeof(float) * 2];
Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));
if (Yoyo.markedLocation == null) {
TheOtherRolesPlugin.Logger.LogMessage($"marked location is null in button press");
MessageWriter writer = AmongUsClient.Instance.StartRpc(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.YoyoMarkLocation, Hazel.SendOption.Reliable);
writer.WriteBytesAndSize(buff);
writer.EndMessage();
RPCProcedure.yoyoMarkLocation(buff);
SoundEffectsManager.play("tricksterPlaceBox");
yoyoButton.Sprite = Yoyo.getBlinkButtonSprite();
yoyoButton.Timer = 10f;
yoyoButton.HasEffect = false;
yoyoButton.buttonText = "Blink";
} else {
TheOtherRolesPlugin.Logger.LogMessage("in else for some reason");
// Jump to location
TheOtherRolesPlugin.Logger.LogMessage($"trying to blink!");
var exit = (Vector3)Yoyo.markedLocation;
if (SubmergedCompatibility.IsSubmerged) {
SubmergedCompatibility.ChangeFloor(exit.y > -7);
}
MessageWriter writer = AmongUsClient.Instance.StartRpc(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.YoyoBlink, Hazel.SendOption.Reliable);
writer.Write(Byte.MaxValue);
writer.WriteBytesAndSize(buff);
writer.EndMessage();
RPCProcedure.yoyoBlink(true, buff);
yoyoButton.EffectDuration = Yoyo.blinkDuration;
yoyoButton.Timer = 10f;
yoyoButton.HasEffect = true;
yoyoButton.buttonText = "Returning...";
SoundEffectsManager.play("morphlingMorph");
}
},
() => { return Yoyo.yoyo != null && Yoyo.yoyo == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
() => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
() => {
if (Yoyo.markStaysOverMeeting) {
yoyoButton.Timer = 10f;
} else {
Yoyo.markedLocation = null;
yoyoButton.Timer = yoyoButton.MaxTimer;
yoyoButton.Sprite = Yoyo.getMarkButtonSprite();
yoyoButton.buttonText = "Mark Location";
}
},
Yoyo.getMarkButtonSprite(),
CustomButton.ButtonPositions.upperRowLeft,
__instance,
KeyCode.F,
false,
Yoyo.blinkDuration,
() => {
if (TransportationToolPatches.isUsingTransportation(Yoyo.yoyo)) {
yoyoButton.Timer = 0.5f;
yoyoButton.DeputyTimer = 0.5f;
yoyoButton.isEffectActive = true;
yoyoButton.actionButton.cooldownTimerText.color = new Color(0F, 0.8F, 0F);
return;
} else if (Yoyo.yoyo.inVent) {
__instance.ImpostorVentButton.DoClick();
}
// jump back!
var pos = CachedPlayer.LocalPlayer.transform.position;
byte[] buff = new byte[sizeof(float) * 2];
Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));
var exit = (Vector3)Yoyo.markedLocation;
if (SubmergedCompatibility.IsSubmerged) {
SubmergedCompatibility.ChangeFloor(exit.y > -7);
}
MessageWriter writer = AmongUsClient.Instance.StartRpc(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.YoyoBlink, Hazel.SendOption.Reliable);
writer.Write((byte)0);
writer.WriteBytesAndSize(buff);
writer.EndMessage();
RPCProcedure.yoyoBlink(false, buff);
yoyoButton.Timer = yoyoButton.MaxTimer;
yoyoButton.isEffectActive = false;
yoyoButton.actionButton.cooldownTimerText.color = Palette.EnabledColor;
yoyoButton.HasEffect = false;
yoyoButton.Sprite = Yoyo.getMarkButtonSprite();
yoyoButton.buttonText = "Mark Location";
SoundEffectsManager.play("morphlingMorph");
if (Minigame.Instance) {
Minigame.Instance.Close();
}
},
buttonText: "Mark Location"
);

yoyoAdminTableButton = new CustomButton(
() => {
if (!MapBehaviour.Instance || !MapBehaviour.Instance.isActiveAndEnabled) {
HudManager __instance = FastDestroyableSingleton<HudManager>.Instance;
__instance.InitMap();
MapBehaviour.Instance.ShowCountOverlay(allowedToMove: true, showLivePlayerPosition: true, includeDeadBodies: true);
}
},
() => { return Yoyo.yoyo != null && Yoyo.yoyo == CachedPlayer.LocalPlayer.PlayerControl && Yoyo.hasAdminTable && !CachedPlayer.LocalPlayer.Data.IsDead; },
() => {
return true;
},
() => {
yoyoAdminTableButton.Timer = yoyoAdminTableButton.MaxTimer;
yoyoAdminTableButton.isEffectActive = false;
yoyoAdminTableButton.actionButton.cooldownTimerText.color = Palette.EnabledColor;
},
Hacker.getAdminSprite(),
CustomButton.ButtonPositions.lowerRowCenter,
__instance,
KeyCode.G,
true,
0f,
() => {
yoyoAdminTableButton.Timer = yoyoAdminTableButton.MaxTimer;
if (MapBehaviour.Instance && MapBehaviour.Instance.isActiveAndEnabled) MapBehaviour.Instance.Close();
},
GameOptionsManager.Instance.currentNormalGameOptions.MapId == 3,
"ADMIN"
);


zoomOutButton = new CustomButton(
() => { Helpers.toggleZoom();
},
() => { if (CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.Data.IsDead || CachedPlayer.LocalPlayer.Data.Role.IsImpostor) return false;
() => { if (CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.Data.IsDead || (CachedPlayer.LocalPlayer.Data.Role.IsImpostor && !CustomOptionHolder.deadImpsBlockSabotage.getBool())) return false;
var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data);
int numberOfLeftTasks = playerTotal - playerCompleted;
return numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool();
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/CustomGameModes/PropHunt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public static bool AdminUsePostfix(MapConsole __instance) {
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.MurderPlayer))]
[HarmonyPostfix]
public static void MurderPlayerPostfix(PlayerControl __instance, [HarmonyArgument(0)] PlayerControl target) {
if (!PropHunt.isPropHuntGM) return;
if (!PropHunt.isPropHuntGM || target != CachedPlayer.LocalPlayer.PlayerControl) return;
try {
target.NetTransform.RpcSnapTo(__instance.transform.position);
} catch { }
Expand Down
Loading

0 comments on commit 9c36355

Please sign in to comment.