1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-11 03:23:46 +00:00

Name PLAYER_STATE1_CHARGING_SPIN_ATTACK (#2203)

* name charge state flag

* format
This commit is contained in:
fig02 2024-09-16 17:14:29 -04:00 committed by GitHub
parent dc9782b5b3
commit 8f0e2fc29c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 16 deletions

View file

@ -660,7 +660,7 @@ typedef struct WeaponInfo {
#define PLAYER_STATE1_9 (1 << 9) #define PLAYER_STATE1_9 (1 << 9)
#define PLAYER_STATE1_10 (1 << 10) #define PLAYER_STATE1_10 (1 << 10)
#define PLAYER_STATE1_ACTOR_CARRY (1 << 11) // Currently carrying an actor #define PLAYER_STATE1_ACTOR_CARRY (1 << 11) // Currently carrying an actor
#define PLAYER_STATE1_12 (1 << 12) #define PLAYER_STATE1_CHARGING_SPIN_ATTACK (1 << 12) // Currently charing a spin attack (by holding down the B button)
#define PLAYER_STATE1_13 (1 << 13) #define PLAYER_STATE1_13 (1 << 13)
#define PLAYER_STATE1_14 (1 << 14) #define PLAYER_STATE1_14 (1 << 14)
#define PLAYER_STATE1_Z_TARGETING (1 << 15) // Either lock-on or parallel is active. This flag is never checked for and is practically unused. #define PLAYER_STATE1_Z_TARGETING (1 << 15) // Either lock-on or parallel is active. This flag is never checked for and is practically unused.

View file

@ -1807,8 +1807,9 @@ u32 Actor_HasParent(Actor* actor, PlayState* play) {
s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | if (!(player->stateFlags1 &
PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21)) && (PLAYER_STATE1_7 | 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) { Player_GetExplosiveHeld(player) < 0) {
if ((((player->heldActor != NULL) || (actor == player->talkActor)) && (getItemId > GI_NONE) && if ((((player->heldActor != NULL) || (actor == player->talkActor)) && (getItemId > GI_NONE) &&
(getItemId < GI_MAX)) || (getItemId < GI_MAX)) ||
@ -1881,8 +1882,8 @@ u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & if (!(player->stateFlags1 &
(PLAYER_STATE1_7 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | (PLAYER_STATE1_7 | PLAYER_STATE1_ACTOR_CARRY | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 |
PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) { PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) {
player->rideActor = horse; player->rideActor = horse;
player->mountSide = mountSide; player->mountSide = mountSide;
return true; return true;

View file

@ -2927,7 +2927,7 @@ s32 Camera_Battle1(Camera* camera) {
sp78 = roData->swingPitchFinal; sp78 = roData->swingPitchFinal;
fov = roData->fov; fov = roData->fov;
if (camera->player->stateFlags1 & PLAYER_STATE1_12) { if (camera->player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) {
// charging sword. // charging sword.
rwData->unk_10 = rwData->unk_10 =
Camera_LERPCeilF(CAM_GLOBAL_12 * (1.0f - 0.5f), rwData->unk_10, CAM_UPDATE_RATE_STEP_SCALE_XZ, 0.1f); Camera_LERPCeilF(CAM_GLOBAL_12 * (1.0f - 0.5f), rwData->unk_10, CAM_UPDATE_RATE_STEP_SCALE_XZ, 0.1f);

View file

@ -180,7 +180,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, PlayState* play) {
s32 i; s32 i;
s32 j; s32 j;
if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_12)) { if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) {
if (this->life != 0) { if (this->life != 0) {
this->life--; this->life--;
} else { } else {

View file

@ -135,7 +135,7 @@ void func_80A9F350(EnMThunder* this, PlayState* play) {
return; return;
} }
if (!(player->stateFlags1 & PLAYER_STATE1_12)) { if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} }
@ -218,7 +218,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
} }
} }
if (!(player->stateFlags1 & PLAYER_STATE1_12)) { if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) {
if (this->actor.child != NULL) { if (this->actor.child != NULL) {
this->actor.child->parent = NULL; this->actor.child->parent = NULL;
} }

View file

@ -3642,7 +3642,7 @@ void func_80836BEC(Player* this, PlayState* play) {
isTalking = func_8083224C(play); isTalking = func_8083224C(play);
if (isTalking || (this->zTargetActiveTimer != 0) || if (isTalking || (this->zTargetActiveTimer != 0) ||
(this->stateFlags1 & (PLAYER_STATE1_12 | PLAYER_STATE1_BOOMERANG_THROWN))) { (this->stateFlags1 & (PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_BOOMERANG_THROWN))) {
if (!isTalking) { if (!isTalking) {
if (!(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) && if (!(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) &&
((this->heldItemAction != PLAYER_IA_FISHING_POLE) || (this->unk_860 == 0)) && ((this->heldItemAction != PLAYER_IA_FISHING_POLE) || (this->unk_860 == 0)) &&
@ -4065,7 +4065,7 @@ void func_80837530(PlayState* play, Player* this, s32 arg2) {
this->unk_858 = 0.5f; this->unk_858 = 0.5f;
} }
this->stateFlags1 |= PLAYER_STATE1_12; this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (this->actor.category == ACTORCAT_PLAYER) { if (this->actor.category == ACTORCAT_PLAYER) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_THUNDER, this->bodyPartsPos[PLAYER_BODYPART_WAIST].x, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_THUNDER, this->bodyPartsPos[PLAYER_BODYPART_WAIST].x,
@ -9383,7 +9383,7 @@ void Player_Action_80844E68(Player* this, PlayState* play) {
s16 yawTarget; s16 yawTarget;
s32 temp; s32 temp;
this->stateFlags1 |= PLAYER_STATE1_12; this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (LinkAnimation_Update(play, &this->skelAnime)) { if (LinkAnimation_Update(play, &this->skelAnime)) {
func_80832DBC(this); func_80832DBC(this);
@ -9435,7 +9435,7 @@ void Player_Action_80845000(Player* this, PlayState* play) {
sp5C = fabsf(this->speedXZ); sp5C = fabsf(this->speedXZ);
sp58 = sp5C * 1.5f; sp58 = sp5C * 1.5f;
this->stateFlags1 |= PLAYER_STATE1_12; this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (sp58 < 1.5f) { if (sp58 < 1.5f) {
sp58 = 1.5f; sp58 = 1.5f;
@ -9497,7 +9497,7 @@ void Player_Action_80845308(Player* this, PlayState* play) {
sp5C = fabsf(this->speedXZ); sp5C = fabsf(this->speedXZ);
this->stateFlags1 |= PLAYER_STATE1_12; this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (sp5C == 0.0f) { if (sp5C == 0.0f) {
sp5C = ABS(this->unk_87C) * 0.0015f; sp5C = ABS(this->unk_87C) * 0.0015f;
@ -10856,7 +10856,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
camMode = CAM_MODE_Z_TARGET_UNFRIENDLY; camMode = CAM_MODE_Z_TARGET_UNFRIENDLY;
} }
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, focusActor); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, focusActor);
} else if (this->stateFlags1 & PLAYER_STATE1_12) { } else if (this->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) {
camMode = CAM_MODE_CHARGE; camMode = CAM_MODE_CHARGE;
} else if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) { } else if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) {
camMode = CAM_MODE_FOLLOW_BOOMERANG; camMode = CAM_MODE_FOLLOW_BOOMERANG;
@ -11429,7 +11429,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21);
} }
this->stateFlags1 &= ~(PLAYER_STATE1_SWINGING_BOTTLE | PLAYER_STATE1_9 | PLAYER_STATE1_12 | PLAYER_STATE1_22); this->stateFlags1 &=
~(PLAYER_STATE1_SWINGING_BOTTLE | PLAYER_STATE1_9 | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_22);
this->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_2 | PLAYER_STATE2_3 | PLAYER_STATE2_5 | PLAYER_STATE2_6 | this->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_2 | PLAYER_STATE2_3 | PLAYER_STATE2_5 | PLAYER_STATE2_6 |
PLAYER_STATE2_8 | PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND | PLAYER_STATE2_12 | PLAYER_STATE2_8 | PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND | PLAYER_STATE2_12 |
PLAYER_STATE2_14 | PLAYER_STATE2_DO_ACTION_ENTER | PLAYER_STATE2_22 | PLAYER_STATE2_26); PLAYER_STATE2_14 | PLAYER_STATE2_DO_ACTION_ENTER | PLAYER_STATE2_22 | PLAYER_STATE2_26);