mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-23 13:59:40 +00:00
PLAYER_STATE1_DEAD
(#2204)
* PLAYER_STATE1_DEAD * change comment * format
This commit is contained in:
parent
3287437069
commit
cc0b1bb127
@ -655,7 +655,7 @@ typedef struct WeaponInfo {
|
||||
#define PLAYER_STATE1_HOSTILE_LOCK_ON (1 << 4) // Currently locked onto a hostile actor. Triggers a "battle" variant of many actions.
|
||||
#define PLAYER_STATE1_5 (1 << 5)
|
||||
#define PLAYER_STATE1_6 (1 << 6)
|
||||
#define PLAYER_STATE1_7 (1 << 7)
|
||||
#define PLAYER_STATE1_DEAD (1 << 7) // Player has died. Note that this gets set when the death cutscene has started, after landing from the air.
|
||||
#define PLAYER_STATE1_START_CHANGING_HELD_ITEM (1 << 8) // Item change process has begun
|
||||
#define PLAYER_STATE1_9 (1 << 9)
|
||||
#define PLAYER_STATE1_10 (1 << 10)
|
||||
|
@ -1143,7 +1143,8 @@ void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) {
|
||||
}
|
||||
|
||||
int func_8002DEEC(Player* player) {
|
||||
return (player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (player->csAction != PLAYER_CSACTION_NONE);
|
||||
return (player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) ||
|
||||
(player->csAction != PLAYER_CSACTION_NONE);
|
||||
}
|
||||
|
||||
void func_8002DF18(PlayState* play, Player* player) {
|
||||
@ -1808,7 +1809,7 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_7 | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 | PLAYER_STATE1_14 |
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 | PLAYER_STATE1_14 |
|
||||
PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21)) &&
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->talkActor)) && (getItemId > GI_NONE) &&
|
||||
@ -1882,7 +1883,7 @@ u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_7 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 |
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 |
|
||||
PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) {
|
||||
player->rideActor = horse;
|
||||
player->mountSide = mountSide;
|
||||
@ -2257,29 +2258,29 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* play
|
||||
|
||||
u32 sCategoryFreezeMasks[ACTORCAT_MAX] = {
|
||||
// ACTORCAT_SWITCH
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28,
|
||||
// ACTORCAT_BG
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28,
|
||||
// ACTORCAT_PLAYER
|
||||
0,
|
||||
// ACTORCAT_EXPLOSIVE
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28,
|
||||
// ACTORCAT_NPC
|
||||
PLAYER_STATE1_7,
|
||||
PLAYER_STATE1_DEAD,
|
||||
// ACTORCAT_ENEMY
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29,
|
||||
// ACTORCAT_PROP
|
||||
PLAYER_STATE1_7 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_DEAD | PLAYER_STATE1_28,
|
||||
// ACTORCAT_ITEMACTION
|
||||
0,
|
||||
// ACTORCAT_MISC
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29,
|
||||
// ACTORCAT_BOSS
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28,
|
||||
// ACTORCAT_DOOR
|
||||
0,
|
||||
// ACTORCAT_CHEST
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28,
|
||||
PLAYER_STATE1_6 | PLAYER_STATE1_DEAD | PLAYER_STATE1_28,
|
||||
};
|
||||
|
||||
void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
|
||||
|
@ -490,7 +490,7 @@ void Player_SetBootData(PlayState* play, Player* this) {
|
||||
}
|
||||
|
||||
int Player_InBlockingCsMode(PlayState* play, Player* this) {
|
||||
return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csAction != PLAYER_CSACTION_NONE) ||
|
||||
return (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) || (this->csAction != PLAYER_CSACTION_NONE) ||
|
||||
(play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) ||
|
||||
(this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT) ||
|
||||
((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0));
|
||||
@ -1048,7 +1048,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
|
||||
s16 temp2;
|
||||
s32 temp3;
|
||||
|
||||
if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_7) &&
|
||||
if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_DEAD) &&
|
||||
(Player_ActionToMagicSpell(this, this->itemAction) < 0)) {
|
||||
s32 pad;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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--;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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)) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user