Skip to content

Commit a6cbe49

Browse files
v5.0.3 Source Code
1 parent 198b9b8 commit a6cbe49

File tree

135 files changed

+1066
-683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1066
-683
lines changed

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Join our [Discord](https://discord.gg/ugyc4EVUYZ) if you have any problems or wa
8484
# Releases
8585
| Among Us - Version| Mod Version | Link |
8686
|----------|-------------|-----------------|
87+
| 2023.11.28s & 2023.11.28e | v5.0.3 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v5.0.3/ToU.v5.0.3.zip) |
8788
| 2023.7.12s & 2023.7.12e | v5.0.2 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v5.0.2/ToU.v5.0.2.zip) |
8889
| 2023.6.13s & 2023.6.13e | v5.0.1 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v5.0.1/ToU.v5.0.1.zip) |
8990
| 2023.6.13s & 2023.6.13e | v5.0.0 | [Download](https://github.com/eDonnes124/Town-Of-Us/releases/download/v5.0.0/ToU.v5.0.0.zip) |
@@ -146,6 +147,21 @@ Join our [Discord](https://discord.gg/ugyc4EVUYZ) if you have any problems or wa
146147
<details>
147148
<summary> Changelog </summary>
148149
<details>
150+
<summary> v5.0.3 </summary>
151+
<ul> <li>Compatibility with the new Among Us version v2023.11.28</li> </ul>
152+
<ul> <li>Role gen system reparied, courtesy of @AlchlcDvl</li> </ul>
153+
<ul> <li>Role color is now used for interaction highlights</li> </ul>
154+
<ul> <li>Changes to intro role colors, courtesy of @Loonie-Toons</li> </ul>
155+
<ul> <li>Custom keybinds for interactions - integration to among us keybinds, courtesy of @whichtwix</li> </ul>
156+
<ul> <li>Added a tiny discord rich prescense line</li> </ul>
157+
<ul> <li>Disperse added back to submerged and heli</li> </ul>
158+
<ul> <li>Multiple revived people from altruist appear on imposters arrows, rather than just the latest, courtesy of @whichtwix</li> </ul>
159+
<ul> <li>Ping tracker reduced in size</li> </ul>
160+
<ul> <li>Host is now shown in the ping tracker whilst in the lobby</li> </ul>
161+
<ul> <li>Shows host in top left of lobby meetings</li> </ul>
162+
<ul> <li>-- Soon to come: Full rewrite.</li> </ul>
163+
</details>
164+
<details>
149165
<summary> v5.0.2 </summary>
150166
<ul> <li>Compatibility with the new Among Us version v2023.7.12</li> </ul>
151167
<ul> <li>New Setting: Detective can detect last killer</li> </ul>
@@ -725,6 +741,15 @@ Join our [Discord](https://discord.gg/ugyc4EVUYZ) if you have any problems or wa
725741
\
726742
A first launch may take up to 5 minutes, so be patient if it doesn't launch immediately.<br/>
727743
<br/>
744+
If the mod does not work and the version of Among Us that you see in the main menu, under the town of us logo or bottom left, does not correspond to the version indicated in the [releases table](#releases) above please do the following to get the correct version:
745+
746+
**1. Go to Among Us in your Steam library**\
747+
\
748+
**2. Click the gears icon or right click among us and then go into properties**\
749+
\
750+
**3. Go to betas and select "public-previous" in the drop box**\
751+
\
752+
**4. Reinstall the game and redo the mod installation, recreate your copy of the game if necessary**
728753

729754
## Installation Guide (Epic Games)
730755
**1. [Download](#releases) the Town of Us version corresponding to the installed Among Us version.**\
@@ -756,6 +781,25 @@ A first launch may take up to 5 minutes, so be patient if it doesn't launch imme
756781
A first launch may take up to 5 minutes, so be patient if it doesn't launch immediately.<br/>
757782
<br/>
758783

784+
If the mod does not work and the version of Among Us that you see in the main menu, under the town of us logo or bottom left, does not correspond to the version indicated in the [releases table](#releases) above please do the following to get the correct version:
785+
786+
**1. Download the latest downgrade script(DowngradeEpic.ps1) [here](https://github.com/whichtwix/EpicGamesDowngrader/releases/latest).**\
787+
\
788+
**2. Right click the file and click "run with powershell". If it does not open or instantly closes do the following:**\
789+
- search powershell in your windows search bar and open it <br>
790+
- navigate to the folder the script is in, by doing for example ```cd downloads``` or ```cd desktop``` <br>
791+
- write ```Set-ExecutionPolicy Unrestricted -Scope Process``` and click enter <br>
792+
- write ```./DowngradeEpic.ps1``` and click enter <br>
793+
\
794+
**3. Click the y key the couple times it prompts, and look above the prompt at the 'install path' to see where among us is getting installed.**\
795+
\
796+
**4. After its finished reinstall the mod to that path**\
797+
\
798+
**5. Open the game using a .cmd file that gets created in the same folder the script is, it will have the version of among us in its name. Do not use the epic launcher.**\
799+
\
800+
If there any problems with the script please check the [faq](https://github.com/whichtwix/EpicGamesDowngrader/tree/main#common-issues), and make contact with the discord server or in a issue [here](https://github.com/whichtwix/EpicGamesDowngrader/issues/new).<br/>
801+
<br/>
802+
759803
![Install](https://i.imgur.com/pvBAyZN.png)
760804
<br/>
761805
## Issues
@@ -1928,4 +1972,4 @@ v1.2.0 has Essentials embedded and can be found [here](https://github.com/slushi
19281972

19291973
#
19301974
<p align="center">This mod is not affiliated with Among Us or Innersloth LLC, and the content contained therein is not endorsed or otherwise sponsored by Innersloth LLC. Portions of the materials contained herein are property of Innersloth LLC.</p>
1931-
<p align="center">© Innersloth LLC.</p>
1975+
<p align="center">© Innersloth LLC.</p>

source/Extensions/AmongUsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static Texture2D CreateEmptyTexture(int width = 0, int height = 0)
127127
return new Texture2D(width, height, TextureFormat.RGBA32, Texture.GenerateAllMips, false, IntPtr.Zero);
128128
}
129129

130-
public static TMPro.TextMeshPro nameText(this PlayerControl p) => p.cosmetics.nameText;
130+
public static TMPro.TextMeshPro nameText(this PlayerControl p) => p?.cosmetics?.nameText;
131131

132132
public static TMPro.TextMeshPro NameText(this PoolablePlayer p) => p.cosmetics.nameText;
133133

source/Patches/AddHauntPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static void ExileControllerPostfix(ExileController __instance)
3939
[HarmonyPatch(typeof(Object), nameof(Object.Destroy), new Type[] { typeof(GameObject) })]
4040
public static void Prefix(GameObject obj)
4141
{
42-
if (!SubmergedCompatibility.Loaded || GameOptionsManager.Instance?.currentNormalGameOptions?.MapId != 5) return;
42+
if (!SubmergedCompatibility.Loaded || GameOptionsManager.Instance?.currentNormalGameOptions?.MapId != 6) return;
4343
if (obj.name?.Contains("ExileCutscene") == true) ExileControllerPostfix(ExileControllerPatch.lastExiled);
4444
}
4545
}

source/Patches/CamoComms.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public static void Postfix(HudManager __instance)
1616
if (ShipStatus.Instance != null)
1717
switch (GameOptionsManager.Instance.currentNormalGameOptions.MapId)
1818
{
19+
default:
1920
case 0:
2021
case 2:
2122
case 3:
2223
case 4:
23-
case 5:
2424
case 6:
2525
var comms1 = ShipStatus.Instance.Systems[SystemTypes.Comms].Cast<HudOverrideSystemType>();
2626
if (comms1.IsActive)
@@ -32,6 +32,7 @@ public static void Postfix(HudManager __instance)
3232

3333
break;
3434
case 1:
35+
case 5:
3536
var comms2 = ShipStatus.Instance.Systems[SystemTypes.Comms].Cast<HqHudSystemType>();
3637
if (comms2.IsActive)
3738
{

source/Patches/CrewmateRoles/AltruistMod/Coroutine.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ namespace TownOfUs.CrewmateRoles.AltruistMod
1515
{
1616
public class Coroutine
1717
{
18-
public static ArrowBehaviour Arrow;
19-
public static PlayerControl Target;
18+
public static Dictionary<PlayerControl, ArrowBehaviour> Revived = new();
2019
public static Sprite Sprite => TownOfUs.Arrow;
2120

2221
public static IEnumerator AltruistRevive(DeadBody target, Altruist role)
@@ -103,13 +102,14 @@ public static IEnumerator AltruistRevive(DeadBody target, Altruist role)
103102
if (PlayerControl.LocalPlayer.Data.IsImpostor() || PlayerControl.LocalPlayer.Is(Faction.NeutralKilling))
104103
{
105104
var gameObj = new GameObject();
106-
Arrow = gameObj.AddComponent<ArrowBehaviour>();
105+
var Arrow = gameObj.AddComponent<ArrowBehaviour>();
107106
gameObj.transform.parent = PlayerControl.LocalPlayer.gameObject.transform;
108107
var renderer = gameObj.AddComponent<SpriteRenderer>();
109108
renderer.sprite = Sprite;
110109
Arrow.image = renderer;
111110
gameObj.layer = 5;
112-
Target = player;
111+
Revived.Add(player, Arrow);
112+
//Target = player;
113113
yield return Utils.FlashCoroutine(role.Color, 1f, 0.5f);
114114
}
115115
}

source/Patches/CrewmateRoles/AltruistMod/PerformKillButton.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using HarmonyLib;
2-
using Hazel;
32
using Reactor.Utilities;
43
using TownOfUs.Roles;
54
using UnityEngine;

source/Patches/CrewmateRoles/AltruistMod/UpdateArrows.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ public class UpdateArrows
88
{
99
public static void Postfix(PlayerControl __instance)
1010
{
11-
if (Coroutine.Arrow != null)
11+
foreach (var revived in Coroutine.Revived)
1212
{
1313
if (LobbyBehaviour.Instance || MeetingHud.Instance || PlayerControl.LocalPlayer.Data.IsDead ||
14-
Coroutine.Target.Data.IsDead)
14+
revived.Key.Data.IsDead)
1515
{
16-
Coroutine.Arrow.gameObject.Destroy();
17-
Coroutine.Target = null;
16+
revived.Value.gameObject.Destroy();
17+
Coroutine.Revived.Remove(revived.Key);
1818
return;
1919
}
2020

21-
Coroutine.Arrow.target = Coroutine.Target.transform.position;
21+
revived.Value.target = revived.Key.transform.position;
2222
}
2323
}
2424
}

source/Patches/CrewmateRoles/EngineerMod/KillButtonSprite.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Linq;
21
using HarmonyLib;
32
using TownOfUs.Roles;
43
using UnityEngine;
@@ -47,11 +46,9 @@ public static void Postfix(HudManager __instance)
4746
if (!ShipStatus.Instance) return;
4847
var system = ShipStatus.Instance.Systems[SystemTypes.Sabotage].Cast<SabotageSystemType>();
4948
if (system == null) return;
50-
var specials = system.specials.ToArray();
51-
var dummyActive = system.dummy.IsActive;
52-
var sabActive = specials.Any(s => s.IsActive);
49+
var sabActive = system.AnyActive;
5350
var renderer = __instance.KillButton.graphic;
54-
if (sabActive & !dummyActive & role.ButtonUsable & __instance.KillButton.enabled)
51+
if (sabActive & role.ButtonUsable & __instance.KillButton.enabled)
5552
{
5653
renderer.color = Palette.EnabledColor;
5754
renderer.material.SetFloat("_Desat", 0f);

source/Patches/CrewmateRoles/EngineerMod/PerformKill.cs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Linq;
21
using HarmonyLib;
3-
using Hazel;
42
using TownOfUs.Roles;
53

64
namespace TownOfUs.CrewmateRoles.EngineerMod
@@ -21,12 +19,10 @@ public static bool Prefix(KillButton __instance)
2119
if (!role.ButtonUsable) return false;
2220
var system = ShipStatus.Instance.Systems[SystemTypes.Sabotage].Cast<SabotageSystemType>();
2321
if (system == null) return false;
24-
var specials = system.specials.ToArray();
25-
var dummyActive = system.dummy.IsActive;
26-
var sabActive = specials.Any(s => s.IsActive);
27-
if (!sabActive | dummyActive) return false;
22+
var sabActive = system.AnyActive;
23+
if (!sabActive) return false;
2824
role.UsesLeft -= 1;
29-
25+
Utils.Rpc(CustomRPC.EngineerFix, PlayerControl.LocalPlayer.NetId);
3026
switch (GameOptionsManager.Instance.currentNormalGameOptions.MapId)
3127
{
3228
case 0:
@@ -63,12 +59,24 @@ public static bool Prefix(KillButton __instance)
6359
case 4:
6460
var comms4 = ShipStatus.Instance.Systems[SystemTypes.Comms].Cast<HudOverrideSystemType>();
6561
if (comms4.IsActive) return FixComms();
66-
var reactor = ShipStatus.Instance.Systems[SystemTypes.Reactor].Cast<HeliSabotageSystem>();
62+
var reactor = ShipStatus.Instance.Systems[SystemTypes.HeliSabotage].Cast<HeliSabotageSystem>();
6763
if (reactor.IsActive) return FixAirshipReactor();
6864
var lights4 = ShipStatus.Instance.Systems[SystemTypes.Electrical].Cast<SwitchSystem>();
6965
if (lights4.IsActive) return FixLights(lights4);
7066
break;
7167
case 5:
68+
var reactor7 = ShipStatus.Instance.Systems[SystemTypes.Reactor].Cast<ReactorSystemType>();
69+
if (reactor7.IsActive) return FixReactor(SystemTypes.Reactor);
70+
var comms7 = ShipStatus.Instance.Systems[SystemTypes.Comms].Cast<HqHudSystemType>();
71+
if (comms7.IsActive) return FixMiraComms();
72+
var mushroom = ShipStatus.Instance.Systems[SystemTypes.MushroomMixupSabotage].Cast<MushroomMixupSabotageSystem>();
73+
if (mushroom.IsActive)
74+
{
75+
mushroom.currentSecondsUntilHeal = 0.1f;
76+
return false;
77+
}
78+
break;
79+
case 6:
7280
var reactor5 = ShipStatus.Instance.Systems[SystemTypes.Reactor].Cast<ReactorSystemType>();
7381
if (reactor5.IsActive) return FixReactor(SystemTypes.Reactor);
7482
var lights5 = ShipStatus.Instance.Systems[SystemTypes.Electrical].Cast<SwitchSystem>();
@@ -83,7 +91,7 @@ public static bool Prefix(KillButton __instance)
8391
}
8492
}
8593
break;
86-
case 6:
94+
case 7:
8795
var comms6 = ShipStatus.Instance.Systems[SystemTypes.Comms].Cast<HudOverrideSystemType>();
8896
if (comms6.IsActive) return FixComms();
8997
var reactor6 = ShipStatus.Instance.Systems[SystemTypes.Reactor].Cast<ReactorSystemType>();
@@ -95,40 +103,40 @@ public static bool Prefix(KillButton __instance)
95103
break;
96104
}
97105

98-
Utils.Rpc(CustomRPC.EngineerFix, PlayerControl.LocalPlayer.NetId);
106+
99107

100108
return false;
101109
}
102110

103111
private static bool FixComms()
104112
{
105-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 0);
113+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.Comms, 0);
106114
return false;
107115
}
108116

109117
private static bool FixMiraComms()
110118
{
111-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 0);
112-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 1);
119+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.Comms, 16 | 0);
120+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.Comms, 16 | 1);
113121
return false;
114122
}
115123

116124
private static bool FixAirshipReactor()
117125
{
118-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16 | 0);
119-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16 | 1);
126+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.HeliSabotage, 16 | 0);
127+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.HeliSabotage, 16 | 1);
120128
return false;
121129
}
122130

123131
private static bool FixReactor(SystemTypes system)
124132
{
125-
ShipStatus.Instance.RpcRepairSystem(system, 16);
133+
ShipStatus.Instance.RpcUpdateSystem(system, 16);
126134
return false;
127135
}
128136

129137
private static bool FixOxygen()
130138
{
131-
ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 16);
139+
ShipStatus.Instance.RpcUpdateSystem(SystemTypes.LifeSupp, 16);
132140
return false;
133141
}
134142

source/Patches/CrewmateRoles/HaunterMod/RepickHaunter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using HarmonyLib;
22
using System.Linq;
3-
using Hazel;
43
using UnityEngine;
54

65
namespace TownOfUs.CrewmateRoles.HaunterMod

0 commit comments

Comments
 (0)