public static void updateMeetingHUD(MeetingHud __instance) { foreach (PlayerVoteArea player in __instance.HBDFFAHBIGI) { if (PlayerControlPatch.Mayor.name == player.NameText.Text && PlayerControlPatch.IsMayor(PlayerControl.LocalPlayer)) { player.NameText.Color = new Color(0.44f, 0.31f, 0.66f, 1f); } } }
public static void Postfix(IntroCutscene_CoBegin_d__10 __instance) { if (PlayerControlPatch.IsMayor(PlayerControl.LocalPlayer)) { __instance.field_Public_PENEIDJGGAF_0.Title.Text = "Mayor"; __instance.field_Public_PENEIDJGGAF_0.Title.Color = new Color(0.44f, 0.31f, 0.66f, 1f); __instance.field_Public_PENEIDJGGAF_0.ImpostorText.Text = "Your vote counts twice"; __instance.field_Public_PENEIDJGGAF_0.BackgroundBar.material.color = new Color(0.44f, 0.31f, 0.66f, 1f); } }
public static void Postfix([HarmonyArgument(0)] Il2CppReferenceArray <GameDataPlayerInfo> infected) { MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, 41, SendOption.None, -1); List <PlayerControl> crewMates = PlayerControlPatch.GetCrewMates(infected); System.Random random = new System.Random(); PlayerControlPatch.Mayor = crewMates[random.Next(0, crewMates.Count)]; byte playerId = PlayerControlPatch.Mayor.PlayerId; messageWriter.Write(playerId); AmongUsClient.Instance.FinishRpcImmediately(messageWriter); }
public static void Postfix(HudManager __instance) { if (MeetingHud.Instance != null) { HudPatch.updateMeetingHUD(MeetingHud.Instance); } if (PlayerControl.AllPlayerControls.Count > 1 && PlayerControlPatch.Mayor != null && PlayerControlPatch.IsMayor(PlayerControl.LocalPlayer)) { PlayerControl.LocalPlayer.nameText.Color = new Color(0.44f, 0.31f, 0.66f, 1f); } }