diff --git a/SotnApi/SotnApi/ActorApi.cs b/SotnApi/SotnApi/ActorApi.cs index 672b755..706c667 100644 --- a/SotnApi/SotnApi/ActorApi.cs +++ b/SotnApi/SotnApi/ActorApi.cs @@ -72,8 +72,10 @@ private long FindAvailableActorSlot() { long hitboxWidth = memAPI.ReadByte(start + Actors.HitboxWidthOffset); long hitboxHeight = memAPI.ReadByte(start + Actors.HitboxHeightOffset); + long hp = memAPI.ReadU16(start + Actors.HpOffset); + long damage = memAPI.ReadU16(start + Actors.DamageOffset); - if (hitboxWidth == 0 && hitboxHeight == 0) + if (hitboxWidth == 0 && hitboxHeight == 0 && hp == 0 && damage == 0) { return start; } diff --git a/SotnApi/SotnApi/Constants/Values/Game/Various.cs b/SotnApi/SotnApi/Constants/Values/Game/Various.cs index afa3eac..949e7b0 100644 --- a/SotnApi/SotnApi/Constants/Values/Game/Various.cs +++ b/SotnApi/SotnApi/Constants/Values/Game/Various.cs @@ -7,6 +7,7 @@ public static class Various public static long RowOffset = 0x800; public static uint PrologueArea = 0x20; public static uint PrologueZone = 0x21; + public static uint LoadingZone = 0x32; public static uint LibraryWarped = 0x78; public static Dictionary CharacterMap = new Dictionary { diff --git a/SotnApi/SotnApi/GameApi.cs b/SotnApi/SotnApi/GameApi.cs index 93ff7c2..074bafb 100644 --- a/SotnApi/SotnApi/GameApi.cs +++ b/SotnApi/SotnApi/GameApi.cs @@ -154,11 +154,16 @@ public bool InPrologue() { bool inGame = this.Status == SotnApi.Constants.Values.Game.Status.InGame; bool isAlucard = this.CurrentCharacter == Character.Alucard; - bool notInPrologue = this.Area != Various.PrologueArea && this.Area > 0 && this.Zone != Various.PrologueZone; + bool notInPrologue = this.Area != Various.PrologueArea && this.Area > 0 && this.Zone != Various.PrologueZone && this.SecondCastle; + if (this.Area == Various.PrologueArea && this.Zone != Various.PrologueZone && this.SecondCastle) { notInPrologue = true; } + if (this.Area == 0 && this.Zone == Various.LoadingZone && !this.SecondCastle) + { + notInPrologue = true; + } return (inGame && isAlucard && !notInPrologue); } diff --git a/SotnApi/SotnApi/Models/Actor.cs b/SotnApi/SotnApi/Models/Actor.cs index 1611f4a..bc0e844 100644 --- a/SotnApi/SotnApi/Models/Actor.cs +++ b/SotnApi/SotnApi/Models/Actor.cs @@ -126,6 +126,30 @@ public uint DamageTypeB } } + public ushort Palette + { + get + { + return Value[Actors.PaletteOffset]; + } + set + { + Value[Actors.PaletteOffset] = (byte)value; + } + } + + public ushort ColorMode + { + get + { + return Value[Actors.ColorMode]; + } + set + { + Value[Actors.ColorMode] = (byte)value; + } + } + public ushort HitboxWidth { get