-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
543f78a
commit 49493cf
Showing
7 changed files
with
186 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,68 @@ | ||
using System.Diagnostics; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace SRTPluginProviderRER1.Structs.GameStructs | ||
{ | ||
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 0x8)] | ||
[DebuggerDisplay("{_DebuggerDisplay,nq}")] | ||
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 0xE44)] | ||
public struct GameEnemy | ||
{ | ||
[FieldOffset(0x0)] private float currentHP; | ||
[FieldOffset(0x4)] private float maximumHP; | ||
[FieldOffset(0xE28)] private short id; | ||
[FieldOffset(0xE3C)] private float currentHP; | ||
[FieldOffset(0xE40)] private float maximumHP; | ||
|
||
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | ||
public string _DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
if (IsTrigger) | ||
{ | ||
return string.Format("TRIGGER", CurrentHP, MaximumHP, Percentage); | ||
} | ||
else if (IsAlive) | ||
{ | ||
return string.Format("{0} / {1} ({2:P1})", CurrentHP, MaximumHP, Percentage); | ||
} | ||
return "DEAD / DEAD (0%)"; | ||
} | ||
} | ||
public short ID => id; | ||
public string Name => Enemies.NamesList.ContainsKey(ID) ? string.Format("{0}: ", Enemies.NamesList[ID]) : ""; | ||
public bool IsNaN(float hp) => hp.CompareTo(float.NaN) == 0; | ||
public float CurrentHP => !IsNaN(currentHP) ? currentHP : 0f; | ||
public float MaximumHP => !IsNaN(maximumHP) ? maximumHP : 0f; | ||
public bool IsTrigger => !Enemies.NamesList.ContainsKey(ID); | ||
public bool IsAlive => !IsTrigger && CurrentHP != 0; | ||
public bool IsDamaged => IsAlive ? CurrentHP < MaximumHP : false; | ||
public float Percentage => (IsAlive) ? CurrentHP / MaximumHP : 0f; | ||
} | ||
|
||
public float CurrentHP => currentHP; | ||
public float MaximumHP => maximumHP; | ||
public bool IsTrigger => MaximumHP <= 10f || MaximumHP > 100000f; | ||
public bool IsNaN => MaximumHP.CompareTo(float.NaN) == 0; | ||
public bool IsAlive => !IsNaN && !IsTrigger && CurrentHP <= MaximumHP; | ||
public bool IsDamaged => IsAlive && CurrentHP < MaximumHP; | ||
public float Percentage => ((IsAlive) ? CurrentHP / MaximumHP : 0f); | ||
public class Enemies | ||
{ | ||
public static Dictionary<short, string> NamesList = new Dictionary<short, string>() | ||
{ | ||
{ 0x1000, "Mutated Ooze" }, | ||
{ 0x1010, "Claw Ooze" }, | ||
{ 0x1020, "Shooter Ooze" }, | ||
{ 0x1030, "Explode Ooze" }, | ||
{ 0x1060, "Rachael Ooze" }, | ||
{ 0x1070, "Mutated Ooze" }, | ||
{ 0x1080, "Claw Ooze" }, | ||
{ 0x1090, "Shooter Ooze" }, | ||
{ 0x1200, "Sea Creeper" }, | ||
{ 0x1201, "Sea Creeper" }, | ||
{ 0x1210, "Mutated Dog" }, | ||
{ 0x1211, "Mutated Dog" }, | ||
{ 0x1220, "Fish" }, | ||
{ 0x1221, "Blowfish" }, | ||
{ 0x1230, "Green Hunter" }, | ||
{ 0x1240, "Invisible Hunter" }, | ||
{ 0x1300, "Scarmiglione" }, | ||
{ 0x1301, "Scarmiglione" }, | ||
{ 0x1310, "Beach Blob" }, | ||
{ 0x1320, "Beach Blob" }, | ||
{ 0x1330, "LowPoly Beach Blob" }, | ||
{ 0x1400, "Scragdead" }, | ||
{ 0x1401, "Scragdead" }, | ||
{ 0x1410, "Wall Blister" }, | ||
{ 0x1420, "Draghignazzo" }, | ||
{ 0x1421, "Draghignazzo" }, | ||
{ 0x1422, "Draghignazzo" }, | ||
{ 0x1430, "Malacoda" }, | ||
{ 0x1431, "Malacoda" }, | ||
{ 0x1440, "Jack" }, | ||
{ 0x1442, "Jack" }, | ||
{ 0x1450, "Jack" }, | ||
{ 0x1910, "Zenobia" }, | ||
{ 0x1911, "Zenobia" }, | ||
{ 0x1912, "Zenobia" }, | ||
{ 0x1913, "Zenobia" }, | ||
{ 0x1920, "Zenobia" } | ||
}; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
SRTPluginProviderRER1/Structs/GameStructs/GameInventory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
namespace SRTPluginProviderRER1.Structs.GameStructs | ||
{ | ||
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 0xD0)] | ||
|
||
public struct GameInventory | ||
{ | ||
[FieldOffset(0x40)] private uint handgunAmmo; | ||
[FieldOffset(0x44)] private uint shotgunAmmo; | ||
[FieldOffset(0x48)] private uint machineGunAmmo; | ||
[FieldOffset(0x4C)] private uint rifleAmmo; | ||
[FieldOffset(0x50)] private uint magnumAmmo; | ||
|
||
[FieldOffset(0xA0)] private uint handGrenade; | ||
[FieldOffset(0xA4)] private uint shockGrenade; | ||
[FieldOffset(0xA8)] private uint bowDecoy; | ||
[FieldOffset(0xAC)] private uint pulseGrenade; | ||
|
||
[FieldOffset(0xC8)] private uint greenHerb; | ||
[FieldOffset(0xCC)] private uint oldKey; | ||
|
||
public uint HandgunAmmo => handgunAmmo; | ||
public uint ShotgunAmmo => shotgunAmmo; | ||
public uint MachineGunAmmo => machineGunAmmo; | ||
public uint RifleAmmo => rifleAmmo; | ||
public uint MagnumAmmo => magnumAmmo; | ||
public uint HandGrenade => handGrenade; | ||
public uint ShockGrenade => shockGrenade; | ||
public uint BOWDecoy => bowDecoy; | ||
public uint PulseGrenade => pulseGrenade; | ||
public uint GreenHerb => greenHerb; | ||
public uint OldKey => oldKey; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters