File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using HarmonyLib ;
34using ScavMulti . Network . Messages ;
45using UnityEngine ;
56
67namespace ScavMulti ;
78
9+ [ HarmonyPatch ]
810/// <summary>
911/// represents the Expie that is YOU, the player on this computer
1012/// </summary>
@@ -36,4 +38,15 @@ void LateUpdate()
3638 }
3739 Events . Clear ( ) ;
3840 }
41+
42+ [ HarmonyPrefix ]
43+ [ HarmonyPatch ( typeof ( global ::Body ) , nameof ( global ::Body . Attack ) ) ]
44+ static void Body_Attack_Prefix ( global ::Body __instance )
45+ {
46+ if ( MessageDispatcher . IsAvailable && __instance == MainExperiment . Instance . Body )
47+ {
48+ if ( __instance . conscious && __instance . attackCooldown <= 0f )
49+ MainExperiment . Instance . Events . Add ( new AttackEvent ( ) ) ;
50+ }
51+ }
3952}
Original file line number Diff line number Diff line change 11using System ;
22using UnityEngine ;
3+ using HarmonyLib ;
34using ScavMulti . Network . Messages ;
45
56namespace ScavMulti ;
67
8+ [ HarmonyPatch ]
79/// <summary>
810/// represents any Expie that is NOT you, the player on this computer
911/// </summary>
@@ -39,6 +41,18 @@ public void HandleUpdate(ExpieUpdate expieUpdate)
3941 }
4042 }
4143
44+ [ HarmonyPrefix ]
45+ [ HarmonyPatch ( typeof ( global ::Body ) , nameof ( global ::Body . Attack ) ) ]
46+ static void Body_Attack_Prefix ( global ::Body __instance , global ::AttackInfo atk )
47+ {
48+ if ( MessageDispatcher . IsAvailable && __instance != MainExperiment . Instance . Body )
49+ {
50+ // only show the animation and "disable" the damage done
51+ atk . distance = 0 ;
52+ atk . damage = 0 ;
53+ }
54+ }
55+
4256 public static OtherExperiment CreateInstance ( int id , Vector3 position )
4357 {
4458 if ( ! _baseBody )
You can’t perform that action at this time.
0 commit comments