Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

tor 4.1.5 #91

Open
wants to merge 62 commits into
base: 1.2.0-tor
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7d30ebd
Version 3.4.5
dwd0tcom Apr 9, 2022
70139e3
Merge pull request #333 from Eisbison/v-3-4-5
dwd0tcom Apr 9, 2022
b75ad7b
Version 4.0.0
dwd0tcom Apr 29, 2022
a5de718
Merge pull request #338 from Eisbison/v-4-0-0
dwd0tcom Apr 29, 2022
32f2e08
version 4.1.0
May 1, 2022
6ccba0f
Update README.md
Mallaris May 1, 2022
322de56
Merge pull request #342 from Eisbison/Version_4.1.0
Mallaris May 1, 2022
93121a9
Update to version 4.1.1
May 2, 2022
3d06deb
Update README.md
Mallaris May 2, 2022
c623255
Merge pull request #344 from Eisbison/4.1.1
Mallaris May 2, 2022
0b47cc8
Version 4.1.2
dwd0tcom May 17, 2022
a8b6a74
Merge pull request #351 from Eisbison/v-4-1-2
dwd0tcom May 17, 2022
c8eda67
Update to v4.1.3
May 18, 2022
18114eb
Update README.md
Mallaris May 18, 2022
1f8c2f3
update
May 24, 2022
a40b895
Merge pull request #356 from Eisbison/update
Mallaris May 24, 2022
5b89ee0
update
Jun 23, 2022
598aa73
Update README.md
Mallaris Jun 23, 2022
f87e7b8
Merge pull request #376 from Eisbison/v4.1.5
Mallaris Jun 23, 2022
5829cb3
Update 4.1.6
Jul 11, 2022
d6c5c2f
Update FUNDING.yml
dwd0tcom Aug 1, 2022
af4b339
List 7.12 as compatible in the readme
miniduikboot Aug 8, 2022
639cca8
Merge pull request #395 from miniduikboot/fix/7.12
Mallaris Aug 8, 2022
1814a69
Update v4.1.7
Aug 25, 2022
8243ded
Update to v4.2.0
Oct 26, 2022
625d192
Update README.md
Mallaris Oct 26, 2022
2fc4d59
Update README.md
Mallaris Oct 26, 2022
aa8f436
update to v4.2.1
Jan 8, 2023
a57e132
Update v4.2.1 (with fixed merge issues)
gendelo3 Jan 9, 2023
fe30e14
Update 4.3.0
Mallaris Mar 3, 2023
373cee9
Fix merge issues. v4.3.0
gendelo3 Mar 4, 2023
cf99a88
Update build.yml
gendelo3 Mar 4, 2023
d693bbc
Fix typos and errors in Readme
gendelo3 Mar 11, 2023
af353e8
Update 4.3.1
gendelo3 Mar 31, 2023
7f76a00
Update v4.3.2
gendelo3 May 20, 2023
d253174
Update v4.3.2
gendelo3 May 20, 2023
6206f94
Update v4.3.2
gendelo3 May 20, 2023
a77e6bd
.
Mallaris May 21, 2023
607b4c3
Update v4.3.3
gendelo3 Jul 16, 2023
6f1489b
update
Mallaris Jul 16, 2023
cdb5ed5
Update nuget.config / fix build for 4.3.3
gendelo3 Jul 16, 2023
2bd94e2
Update to v4.3.4
gendelo3 Aug 19, 2023
f6cfa07
Update to v4.4.0
gendelo3 Sep 20, 2023
4565333
Update to v4.4.1
gendelo3 Sep 21, 2023
39c3e3d
Update to v4.4.2
gendelo3 Sep 29, 2023
b0fef3b
Update v4.5.0
gendelo3 Dec 15, 2023
9d65875
Update v4.5.1
gendelo3 Dec 17, 2023
8c55511
Preparation for update v4.5.2
gendelo3 Mar 11, 2024
9c36355
Preparation vor Update v4.5.3
gendelo3 May 15, 2024
834b891
Update build.yml
gendelo3 Aug 1, 2024
8e63bff
Update v4.6.0
gendelo3 Aug 1, 2024
d811d0b
Update README.md
K3ndoo Jan 16, 2025
4fdae9b
files for Update V4.7.0
gendelo3 Jan 18, 2025
21f54f9
Merge branch 'main' of github.com:TheOtherRolesAU/TheOtherRoles
gendelo3 Jan 18, 2025
ce449e0
Deleting unused files from resources
gendelo3 Jan 18, 2025
ac00d01
Update README.md
K3ndoo Jan 21, 2025
1b0868f
Update README.md
K3ndoo Jan 21, 2025
a5126c5
Update README.md
K3ndoo Jan 21, 2025
5443351
Update README.md
K3ndoo Feb 18, 2025
61a70ef
Update to v4.8.0
gendelo3 Feb 23, 2025
bc45a3a
Update README.md
gendelo3 Mar 5, 2025
b782da4
Update README.md
gendelo3 Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to v4.1.3
  • Loading branch information
