Skip to content

Commit

Permalink
feat: DeadBodies are anonymous too
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandraghon committed Mar 22, 2021
1 parent dbeba26 commit 867c857
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BetterSabotage/BetterSabotage.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>

<Description>BetterSabotage</Description>
Expand Down
32 changes: 31 additions & 1 deletion BetterSabotage/PlayerControlPatch.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Linq;
using System;
using System.Linq;
using HarmonyLib;
using UnityEngine;

namespace Glaucus
{
Expand All @@ -9,6 +11,7 @@ class PlayerControlPatch
[HarmonyPatch("CAMJPMDIIMN" /* PlayerControl.Visible */, MethodType.Setter)]
static void Postfix(PlayerControl __instance, ref bool NJFHEFBMBOD)
{
if (!PlayerControl.LocalPlayer || PlayerControl.LocalPlayer.myTasks == null) return;
if (PlayerControl.LocalPlayer.myTasks.ToArray().Any(task => task.TaskType == TaskTypes.FixComms)
&& (BetterSabotage.CommsSabotageAnonymous.GetValue() == 1 && !PlayerControl.LocalPlayer.Data.IsImpostor
|| BetterSabotage.CommsSabotageAnonymous.GetValue() == 2))
Expand All @@ -24,6 +27,33 @@ static void Postfix(PlayerControl __instance, ref bool NJFHEFBMBOD)
}
}

[HarmonyPatch(nameof(PlayerControl.SetPlayerMaterialColors), new Type[] {typeof(int), typeof(Renderer)})]
static void Postfix(int FGAOHLPPBDL /* colorId */, Renderer FNEEAAEEGLD)
{
Renderer rend = FNEEAAEEGLD;
if (!rend || !PlayerControl.LocalPlayer || PlayerControl.LocalPlayer.myTasks == null) return;
if (PlayerControl.LocalPlayer.myTasks.ToArray().Any(task => task.TaskType == TaskTypes.FixComms)
&& (BetterSabotage.CommsSabotageAnonymous.GetValue() == 1 && !PlayerControl.LocalPlayer.Data.IsImpostor
|| BetterSabotage.CommsSabotageAnonymous.GetValue() == 2))
{
rend.material.SetColor("_BackColor", Main.Palette.UnknownBackColor);
rend.material.SetColor("_BodyColor", Main.Palette.UnknownBodyColor);
}
}

[HarmonyPatch(nameof(PlayerControl.SetPlayerMaterialColors), new Type[] {typeof(Color), typeof(Renderer)})]
static void Postfix(Color JMDILEGDONK, Renderer FNEEAAEEGLD)
{
Renderer rend = FNEEAAEEGLD;
if (!rend || !PlayerControl.LocalPlayer) return;
if (BetterSabotage.CommsSabotageAnonymous.GetValue() == 1 && !PlayerControl.LocalPlayer.Data.IsImpostor
|| BetterSabotage.CommsSabotageAnonymous.GetValue() == 2)
{
rend.material.SetColor("_BackColor", Main.Palette.UnknownBackColor);
rend.material.SetColor("_BodyColor", Main.Palette.UnknownBodyColor);
}
}

[HarmonyPatch(nameof(PlayerControl.AddSystemTask))]
static void Postfix(SystemTypes IBKONFPFHAB)
{
Expand Down

0 comments on commit 867c857

Please sign in to comment.