Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions QCreatureConfig/Patches/AttachAndSuck_SuckBlood_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Harmony;

namespace QCreatureConfig.Patches
{
[HarmonyPatch(typeof(AttachAndSuck))]
[HarmonyPatch("SuckBlood")]
class AttachAndSuck_SuckBlood_Patch
{
public static void Prefix(AttachAndSuck __instance)
{
QCreatures.lastTouched = __instance.bleeder;
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
5 changes: 5 additions & 0 deletions QCreatureConfig/Patches/CrabSnake_OnTouch_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ public static void Prefix(CrabsnakeMeleeAttack __instance)
{
QCreatures.lastTouched = __instance.gameObject.GetComponent<Creature>();
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
5 changes: 5 additions & 0 deletions QCreatureConfig/Patches/Crash_Detonate_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ public static void Prefix(Crash __instance)
{
QCreatures.lastTouched = __instance;
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
14 changes: 0 additions & 14 deletions QCreatureConfig/Patches/Knife_OnToolUseAnim_Patch.cs

This file was deleted.

5 changes: 5 additions & 0 deletions QCreatureConfig/Patches/MeleeAttack_OnTouch_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ public static void Prefix(MeleeAttack __instance, Collider collider)
{
QCreatures.lastTouched = __instance.gameObject.GetComponent<Creature>();
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ public static void Prefix(ReaperLeviathan __instance)
{
QCreatures.lastTouched = __instance;
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
5 changes: 5 additions & 0 deletions QCreatureConfig/Patches/ReaperMeleeAttack_OnTouch_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ public static void Prefix(ReaperMeleeAttack __instance)
{
QCreatures.lastTouched = __instance.gameObject.GetComponent<Creature>();
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ class SeaDragonMeleeAttack_OnTouchFront_Patch
{
public static void Prefix(SeaDragonMeleeAttack __instance)
{
QCreatures.lastTouched = __instance.gameObject.GetComponent<Creature>();
QCreatures.lastTouched = __instance.seaDragon;
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
7 changes: 6 additions & 1 deletion QCreatureConfig/Patches/SeaDragon_DamageExosuit_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ namespace QCreatureConfig.Patches
[HarmonyPatch("DamageExosuit")]
class SeaDragon_DamageExosuit_Patch
{
public static void Prefix(ReaperLeviathan __instance)
public static void Prefix(SeaDragon __instance)
{
QCreatures.lastTouched = __instance;
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
23 changes: 23 additions & 0 deletions QCreatureConfig/Patches/WarpBall_Warp_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Harmony;
using UnityEngine;
using System.Reflection;

namespace QCreatureConfig.Patches
{
[HarmonyPatch(typeof(WarpBall))]
[HarmonyPatch("Warp")]
class WarpBall_Warp_Patch
{
public static void Prefix(WarpBall __instance)
{
FieldInfo field = typeof(WarpBall).GetField("warperGO", BindingFlags.Instance | BindingFlags.NonPublic);
GameObject warperGO = (GameObject)field.GetValue(__instance);
QCreatures.lastTouched = warperGO.GetComponent<Creature>();
}

public static void Postfix()
{
QCreatures.lastTouched = null;
}
}
}
3 changes: 2 additions & 1 deletion QCreatureConfig/QCreatureConfig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Patches\AttachAndSuck_SuckBlood_Patch.cs" />
<Compile Include="Patches\CrabSnake_OnTouch_Patch.cs" />
<Compile Include="Patches\Crash_Detonate_Patch.cs" />
<Compile Include="Patches\Creature_Start_Patch.cs" />
<Compile Include="Patches\DamageSystem_CalculateDamage_Patch.cs" />
<Compile Include="Patches\Knife_OnToolUseAnim_Patch.cs" />
<Compile Include="Patches\MeleeAttack_OnTouch_Patch.cs" />
<Compile Include="Patches\ReaperLeviathan_DamageVehicle_Patch.cs" />
<Compile Include="Patches\ReaperMeleeAttack_OnTouch_Patch.cs" />
<Compile Include="Patches\SeaDragonMeleeAttack_OnTouchFront_Patch.cs" />
<Compile Include="Patches\SeaDragon_DamageExosuit_Patch.cs" />
<Compile Include="Patches\WarpBall_Warp_Patch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QCreature.cs" />
<Compile Include="QCreatures.cs" />
Expand Down