Mallöris committed May 18, 2022
commit c8eda67c60f8288d0cdbf0f91bcd90045eb1ab90
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
# Releases
| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
| 2022.3.29| v4.1.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.1.3/TheOtherRoles.zip)
| 2022.3.29| v4.1.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.1.2/TheOtherRoles.zip)
| 2022.3.29| v4.1.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.1.1/TheOtherRoles.zip)
| 2022.3.29| v4.1.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.1.0/TheOtherRoles.zip)
Expand Down Expand Up @@ -104,6 +105,11 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
<details>
<summary>Click to show the Changelog</summary>

**Version 4.1.3**
- Fixed morphling's being morphed during meetings
- Fixed hide player names hiding the player's name during meetings
- Added an option to the mayor: "Number Of Remote Meetings", so that the amount of mobile meetings is limited.

**Version 4.1.2**
- Made some general performance fixes. Special thanks to [probablyadnf](https://github.com/simonkellly)
- Added an option to the ninja to get invisible after kill for x-seconds
Expand Down
8 changes: 5 additions & 3 deletions TheOtherRoles/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1491,23 +1491,25 @@ public static void Postfix(HudManager __instance)
mayorMeetingButton = new CustomButton(
() => {
PlayerControl.LocalPlayer.NetTransform.Halt(); // Stop current movement
Helpers.handleVampireBiteOnBodyReport(); // Manually call Vampire handling, since the CmdReportDeadBody Prefix won't be called
Mayor.remoteMeetingsLeft--;
Helpers.handleVampireBiteOnBodyReport(); // Manually call Vampire handling, since the CmdReportDeadBody Prefix won't be called
RPCProcedure.uncheckedCmdReportDeadBody(PlayerControl.LocalPlayer.PlayerId, Byte.MinValue);

MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedCmdReportDeadBody, Hazel.SendOption.Reliable, -1);
writer.Write(PlayerControl.LocalPlayer.PlayerId);
writer.Write(Byte.MaxValue);
AmongUsClient.Instance.FinishRpcImmediately(writer);
mayorMeetingButton.Timer = 1f;
},
() => { return Mayor.mayor != null && Mayor.mayor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead ;},
() => {
mayorMeetingButton.actionButton.OverrideText("Emergency");
mayorMeetingButton.actionButton.OverrideText("Emergency ("+ Mayor.remoteMeetingsLeft + ")");
bool sabotageActive = false;
foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks.GetFastEnumerator())
if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms || task.TaskType == TaskTypes.StopCharles
|| SubmergedCompatibility.IsSubmerged && task.TaskType == SubmergedCompatibility.RetrieveOxygenMask)
sabotageActive = true;
return !sabotageActive && PlayerControl.LocalPlayer.CanMove;
return !sabotageActive && PlayerControl.LocalPlayer.CanMove && (Mayor.remoteMeetingsLeft > 0);
},
() => { mayorMeetingButton.Timer = mayorMeetingButton.MaxTimer; },
Mayor.getMeetingSprite(),
Expand Down
2 changes: 2 additions & 0 deletions TheOtherRoles/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class CustomOptionHolder {
public static CustomOption mayorCanSeeVoteColors;
public static CustomOption mayorTasksNeededToSeeVoteColors;
public static CustomOption mayorMeetingButton;
public static CustomOption mayorMaxRemoteMeetings;

public static CustomOption portalmakerSpawnRate;
public static CustomOption portalmakerCooldown;
Expand Down Expand Up @@ -406,6 +407,7 @@ public static void Load() {
mayorCanSeeVoteColors = CustomOption.Create(81, Types.Crewmate, "Mayor Can See Vote Colors", false, mayorSpawnRate);
mayorTasksNeededToSeeVoteColors = CustomOption.Create(82, Types.Crewmate, "Completed Tasks Needed To See Vote Colors", 5f, 0f, 20f, 1f, mayorCanSeeVoteColors);
mayorMeetingButton = CustomOption.Create(83, Types.Crewmate, "Mobile Emergency Button", true, mayorSpawnRate);
mayorMaxRemoteMeetings = CustomOption.Create(84, Types.Crewmate, "Number Of Remote Meetings", 1f, 1f, 5f, 1f, mayorMeetingButton);

engineerSpawnRate = CustomOption.Create(90, Types.Crewmate, cs(Engineer.color, "Engineer"), rates, null, true);
engineerNumberOfFixes = CustomOption.Create(91, Types.Crewmate, "Number Of Sabotage Fixes", 1f, 1f, 3f, 1f, engineerSpawnRate);
Expand Down
13 changes: 10 additions & 3 deletions TheOtherRoles/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ public enum MurderAttemptResult {
SuppressKill,
BlankKill
}
public static class Helpers {
public static class Helpers
{

public static Dictionary<string, Sprite> CachedSprites = new();

public static Sprite loadSpriteFromResources(string path, float pixelsPerUnit) {
try {
try
{
if (CachedSprites.TryGetValue(path + pixelsPerUnit, out var sprite)) return sprite;
Texture2D texture = loadTextureFromResources(path);
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
sprite.hideFlags |= HideFlags.HideAndDontSave | HideFlags.DontSaveInEditor;
return CachedSprites[path + pixelsPerUnit] = sprite;
} catch {
System.Console.WriteLine("Error loading sprite from path: " + path);
}
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace TheOtherRoles
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
public const string VersionString = "4.1.2";
public const string VersionString = "4.1.3";

public static Version Version = Version.Parse(VersionString);
internal static BepInEx.Logging.ManualLogSource Logger;
Expand Down
148 changes: 102 additions & 46 deletions TheOtherRoles/Objects/Footprint.cs
Original file line number Diff line number Diff line change
@@ -1,65 +1,121 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using TheOtherRoles.Utilities;
using UnityEngine;

namespace TheOtherRoles.Objects {
class Footprint {
private static List<Footprint> footprints = new List<Footprint>();
private static Sprite sprite;
private Color color;
private GameObject footprint;
private SpriteRenderer spriteRenderer;
private PlayerControl owner;
private bool anonymousFootprints;
namespace TheOtherRoles.Objects
{
public class FootprintHolder : MonoBehaviour
{
static FootprintHolder() => ClassInjector.RegisterTypeInIl2Cpp<FootprintHolder>();

public static Sprite getFootprintSprite() {
if (sprite) return sprite;
sprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.Footprint.png", 600f);
return sprite;
}

public Footprint(float footprintDuration, bool anonymousFootprints, PlayerControl player) {
this.owner = player;
this.anonymousFootprints = anonymousFootprints;
if (anonymousFootprints)
this.color = Palette.PlayerColors[6];
else
this.color = Palette.PlayerColors[(int) player.Data.DefaultOutfit.ColorId];
public FootprintHolder(IntPtr ptr) : base(ptr) { }

footprint = new GameObject("Footprint");
footprint.AddSubmergedComponent(SubmergedCompatibility.Classes.ElevatorMover);
Vector3 position = new Vector3(player.transform.position.x, player.transform.position.y, player.transform.position.y / 1000 + 0.001f);
footprint.transform.position = position;
footprint.transform.localPosition = position;
footprint.transform.SetParent(player.transform.parent);
private static FootprintHolder _instance;
public static FootprintHolder Instance
{
get => _instance ? _instance : _instance = new GameObject("FootprintHolder").AddComponent<FootprintHolder>();
set => _instance = value;

footprint.transform.Rotate(0.0f, 0.0f, UnityEngine.Random.Range(0.0f, 360.0f));
}

private static Sprite _footprintSprite;
private static Sprite FootprintSprite => _footprintSprite ??= Helpers.loadSpriteFromResources("TheOtherRoles.Resources.Footprint.png", 600f);

private static bool AnonymousFootprints => TheOtherRoles.Detective.anonymousFootprints;
private static float FootprintDuration => TheOtherRoles.Detective.footprintDuration;

private class Footprint
{
public GameObject GameObject;
public Transform Transform;
public SpriteRenderer Renderer;
public PlayerControl Owner;
public GameData.PlayerInfo Data;
public float Lifetime;

spriteRenderer = footprint.AddComponent<SpriteRenderer>();
spriteRenderer.sprite = getFootprintSprite();
spriteRenderer.color = color;
public Footprint()
{
GameObject = new("Footprint") { layer = 8 };
Transform = GameObject.transform;
Renderer = GameObject.AddComponent<SpriteRenderer>();
Renderer.sprite = FootprintSprite;
Renderer.color = Color.clear;
GameObject.AddSubmergedComponent(SubmergedCompatibility.Classes.ElevatorMover);
}
}

footprint.SetActive(true);
footprints.Add(this);


FastDestroyableSingleton<HudManager>.Instance.StartCoroutine(Effects.Lerp(footprintDuration, new Action<float>((p) => {
Color c = color;
if (!anonymousFootprints && owner != null) {
if (owner == Morphling.morphling && Morphling.morphTimer > 0 && Morphling.morphTarget?.Data != null)
c = Palette.ShadowColors[Morphling.morphTarget.Data.DefaultOutfit.ColorId];
else if (Camouflager.camouflageTimer > 0)
c = Palette.PlayerColors[6];
private readonly ConcurrentBag<Footprint> _pool = new();
private readonly List<Footprint> _activeFootprints = new();
private readonly List<Footprint> _toRemove = new();

[HideFromIl2Cpp]
public void MakeFootprint(PlayerControl player)
{
if (!_pool.TryTake(out var print))
{
print = new();
}

if (spriteRenderer) spriteRenderer.color = new Color(c.r, c.g, c.b, Mathf.Clamp01(1 - p));
print.Lifetime = FootprintDuration;

var pos = player.transform.position;
pos.z = pos.y / 1000f + 0.001f;
print.Transform.SetPositionAndRotation(pos, Quaternion.EulerRotation(0, 0, UnityEngine.Random.Range(0.0f, 360.0f)));
print.GameObject.SetActive(true);
print.Owner = player;
print.Data = player.Data;
_activeFootprints.Add(print);
}

if (p == 1f && footprint != null) {
UnityEngine.Object.Destroy(footprint);
footprints.Remove(this);
private void Update()
{
var dt = Time.deltaTime;
_toRemove.Clear();
foreach (var activeFootprint in _activeFootprints)
{
var p = activeFootprint.Lifetime / FootprintDuration;

if (activeFootprint.Lifetime <= 0)
{
_toRemove.Add(activeFootprint);
continue;
}

Color color;
if (AnonymousFootprints || Camouflager.camouflageTimer > 0)
{
color = Palette.PlayerColors[6];
}
else if (activeFootprint.Owner == Morphling.morphling && Morphling.morphTimer > 0 && Morphling.morphTarget && Morphling.morphTarget.Data != null)
{
color = Palette.PlayerColors[Morphling.morphTarget.Data.DefaultOutfit.ColorId];
}
else
{
color = Palette.PlayerColors[activeFootprint.Data.DefaultOutfit.ColorId];
}

color.a = Math.Clamp(p, 0f, 1f);
activeFootprint.Renderer.color = color;

activeFootprint.Lifetime -= dt;
}

foreach (var footprint in _toRemove)
{
footprint.GameObject.SetActive(false);
_activeFootprints.Remove(footprint);
_pool.Add(footprint);
}
})));
}

private void OnDestroy()
{
Instance = null;
}
}
}
5 changes: 3 additions & 2 deletions TheOtherRoles/Patches/PlayerControlPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ static void detectiveUpdateFootPrints() {
if (Detective.timer <= 0f) {
Detective.timer = Detective.footprintIntervall;
foreach (PlayerControl player in PlayerControl.AllPlayerControls.GetFastEnumerator()) {
if (player != null && player != PlayerControl.LocalPlayer && !player.Data.IsDead && !player.inVent) {
new Footprint(Detective.footprintDuration, Detective.anonymousFootprints, player);
if (player != null && player != PlayerControl.LocalPlayer && !player.Data.IsDead && !player.inVent)
{
FootprintHolder.Instance.MakeFootprint(player);
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions TheOtherRoles/Patches/UpdatePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ static void resetNameTagsAndColors() {
foreach (var data in GameData.Instance.AllPlayers.GetFastEnumerator())
{
var player = data.Object;
string text;
string text = data.PlayerName;
Color color;
if (player)
{
String playerName = data.PlayerName;
var playerName = text;
if (morphTimerNotUp && morphTargetNotNull && Morphling.morphling == player) playerName = Morphling.morphTarget.Data.PlayerName;
var nameText = player.nameText;

nameText.text = text = Helpers.hidePlayerName(localPlayer, player) ? "" : playerName;
nameText.text = Helpers.hidePlayerName(localPlayer, player) ? "" : playerName;
nameText.color = color = amImpostor && data.Role.IsImpostor ? Palette.ImpostorRed : Color.white;
}
else
{
text = data.PlayerName;
color = Color.white;
}

Expand Down
Binary file modified TheOtherRoles/Resources/ThirdParty/Submerged/Submerged.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion TheOtherRoles/TheOtherRoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public static class Mayor {
public static Color color = new Color32(32, 77, 66, byte.MaxValue);
public static Minigame emergency = null;
public static Sprite emergencySprite = null;
public static int remoteMeetingsLeft = 1;


public static bool canSeeVoteColors = false;
public static int tasksNeededToSeeVoteColors;
Expand All @@ -145,7 +147,7 @@ public static void clearAndReload() {
mayor = null;
emergency = null;
emergencySprite = null;

remoteMeetingsLeft = Mathf.RoundToInt(CustomOptionHolder.mayorMaxRemoteMeetings.getFloat());
canSeeVoteColors = CustomOptionHolder.mayorCanSeeVoteColors.getBool();
tasksNeededToSeeVoteColors = (int)CustomOptionHolder.mayorTasksNeededToSeeVoteColors.getFloat();
meetingButton = CustomOptionHolder.mayorMeetingButton.getBool();
Expand Down
39 changes: 20 additions & 19 deletions TheOtherRoles/TheOtherRoles.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>4.1.2</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>4.1.3</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2022.3.29" />
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.559" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2022.3.29" />
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.559" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="1.1.1" />
</ItemGroup>

<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
<Message Text="Second occurrence" />
<Copy SourceFiles="$(ProjectDir)\bin\$(Configuration)\netstandard2.1\TheOtherRoles.dll" DestinationFolder="$(AmongUsLatest)/BepInEx/plugins/" />
</Target>
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="Exists('$(AmongUsLatest)/BepInEx/plugins/')">
<Message Text="Second occurrence" />
<Copy SourceFiles="$(ProjectDir)\bin\$(Configuration)\netstandard2.1\TheOtherRoles.dll" DestinationFolder="$(AmongUsLatest)/BepInEx/plugins/" />
</Target>
</Project>
Loading