Skip to content

Commit 9c357d6

Browse files
committed
Update to 1.0.3.1
Hello there quickly!A little Bugs Fixed (EG: Prophet prophecy button error, torch vision error, button text, button cascading)New Role - Fraudster:Can suicide Add Mod Option: ShowFPS Have a Good Game! Xtreme - ELinmei
1 parent 05e368d commit 9c357d6

252 files changed

Lines changed: 3777 additions & 1822 deletions

File tree

Some content is hidden

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

TheOtherRoles/Buttons.cs

Lines changed: 183 additions & 109 deletions
Large diffs are not rendered by default.

TheOtherRoles/CustomAssets.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace TheOtherRoles;
55
public class CustomZip
66
{
77

8+
89
//Sprite
910
public Sprite RightPanelCloseButton;
1011
public Sprite Alert;
@@ -108,4 +109,4 @@ public class CustomZip
108109
public AudioClip vultureEat;
109110
public AudioClip warlockCurse;
110111
public AudioClip witchSpell;
111-
}//CE的骨灰盒
112+
}

TheOtherRoles/CustomGameModes/HideNSeekGM.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ public static bool isLightActive (byte playerId) {
8484

8585
public static Sprite getArrowSprite() {
8686
if (buttonSpriteArrow) return buttonSpriteArrow;
87-
buttonSpriteArrow = CustomMain.customZips.HideNSeekArrowButton;
87+
buttonSpriteArrow = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.HideNSeekArrowButton.png", 115f);
8888
return buttonSpriteArrow;
8989
}
9090

9191
public static Sprite getLightSprite() {
9292
if (buttonSpriteLight) return buttonSpriteLight;
93-
buttonSpriteLight = CustomMain.customZips.LighterButton ;
93+
buttonSpriteLight = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.LighterButton.png", 115f);
9494
return buttonSpriteLight;
9595
}
9696

TheOtherRoles/CustomGameModes/PropHunt.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
using System;
88
using System.Collections.Generic;
99
using System.Linq;
10+
using System.Reflection;
1011
using TheOtherRoles.Patches;
11-
using TheOtherRoles.Players;
1212
using TheOtherRoles.Utilities;
1313
using TMPro;
1414
using UnityEngine;
1515
using UnityEngine.Video;
1616
using static TheOtherRoles.Snitch;
1717
using static UnityEngine.GraphicsBuffer;
1818

19+
1920
namespace TheOtherRoles.CustomGameModes {
2021
[HarmonyPatch]
2122
class PropHunt {
@@ -324,29 +325,29 @@ public static Sprite getDisguiseButtonSprite() {
324325

325326
public static Sprite getUnstuckButtonSprite() {
326327
if (unstuckButtonSprite) return unstuckButtonSprite;
327-
unstuckButtonSprite = CustomMain.customZips.UnStuck;
328+
unstuckButtonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.UnStuck.png", 115f);
328329
return unstuckButtonSprite;
329330
}
330331
public static Sprite getRevealButtonSprite() {
331332
if (revealButtonSprite) return revealButtonSprite;
332-
revealButtonSprite = CustomMain.customZips.Reveal;
333+
revealButtonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.Reveal.png", 115f);
333334
return revealButtonSprite;
334335
}
335336

336337
public static Sprite getInvisButtonSprite() {
337338
if (invisButtonSprite) return invisButtonSprite;
338-
invisButtonSprite = CustomMain.customZips.InvisButton;
339+
invisButtonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.InvisButton.png", 115f);
339340
return invisButtonSprite;
340341
}
341342

342343
public static Sprite getFindButtonSprite() {
343344
if (findButtonSprite) return findButtonSprite;
344-
findButtonSprite = CustomMain.customZips.FindButton;
345+
findButtonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.FindButton.png", 115f);
345346
return findButtonSprite;
346347
}
347348
public static Sprite getSpeedboostButtonSprite() {
348349
if (speedboostButtonSprite) return speedboostButtonSprite;
349-
speedboostButtonSprite = CustomMain.customZips.SpeedboostButton;
350+
speedboostButtonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.SpeedboostButton.png", 115f);
350351
return speedboostButtonSprite;
351352
}
352353

@@ -399,7 +400,8 @@ public static void SpeedbostPostfix(PlayerPhysics __instance) {
399400

400401
[HarmonyPatch(typeof(CustomNetworkTransform), nameof(CustomNetworkTransform.FixedUpdate))]
401402
[HarmonyPostfix]
402-
public static void PostfixNetworkSpeed(CustomNetworkTransform __instance) {
403+
public static void PostfixNetworkSpeed(CustomNetworkTransform __instance)
404+
{
403405
if (__instance.AmOwner || !speedboostActive.ContainsKey(__instance.myPlayer.PlayerId)) return;
404406
if (GameData.Instance && __instance.myPlayer.CanMove)
405407
__instance.body.velocity *= speedboostRatio;
@@ -459,20 +461,19 @@ public static void IntroCutsceneDestroyPatch(IntroCutscene __instance)
459461
})));
460462
}
461463

464+
462465
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
463466
[HarmonyPostfix]
464-
public static void PlayerControlFixedUpdatePatch(PlayerControl __instance)
465-
{
467+
public static void PlayerControlFixedUpdatePatch(PlayerControl __instance) {
466468
if (!PropHunt.isPropHuntGM) return;
467-
if (__instance.Data.Role.IsImpostor)
468-
{
469-
__instance.GetComponent<CircleCollider2D>().radius = 0.2234f;
470-
return;
471-
}
472-
if (__instance.GetComponent<SpriteRenderer>() != null || __instance.Data.IsDead) return;
469+
if (__instance.Data.Role.IsImpostor) {
470+
__instance.GetComponent<CircleCollider2D>().radius = 0.2234f;
471+
return;
472+
}
473+
if (__instance.GetComponent<SpriteRenderer>() != null || __instance.Data.IsDead) return;
473474

474-
__instance.gameObject.AddComponent<SpriteRenderer>();
475-
__instance.GetComponent<CircleCollider2D>().radius = 0.00001f;
475+
__instance.gameObject.AddComponent<SpriteRenderer>();
476+
__instance.GetComponent<CircleCollider2D>().radius = 0.00001f;
476477
}
477478

478479

@@ -561,7 +562,7 @@ public static bool AdminUsePostfix(MapConsole __instance) {
561562
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.MurderPlayer))]
562563
[HarmonyPostfix]
563564
public static void MurderPlayerPostfix(PlayerControl __instance, [HarmonyArgument(0)] PlayerControl target) {
564-
if (!PropHunt.isPropHuntGM || target != CachedPlayer.LocalPlayer.PlayerControl) return;
565+
if (!PropHunt.isPropHuntGM || target != PlayerControl.LocalPlayer) return;
565566
try {
566567
target.NetTransform.RpcSnapTo(__instance.transform.position);
567568
} catch { }
@@ -597,7 +598,7 @@ public static bool KillButtonClickPatch(KillButton __instance) {
597598
if (__instance.currentTarget == null) {
598599
PlayerControl.LocalPlayer.SetKillTimer(killCooldownMiss);
599600
} else { // There is a target, execute kill!
600-
MurderAttemptResult res = Helpers.checkMurderAttemptAndKill(CachedPlayer.LocalPlayer.PlayerControl, __instance.currentTarget);
601+
MurderAttemptResult res = Helpers.checkMurderAttemptAndKill(PlayerControl.LocalPlayer, __instance.currentTarget);
601602
__instance.SetTarget(null);
602603
PlayerControl.LocalPlayer.SetKillTimer(killCooldownHit);
603604
}

0 commit comments

Comments
 (0)