Skip to content

Commit

Permalink
v4.0.4 Source Code
Browse files Browse the repository at this point in the history
  • Loading branch information
eDonnes124 committed Apr 17, 2023
1 parent 2fcd75f commit 389cd03
Show file tree
Hide file tree
Showing 73 changed files with 735 additions and 1,096 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Join our [Discord](https://discord.gg/ugyc4EVUYZ) if you have any problems or wa
# Releases
| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
| 2023.3.28s & 2023.3.28e | v4.0.4 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v4.0.4/ToU.v4.0.4.zip) |
| 2023.2.28s & 2023.2.28e | v4.0.3 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v4.0.3/ToU.v4.0.3.zip) |
| 2022.12.14s & 2022.12.14e | v4.0.2 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v4.0.2/ToU.v4.0.2.zip) |
| 2022.12.14s & 2022.12.14e | v4.0.1 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v4.0.1/ToU.v4.0.1.zip) |
Expand Down Expand Up @@ -131,6 +132,11 @@ Join our [Discord](https://discord.gg/ugyc4EVUYZ) if you have any problems or wa
<details>
<summary> Changelog </summary>
<details>
<summary> v4.0.4 </summary>
<ul> <li>Compatibility with the new Among Us version v2023.3.28</li> </ul>
<ul> <li>Haunter/Phantom/Traitor spawn adjustments</li> </ul>
</details>
<details>
<summary> v4.0.3 </summary>
<ul> <li>Compatibility with the new Among Us version v2023.2.28</li> </ul>
<ul> <li>New Setting: Who can see dead players on admin (under Spy)</li> </ul>
Expand Down Expand Up @@ -1642,7 +1648,6 @@ When they are the only remaining Impostor, they will have their kill cooldown sh
| Camouflaged Comms | Whether everyone becomes camouflaged when Comms are sabotaged | Toggle | False |
| Impostors can see the roles of their team | Whether Impostors are able to see which Impostor roles their teammates have | Toggle | False |
| Dead can see everyone's roles and Votes | Whether dead players are able to see the roles and votes of everyone else | Toggle | False |
| Probability of a completely vanilla game | The percentage probability of a vanilla Among Us game happening | Percentage | 0% |
| Game Start Cooldowns | The cooldown for all roles at the start of the game | Time | 10s |
| Parallel Medbay Scans | Whether players have to wait for others to scan | Toggle | False |
| Disable Meeting Skip Button | Whether the meeting button is disabled | No / Emergency / Always | No |
Expand Down
20 changes: 0 additions & 20 deletions source/Patches/AddHauntPatch.cs

This file was deleted.

2 changes: 2 additions & 0 deletions source/Patches/CrewmateRoles/AltruistMod/Coroutine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Object = UnityEngine.Object;
using TownOfUs.Roles.Modifiers;
using AmongUs.GameOptions;
using TownOfUs.Patches;

namespace TownOfUs.CrewmateRoles.AltruistMod
{
Expand Down Expand Up @@ -98,6 +99,7 @@ public static IEnumerator AltruistRevive(DeadBody target, Altruist role)
{
}

ExilePatch.CheckTraitorSpawn(null);

if (PlayerControl.LocalPlayer.Data.IsImpostor() || PlayerControl.LocalPlayer.Is(RoleEnum.Glitch) || PlayerControl.LocalPlayer.Is(RoleEnum.Juggernaut)
|| PlayerControl.LocalPlayer.Is(RoleEnum.Arsonist) || PlayerControl.LocalPlayer.Is(RoleEnum.Werewolf)
Expand Down
7 changes: 5 additions & 2 deletions source/Patches/CrewmateRoles/AltruistMod/KillButtonTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ public static bool Prefix(KillButton __instance)
public static void SetTarget(KillButton __instance, DeadBody target, Altruist role)
{
if (role.CurrentTarget && role.CurrentTarget != target)
role.CurrentTarget.bodyRenderer.material.SetFloat("_Outline", 0f);
{
foreach (var body in role.CurrentTarget.bodyRenderers) body.material.SetFloat("_Outline", 0f);
}

if (target != null && target.ParentId == DontRevive) target = null;
role.CurrentTarget = target;
if (role.CurrentTarget && __instance.enabled)
{
var component = role.CurrentTarget.bodyRenderer;
SpriteRenderer component = null;
foreach (var body in role.CurrentTarget.bodyRenderers) component = body;
component.material.SetFloat("_Outline", 1f);
component.material.SetColor("_OutlineColor", Color.red);
__instance.graphic.color = Palette.EnabledColor;
Expand Down
2 changes: 1 addition & 1 deletion source/Patches/CrewmateRoles/DetectiveMod/DeadBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static string ParseBodyReport(BodyReport br)
return
$"Body Report: The killer appears to be a Crewmate! (Killed {Math.Round(br.KillAge / 1000)}s ago)";

else if (br.Killer.Is(Faction.Neutral))
else if (br.Killer.Is(Faction.NeutralKilling) || br.Killer.Is(Faction.NeutralOther))
return
$"Body Report: The killer appears to be a Neutral Role! (Killed {Math.Round(br.KillAge / 1000)}s ago)";

Expand Down
4 changes: 2 additions & 2 deletions source/Patches/CrewmateRoles/HaunterMod/CompleteTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Postfix(PlayerControl __instance)
{
Coroutines.Start(Utils.FlashCoroutine(role.Color));
}
else if (PlayerControl.LocalPlayer.Data.IsImpostor() || (PlayerControl.LocalPlayer.Is(Faction.Neutral) && CustomGameOptions.HaunterRevealsNeutrals))
else if (PlayerControl.LocalPlayer.Data.IsImpostor() || (PlayerControl.LocalPlayer.Is(Faction.NeutralKilling) && CustomGameOptions.HaunterRevealsNeutrals))
{
role.Revealed = true;
Coroutines.Start(Utils.FlashCoroutine(role.Color));
Expand All @@ -48,7 +48,7 @@ public static void Postfix(PlayerControl __instance)
{
Coroutines.Start(Utils.FlashCoroutine(Color.white));
}
else if (PlayerControl.LocalPlayer.Data.IsImpostor() || (PlayerControl.LocalPlayer.Is(Faction.Neutral) && CustomGameOptions.HaunterRevealsNeutrals))
else if (PlayerControl.LocalPlayer.Data.IsImpostor() || (PlayerControl.LocalPlayer.Is(Faction.NeutralKilling) && CustomGameOptions.HaunterRevealsNeutrals))
{
Coroutines.Start(Utils.FlashCoroutine(Color.white));
}
Expand Down
9 changes: 9 additions & 0 deletions source/Patches/CrewmateRoles/HaunterMod/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TownOfUs.CrewmateRoles.HaunterMod
{
public enum HaunterCanBeClickedBy
{
All,
NonCrew,
ImpsOnly
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void UpdateMeeting(MeetingHud __instance)
var role = Role.GetRole(player);
if (player.Is(Faction.Impostors))
state.NameText.color = Palette.ImpostorRed;
if (player.Is(Faction.Neutral) && CustomGameOptions.HaunterRevealsNeutrals)
if (player.Is(Faction.NeutralKilling) && CustomGameOptions.HaunterRevealsNeutrals)
state.NameText.color = role.Color;
}
}
Expand Down
32 changes: 0 additions & 32 deletions source/Patches/CrewmateRoles/HaunterMod/RepickHaunter.cs

This file was deleted.

124 changes: 0 additions & 124 deletions source/Patches/CrewmateRoles/HaunterMod/SetHaunter.cs

This file was deleted.

2 changes: 1 addition & 1 deletion source/Patches/CrewmateRoles/ImitatorMod/StopImitate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)] GameDat
{
return;
}
if (StartImitate.ImitatingPlayer != null)
if (StartImitate.ImitatingPlayer != null && !StartImitate.ImitatingPlayer.Is(RoleEnum.Traitor))
{
PlayerControl lastExaminedPlayer = null;
List<RoleEnum> trappedPlayers = null;
Expand Down
6 changes: 2 additions & 4 deletions source/Patches/CrewmateRoles/SeerMod/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ private static void UpdateMeeting(MeetingHud __instance, Seer seer)
((player.Is(RoleEnum.Sheriff) || player.Is(RoleEnum.Veteran) || player.Is(RoleEnum.Vigilante)) && !CustomGameOptions.CrewKillingRed) ||
((player.Is(RoleEnum.Amnesiac) || player.Is(RoleEnum.Survivor) || player.Is(RoleEnum.GuardianAngel)) && !CustomGameOptions.NeutBenignRed) ||
((player.Is(RoleEnum.Executioner) || player.Is(RoleEnum.Jester) || player.Is(RoleEnum.Phantom)) && !CustomGameOptions.NeutEvilRed) ||
((player.Is(RoleEnum.Arsonist) || player.Is(RoleEnum.Glitch) || player.Is(RoleEnum.Juggernaut) ||
player.Is(RoleEnum.Plaguebearer) || player.Is(RoleEnum.Pestilence) || player.Is(RoleEnum.Werewolf)) && !CustomGameOptions.NeutKillingRed))
(player.Is(Faction.NeutralKilling) && !CustomGameOptions.NeutKillingRed))
{
state.NameText.color = Color.green;
}
Expand Down Expand Up @@ -73,8 +72,7 @@ private static void Postfix(HudManager __instance)
((player.Is(RoleEnum.Sheriff) || player.Is(RoleEnum.Veteran) || player.Is(RoleEnum.Vigilante)) && !CustomGameOptions.CrewKillingRed) ||
((player.Is(RoleEnum.Amnesiac) || player.Is(RoleEnum.Survivor) || player.Is(RoleEnum.GuardianAngel)) && !CustomGameOptions.NeutBenignRed) ||
((player.Is(RoleEnum.Executioner) || player.Is(RoleEnum.Jester) || player.Is(RoleEnum.Phantom)) && !CustomGameOptions.NeutEvilRed) ||
((player.Is(RoleEnum.Arsonist) || player.Is(RoleEnum.Glitch) || player.Is(RoleEnum.Juggernaut) ||
player.Is(RoleEnum.Plaguebearer) || player.Is(RoleEnum.Pestilence) || player.Is(RoleEnum.Werewolf)) && !CustomGameOptions.NeutKillingRed))
(player.Is(Faction.NeutralKilling) && !CustomGameOptions.NeutKillingRed))
{
player.nameText().color = Color.green;
}
Expand Down
4 changes: 2 additions & 2 deletions source/Patches/CrewmateRoles/SnitchMod/HighlightImpostors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private static void UpdateMeeting(MeetingHud __instance)
state.NameText.color = Palette.ImpostorRed;
else if (player.Is(RoleEnum.Traitor) && CustomGameOptions.SnitchSeesTraitor)
state.NameText.color = Palette.ImpostorRed;
if (player.Is(Faction.Neutral) && CustomGameOptions.SnitchSeesNeutrals)
if (player.Is(Faction.NeutralKilling) && CustomGameOptions.SnitchSeesNeutrals)
state.NameText.color = role.Color;
}
}
Expand All @@ -38,7 +38,7 @@ public static void Postfix(HudManager __instance)
if (player.Data.IsImpostor() && !player.Is(RoleEnum.Traitor)) player.nameText().color = Palette.ImpostorRed;
else if (player.Is(RoleEnum.Traitor) && CustomGameOptions.SnitchSeesTraitor) player.nameText().color = Palette.ImpostorRed;
var playerRole = Role.GetRole(player);
if (playerRole.Faction == Faction.Neutral && CustomGameOptions.SnitchSeesNeutrals)
if (playerRole.Faction == Faction.NeutralKilling && CustomGameOptions.SnitchSeesNeutrals)
player.nameText().color = playerRole.Color;
}
}
Expand Down
26 changes: 0 additions & 26 deletions source/Patches/CrewmateRoles/SpyMod/Vitals.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using TownOfUs.Roles;
using System;
using Hazel;
using Reactor.Utilities.Extensions;

namespace TownOfUs.CrewmateRoles.TransporterMod
{
Expand Down
4 changes: 1 addition & 3 deletions source/Patches/CrewmateRoles/TransporterMod/Update.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Linq;
using HarmonyLib;
using HarmonyLib;
using InnerNet;
using TownOfUs.Roles;
using UnityEngine;

namespace TownOfUs.CrewmateRoles.TransporterMod
{
Expand Down
Loading

0 comments on commit 389cd03

Please sign in to comment.