Rename g_Player.unk0 to g_Player.status (#1721)

As discussed in
https://github.com/Xeeynamo/sotn-decomp/pull/1709#issuecomment-2386396310
This commit is contained in:
Josh Schreuder 2024-10-05 13:03:16 +10:00 committed by GitHub
parent c1b36a1029
commit f647b0c26b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
53 changed files with 210 additions and 206 deletions

View File

@ -38,7 +38,7 @@ g_Player = 0x80072684;
g_Player_padSim = 0x800729A8;
g_Player_D_80072EFC = 0x800729B0;
g_Player_pl_vram_flag = 0x800729D4;
g_Player_unk0C = 0x800729E0;
g_Player_status = 0x800729E0;
g_Player_unk10 = 0x800729E4;
D_80072F76 = 0x80072A2A;
D_80072F78 = 0x80072A2C;

View File

@ -867,7 +867,7 @@ g_Player_timers_15 = 0x80072F1E;
g_Player_pl_vram_flag = 0x80072F20;
g_Player_unk04 = 0x80072F24;
g_Player_unk08 = 0x80072F28;
g_Player_unk0C = 0x80072F2C;
g_Player_status = 0x80072F2C;
g_Player_unk10 = 0x80072F30;
g_Player_unk14 = 0x80072F34;
g_Player_unk18 = 0x80072F38;

View File

@ -896,7 +896,7 @@ g_Player_timers_15 = 0x80072F1E;
g_Player_pl_vram_flag = 0x80072F20;
g_Player_unk04 = 0x80072F24;
g_Player_unk08 = 0x80072F28;
g_Player_unk0C = 0x80072F2C;
g_Player_status = 0x80072F2C;
g_Player_unk10 = 0x80072F30;
g_Player_unk14 = 0x80072F34;
g_Player_unk18 = 0x80072F38;

View File

@ -288,40 +288,43 @@ typedef enum {
FLAG_DESTROY_IF_OUT_OF_CAMERA = 0x80000000,
} EntityFlag;
// document g_Player.unk0C
#define PLAYER_STATUS_BAT_FORM 0x1
#define PLAYER_STATUS_MIST_FORM 0x2
#define PLAYER_STATUS_WOLF_FORM 0x4
#define PLAYER_STATUS_TRANSFORM \
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM | PLAYER_STATUS_WOLF_FORM)
#define PLAYER_STATUS_UNK8 0x8
#define PLAYER_STATUS_UNK10 0x10
#define PLAYER_STATUS_UNK_20 0x20
#define PLAYER_STATUS_UNK40 0x40
#define PLAYER_STATUS_STONE 0x80
#define PLAYER_STATUS_UNK100 0x100
#define PLAYER_STATUS_UNK200 0x200
#define PLAYER_STATUS_UNK400 0x400
#define PLAYER_STATUS_UNK800 0x800
#define PLAYER_STATUS_UNK1000 0x1000
#define PLAYER_STATUS_UNK2000 0x2000
#define PLAYER_STATUS_POISON 0x4000
#define PLAYER_STATUS_CURSE 0x8000
#define PLAYER_STATUS_UNK10000 0x10000 // possibly freezing?
#define PLAYER_STATUS_UNK20000 0x20000
#define PLAYER_STATUS_UNK40000 0x40000
#define PLAYER_STATUS_UNK80000 0x80000
#define PLAYER_STATUS_UNK100000 0x100000
#define PLAYER_STATUS_UNK200000 0x200000
#define PLAYER_STATUS_UNK400000 0x400000
#define PLAYER_STATUS_UNK800000 0x800000
#define PLAYER_STATUS_AXEARMOR 0x1000000
#define PLAYER_STATUS_ABSORB_BLOOD 0x2000000
#define PLAYER_STATUS_UNK4000000 0x4000000
#define NO_AFTERIMAGE 0x8000000
#define PLAYER_STATUS_UNK10000000 0x10000000
#define PLAYER_STATUS_UNK40000000 0x40000000
#define PLAYER_STATUS_UNK80000000 0x80000000
// document g_Player.status
typedef enum {
PLAYER_STATUS_BAT_FORM = 0x1,
PLAYER_STATUS_MIST_FORM = 0x2,
PLAYER_STATUS_WOLF_FORM = 0x4,
PLAYER_STATUS_TRANSFORM =
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM |
PLAYER_STATUS_WOLF_FORM),
PLAYER_STATUS_UNK8 = 0x8,
PLAYER_STATUS_UNK10 = 0x10,
PLAYER_STATUS_UNK_20 = 0x20,
PLAYER_STATUS_UNK40 = 0x40,
PLAYER_STATUS_STONE = 0x80,
PLAYER_STATUS_UNK100 = 0x100,
PLAYER_STATUS_UNK200 = 0x200,
PLAYER_STATUS_UNK400 = 0x400,
PLAYER_STATUS_UNK800 = 0x800,
PLAYER_STATUS_UNK1000 = 0x1000,
PLAYER_STATUS_UNK2000 = 0x2000,
PLAYER_STATUS_POISON = 0x4000,
PLAYER_STATUS_CURSE = 0x8000,
PLAYER_STATUS_UNK10000 = 0x10000, // possibly freezing?
PLAYER_STATUS_UNK20000 = 0x20000,
PLAYER_STATUS_UNK40000 = 0x40000,
PLAYER_STATUS_UNK80000 = 0x80000,
PLAYER_STATUS_UNK100000 = 0x100000,
PLAYER_STATUS_UNK200000 = 0x200000,
PLAYER_STATUS_UNK400000 = 0x400000,
PLAYER_STATUS_UNK800000 = 0x800000,
PLAYER_STATUS_AXEARMOR = 0x1000000,
PLAYER_STATUS_ABSORB_BLOOD = 0x2000000,
PLAYER_STATUS_UNK4000000 = 0x4000000,
NO_AFTERIMAGE = 0x8000000,
PLAYER_STATUS_UNK10000000 = 0x10000000,
PLAYER_STATUS_UNK40000000 = 0x40000000,
PLAYER_STATUS_UNK80000000 = 0x80000000,
} PlayerStateStatus;
#define ANIMSET_OVL_FLAG 0x8000
#define ANIMSET_DRA(x) (x)
@ -1726,7 +1729,7 @@ typedef struct {
/* 80072F24 */ s32 unk04; // copy of the previous field
/* 80072F28 */ s32 unk08;
/* 80072F2C */ u32 unk0C;
/* 80072F2C */ PlayerStateStatus status;
/* 80072F30 */ s32 unk10;
/* 80072F34 */ u32 unk14;
/* 80072F38 */ s32 unk18;

View File

@ -317,7 +317,7 @@ s32 SetNextRoomToLoad(u32 x, u32 y) {
RoomHeader* room;
u32 stack[4];
if (g_Player.unk0C & PLAYER_STATUS_UNK40000) {
if (g_Player.status & PLAYER_STATUS_UNK40000) {
return 0;
}
res = func_800F087C(x, y);
@ -409,7 +409,7 @@ s32 func_800F0CD8(s32 arg0) {
}
var_s0 = 48;
if (!(g_Player.pl_vram_flag & 1) &&
!(g_Player.unk0C &
!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM))) {
var_s0 = 24;
}
@ -1485,7 +1485,7 @@ void RunMainEngine(void) {
if (D_80137598 != 0) {
func_80105428();
}
if (g_Player.unk0C & PLAYER_STATUS_UNK80000) {
if (g_Player.status & PLAYER_STATUS_UNK80000) {
g_GameEngineStep = Engine_10;
g_MenuStep = MENU_STEP_INIT;
}
@ -1513,7 +1513,7 @@ void RunMainEngine(void) {
D_8006BB00 = 0;
}
}
if (!(g_Player.unk0C & PLAYER_STATUS_UNK40000)) {
if (!(g_Player.status & PLAYER_STATUS_UNK40000)) {
if ((g_pads[0].tapped & PAD_START) && (D_8003C8B8 != 0)) {
func_801027A4();
if ((g_StageId == STAGE_ST0) ||

View File

@ -571,7 +571,7 @@ void GetEquipProperties(s32 handId, Equipment* res, s32 equipId) {
itemCategory = g_EquipDefs[equipId].itemCategory;
if (itemCategory != ITEM_FOOD && itemCategory != ITEM_MEDICINE) {
res->attack = CalcAttack(equipId, g_Status.equipment[1 - handId]);
if (g_Player.unk0C & PLAYER_STATUS_POISON) {
if (g_Player.status & PLAYER_STATUS_POISON) {
res->attack >>= 1;
}
}
@ -671,7 +671,7 @@ s32 HandleDamage(DamageParam* damage, s32 arg1, s32 amount, s32 arg3) {
amount -= amount / 3;
}
}
if (g_Player.unk0C & PLAYER_STATUS_STONE) {
if (g_Player.status & PLAYER_STATUS_STONE) {
damage->damageTaken = g_Status.hpMax / 8;
ret = 8;
} else if (damage->effects & 0x200) {
@ -693,7 +693,7 @@ s32 HandleDamage(DamageParam* damage, s32 arg1, s32 amount, s32 arg3) {
} else {
damage->damageTaken = g_Status.hpMax / 8;
}
if (g_Player.unk0C & PLAYER_STATUS_POISON) {
if (g_Player.status & PLAYER_STATUS_POISON) {
damage->damageTaken *= 2;
}
// Check for player wearing a Talisman (chance to dodge attack)
@ -716,7 +716,7 @@ s32 HandleDamage(DamageParam* damage, s32 arg1, s32 amount, s32 arg3) {
ret = 3;
} else {
if (g_Status.defenseEquip > 99 && !(damage->effects & 0x180) &&
!(g_Player.unk0C & PLAYER_STATUS_STONE)) {
!(g_Player.status & PLAYER_STATUS_STONE)) {
damage->damageKind = 0;
ret = 1;
} else {
@ -1813,7 +1813,7 @@ void DrawRichterHudSubweapon(void) {
prim->u3 = ((g_Status.hearts / 10) * 8) + 8;
prim->v3 = 0x68;
// Perhaps flashes the heart numbers when you have enough for a crash
if ((g_Player.unk0C & PLAYER_STATUS_UNK200000) && !(g_Timer & 2)) {
if ((g_Player.status & PLAYER_STATUS_UNK200000) && !(g_Timer & 2)) {
prim->clut = 0x100;
} else {
prim->clut = 0x103;
@ -2049,8 +2049,8 @@ void DrawHudSubweapon() {
}
if ((CheckEquipmentItemCount(ITEM_HEALING_MAIL, EQUIP_ARMOR)) &&
((g_Player.unk0C & (PLAYER_STATUS_TRANSFORM |
PLAYER_STATUS_UNK4000000)) == 0x04000000)) {
((g_Player.status & (PLAYER_STATUS_TRANSFORM |
PLAYER_STATUS_UNK4000000)) == 0x04000000)) {
g_HealingMailTimer[0]++;
if (g_HealingMailTimer[0] >= 128) {
g_Player.unk56 = 2;

View File

@ -145,7 +145,7 @@ void func_801093C4(void) {
}
drawEnv = g_CurrentBuffer->draw;
drawEnv.isbg = false;
if (g_Player.unk0C & PLAYER_STATUS_UNK4000000) {
if (g_Player.status & PLAYER_STATUS_UNK4000000) {
drawEnv.isbg = true;
}
drawEnv.r0 = drawEnv.g0 = drawEnv.b0 = 0;
@ -271,7 +271,7 @@ void func_80109594() {
weapon = D_8017A000.EntityWeaponAttack;
weapon();
g_Player.unk0C |= PLAYER_STATUS_AXEARMOR;
g_Player.status |= PLAYER_STATUS_AXEARMOR;
func_8010DFF0(1, 10);
func_80109328();
}
@ -279,7 +279,7 @@ void func_80109594() {
void func_80109990(void) {
if (D_80137FB4 == 0) {
if (g_Status.mp == g_Status.mpMax &&
!(g_Player.unk0C & PLAYER_STATUS_UNK100000)) {
!(g_Player.status & PLAYER_STATUS_UNK100000)) {
CreateEntFactoryFromEntity(g_CurrentEntity, 40, 0);
PlaySfx(SFX_UI_MP_FULL);
D_80137FB4++;
@ -303,7 +303,7 @@ void func_80109A44(s32 isTransformed) {
s16 x, y;
mist = 0;
if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM ||
if (g_Player.status & PLAYER_STATUS_MIST_FORM ||
g_Entities[0x10].entityId == 0x22) {
mist = mist + 1;
}
@ -311,7 +311,7 @@ void func_80109A44(s32 isTransformed) {
pl_04 = &g_Player.unk04;
*pl_04 = *pl_vram;
*pl_vram = 0;
status = g_Player.unk0C;
status = g_Player.status;
if (isTransformed) {
for (i = 0; i < 4; i++) {
if (status & (PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM)) {
@ -453,7 +453,7 @@ void func_8010A234(s32 arg0) {
// Wearing Axe Lord Armor! This is probably when you initially put it on.
if ((weapon() == 0x2D) &&
CheckEquipmentItemCount(ITEM_AXE_LORD_ARMOR, EQUIP_ARMOR)) {
if (!(g_Player.unk0C & PLAYER_STATUS_AXEARMOR)) {
if (!(g_Player.status & PLAYER_STATUS_AXEARMOR)) {
// Alucard says "WHAT?!" when first putting on Axe Lord Armor
PlaySfx(NA_SE_VO_AL_WHAT);
g_Player.padSim = 0;
@ -461,14 +461,14 @@ void func_8010A234(s32 arg0) {
func_8010FAF4();
weapon = D_8017A000.EntityWeaponAttack;
weapon();
g_Player.unk0C |= PLAYER_STATUS_AXEARMOR;
g_Player.status |= PLAYER_STATUS_AXEARMOR;
func_8010DFF0(1, 0xA);
func_80109328();
if (arg0 != 0) {
PlayAnimation(D_800B0130, D_800B01B8);
}
}
} else if (g_Player.unk0C & PLAYER_STATUS_AXEARMOR) {
} else if (g_Player.status & PLAYER_STATUS_AXEARMOR) {
PLAYER.palette = 0x8100;
PLAYER.animSet = 1;
PLAYER.unk5A = 0;
@ -484,7 +484,7 @@ void func_8010A234(s32 arg0) {
} else {
func_8010E7AC();
}
g_Player.unk0C &= ~PLAYER_STATUS_AXEARMOR;
g_Player.status &= ~PLAYER_STATUS_AXEARMOR;
func_80111CC0();
if (arg0 != 0) {
PlayAnimation(D_800B0130, D_800B01B8);
@ -566,7 +566,7 @@ void EntityAlucard(void) {
D_80137FB8 = g_unkGraphicsStruct.D_800973FC;
var_s7 = 0;
g_Player.unk72 = func_80110394();
if (!(g_Player.unk0C & PLAYER_STATUS_UNK40000)) {
if (!(g_Player.status & PLAYER_STATUS_UNK40000)) {
var_s0 = GetTeleportToOtherCastle();
if (var_s0 != 0) {
func_8010E42C(var_s0);
@ -581,7 +581,7 @@ void EntityAlucard(void) {
func_80118C84(g_Player.unk58, 1);
if (g_Player.unk56 == 1) {
PlaySfx(SFX_HEALTH_PICKUP);
if (!(g_Player.unk0C & PLAYER_STATUS_STONE)) {
if (!(g_Player.status & PLAYER_STATUS_STONE)) {
CreateEntFactoryFromEntity(
g_CurrentEntity, FACTORY(0x2C, 0x48), 0);
CreateEntFactoryFromEntity(
@ -589,7 +589,7 @@ void EntityAlucard(void) {
}
}
if ((g_Player.unk56 == 2) &&
!(g_Player.unk0C & PLAYER_STATUS_STONE)) {
!(g_Player.status & PLAYER_STATUS_STONE)) {
CreateEntFactoryFromEntity(
g_CurrentEntity, FACTORY(0x2C, 0x48), 0);
}
@ -641,16 +641,16 @@ void EntityAlucard(void) {
if (!--g_Player.timers[var_s0]) {
switch (var_s0) {
case 0:
if (!(g_Player.unk0C & (PLAYER_STATUS_STONE |
PLAYER_STATUS_CURSE))) {
if (!(g_Player.status & (PLAYER_STATUS_STONE |
PLAYER_STATUS_CURSE))) {
g_Player.timers[4] = 0xC;
g_Player.timers[15] = 0xC;
func_8010E168(1, 0xC);
}
continue;
case 1:
if (!(g_Player.unk0C & (PLAYER_STATUS_STONE |
PLAYER_STATUS_CURSE))) {
if (!(g_Player.status & (PLAYER_STATUS_STONE |
PLAYER_STATUS_CURSE))) {
g_Player.timers[4] = 0xC;
g_Player.timers[15] = 0xC;
func_8010E168(1, 0xC);
@ -661,7 +661,7 @@ void EntityAlucard(void) {
continue;
case 3:
PLAYER.palette = 0x8100;
if (!(g_Player.unk0C &
if (!(g_Player.status &
(PLAYER_STATUS_STONE | PLAYER_STATUS_POISON |
PLAYER_STATUS_CURSE))) {
g_Player.timers[4] = 0xC;
@ -714,7 +714,7 @@ void EntityAlucard(void) {
break;
case 2: /* switch 6 */
func_8010E168(1, 4);
if (g_Player.unk0C & PLAYER_STATUS_AXEARMOR) {
if (g_Player.status & PLAYER_STATUS_AXEARMOR) {
SetPlayerStep(Player_Unk50);
} else {
SetPlayerStep(Player_Unk49);
@ -739,7 +739,7 @@ void EntityAlucard(void) {
}
g_Player.padTapped =
(g_Player.padHeld ^ g_Player.padPressed) & g_Player.padPressed;
if (g_Player.unk0C & PLAYER_STATUS_UNK8) {
if (g_Player.status & PLAYER_STATUS_UNK8) {
g_Player.padTapped &= ~(PAD_SQUARE | PAD_CIRCLE);
g_Player.padPressed &= ~(PAD_SQUARE | PAD_CIRCLE);
}
@ -779,7 +779,7 @@ void EntityAlucard(void) {
var_s7 = PLAYER.step_s;
var_s0 = HandleDamage(
&damage, PLAYER.hitParams, PLAYER.hitPoints, 0);
if ((g_Player.unk0C & PLAYER_STATUS_AXEARMOR) &&
if ((g_Player.status & PLAYER_STATUS_AXEARMOR) &&
((var_s0 == 1) || (var_s0 == 7) ||
(var_s0 == 8))) {
var_s0 = 3;
@ -1036,8 +1036,8 @@ block_160:
}
var_s0 = 0;
g_unkGraphicsStruct.unk1C &= ~2;
g_Player.unk0C &= ~PLAYER_STATUS_UNK8;
g_Player.unk08 = g_Player.unk0C;
g_Player.status &= ~PLAYER_STATUS_UNK8;
g_Player.unk08 = g_Player.status;
g_Status.D_80097BF8 &= ~1;
switch (PLAYER.step) { /* switch 5 */
case 2: /* switch 5 */
@ -1187,7 +1187,7 @@ block_160:
if (g_Player.timers[11]) {
var_s0 |= 0x02000000;
}
g_Player.unk0C = var_s0;
g_Player.status = var_s0;
if ((var_s0 & 0x08000000) || (g_unkGraphicsStruct.D_800973FC != 0)) {
func_8010DFF0(1, 1);
}
@ -1199,19 +1199,20 @@ block_160:
g_Status.D_80097BF8 |= 1;
}
if (g_Player.timers[13] | g_Player.timers[14]) {
g_Player.unk0C |= PLAYER_STATUS_UNK100;
g_Player.status |= PLAYER_STATUS_UNK100;
}
if ((g_Player.unk08 & 0x10000) &&
!(g_Player.unk0C & (PLAYER_STATUS_UNK10000 | PLAYER_STATUS_UNK40000))) {
!(g_Player.status &
(PLAYER_STATUS_UNK10000 | PLAYER_STATUS_UNK40000))) {
func_8010E168(1, 0xC);
if (!(g_Player.unk0C & (PLAYER_STATUS_POISON | PLAYER_STATUS_CURSE))) {
if (!(g_Player.status & (PLAYER_STATUS_POISON | PLAYER_STATUS_CURSE))) {
g_Player.timers[4] = 0xC;
g_Player.timers[15] = 4;
PLAYER.palette = 0x8100;
}
}
PlayAnimation(D_800B0130, D_800B01B8);
if (g_Player.unk0C & PLAYER_STATUS_UNK40000) {
if (g_Player.status & PLAYER_STATUS_UNK40000) {
if (PLAYER.animFrameDuration < 0) {
PLAYER.animCurFrame |= ANIM_FRAME_LOAD;
}
@ -1225,9 +1226,9 @@ block_160:
g_Player.unk14 = 0;
g_Player.unk7A = 0;
func_801093C4();
if (!(g_Player.unk0C & (PLAYER_STATUS_UNK10 | PLAYER_STATUS_UNK40))) {
if (!(g_Player.status & (PLAYER_STATUS_UNK10 | PLAYER_STATUS_UNK40))) {
if ((CheckEquipmentItemCount(0x58U, 4U) != 0) &&
!(g_Player.unk0C &
!(g_Player.status &
(PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10 |
PLAYER_STATUS_UNK10000 | PLAYER_STATUS_UNK40000 |
PLAYER_STATUS_AXEARMOR)) &&
@ -1238,14 +1239,14 @@ block_160:
}
func_8010D59C();
if ((*D_80097448 >= 0x29 ||
((g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) &&
((g_Player.status & PLAYER_STATUS_WOLF_FORM) &&
*D_80097448 >= 0xD)) &&
(g_CurrentEntity->nFramesInvincibility == 0)) {
PLAYER.velocityY = PLAYER.velocityY * 3 / 4;
PLAYER.velocityX = PLAYER.velocityX * 3 / 4;
}
temp_s1 = g_Player.pl_vram_flag;
if (!(g_Player.unk0C &
if (!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_WOLF_FORM |
PLAYER_STATUS_UNK400000 | PLAYER_STATUS_UNK40000000))) {
if ((abs(PLAYER.velocityX) >= FIX(2)) || (PLAYER.step == 8)) {
@ -1258,7 +1259,7 @@ block_160:
PLAYER.velocityX = PLAYER.velocityX >> 3;
PLAYER.velocityY = PLAYER.velocityY >> 3;
if (PLAYER.posY.i.hi >= 0) {
if (g_Player.unk0C &
if (g_Player.status &
(PLAYER_STATUS_UNK400000 | PLAYER_STATUS_UNK40000000)) {
func_80109A44(0);
} else {
@ -1277,7 +1278,7 @@ block_160:
PLAYER.velocityY *= 8;
goto post_oddblock;
oddblock:
if (g_Player.unk0C & PLAYER_STATUS_UNK800000) {
if (g_Player.status & PLAYER_STATUS_UNK800000) {
func_80109A44(0);
} else {
func_80109A44(1);
@ -1286,7 +1287,7 @@ block_160:
post_oddblock:
g_Player.unk04 = temp_s1;
if (((*D_80097448 >= 0x29) ||
((g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) &&
((g_Player.status & PLAYER_STATUS_WOLF_FORM) &&
(*D_80097448 >= 0xD))) &&
(g_CurrentEntity->nFramesInvincibility == 0)) {
PLAYER.velocityY = PLAYER.velocityY * 4 / 3;
@ -1307,9 +1308,9 @@ block_160:
void func_8010BF64(Unkstruct_8010BF64* arg0) {
if (g_PlayableCharacter == PLAYER_ALUCARD) {
u32 unk0C_var = (g_Player.unk0C / 2) & 2;
arg0->unk14 = D_800ACEE0[0].x - unk0C_var;
arg0->unk1C = D_800ACEE0[0].y + unk0C_var;
u32 status = (g_Player.status / 2) & 2;
arg0->unk14 = D_800ACEE0[0].x - status;
arg0->unk1C = D_800ACEE0[0].y + status;
arg0->unk18 = D_800ACED0[1].y - 1;
arg0->unk20 = D_800ACEC0[1].y + 1;
} else {
@ -1326,11 +1327,11 @@ void func_8010BFFC(void) {
if ((g_Player.pl_vram_flag & 1) || (D_801396EA != 0) ||
#if defined(VERSION_US)
(g_Player.unk0C &
(g_Player.status &
(PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK40000000)) ||
((g_PlayableCharacter != 0) && (PLAYER.step == 0x18)) ||
#elif defined(VERSION_HD)
(g_Player.unk0C & PLAYER_STATUS_TRANSFORM) ||
(g_Player.status & PLAYER_STATUS_TRANSFORM) ||
#endif
(g_Player.unk78 == 1)) {
return;
@ -1425,7 +1426,7 @@ void func_8010C36C(void) {
return;
}
if ((PLAYER.velocityY == 0) && (g_Player.unk04 & 1) &&
!(g_Player.unk0C &
!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM))) {
var_s5 = 4;
} else {
@ -1437,14 +1438,14 @@ void func_8010C36C(void) {
}
if (!((g_Player.colliders[i].effects & EFFECT_UNK_0002) ||
(PLAYER.velocityY >= 0) ||
(g_Player.unk0C & PLAYER_STATUS_TRANSFORM) ||
(g_Player.status & PLAYER_STATUS_TRANSFORM) ||
(abs(PLAYER.velocityX) >= FIX(2)))) {
continue;
}
var_s2 = g_Player.colliders[i].effects &
(EFFECT_UNK_8000 | EFFECT_UNK_0800 | EFFECT_SOLID);
if ((var_s2 == EFFECT_SOLID) || (var_s2 & EFFECT_UNK_0800)) {
if ((g_Player.unk0C &
if ((g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM)) &&
!(var_s2 & 1)) {
continue;
@ -1453,7 +1454,7 @@ void func_8010C36C(void) {
argY = *yPosPtr + D_800ACED0[i].y;
argY += (g_Player.colliders[i].unk18 - 1);
CheckCollision(argX, argY, &sp10, 0);
if ((g_Player.unk0C & PLAYER_STATUS_MIST_FORM) &&
if ((g_Player.status & PLAYER_STATUS_MIST_FORM) &&
(sp10.effects & 0x10)) {
sp10.effects &= ~3;
}
@ -1607,14 +1608,14 @@ void func_8010C9F4(void) {
if (g_Player.colliders2[i].effects & EFFECT_SOLID_FROM_ABOVE) {
continue;
}
if ((g_Player.unk0C & PLAYER_STATUS_MIST_FORM) &&
if ((g_Player.status & PLAYER_STATUS_MIST_FORM) &&
(collider.effects & EFFECT_MIST_ONLY)) {
collider.effects &= ~(EFFECT_UNK_0002 | EFFECT_SOLID);
}
temp_s0 = g_Player.colliders2[i].effects &
(EFFECT_UNK_8000 | EFFECT_UNK_0800 | EFFECT_SOLID);
if ((temp_s0 == EFFECT_SOLID) || (temp_s0 & EFFECT_UNK_8000)) {
if ((g_Player.unk0C &
if ((g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM)) &&
!(temp_s0 & EFFECT_SOLID)) {
continue;
@ -1626,7 +1627,7 @@ void func_8010C9F4(void) {
CheckCollision(argX, argY, &collider, 0);
// If in mist form, and collider is mist, then disable collision on
// that collider!
if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM &&
if (g_Player.status & PLAYER_STATUS_MIST_FORM &&
collider.effects & EFFECT_MIST_ONLY) {
collider.effects &= ~(EFFECT_UNK_0002 | EFFECT_SOLID);
}

View File

@ -670,7 +670,7 @@ void AlucardHandleDamage(DamageParam* damage, s16 arg1, s16 arg2) {
PLAYER.entityRoomIndex = 0;
}
}
if (g_Player.unk0C & PLAYER_STATUS_AXEARMOR) {
if (g_Player.status & PLAYER_STATUS_AXEARMOR) {
PLAYER.velocityY = FIX(-3);
func_8010E3B8(FIX(-1.25));
PLAYER.step = Player_AxearmorHit;

View File

@ -673,7 +673,7 @@ void func_80119F70(Entity* entity) {
break;
case 1:
if (!(g_Player.unk0C & PLAYER_STATUS_UNK10000)) {
if (!(g_Player.status & PLAYER_STATUS_UNK10000)) {
DestroyEntity(entity);
return;
}

View File

@ -153,7 +153,7 @@ void UpdatePlayerEntities(void) {
}
}
// Appears to be a temporary debugging block that was left in.
if ((g_Player.unk0C & (PLAYER_STATUS_UNK40000 | PLAYER_STATUS_UNK80000)) ||
if ((g_Player.status & (PLAYER_STATUS_UNK40000 | PLAYER_STATUS_UNK80000)) ||
(PLAYER.step == Player_Teleport && PLAYER.step_s == 0)) {
#if defined(VERSION_US)
// Japanese for "without hit".
@ -550,7 +550,7 @@ void func_8011B5A4(Entity* self) {
switch (self->step) {
case 0:
// Note that paramsHi is uninitialized here - possible bug?
if ((g_Player.unk0C & PLAYER_STATUS_UNK20000) && (paramsHi != 9)) {
if ((g_Player.status & PLAYER_STATUS_UNK20000) && (paramsHi != 9)) {
DestroyEntity(self);
return;
}
@ -766,8 +766,8 @@ void EntityPlayerBlinkWhite(Entity* self) {
sp48 = 1;
}
if ((((sp70 & 0x3F) != 0x1D) &&
(g_Player.unk0C & PLAYER_STATUS_MIST_FORM)) ||
(g_Player.unk0C & PLAYER_STATUS_AXEARMOR)) {
(g_Player.status & PLAYER_STATUS_MIST_FORM)) ||
(g_Player.status & PLAYER_STATUS_AXEARMOR)) {
goto block_229;
}
if ((g_Player.unk6C) && sp70 != 0x20 && sp70 != 0x21 &&
@ -997,7 +997,7 @@ block_748:
}
break;
case 0x7008:
if ((g_Player.unk0C & PLAYER_STATUS_UNK400000) == 0) {
if ((g_Player.status & PLAYER_STATUS_UNK400000) == 0) {
self->step += 1;
}
break;
@ -1008,7 +1008,7 @@ block_748:
}
/* fallthrough */
case 0x700B:
if ((g_Player.unk0C & PLAYER_STATUS_UNK40000000) == 0) {
if ((g_Player.status & PLAYER_STATUS_UNK40000000) == 0) {
self->step += 1;
}
break;
@ -1393,8 +1393,8 @@ void EntityPlayerOutline(Entity* self) {
s16 selfX;
s16 selfY;
if ((g_Player.unk0C & (PLAYER_STATUS_AXEARMOR | PLAYER_STATUS_UNK40000 |
PLAYER_STATUS_STONE | PLAYER_STATUS_TRANSFORM)) ||
if ((g_Player.status & (PLAYER_STATUS_AXEARMOR | PLAYER_STATUS_UNK40000 |
PLAYER_STATUS_STONE | PLAYER_STATUS_TRANSFORM)) ||
!(PLAYER.animCurFrame & 0x7FFF) || (!PLAYER.animSet) ||
((PLAYER.step == Player_SpellHellfire) && (PLAYER.palette == 0x810D))) {
DestroyEntity(self);
@ -1671,7 +1671,7 @@ void EntityGravityBootBeam(Entity* self) {
self->step = 2;
}
// If transformed, timer drains faster
if (g_Player.unk0C & PLAYER_STATUS_TRANSFORM) {
if (g_Player.status & PLAYER_STATUS_TRANSFORM) {
self->step = 3;
}
break;

View File

@ -783,7 +783,7 @@ void EntityHitByIce(Entity* self) {
self->posX.i.hi = PLAYER.posX.i.hi;
self->posY.i.hi = PLAYER.posY.i.hi;
sp18 = (g_Player.unk0C & PLAYER_STATUS_UNK10000) == sp18;
sp18 = (g_Player.status & PLAYER_STATUS_UNK10000) == sp18;
switch (self->step) {
case 0:
self->primIndex = AllocPrimitives(PRIM_GT3, 24);
@ -2167,7 +2167,7 @@ void UnknownEntId48(Entity* self) {
s32 params;
params = (u8)self->params;
if (!(g_Player.unk0C & PLAYER_STATUS_MIST_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_MIST_FORM)) {
DestroyEntity(self);
return;
}
@ -2198,7 +2198,7 @@ void UnknownEntId48(Entity* self) {
void UnknownEntId49(Entity* self) {
s32 x_offset;
if (!(g_Player.unk0C & PLAYER_STATUS_AXEARMOR) || (PLAYER.step != 0x2B)) {
if (!(g_Player.status & PLAYER_STATUS_AXEARMOR) || (PLAYER.step != 0x2B)) {
DestroyEntity(self);
return;
}
@ -2230,7 +2230,7 @@ void UnknownEntId49(Entity* self) {
void func_80123A60(Entity* entity) {
Entity* player = &PLAYER;
if (!(g_Player.unk0C & PLAYER_STATUS_AXEARMOR)) {
if (!(g_Player.status & PLAYER_STATUS_AXEARMOR)) {
DestroyEntity(entity);
return;
}

View File

@ -298,7 +298,7 @@ void EntitySubwpnThrownDagger(Entity* self) {
self->hitboxHeight = 2;
self->hitboxOffX = 4;
self->hitboxOffY = 0;
if (!(g_Player.unk0C & PLAYER_STATUS_UNK_20)) {
if (!(g_Player.status & PLAYER_STATUS_UNK_20)) {
self->posY.i.hi -= 9;
}
prim = &g_PrimBuf[self->primIndex];
@ -512,7 +512,7 @@ void EntitySubwpnThrownAxe(Entity* self) {
self->velocityY = FIX(-6);
tempLeft = self->facingLeft;
self->ext.axeCrash.unk7C = tempLeft ? 0x400 : 0xC00;
if (!(g_Player.unk0C & PLAYER_STATUS_UNK_20)) {
if (!(g_Player.status & PLAYER_STATUS_UNK_20)) {
self->posY.i.hi = (u16)self->posY.i.hi - 0xC;
}
sp10 = 0;
@ -2158,7 +2158,7 @@ void EntitySubwpnAgunea(Entity* self) {
u16 tempX;
u32 heartBroachesWorn;
if (g_Player.unk0C & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10000)) {
if (g_Player.status & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10000)) {
DestroyEntity(self);
return;
}

View File

@ -1001,7 +1001,7 @@ void func_8012F894(Entity* self) {
s32 vram_flag_F000;
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}
@ -1285,7 +1285,7 @@ static s16 D_800B0A7C[] = {0, 0, 1, 1, 2, 2, 3, 3};
void func_80130264(Entity* self) {
s32 var_v1;
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}
@ -1395,7 +1395,7 @@ static s16 D_800B0AAC[] = {0, 0, 0, 1, 1, 1, 2, 2};
void func_80130618(Entity* self) {
s32 var_v1;
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}
@ -1517,7 +1517,7 @@ void func_801309B4(Entity* self) {
s32 var_v0;
s32 var_v0_2;
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}
@ -1672,7 +1672,7 @@ void func_80130E94(Entity* self) {
s32 var_s6;
s32 var_s7;
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}
@ -1805,7 +1805,7 @@ void func_80130E94(Entity* self) {
// Entity #60. This is created manually at g_Entities[30].
// Creation is in func_8012E7A4.
void func_8013136C(Entity* self) {
if (!(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
DestroyEntity(self);
return;
}

View File

@ -1379,13 +1379,13 @@ void MenuDrawStats(s32 menuDialogue) {
MenuDrawInt(g_Status.level, 304, 40, ctx);
MenuDrawStr(g_MenuStr[15], 248, 56, ctx);
i = 37;
if (g_Player.unk0C & PLAYER_STATUS_CURSE) {
if (g_Player.status & PLAYER_STATUS_CURSE) {
i = 40;
}
if (g_Player.unk0C & PLAYER_STATUS_POISON) {
if (g_Player.status & PLAYER_STATUS_POISON) {
i = 38;
}
if (g_Player.unk0C & PLAYER_STATUS_STONE) {
if (g_Player.status & PLAYER_STATUS_STONE) {
i = 39;
}
if (IsAlucart()) {
@ -3124,7 +3124,7 @@ s32 func_800FB23C(MenuNavigation* nav, u8* order, u8* count, u32* selected) {
var_s6 = 0;
func_800F53A4();
if ((g_Player.unk0C & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10)) |
if ((g_Player.status & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10)) |
(PLAYER.step == Player_UnmorphWolf) | (PLAYER.step == Player_BossGrab) |
(g_Player.unk60)) {
if (itemId == ITEM_AXE_LORD_ARMOR) {

View File

@ -180,18 +180,18 @@ static void func_801572A8(bool arg0) {
s32 xVel;
s32 i;
s32 j;
s32 unk0C;
s32 status;
s32* vram_ptr = &g_Player.pl_vram_flag;
s32* unk04_ptr = &g_Player.unk04;
g_Player.unk04 = *vram_ptr;
*vram_ptr = 0;
unk0C = g_Player.unk0C;
status = g_Player.status;
if (arg0) {
for (i = 0; i < LEN(D_801545E4); i++) {
if (unk0C & PLAYER_STATUS_UNK_20) {
if (status & PLAYER_STATUS_UNK_20) {
D_801545F4[i].y = D_80154644[i];
D_801545E4[i].y = D_8015465C[i];
} else {
@ -200,7 +200,7 @@ static void func_801572A8(bool arg0) {
}
}
for (i = 0; i < 7; i++) {
if (unk0C & PLAYER_STATUS_UNK_20) {
if (status & PLAYER_STATUS_UNK_20) {
D_80154604[i].y = D_80154664[i];
D_80154604[i + 7].y = D_80154664[i];
} else {
@ -596,7 +596,7 @@ void RicMain(void) {
func_8015BCD0();
break;
}
g_Player.unk08 = g_Player.unk0C;
g_Player.unk08 = g_Player.status;
#ifdef VERSION_PC
var_s4 = 0;
#endif
@ -671,7 +671,7 @@ void RicMain(void) {
var_s4 |= PLAYER_STATUS_UNK20000;
}
var_s4 |= PLAYER_STATUS_UNK10000000;
g_Player.unk0C = var_s4;
g_Player.status = var_s4;
if (g_Player.unk08 & PLAYER_STATUS_UNK10000) {
if (!(var_s4 & PLAYER_STATUS_UNK10000)) {
if (g_Player.unk5C != 0) {
@ -691,7 +691,7 @@ void RicMain(void) {
}
if (g_Player.timers[PL_T_INVINCIBLE_SCENE] |
g_Player.timers[PL_T_INVINCIBLE]) {
g_Player.unk0C |= PLAYER_STATUS_UNK100;
g_Player.status |= PLAYER_STATUS_UNK100;
}
g_api.UpdateAnim(D_80155964, D_8015538C);
PLAYER.hitboxState = 1;
@ -714,7 +714,7 @@ void RicMain(void) {
return;
#endif
}
if (g_Player.unk0C & (PLAYER_STATUS_UNK10 | PLAYER_STATUS_UNK40)) {
if (g_Player.status & (PLAYER_STATUS_UNK10 | PLAYER_STATUS_UNK40)) {
return;
}
func_8015C4AC();

View File

@ -1302,7 +1302,7 @@ void RicEntityHitByHoly(Entity* entity) {
entity->step++;
break;
case 1:
if (!(g_Player.unk0C & PLAYER_STATUS_UNK10000)) {
if (!(g_Player.status & PLAYER_STATUS_UNK10000)) {
DestroyEntity(entity);
return;
}
@ -1595,9 +1595,9 @@ void RicUpdatePlayerEntities(void) {
// This IF will fire if we have enough hearts to use a subweapon crash.
// No idea what it's doing here.
if (func_8015FB84(&subwpn, true, false) >= 0) {
g_Player.unk0C |= PLAYER_STATUS_UNK200000;
g_Player.status |= PLAYER_STATUS_UNK200000;
}
if (g_Player.unk0C & (PLAYER_STATUS_UNK40000 | PLAYER_STATUS_UNK80000)) {
if (g_Player.status & (PLAYER_STATUS_UNK40000 | PLAYER_STATUS_UNK80000)) {
FntPrint("dead player\n");
entity = &g_Entities[17]; // Weird code here. Set entity to #17 but...
entity -= 13; // then change to #4 before the for-loop starting with 4?

View File

@ -312,7 +312,7 @@ void RicEntitySmokePuff(Entity* self) {
s16 paramsLo = self->params & 0xFF;
s16 paramsHi = self->params >> 8;
if ((g_Player.unk0C & PLAYER_STATUS_UNK20000) && (paramsHi != 9)) {
if ((g_Player.status & PLAYER_STATUS_UNK20000) && (paramsHi != 9)) {
DestroyEntity(self);
return;
}

View File

@ -697,7 +697,7 @@ void RicEntityHitByIce(Entity* self) {
self->posX.i.hi = PLAYER.posX.i.hi;
self->posY.i.hi = PLAYER.posY.i.hi;
// This is badly written but it checks if 0x10000 is unset.
sp18 = ((g_Player.unk0C & PLAYER_STATUS_UNK10000) == sp18);
sp18 = ((g_Player.status & PLAYER_STATUS_UNK10000) == sp18);
switch (self->step) {
case 0:
self->primIndex = g_api.AllocPrimitives(PRIM_GT3, PrimCount);

View File

@ -1989,7 +1989,7 @@ void RicEntitySubwpnAgunea(Entity* self) {
u16 tempX;
u32 heartBroachesWorn;
if (g_Player.unk0C & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10000)) {
if (g_Player.status & (PLAYER_STATUS_TRANSFORM | PLAYER_STATUS_UNK10000)) {
DestroyEntity(self);
return;
}

View File

@ -306,7 +306,7 @@ void GetEquipProperties(s32 handId, Equipment* res, s32 equipId) {
itemCategory = g_EquipDefs[equipId].itemCategory;
if (itemCategory != ITEM_FOOD && itemCategory != ITEM_MEDICINE) {
res->attack = func_800F4D38(equipId, g_Status.equipment[1 - handId]);
if (g_Player.unk0C & PLAYER_STATUS_POISON) {
if (g_Player.status & PLAYER_STATUS_POISON) {
res->attack >>= 1;
}
}

View File

@ -10,7 +10,7 @@
extern EnemyDef g_EnemyDefs[];
extern s32 g_RoomCount;
// document g_Player.unk0C
// document g_Player.status
#define PLAYER_STATUS_POISON 0x00004000
#endif

View File

@ -302,7 +302,7 @@ typedef struct Unkstruct_800A7734 {
typedef struct {
char pad[0x3F8];
u32 unk0C;
u32 status;
} PlayerState;
typedef enum {

View File

@ -565,7 +565,7 @@ void func_80172120(Entity* self) {
func_801719E0(self);
break;
case 1:
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
self->ext.bat.unk8C = 0;
self->step = 5;
break;
@ -803,14 +803,14 @@ void func_80172C30(Entity* self) {
}
self->facingLeft = PLAYER.facingLeft ? false : true;
if (!self->ext.bat.unkA8) {
if (g_Player.unk0C & PLAYER_STATUS_UNK800) {
if (g_Player.status & PLAYER_STATUS_UNK800) {
// This causes the bat familiar to shoot a fireball when the
// player does so in bat form.
g_api.CreateEntFactoryFromEntity(self, FACTORY(81, 1), 0);
self->ext.bat.unkA8 = 1;
}
} else if (self->ext.bat.unkA8) {
if (!(g_Player.unk0C & PLAYER_STATUS_UNK800)) {
if (!(g_Player.status & PLAYER_STATUS_UNK800)) {
self->ext.bat.unkA8 = 0;
}
}
@ -832,7 +832,7 @@ void func_80172C30(Entity* self) {
D_80174C3C[self->ext.bat.unk82][D_80174B30].y =
self->ext.bat.follow->posY.i.hi + self->ext.bat.cameraY;
}
if (!(g_Player.unk0C & PLAYER_STATUS_BAT_FORM)) {
if (!(g_Player.status & PLAYER_STATUS_BAT_FORM)) {
self->ext.bat.unk8C = 0;
self->step++;
}

View File

@ -394,7 +394,7 @@ void func_us_80171864(Entity* self) {
self->step++;
break;
case 1:
if (g_Player.unk0C &
if (g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_AXEARMOR)) {
self->step = 4;
self->ext.ghost.unk8C = 0;
@ -454,7 +454,7 @@ void func_us_80171864(Entity* self) {
break;
case 2:
case 3:
if (g_Player.unk0C &
if (g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_AXEARMOR)) {
self->step = 4;
self->ext.ghost.unk8C = 0;
@ -508,7 +508,7 @@ void func_us_80171864(Entity* self) {
self->posY.val += self->velocityY;
break;
case 4:
if (!(g_Player.unk0C &
if (!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_AXEARMOR))) {
if (self->ext.ghost.unk96->entityId == 0xDB) {
self->ext.ghost.unk96->params = 1;
@ -562,7 +562,7 @@ void func_us_80171864(Entity* self) {
}
break;
case 5:
if (!(g_Player.unk0C &
if (!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_AXEARMOR))) {
self->step = 1;
@ -580,7 +580,7 @@ void func_us_80171864(Entity* self) {
}
break;
case 6:
if (!(g_Player.unk0C &
if (!(g_Player.status &
(PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_AXEARMOR))) {
self->step = 1;
} else {

View File

@ -114,11 +114,11 @@ void EntityPlatform(Entity* self) {
((self->posY.i.hi - player->posY.i.hi) < 80)) {
D_8003C8B8 = 0;
g_unkGraphicsStruct.pauseEnemies = 1;
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
g_Player.padSim = PAD_R1;
} else if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM) {
} else if (g_Player.status & PLAYER_STATUS_MIST_FORM) {
g_Player.padSim = PAD_L1;
} else if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
} else if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = PAD_R2;
} else if (temp_s1 > 384) {
g_Player.padSim = PAD_LEFT;
@ -135,13 +135,13 @@ void EntityPlatform(Entity* self) {
case 2:
g_Player.padSim = 0;
if (g_Player.unk0C & PLAYER_STATUS_TRANSFORM) {
if (g_Player.status & PLAYER_STATUS_TRANSFORM) {
if (g_Timer & 1) {
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
g_Player.padSim = PAD_R1;
} else if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM) {
} else if (g_Player.status & PLAYER_STATUS_MIST_FORM) {
g_Player.padSim = PAD_L1;
} else if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
} else if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = PAD_R2;
}
}

View File

@ -42,13 +42,13 @@ void EntityCSMoveAlucard(Entity* self) {
if (self->ext.generic.unk7C.u != 0) {
self->ext.generic.unk7C.u--;
}
if (g_Player.unk0C & PLAYER_STATUS_TRANSFORM) {
if (g_Player.status & PLAYER_STATUS_TRANSFORM) {
if (g_Timer & 1) {
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
g_Player.padSim = 8;
} else if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM) {
} else if (g_Player.status & PLAYER_STATUS_MIST_FORM) {
g_Player.padSim = 4;
} else if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
} else if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = 2;
}
}
@ -152,11 +152,11 @@ void EntityUnkId23(Entity* self) {
D_8003C8B8 = 0;
g_unkGraphicsStruct.pauseEnemies = 1;
g_Player.padSim = 0;
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
g_Player.padSim = PAD_R1;
} else if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM) {
} else if (g_Player.status & PLAYER_STATUS_MIST_FORM) {
g_Player.padSim = PAD_L1;
} else if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
} else if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = PAD_R2;
}
g_Player.D_80072EFC = PAD_L2;
@ -164,13 +164,13 @@ void EntityUnkId23(Entity* self) {
case 1:
g_Player.padSim = 0;
if (g_Player.unk0C & PLAYER_STATUS_TRANSFORM) {
if (g_Player.status & PLAYER_STATUS_TRANSFORM) {
if (g_Timer & 1) {
if (g_Player.unk0C & PLAYER_STATUS_BAT_FORM) {
if (g_Player.status & PLAYER_STATUS_BAT_FORM) {
g_Player.padSim = PAD_R1;
} else if (g_Player.unk0C & PLAYER_STATUS_MIST_FORM) {
} else if (g_Player.status & PLAYER_STATUS_MIST_FORM) {
g_Player.padSim = PAD_L1;
} else if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
} else if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = PAD_R2;
}
}

View File

@ -490,7 +490,7 @@ void EntitySuccubus(Entity* self) {
switch (self->step_s) {
case SUCCUBUS_PETAL_ATTACK_SETUP:
self->facingLeft = (GetSideToPlayer() & 1) ^ 1;
if (g_Player.unk0C & PLAYER_STATUS_CURSE) {
if (g_Player.status & PLAYER_STATUS_CURSE) {
self->ext.succubus.unk87 = false;
} else {
self->ext.succubus.unk87 = true;
@ -522,7 +522,7 @@ void EntitySuccubus(Entity* self) {
SetStep(SUCCUBUS_FLY);
}
if (self->ext.succubus.unk87) {
if (g_Player.unk0C & PLAYER_STATUS_CURSE) {
if (g_Player.status & PLAYER_STATUS_CURSE) {
SetStep(SUCCUBUS_CHARGE);
}
} else if (D_80180668 != 0) {
@ -580,7 +580,7 @@ void EntitySuccubus(Entity* self) {
posY = -posY;
}
if (!(g_Player.unk0C & 0x010401A2)) {
if (!(g_Player.status & 0x010401A2)) {
if ((posY < 12) && (posX < 24)) {
g_Player.unk60 = 1;
g_Player.unk64 = 0;

View File

@ -76,7 +76,7 @@ void EntityEnemyBlood(Entity* self) {
}
if (self->hitboxState) {
if (!(g_Player.unk0C & PLAYER_STATUS_ABSORB_BLOOD)) {
if (!(g_Player.status & PLAYER_STATUS_ABSORB_BLOOD)) {
self->hitboxState = 0;
} else {
self->velocityX += self->ext.bloodDroplets.speed;

View File

@ -10,7 +10,7 @@ s32 GetPlayerCollisionWith(Entity* self, u16 w, u16 h, u16 flags) {
u16 checks;
#if STAGE != STAGE_ST0
s32 plStatus = g_Player.unk0C;
s32 plStatus = g_Player.status;
Collider col;
x = self->posX.i.hi;

View File

@ -1269,7 +1269,7 @@ void EntityMermanRockLeftSide(Entity* self) {
case 2:
if ((self->hitFlags != 0) &&
(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
g_CastleFlags[JEWEL_SWORD_ROOM] |= wolfFlag;
}
break;
@ -1363,7 +1363,7 @@ void EntityMermanRockRightSide(Entity* self) {
case 2:
if ((self->hitFlags != 0) &&
(g_Player.unk0C & PLAYER_STATUS_BAT_FORM)) {
(g_Player.status & PLAYER_STATUS_BAT_FORM)) {
g_CastleFlags[JEWEL_SWORD_ROOM] |= batFlag;
}
break;

View File

@ -51,7 +51,7 @@ void EntityAlucardWaterEffect(Entity* arg0) {
Entity* player = &PLAYER;
sp18 = player->posX.i.hi + tilemap->scrollX.i.hi;
status = g_Player.unk0C;
status = g_Player.status;
if (status & (PLAYER_STATUS_UNK_20 | PLAYER_STATUS_TRANSFORM)) {
if (status & PLAYER_STATUS_UNK_20) {
sp4A = 0x14;

View File

@ -1190,7 +1190,7 @@ void EntityMermanRockLeftSide(Entity* self) {
case 2:
if ((self->hitFlags != 0) &&
(g_Player.unk0C & PLAYER_STATUS_WOLF_FORM)) {
(g_Player.status & PLAYER_STATUS_WOLF_FORM)) {
g_CastleFlags[JEWEL_SWORD_ROOM] |= wolfFlag;
}
break;
@ -1285,7 +1285,7 @@ void EntityMermanRockRightSide(Entity* self) {
case 2:
if ((self->hitFlags != 0) &&
(g_Player.unk0C & PLAYER_STATUS_BAT_FORM)) {
(g_Player.status & PLAYER_STATUS_BAT_FORM)) {
g_CastleFlags[JEWEL_SWORD_ROOM] |= batFlag;
}
break;

View File

@ -51,7 +51,7 @@ void EntityAlucardWaterEffect(Entity* arg0) {
Entity* player = &PLAYER;
sp18 = player->posX.i.hi + tilemap->scrollX.i.hi;
status = g_Player.unk0C;
status = g_Player.status;
if (status & (PLAYER_STATUS_UNK_20 | PLAYER_STATUS_TRANSFORM)) {
if (status & PLAYER_STATUS_UNK_20) {
sp4A = 0x14;

View File

@ -17,7 +17,7 @@ void EntityElevator(Entity* self) {
FntPrint("elevator:%x\n", g_ElevatorTarget);
if (g_Player.unk0C & (PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM)) {
if (g_Player.status & (PLAYER_STATUS_BAT_FORM | PLAYER_STATUS_MIST_FORM)) {
temp = 0;
} else {
temp = GetPlayerCollisionWith(self, 16, 5, 4);

View File

@ -9,7 +9,7 @@ void func_801B8E0C(Entity* self) {
D_8003C8B8 = 0;
g_unkGraphicsStruct.pauseEnemies = 1;
g_Player.padSim = PAD_LEFT;
if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
g_Player.padSim = PAD_R2;
}
g_Player.D_80072EFC = 1;
@ -21,7 +21,7 @@ void func_801B8E0C(Entity* self) {
self->step++;
} else {
g_Player.padSim = 0;
if (g_Player.unk0C & PLAYER_STATUS_WOLF_FORM) {
if (g_Player.status & PLAYER_STATUS_WOLF_FORM) {
if (g_Timer & 1) {
g_Player.padSim = PAD_R2;
}

View File

@ -45,7 +45,7 @@ s32 WarpBackgroundBrightness;
//
// n.b.! this value is also used in src/st/wrp/warp.c
// clang-format off
#define PLAYER_UNK0C_READY_MASK \
#define PLAYER_STATUS_READY_MASK \
( \
/* 0xC0000000 */ PLAYER_STATUS_UNK80000000 | PLAYER_STATUS_UNK40000000 | \
/* 0x05000000 */ PLAYER_STATUS_UNK4000000 | PLAYER_STATUS_AXEARMOR | \
@ -169,7 +169,7 @@ void EntityRWarpRoom(Entity* self) {
// Wait for player to press the UP button
if (collision & 0x4 && g_pads[0].pressed & PAD_UP &&
ImplicitGetDistanceToPlayerX() < 8 &&
!(g_Player.unk0C & PLAYER_UNK0C_READY_MASK)) {
!(g_Player.status & PLAYER_STATUS_READY_MASK)) {
g_Player.padSim = 0;
g_Player.D_80072EFC = 0x80;
PLAYER.velocityY = PLAYER.velocityX = D_8003C8B8 = 0;
@ -303,7 +303,7 @@ void EntityRWarpRoom(Entity* self) {
if (g_pads[0].pressed & PAD_UP &&
ImplicitGetDistanceToPlayerX() < 8 &&
!(g_Player.unk0C & PLAYER_UNK0C_READY_MASK)) {
!(g_Player.status & PLAYER_STATUS_READY_MASK)) {
g_Player.padSim = 0;
g_Player.D_80072EFC = 0x80;
D_8003C8B8 = 0;

View File

@ -58,7 +58,7 @@ static s32 WarpBackgroundBrightness;
//
// n.b.! this value is also used in src/st/rwrp/warp.c
// clang-format off
#define PLAYER_UNK0C_READY_MASK \
#define PLAYER_STATUS_READY_MASK \
( \
/* 0xC0000000 */ PLAYER_STATUS_UNK80000000 | PLAYER_STATUS_UNK40000000 | \
/* 0x05000000 */ PLAYER_STATUS_UNK4000000 | PLAYER_STATUS_AXEARMOR | \
@ -178,7 +178,7 @@ void EntityWarpRoom(Entity* self) {
case 1:
// Wait for player to press the UP button
if (self->hitFlags && g_pads->pressed & PAD_UP &&
!(g_Player.unk0C & PLAYER_UNK0C_READY_MASK)) {
!(g_Player.status & PLAYER_STATUS_READY_MASK)) {
g_Player.padSim = 0;
g_Player.D_80072EFC = 0x80;
D_8003C8B8 = 0;

View File

@ -39,7 +39,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -38,7 +38,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -62,7 +62,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -41,7 +41,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -44,7 +44,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -39,7 +39,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -47,7 +47,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -43,7 +43,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -59,7 +59,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -36,7 +36,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -56,7 +56,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -248,7 +248,7 @@ static void EntityWeaponAttack(Entity* self) {
self->ext.weapon.unk82 = -20;
}
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 11;
}
self->posX.i.hi = self->posX.i.hi + self->ext.weapon.unk82;
@ -371,7 +371,7 @@ static s32 func_ptr_80170004(Entity* self) {
}
SetWeaponProperties(self, 0);
DestroyEntityWeapon(true);
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon_046.unk7C = -0x200;
self->ext.weapon_046.unk94 = -0x200;
self->ext.weapon_046.unk90 = 0x280;

View File

@ -196,7 +196,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {

View File

@ -119,7 +119,7 @@ s32 func_ptr_80170004(Entity* self) {
self->ext.weapon.unk82 = -20;
}
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 11;
}
self->posX.i.hi += self->ext.weapon.unk82;
@ -212,7 +212,7 @@ s32 func_ptr_80170004(Entity* self) {
self->ext.weapon.unk82 = -0x26;
}
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 0xB;
}
self->posX.i.hi = self->ext.weapon.unk82 + PLAYER.posX.i.hi;
@ -350,7 +350,7 @@ void func_ptr_8017000C(Entity* self) {
if (self->step == 0) {
self->facingLeft = PLAYER.facingLeft;
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 0xB;
}
self->posY.i.hi = self->posY.i.hi + self->ext.weapon.unk80;

View File

@ -212,7 +212,7 @@ s32 func_ptr_80170004(Entity* self) {
self->ext.weapon.unk82 = -20;
}
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 11;
}
self->posX.i.hi += self->ext.weapon.unk82;
@ -305,7 +305,7 @@ s32 func_ptr_80170004(Entity* self) {
self->ext.weapon.unk82 = -0x26;
}
self->ext.weapon.unk80 = -5;
if (g_Player.unk0C & PLAYER_STATUS_UNK_20) {
if (g_Player.status & PLAYER_STATUS_UNK_20) {
self->ext.weapon.unk80 = 0xB;
}
self->posX.i.hi = self->ext.weapon.unk82 + PLAYER.posX.i.hi;

View File

@ -38,7 +38,7 @@ static void EntityWeaponAttack(Entity* self) {
self->posY.val = PLAYER.posY.val;
self->facingLeft = PLAYER.facingLeft;
}
if ((g_Player.unk0C & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
if ((g_Player.status & PLAYER_STATUS_UNK10000) && (self->step != 4)) {
self->zPriority = PLAYER.zPriority + 2;
self->step = 4;
if (g_Player.pl_vram_flag & 1) {