1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-12 01:40:47 +00:00

PLAYER_STATE1_DEAD (#2204)

* PLAYER_STATE1_DEAD

* change comment

* format
This commit is contained in:
fig02 2024-09-17 08:21:47 -04:00 committed by GitHub
parent 3287437069
commit cc0b1bb127
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 36 additions and 35 deletions

View file

@ -121,7 +121,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
if (Player_HoldsHookshot(player)) {
if ((player->itemAction != player->heldItemAction) || (player->actor.flags & ACTOR_FLAG_TALK) ||
((player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)))) {
((player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_26)))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8);

View file

@ -289,7 +289,7 @@ void BgHakaSgami_Update(Actor* thisx, PlayState* play) {
BgHakaSgami* this = (BgHakaSgami*)thisx;
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
(this->actionFunc == BgHakaSgami_SetupSpin)) {
this->actionFunc(this, play);
}

View file

@ -200,7 +200,7 @@ void BgJyaGoroiwa_Update(Actor* thisx, PlayState* play) {
s32 bgId;
Vec3f checkPos;
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
this->actionFunc(this, play);
BgJyaGoroiwa_UpdateRotation(this);
checkPos.x = this->actor.world.pos.x;

View file

@ -661,7 +661,7 @@ void BossSst_HeadNeutral(BossSst* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((player->actor.world.pos.y > -50.0f) &&
!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
sHands[Rand_ZeroOne() <= 0.5f]->ready = true;
BossSst_HeadSetupWait(this);
} else {
@ -1250,7 +1250,7 @@ void BossSst_HandWait(BossSst* this, PlayState* play) {
}
if ((this->timer == 0) && (player->actor.world.pos.y > -50.0f) &&
!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
BossSst_HandSelectAttack(this);
}
} else if (sHead->actionFunc == BossSst_HeadNeutral) {

View file

@ -906,7 +906,7 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) {
DoorShutter* this = (DoorShutter*)thisx;
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28)) ||
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28)) ||
(this->actionFunc == DoorShutter_WaitForObject)) {
this->actionFunc(this, play);
}

View file

@ -739,7 +739,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
s32 pad;
s32 bgId;
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
if (this->collisionDisabledTimer > 0) {
this->collisionDisabledTimer--;
}

View file

@ -147,7 +147,7 @@ void EnNutsball_Update(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
(this->actionFunc == func_80ABBB34)) {
this->actionFunc(this, play);

View file

@ -578,7 +578,7 @@ void EnOkuta_Update(Actor* thisx, PlayState* play2) {
Vec3f prevPos;
s32 canRestorePrevPos;
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) {
if (this->actor.params == 0) {
EnOkuta_ColliderCheck(this, play);
if (!WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,

View file

@ -355,7 +355,7 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) {
}
if ((ABS(yaw) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) {
if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 |
if (!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 |
PLAYER_STATE1_19 | PLAYER_STATE1_21)) &&
!(player->stateFlags2 & PLAYER_STATE2_7)) {
if (this->playerStunWaitTimer == 0) {
@ -430,7 +430,7 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime);
if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 |
if (!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 |
PLAYER_STATE1_19 | PLAYER_STATE1_21)) &&
!(player->stateFlags2 & PLAYER_STATE2_7) &&
(Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) {

View file

@ -3394,7 +3394,7 @@ void func_80836448(PlayState* play, Player* this, LinkAnimationHeader* anim) {
Player_SetupAction(play, this, cond ? Player_Action_8084E368 : Player_Action_80843CEC, 0);
this->stateFlags1 |= PLAYER_STATE1_7;
this->stateFlags1 |= PLAYER_STATE1_DEAD;
Player_AnimPlayOnce(play, this, anim);
if (anim == &gPlayerAnim_link_derth_rebirth) {
@ -3607,7 +3607,7 @@ void func_80836BEC(Player* this, PlayState* play) {
}
if ((play->csCtx.state != CS_STATE_IDLE) || (this->csAction != PLAYER_CSACTION_NONE) ||
(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) ||
(this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) ||
(this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT)) {
// Don't allow Z-Targeting in various states
this->zTargetActiveTimer = 0;
@ -3984,7 +3984,7 @@ static s32 (*sActionChangeFuncs[])(Player* this, PlayState* play) = {
s32 Player_TryActionChangeList(PlayState* play, Player* this, s8* actionChangeList, s32 updateUpperBody) {
s32 i;
if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_7 | PLAYER_STATE1_29))) {
if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_DEAD | PLAYER_STATE1_29))) {
if (updateUpperBody) {
sUpperBodyIsBusy = Player_UpdateUpperBody(this, play);
@ -4858,7 +4858,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
if (this->actor.category == ACTORCAT_PLAYER) {
exitIndex = 0;
if (!(this->stateFlags1 & PLAYER_STATE1_7) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(this->csAction == PLAYER_CSACTION_NONE) && !(this->stateFlags1 & PLAYER_STATE1_0) &&
(((poly != NULL) && (exitIndex = SurfaceType_GetExitIndex(&play->colCtx, poly, bgId), exitIndex != 0)) ||
(func_8083816C(sFloorType) && (this->floorProperty == FLOOR_PROPERTY_12)))) {
@ -8936,7 +8936,7 @@ void func_80843AE8(PlayState* play, Player* this) {
this->av2.actionVar2 = -1;
}
} else if (gSaveContext.healthAccumulator == 0) {
this->stateFlags1 &= ~PLAYER_STATE1_7;
this->stateFlags1 &= ~PLAYER_STATE1_DEAD;
if (this->stateFlags1 & PLAYER_STATE1_27) {
func_80838F18(play, this);
} else {
@ -11517,11 +11517,11 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
Collider_UpdateCylinder(&this->actor, &this->cylinder);
if (!(this->stateFlags2 & PLAYER_STATE2_14)) {
if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_23))) {
if (!(this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_23))) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder.base);
}
if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)) && (this->invincibilityTimer <= 0)) {
if (!(this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_26)) && (this->invincibilityTimer <= 0)) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder.base);
if (this->invincibilityTimer < 0) {
@ -11538,7 +11538,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[PLAYER_BODYPART_WAIST]);
if (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) {
if (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
} else {
this->actor.colChkInfo.mass = 50;
@ -11897,7 +11897,7 @@ void func_8084B000(Player* this) {
}
phi_f18 = -0.1f - phi_f16;
} else {
if (!(this->stateFlags1 & PLAYER_STATE1_7) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
(this->actor.velocity.y >= -3.0f)) {
phi_f18 = -0.2f;
} else {