# Releases\r
| Among Us - Version| Mod Version | Link |\r
|----------|-------------|-----------------|\r
+| 2021.3.5s | v1.8.2 | [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.8.2/TheOtherRoles.zip)\r
| 2021.3.5s | v1.8.1 | [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.8.1/TheOtherRoles.zip)\r
| 2021.3.5s | v1.8 | [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.8/TheOtherRoles.zip)\r
| 2021.3.5s | v1.7 | [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.7/TheOtherRoles.zip)\r
<details>\r
<summary>Click to show the Changelog</summary>\r
\r
+**Hotfix 1.8.2**\r
+- Add map and impostor count to lobby settings.\r
+- Fixed bugs where changing players to be the Sidekick didn't reset all the effects of their previous role. \r
+\r
**Hotfix 1.8.1** Resolves bugs that occured when the Jackal recruited a Medic, Swapper and Tracker\\r
\\r
**Changes in v1.8:**\r
</details>\r
\r
# Installation \r
-1. Download and unzip the newest [release](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.8.1/TheOtherRoles.zip)\r
+1. Download and unzip the newest [release](https://github.com/Eisbison/TheOtherRoles/releases/download/v1.8.2/TheOtherRoles.zip)\r
2. Find the folder of your game, for steams players you can right click in steam, on the game, a menu will appear proposing you to go to the folders.3. Make a copy of your game, it's not obligatory but advise, put it where you want.\r
4. Drag or extract the files from the zip into your game, at the .exe level.\r
6. Run the game (the first launch might take a while)\r
vampireKillButton.MaxTimer = Vampire.cooldown;
trackerButton.MaxTimer = 0f;
garlicButton.MaxTimer = 0f;
-
- spyButton.EffectDuration = Spy.duration;
- vampireKillButton.EffectDuration= Vampire.delay;
-
jackalKillButton.MaxTimer = Jackal.cooldown;
sidekickKillButton.MaxTimer = Sidekick.cooldown;
jackalSidekickButton.MaxTimer = Jackal.createSidekickCooldown;
+
+ spyButton.EffectDuration = Spy.duration;
+ vampireKillButton.EffectDuration= Vampire.delay;
}
public static void Postfix(HudManager __instance)
() => {
engineerRepairButton.Timer = 0f;
- MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.None, -1);
+ MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(usedRepairWriter);
RPCProcedure.engineerUsedRepair();
foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks) {
if (task.TaskType == TaskTypes.FixLights) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerFixLights, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerFixLights, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.engineerFixLights();
} else if (task.TaskType == TaskTypes.RestoreOxy) {
{
GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JanitorClean, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JanitorClean, Hazel.SendOption.Reliable, -1);
writer.Write(playerInfo.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.janitorClean(playerInfo.PlayerId);
sheriffKillButton = new CustomButton(
() => {
if (Medic.shielded != null && Medic.shielded == Sheriff.currentTarget) {
- MessageWriter attemptWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.None, -1);
+ MessageWriter attemptWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(attemptWriter);
RPCProcedure.shieldedMurderAttempt();
return;
else {
targetId = PlayerControl.LocalPlayer.PlayerId;
}
- MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.None, -1);
+ MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.Reliable, -1);
killWriter.Write(targetId);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
RPCProcedure.sheriffKill(targetId);
// Time Master Rewind Time
timeMasterRewindTimeButton = new CustomButton(
() => {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TimeMasterRewindTime, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TimeMasterRewindTime, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.timeMasterRewindTime();
timeMasterRewindTimeButton.Timer = timeMasterRewindTimeButton.MaxTimer;
() => {
medicShieldButton.Timer = 0f;
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MedicSetShielded, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MedicSetShielded, Hazel.SendOption.Reliable, -1);
writer.Write(Medic.currentTarget.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.medicSetShielded(Medic.currentTarget.PlayerId);
() => {
shifterShiftButton.Timer = shifterShiftButton.MaxTimer;
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShifterShift, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShifterShift, Hazel.SendOption.Reliable, -1);
writer.Write(Shifter.currentTarget.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
targetOrMistake = players[index];
}
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SeerReveal, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SeerReveal, Hazel.SendOption.Reliable, -1);
writer.Write(Seer.currentTarget.PlayerId);
writer.Write(targetOrMistake.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
morphlingButton = new CustomButton(
() => {
if (Morphling.sampledTarget != null) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MorphlingMorph, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MorphlingMorph, Hazel.SendOption.Reliable, -1);
writer.Write(Morphling.sampledTarget.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
// Camouflager camouflage
camouflagerButton = new CustomButton(
() => {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CamouflagerCamouflage, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CamouflagerCamouflage, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.camouflagerCamouflage();
},
// Tracker button
trackerButton = new CustomButton(
() => {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TrackerUsedTracker, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TrackerUsedTracker, Hazel.SendOption.Reliable, -1);
writer.Write(Tracker.currentTarget.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId);
} else {
Vampire.bitten = Vampire.currentTarget;
Reactor.Coroutines.Start(Vampire.killWithDelay());
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireBiteNotification, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireBiteNotification, Hazel.SendOption.Reliable, -1);
writer.Write(Vampire.bitten.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.vampireBiteNotification(Vampire.bitten.PlayerId);
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));
- MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceGarlic, Hazel.SendOption.None);
+ MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceGarlic, Hazel.SendOption.Reliable);
writer.WriteBytesAndSize(buff);
writer.EndMessage();
RPCProcedure.placeGarlic(buff);
// Jackal Sidekick Button
jackalSidekickButton = new CustomButton(
() => {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalCreatesSidekick, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalCreatesSidekick, Hazel.SendOption.Reliable, -1);
writer.Write(Jackal.currentTarget.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId);
() => {
if (!Helpers.handleMurderAttempt(Jackal.currentTarget)) return;
byte targetId = Jackal.currentTarget.PlayerId;
- MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalKill, Hazel.SendOption.None, -1);
+ MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalKill, Hazel.SendOption.Reliable, -1);
killWriter.Write(targetId);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
RPCProcedure.jackalKill(targetId);
() => {
if (!Helpers.handleMurderAttempt(Sidekick.currentTarget)) return;
byte targetId = Sidekick.currentTarget.PlayerId;
- MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickKill, Hazel.SendOption.None, -1);
+ MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickKill, Hazel.SendOption.Reliable, -1);
killWriter.Write(targetId);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
RPCProcedure.sidekickKill(targetId);
{
static void Postfix(VersionShower __instance) {
string spacer = new String('\n', 15);
- string text = "[FCCE03FF]TheOtherRoles[] v1.8.1:\n- Modded by [FCCE03FF]Eisbison[] and [FFEB91FF]Thunderstorm584[]\n- Balanced with [FFEB91FF]Dhalucard";
+ string text = "[FCCE03FF]TheOtherRoles[] v1.8.2:\n- Modded by [FCCE03FF]Eisbison[] and [FFEB91FF]Thunderstorm584[]\n- Balanced with [FFEB91FF]Dhalucard";
if (__instance.text.Text.Contains(spacer))
__instance.text.Text += "\n" + text;
else
}
private static bool CheckAndEndGameForJackalWin(ShipStatus __instance, PlayerStatistics statistics) {
- if (statistics.TeamJackalAlive >= statistics.TotalAlive - statistics.TeamJackalAlive && statistics.TeamImpostorsAlive == 0 && !(statistics.TeamJackalHasAliveLover)) {
+ if (statistics.TeamJackalAlive >= statistics.TotalAlive - statistics.TeamJackalAlive && statistics.TeamImpostorsAlive == 0 && !(statistics.TeamJackalHasAliveLover && statistics.TeamLoversAlive == 2)) {
if (!DestroyableSingleton<TutorialManager>.InstanceExists)
{
__instance.enabled = false;
}
private static bool CheckAndEndGameForImpostorWin(ShipStatus __instance, PlayerStatistics statistics) {
- if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive && statistics.TeamJackalAlive == 0 && !(statistics.TeamImpostorHasAliveLover)) {
+ if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive && statistics.TeamJackalAlive == 0 && !(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2)) {
if (!DestroyableSingleton<TutorialManager>.InstanceExists) {
__instance.enabled = false;
GameOverReason endReason;
__result = hudString;
}
}
+
+ [HarmonyPatch(typeof(GameSettingMenu), "OnEnable")]
+ class GameSettingMenuPatch {
+ public static void Prefix(GameSettingMenu __instance) {
+ __instance.HideForOnline = new Transform[]{};
+ }
+ }
}
\ No newline at end of file
// Block impostor shielded kill
if (Medic.shielded != null && Medic.shielded == target) {
if (notifyOthers) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
}
RPCProcedure.shieldedMurderAttempt();
// Terminate round
if(Input.GetKeyDown(KeyCode.L)) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ForceEnd, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ForceEnd, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.forceEnd();
}
}
if (firstPlayer != null && secondPlayer != null) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SwapperSwap, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SwapperSwap, Hazel.SendOption.Reliable, -1);
writer.Write((byte)firstPlayer.TargetPlayerId);
writer.Write((byte)secondPlayer.TargetPlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
if (ExileController.Instance.exiled != null) {
byte exiledId = ExileController.Instance.exiled.PlayerId;
if ((Jester.jester != null && Jester.jester.PlayerId == exiledId) || (BountyHunter.bountyHunter != null && !BountyHunter.bountyHunter.Data.IsDead && BountyHunter.target != null && BountyHunter.target.PlayerId == exiledId)) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JesterBountyHunterWin, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JesterBountyHunterWin, Hazel.SendOption.Reliable, -1);
writer.Write(exiledId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.jesterBountyHunterWin(exiledId);
if (TimeMaster.reviveDuringRewind && PlayerControl.LocalPlayer.Data.IsDead) {
DeadPlayer deadPlayer = deadPlayers.Where(x => x.player == PlayerControl.LocalPlayer).FirstOrDefault();
if (deadPlayer != null && next.Item2 < deadPlayer.timeOfDeath) {
- MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.TimeMasterRevive, SendOption.None, -1);
+ MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.TimeMasterRevive, Hazel.SendOption.Reliable, -1);
write.Write(PlayerControl.LocalPlayer.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(write);
RPCProcedure.timeMasterRevive(PlayerControl.LocalPlayer.PlayerId);
}
static void engineerUpdate() {
- if (PlayerControl.LocalPlayer.Data.IsImpostor && Engineer.engineer != null) {
+ if (PlayerControl.LocalPlayer.Data.IsImpostor) {
foreach (Vent vent in ShipStatus.Instance.AllVents) {
if (vent.Field_7?.material != null) {
- if (Engineer.engineer.inVent) {
+ if (Engineer.engineer != null && Engineer.engineer.inVent) {
vent.Field_7.material.SetFloat("_Outline", 1f);
vent.Field_7.material.SetColor("_OutlineColor", Engineer.color);
} else if (vent.Field_7.material.GetColor("_AddColor") != Color.red) {
}
static void trackerUpdate() {
- if (Tracker.tracker == null || Tracker.tracked == null) return;
+ if (Tracker.arrow?.arrow == null) return;
- if (Tracker.arrow?.arrow != null && PlayerControl.LocalPlayer != Tracker.tracker) {
+ if (Tracker.tracker == null || PlayerControl.LocalPlayer != Tracker.tracker) {
Tracker.arrow.arrow.SetActive(false);
return;
}
- if (Tracker.arrow?.arrow != null && Tracker.tracked != null) {
+ if (Tracker.tracker != null && Tracker.tracked != null && PlayerControl.LocalPlayer == Tracker.tracker && !Tracker.tracker.Data.IsDead) {
Tracker.timeUntilUpdate -= Time.fixedDeltaTime;
if (Tracker.timeUntilUpdate <= 0f) {
bool trackedOnMap = !Tracker.tracked.Data.IsDead;
- System.Console.WriteLine("Update");
Vector3 position = Tracker.tracked.transform.position;
if (!trackedOnMap) { // Check for dead body
DeadBody body = UnityEngine.Object.FindObjectsOfType<DeadBody>().FirstOrDefault(b => b.ParentId == Tracker.tracked.PlayerId);
if (body != null) {
trackedOnMap = true;
position = body.transform.position;
- System.Console.WriteLine("DeadBody");
}
}
if ((Lovers.lover1 != null && PAIBDFDMIGK == Lovers.lover1) || (Lovers.lover2 != null && PAIBDFDMIGK == Lovers.lover2)) {
PlayerControl otherLover = PAIBDFDMIGK == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
if (PlayerControl.LocalPlayer == PAIBDFDMIGK && otherLover != null && !otherLover.Data.IsDead && Lovers.bothDie) { // Only the dead lover sends the rpc
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoverSuicide, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoverSuicide, Hazel.SendOption.Reliable, -1);
writer.Write(otherLover.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.loverSuicide(otherLover.PlayerId);
// Sidekick promotion trigger on murder
if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead && PAIBDFDMIGK == Jackal.jackal) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.sidekickPromotes();
}
// Sidekick promotion trigger on exile
if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead && __instance == Jackal.jackal) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.sidekickPromotes();
}
if(player == Lighter.lighter) Lighter.clearAndReload();
if(player == Detective.detective) Detective.clearAndReload();
if(player == TimeMaster.timeMaster) TimeMaster.clearAndReload();
- if(player == Medic.medic) {
- if (Medic.shielded != null) Medic.shielded.myRend.material.SetFloat("_Outline", 0f);
- Medic.clearAndReload();
- }
+ if(player == Medic.medic) Medic.clearAndReload();
if(player == Shifter.shifter) Shifter.clearAndReload();
if(player == Seer.seer) Seer.clearAndReload();
if(player == Spy.spy) Spy.clearAndReload();
}
private static void setRoleToPlayer(byte roleId, byte playerId) {
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetRole, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetRole, Hazel.SendOption.Reliable, -1);
writer.Write(roleId);
writer.Write(playerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
public static void Postfix(Il2CppReferenceArray<GameData.PlayerInfo> FMAOEJEHPAO)
{
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ResetVaribles, Hazel.SendOption.None, -1);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ResetVaribles, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.resetVariables();
// byte targetId = availableTargets[rnd.Next(0, availableTargets.Count)].PlayerId;
// crewmates.RemoveAt(bountyHunterIndex);
// setRoleToPlayer((byte)RoleId.BountyHunter, bountyHunterId);
- // writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetBountyHunterTarget, Hazel.SendOption.None, -1);
+ // writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetBountyHunterTarget, Hazel.SendOption.Reliable, -1);
// writer.Write(targetId);
// AmongUsClient.Instance.FinishRpcImmediately(writer);
// RPCProcedure.setBountyHunterTarget(targetId);
public static void clearAndReload() {
medic = null;
+ if (shielded?.myRend?.material != null) shielded.myRend.material.SetFloat("_Outline", 0f);
shielded = null;
currentTarget = null;
usedShield = false;
public static PlayerControl morphTarget;
public static float morphTimer = 0f;
+ public static void resetMorph() {
+ morphTarget = null;
+ morphTimer = 0f;
+ if (morphling == null) return;
+ morphling.SetName(morphling.Data.PlayerName);
+ morphling.SetHat(morphling.Data.HatId, (int)morphling.Data.ColorId);
+ Helpers.setSkinWithAnim(morphling.MyPhysics, morphling.Data.SkinId);
+ morphling.SetPet(morphling.Data.PetId);
+ morphling.CurrentPet.Visible = morphling.Visible;
+ morphling.SetColor(morphling.Data.ColorId);
+ }
public static void clearAndReload() {
+ resetMorph();
morphling = null;
currentTarget = null;
sampledTarget = null;
return buttonSprite;
}
+ public static void resetCamouflage() {
+ camouflageTimer = 0f;
+ foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
+ if (p == null) continue;
+ if (Morphling.morphling == null || Morphling.morphling != p) {
+ p.SetName(p.Data.PlayerName);
+ p.SetHat(p.Data.HatId, (int)p.Data.ColorId);
+ Helpers.setSkinWithAnim(p.MyPhysics, p.Data.SkinId);
+ p.SetPet(p.Data.PetId);
+ p.CurrentPet.Visible = p.Visible;
+ p.SetColor(p.Data.ColorId);
+ }
+ }
+ }
+
public static void clearAndReload() {
+ resetCamouflage();
camouflager = null;
camouflageTimer = 0f;
cooldown = TheOtherRolesPlugin.camouflagerCooldown.GetValue();
usedTracker = false;
timeUntilUpdate = 0f;
updateIntervall = TheOtherRolesPlugin.trackerUpdateIntervall.GetValue();
+ if (arrow?.arrow != null) UnityEngine.Object.Destroy(arrow.arrow);
arrow = new Arrow(Color.blue);
if (arrow.arrow != null) arrow.arrow.SetActive(false);
}
public static IEnumerator killWithDelay() {
yield return new WaitForSeconds(delay);
- MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.None, -1);
+ MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
RPCProcedure.vampireTryKill();
}
public static int taskCountForImpostors = 1;
public static void clearAndReload() {
+ if (localArrows != null) {
+ foreach (Arrow arrow in localArrows)
+ if (arrow?.arrow != null)
+ UnityEngine.Object.Destroy(arrow.arrow);
+ }
localArrows = new List<Arrow>();
taskCountForImpostors = Mathf.RoundToInt(TheOtherRolesPlugin.snitchLeftTasksForImpostors.GetValue());
snitch = null;
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>
<Description>TheOtherRoles</Description>
- <Authors>Eibison</Authors>
+ <Authors>Eisbison</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
// Everyone but morphling reset
if (oldCamouflageTimer > 0f && Camouflager.camouflageTimer <= 0f) {
- foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
- if (Morphling.morphling == null || Morphling.morphling != p) {
- if (Seer.seer == null || Seer.seer != PlayerControl.LocalPlayer)
- p.SetName(p.Data.PlayerName);
- p.SetHat(p.Data.HatId, (int)p.Data.ColorId);
- Helpers.setSkinWithAnim(p.MyPhysics, p.Data.SkinId);
- p.SetPet(p.Data.PetId);
- p.CurrentPet.Visible = p.Visible;
- p.SetColor(p.Data.ColorId);
- }
- }
+ Camouflager.resetCamouflage();
}
// Morphling reset
if ((oldMorphTimer > 0f || oldCamouflageTimer > 0f) && Camouflager.camouflageTimer <= 0f && Morphling.morphTimer <= 0f && Morphling.morphling != null) {
- Morphling.morphTarget = null;
- if (Seer.seer == null || Seer.seer != PlayerControl.LocalPlayer)
- Morphling.morphling.SetName(Morphling.morphling.Data.PlayerName);
- Morphling.morphling.SetHat(Morphling.morphling.Data.HatId, (int)Morphling.morphling.Data.ColorId);
- Helpers.setSkinWithAnim(Morphling.morphling.MyPhysics, Morphling.morphling.Data.SkinId);
- Morphling.morphling.SetPet(Morphling.morphling.Data.PetId);
- Morphling.morphling.CurrentPet.Visible = Morphling.morphling.Visible;
- Morphling.morphling.SetColor(Morphling.morphling.Data.ColorId);
+ Morphling.resetMorph();
}
}
public static void childUpdate() {
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
if (p == null) continue;
-
- if (Child.child == null) {
- p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
- return;
- }
+ p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
+ if (Child.child == null) continue;
float growingProgress = Child.growingProgress();
float scale = growingProgress * 0.35f + 0.35f;
}
static void snitchUpdate() {
- if (Snitch.snitch == null) return;
+ if (Snitch.localArrows == null) return;
foreach (Arrow arrow in Snitch.localArrows) arrow.arrow.SetActive(false);
- if (Snitch.snitch.Data.IsDead) return;
+
+ if (Snitch.snitch == null || Snitch.snitch.Data.IsDead) return;
int numberOfTasks = 0;
GameData.PlayerInfo playerInfo = Snitch.snitch.Data;