Skip to content

Commit 4565333

Browse files
committed
Update to v4.4.1
1 parent f6cfa07 commit 4565333

File tree

6 files changed

+58
-31
lines changed

6 files changed

+58
-31
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
4242
# Releases
4343
| Among Us - Version| Mod Version | Link |
4444
|----------|-------------|-----------------|
45+
| 2023.07.12s| v4.4.1| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.4.1/TheOtherRoles.zip)
46+
| 2023.07.12s| v4.4.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.4.0/TheOtherRoles.zip)
4547
| 2023.07.12s| v4.3.4| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.4/TheOtherRoles.zip)
4648
| 2023.07.12s| v4.3.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.3/TheOtherRoles.zip)
4749
| 2023.03.28s| v4.3.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.2/TheOtherRoles.zip)
@@ -125,6 +127,9 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
125127
<details>
126128
<summary>Click to show the Changelog</summary>
127129

130+
**Version 4.4.1**
131+
- Fixed a bug where PropHunt buttons did not work for the Hunters after watching the intro cutscene.
132+
128133
**Version 4.4.0**
129134
- Added a new gamemode, PropHunt. Players can disguise as objects on the map
130135
- Changed Lighter and Darker colors: L/D are no longer random, but rather assigned in alternating order.
@@ -801,7 +806,7 @@ docker run -d -p 22023:22023/udp --env IMPOSTOR_AntiCheatEnabled=false --env IMP
801806
[Goose-Goose-Duck](https://store.steampowered.com/app/1568590/Goose_Goose_Duck) - Idea for the Vulture role came from **Slushiegoose**\
802807
[TheEpicRoles](https://github.com/LaicosVK/TheEpicRoles) - Idea for the first kill shield (partly) and the tabbed option menu (fully + some code), by **LaicosVK** **DasMonschta** **Nova**\
803808
[Ninja](#ninja), [Thief](#thief), [Lawyer](#lawyer) / [Pursuer](#pursuer), [Deputy](#deputy), [Portalmaker](#portalmaker), [Guesser Modifier](#guesser-modifier) - Idea: [K3ndo](https://github.com/K3ndoo) ; Developed by [Gendelo](https://github.com/gendelo3) & [Mallöris](https://github.com/Mallaris) \
804-
[dMiner53](https://github.com/ugackMiner53/PropHunt) - Idea and core code for the Prop Hunt game mode
809+
[ugackMiner53](https://github.com/ugackMiner53/PropHunt) - Idea and core code for the Prop Hunt game mode
805810

806811
# Settings
807812
The mod adds a few new settings to Among Us (in addition to the role settings):
@@ -2103,12 +2108,15 @@ When a Prop dies, they will either join the Hunter team or die (setting).
21032108
#### Prop Abilities:
21042109
- Invisibility: As a disguised Prop, become invisible for x seconds.
21052110
- Speedboost: Move faster for x seconds.
2111+
- Disguise: While near a usable object, press the button to disguise as the displayed object!
21062112

21072113
**NOTE:**
21082114
- The Report button lights up, but cannot be pressed.
21092115
- Hunters can vent
21102116
- The Kill Button and Vent Button are permanently enabled, so that you cannot use them to check if there is a prop nearby
21112117
- The Kill Button can always be pressed, but you can also miss if no Prop is nearby. The cooldown can be configured for hits and misses seperately.
2118+
- Usable prop objects are: All task consoles as well as many objects (rocks, snowpeople, barriers, beds, tables, ...)
2119+
- Any object on **LevelImposter** maps, that contains `liprop` in its name and has a `SpriteRenderer` (+ Sprite) will be usable as a prop too!
21122120

21132121

21142122
### Game Options

TheOtherRoles/CustomGameModes/PropHunt.cs

+45-26
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,9 @@ public static Sprite getIntroSprite(int index) {
122122
return Helpers.loadSpriteFromResources($"TheOtherRoles.Resources.IntroAnimation.intro_{index + 1000}.png", 150f, cache: false);
123123
}
124124

125-
public static void update() {
126-
127-
if (!isPropHuntGM) {
128-
// Make sure the DangerMeter is not displayed in TOR HideNSeek, Classic or Guesser Game mode.
129-
if (GameOptionsManager.Instance.currentGameOptions.GameMode != AmongUs.GameOptions.GameModes.HideNSeek) HudManager.Instance.DangerMeter?.gameObject.SetActive(false);
130-
return;
131-
}
132-
if (timerRunning) timer = Math.Clamp(timer -= Time.deltaTime, 0, timer >= 0 ? timer : 0);
133-
else if (blackOutTimer > 0f) blackOutTimer -= Time.deltaTime;
134125

135-
// Local player find prop Target:
126+
public static void propTargetAndTimerDisplayUpdate() {
127+
136128
if (!PlayerControl.LocalPlayer.Data.Role.IsImpostor) currentTarget = FindClosestDisguiseObject(PlayerControl.LocalPlayer.gameObject, 1f);
137129

138130
if (timerText == null) {
@@ -157,18 +149,20 @@ public static void update() {
157149
timerText.text = Helpers.cs(timerRunning ? Color.blue : Color.red, suffix);
158150
timerText.outlineColor = Color.white;
159151
timerText.outlineWidth = 0.1f;
160-
timerText.color = timerRunning ? Color.blue : Color.red;
152+
timerText.color = timerRunning ? Color.blue : Color.red;
161153
}
162154
}
163155
if (HudManagerStartPatch.propDisguiseButton != null && HudManagerStartPatch.propDisguiseButton.Timer > HudManagerStartPatch.propDisguiseButton.MaxTimer) HudManagerStartPatch.propDisguiseButton.Timer = HudManagerStartPatch.propDisguiseButton.MaxTimer;
164-
// poolable players update.
156+
}
157+
158+
public static void poolablePlayerUpdate() {
165159
if (poolablesBackground == null) {
166160
poolablesBackground = new GameObject("poolablesBackground");
167161
poolablesBackground.AddComponent<SpriteRenderer>();
168162
if (poolablesBackgroundSprite == null) poolablesBackgroundSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.poolablesBackground.jpg", 200f);
169163
}
170164
poolablesBackground.transform.SetParent(HudManager.Instance.transform);
171-
poolablesBackground.transform.localPosition = IntroCutsceneOnDestroyPatch.bottomLeft + new Vector3(-1.45f, -0.05f, 0) + Vector3.right * PlayerControl.AllPlayerControls.Count * 0.2f;
165+
poolablesBackground.transform.localPosition = IntroCutsceneOnDestroyPatch.bottomLeft + new Vector3(-1.45f, -0.05f, 0) + Vector3.right * PlayerControl.AllPlayerControls.Count * 0.2f;
172166
var backgroundSizeX = PlayerControl.AllPlayerControls.Count * 0.4f + 0.2f;
173167
poolablesBackground.GetComponent<SpriteRenderer>().sprite = poolablesBackgroundSprite;
174168
poolablesBackground.transform.localScale = new Vector3(poolablesBackground.transform.localScale.x * backgroundSizeX / poolablesBackground.GetComponent<SpriteRenderer>().bounds.size.x, poolablesBackground.transform.localScale.y, poolablesBackground.transform.localScale.z);
@@ -188,7 +182,7 @@ public static void update() {
188182
// Display Prop
189183
poolablePlayer.cosmetics.nameText.text = Helpers.cs(Palette.CrewmateBlue, pc.Data.PlayerName); ;
190184
if (isCurrentlyRevealed.ContainsKey(pc.PlayerId)) {
191-
185+
192186
}
193187
}
194188
// update currently revealed:
@@ -219,34 +213,37 @@ public static void update() {
219213
}
220214
}
221215
}
216+
}
222217

223-
// speedboost
224-
foreach (var key in speedboostActive.Keys) {
225-
float speedboostTimer = speedboostActive[key] - Time.deltaTime;
226-
speedboostActive[key] = speedboostTimer;
227-
if (speedboostTimer < 0)
228-
speedboostActive.Remove(key);
229-
}
230-
// invisupdate
218+
public static void invisUpdate() {
231219
foreach (var playerId in invisPlayers.Keys) {
232220
var pc = Helpers.playerById(playerId);
233221
if (pc == null || pc.Data.IsDead) continue;
234222
float timeLeft = invisPlayers[playerId] - Time.deltaTime;
235223
invisPlayers[playerId] = timeLeft;
236224
if (timeLeft > 0) {
237-
pc.GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 1f, PlayerControl.LocalPlayer.Data.IsDead || PlayerControl.LocalPlayer.PlayerId == playerId ? 0.1f: 0f);
225+
pc.GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 1f, PlayerControl.LocalPlayer.Data.IsDead || PlayerControl.LocalPlayer.PlayerId == playerId ? 0.1f : 0f);
238226

239-
}
240-
else {
227+
} else {
241228
pc.GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
242229
invisPlayers.Remove(playerId);
243230
}
244231
if (isCurrentlyRevealed.ContainsKey(playerId)) {
245232
revealRenderer[playerId].GetComponent<SpriteRenderer>().color = pc.GetComponent<SpriteRenderer>().color;
246233
}
247234
}
235+
}
236+
237+
public static void speedboostUpdate() {
238+
foreach (var key in speedboostActive.Keys) {
239+
float speedboostTimer = speedboostActive[key] - Time.deltaTime;
240+
speedboostActive[key] = speedboostTimer;
241+
if (speedboostTimer < 0)
242+
speedboostActive.Remove(key);
243+
}
244+
}
248245

249-
// Update dangerMeter
246+
public static void dangerMeterUpdate() {
250247
if (HudManager.Instance.DangerMeter.gameObject.active) {
251248
float dist = 55f;
252249
float dist2 = 15f;
@@ -268,6 +265,28 @@ public static void update() {
268265
HudManager.Instance.DangerMeter?.gameObject.SetActive(!PlayerControl.LocalPlayer.Data.IsDead && (!PlayerControl.LocalPlayer.Data.Role.IsImpostor || HudManagerStartPatch.propHuntFindButton.isEffectActive));
269266
}
270267

268+
269+
public static void update() {
270+
if (!isPropHuntGM) {
271+
// Make sure the DangerMeter is not displayed in TOR HideNSeek, Classic or Guesser Game mode.
272+
if (GameOptionsManager.Instance.currentGameOptions.GameMode != AmongUs.GameOptions.GameModes.HideNSeek) HudManager.Instance.DangerMeter?.gameObject.SetActive(false);
273+
return;
274+
}
275+
if (timerRunning) timer = Math.Clamp(timer -= Time.deltaTime, 0, timer >= 0 ? timer : 0);
276+
else if (blackOutTimer > 0f) blackOutTimer -= Time.deltaTime;
277+
278+
// Local player find prop Target
279+
propTargetAndTimerDisplayUpdate();
280+
281+
poolablePlayerUpdate();
282+
283+
speedboostUpdate();
284+
285+
invisUpdate();
286+
287+
dangerMeterUpdate();
288+
}
289+
271290
public static void transformLayers() { // A bit of a hacky way to make sure that props as well as propable objects are not visible in the dark, while keeping collisions enabled.
272291
PlayerControl.LocalPlayer.clearAllTasks();
273292
foreach (Collider2D collider in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.transform.position, 500)) {

TheOtherRoles/Helpers.cs

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public static AudioClip loadAudioClipFromResources(string path, string clipName
100100
int channels = 2;
101101
int sampleRate = 48000;
102102
AudioClip audioClip = AudioClip.Create(clipName, samples.Length / 2, channels, sampleRate, false);
103+
audioClip.hideFlags |= HideFlags.HideAndDontSave | HideFlags.DontSaveInEditor;
103104
audioClip.SetData(samples, 0);
104105
return audioClip;
105106
} catch {

TheOtherRoles/Main.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace TheOtherRoles
3131
public class TheOtherRolesPlugin : BasePlugin
3232
{
3333
public const string Id = "me.eisbison.theotherroles";
34-
public const string VersionString = "4.4.0";
34+
public const string VersionString = "4.4.1";
3535
public static uint betaDays = 0; // amount of days for the build to be usable (0 for infinite!)
3636

3737
public static Version Version = Version.Parse(VersionString);

TheOtherRoles/SoundEffectsManager.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ public static void play(string path, float volume=0.8f, bool loop = false)
4242
{
4343
if (!TORMapOptions.enableSoundEffects) return;
4444
AudioClip clipToPlay = get(path);
45-
// if (false) clipToPlay = get("exampleClip"); for april fools?
4645
stop(path);
47-
if (Constants.ShouldPlaySfx()) {
46+
if (Constants.ShouldPlaySfx() && clipToPlay != null) {
4847
AudioSource source = SoundManager.Instance.PlaySound(clipToPlay, false, volume);
4948
source.loop = loop;
5049
}

TheOtherRoles/TheOtherRoles.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net6.0</TargetFramework>
4-
<Version>4.4.0</Version>
4+
<Version>4.4.1</Version>
55
<Description>TheOtherRoles</Description>
66
<Authors>Eisbison</Authors>
77
<LangVersion>latest</LangVersion>

0 commit comments

Comments
 (0)