Skip to content

Commit

Permalink
added HasControl and HasHitbox methods to alucardApi
Browse files Browse the repository at this point in the history
  • Loading branch information
TalicZealot committed Dec 14, 2021
1 parent e51edfc commit 6ba2e95
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SotnApi/SotnApi/AlucardApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using SotnApi.Constants.Addresses.Alucard;
using SotnApi.Constants.Values.Alucard;
using SotnApi.Constants.Values.Alucard.Enums;
using SotnApi.Constants.Values.Game;
using SotnApi.Interfaces;
using System;
using Effects = SotnApi.Constants.Addresses.Alucard.Effects;
Expand Down Expand Up @@ -1250,6 +1251,17 @@ public bool IsInvincible()
return memAPI.ReadByte(Timers.Invincibility) > 0 || memAPI.ReadByte(Timers.KnockbackInvincibility) > 0 || memAPI.ReadByte(Timers.PotionInvincibility) > 0;
}

public bool HasControl()
{

return memAPI.ReadByte(Stats.HasControl) == 0;
}

public bool HasHitbox()
{
return memAPI.ReadByte(Actor.Address + Actors.HitboxWidthOffset) > 0 && memAPI.ReadByte(Actor.Address + Actors.HitboxHeightOffset) > 0;
}

public void Heal(uint amount)
{
memAPI.WriteS16(Effects.HealAmount, (int)amount);
Expand Down
7 changes: 7 additions & 0 deletions SotnApi/SotnApi/Constants/Addresses/Alucard/Actor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace SotnApi.Constants.Addresses.Alucard
{
internal static class Actor
{
public static long Address = 0x0733D8;
}
}
1 change: 1 addition & 0 deletions SotnApi/SotnApi/Constants/Addresses/Alucard/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal static class Stats
public static long WarpsSecondCastle = 0x03BEBD;
public static long MapOffsetX = 0x0973F1;
public static long MapOffsetY = 0x0973F5;
public static long HasControl = 0x072EFC;
public static long ScreenX = 0x072F9C;
public static long ScreenY = 0x072F9E;
public static long MapX = 0x0730B0;
Expand Down
2 changes: 2 additions & 0 deletions SotnApi/SotnApi/Interfaces/IAlucardApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public interface IAlucardApi
bool HasItemInInventory(string name);
bool HasRelic(Relic name);
bool IsInvincible();
bool HasControl();
bool HasHitbox();
void Heal(uint ammount);
void ActivateStopwatch();
void ActivatePotion(Potion potion);
Expand Down

0 comments on commit 6ba2e95

Please sign in to comment.