Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c5ed469
qol feature for reporting bodies
Aug 6, 2022
25acf5b
Merge branch 'master' into QoL-feature--locationreports
whichtwix Aug 26, 2022
a8649b8
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Aug 27, 2022
7b0abfc
merge x3 as i made some mistakes..
Aug 27, 2022
88c2311
Merge branch 'QoL-feature--locationreports' of https://github.com/whi…
Aug 27, 2022
8851cd3
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Sep 7, 2022
19341cd
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Oct 27, 2022
1e8155a
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Dec 24, 2022
3c692ac
Merge branch 'master' into QoL-feature--locationreports
whichtwix Jan 24, 2023
7f98fda
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Jan 25, 2023
95111b8
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Feb 3, 2023
8b426a2
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Mar 19, 2023
0b417ba
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Apr 17, 2023
44ab27f
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Apr 18, 2023
cf166e4
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix May 31, 2023
72ff1cb
Merge branch 'master' into QoL-feature--locationreports
whichtwix Oct 6, 2023
d1768f5
theese were removed
whichtwix Oct 6, 2023
e14147d
finish removing
whichtwix Oct 6, 2023
63227fb
undate to utils method
whichtwix Oct 6, 2023
e4b8dba
Merge branch 'eDonnes124:master' into QoL-feature--locationreports
whichtwix Dec 17, 2023
0d6d705
Merge branch 'master' of https://github.com/eDonnes124/Town-Of-Us-R i…
whichtwix Apr 22, 2024
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
5 changes: 4 additions & 1 deletion source/Patches/CustomGameOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ public static class CustomGameOptions
public static bool SwooperVent => Generate.SwooperVent.Get();
public static bool ImpostorSeeRoles => Generate.ImpostorSeeRoles.Get();
public static bool DeadSeeRoles => Generate.DeadSeeRoles.Get();

public static bool Locationreports => Generate.Locationreports.Get();

public static bool HiddenRoles => Generate.HiddenRoles.Get();
public static bool FirstDeathShield => Generate.FirstDeathShield.Get();
public static bool NeutralEvilWinEndsGame => Generate.NeutralEvilWinEndsGame.Get();
Expand Down Expand Up @@ -383,4 +386,4 @@ public static class CustomGameOptions
public static bool HunterBodyReport => Generate.HunterBodyReport.Get();
public static bool DoomsayerCantObserve => Generate.DoomsayerCantObserve.Get();
}
}
}
7 changes: 6 additions & 1 deletion source/Patches/CustomOption/Generate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public class Generate
public static CustomNumberOption InitialCooldowns;
public static CustomToggleOption ParallelMedScans;
public static CustomStringOption SkipButtonDisable;
public static CustomToggleOption Locationreports;

public static CustomToggleOption HiddenRoles;
public static CustomToggleOption FirstDeathShield;
public static CustomToggleOption NeutralEvilWinEndsGame;
Expand Down Expand Up @@ -793,6 +795,9 @@ public static void GenerateAll()
new CustomNumberOption(num++, MultiMenu.main, "Game Start Cooldowns", 10f, 10f, 30f, 2.5f, CooldownFormat);
ParallelMedScans = new CustomToggleOption(num++, MultiMenu.main, "Parallel Medbay Scans", false);
SkipButtonDisable = new CustomStringOption(num++, MultiMenu.main, "Disable Meeting Skip Button", new[] { "No", "Emergency", "Always" });

Locationreports = new CustomToggleOption(num++, MultiMenu.main, "Locations of body reports are displayed in chat", false);

HiddenRoles = new CustomToggleOption(num++, MultiMenu.main, "Enable Hidden Roles", true);
FirstDeathShield = new CustomToggleOption(num++, MultiMenu.main, "First Death Shield Next Game", false);
NeutralEvilWinEndsGame = new CustomToggleOption(num++, MultiMenu.main, "Neutral Evil Win Ends Game", true);
Expand Down Expand Up @@ -1316,4 +1321,4 @@ public static void GenerateAll()
UnderdogIncreasedKC = new CustomToggleOption(num++, MultiMenu.modifiers, "Increased Kill Cooldown When 2+ Imps", true);
}
}
}
}
2 changes: 2 additions & 0 deletions source/Patches/CustomRPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public enum CustomRPC

SubmergedFixOxygen,

Sendchat,

ContentAddition
}
}
43 changes: 43 additions & 0 deletions source/Patches/Reportmsg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using HarmonyLib;
using Hazel;

namespace TownOfUs
{
public class Reportmessage
{
public static string location;

[HarmonyPatch(typeof(RoomTracker), nameof(RoomTracker.FixedUpdate))]
public class Recordlocation
{
[HarmonyPostfix]
public static void postfix(RoomTracker __instance)
{
if (__instance.text.transform.localPosition.y != -3.25f)
{
location = __instance.text.text;
}
else
{
string name = PlayerControl.LocalPlayer.name;
location = $"a hallway/outside, {name} where is the body?";
}
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CmdReportDeadBody))]
public class Sendchat
{
[HarmonyPostfix]
public static void postfix([HarmonyArgument(0)] GameData.PlayerInfo target)
{
string report = $"Body reported in: {location}";
if (target != null && CustomGameOptions.Locationreports)
{
DestroyableSingleton<HudManager>.Instance.Chat.AddChat(PlayerControl.LocalPlayer, report);
Utils.Rpc(CustomRPC.SendChat, report);
}

}
}
}
}
7 changes: 7 additions & 0 deletions source/Patches/RpcHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,13 @@ public static void Postfix([HarmonyArgument(0)] byte callId, [HarmonyArgument(1)
var lastVoted = Utils.PlayerById(reader.ReadByte());
AssassinKill.MurderPlayer(lastVoted);
break;
case CustomRPC.Sendchat:
string report = reader.ReadString();
if (!PlayerControl.LocalPlayer.Data.IsDead)
{
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, report);
}
break;
}
}
}
Expand Down