Player Docs: Spin Attack (#1741)

* spin attack

* cleanup

* fix bss

* PR review

* sync func name

* add todo
This commit is contained in:
engineer124 2024-11-21 10:48:50 +11:00 committed by GitHub
parent 70e97dc285
commit 0b51a16453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 142 additions and 140 deletions

View File

@ -560,6 +560,14 @@ typedef enum PlayerLedgeClimbType {
#define LEDGE_DIST_MAX 399.96002f
typedef enum PlayerStickDirection {
/* -1 */ PLAYER_STICK_DIR_NONE = -1,
/* 0 */ PLAYER_STICK_DIR_FORWARD,
/* 1 */ PLAYER_STICK_DIR_LEFT,
/* 2 */ PLAYER_STICK_DIR_BACKWARD,
/* 3 */ PLAYER_STICK_DIR_RIGHT
} PlayerStickDirection;
// TODO: less dumb name
#define SFX_VOICE_BANK_SIZE 0x20
@ -893,8 +901,8 @@ typedef enum PlayerCueId {
#define PLAYER_STATE1_400 (1 << 10)
// Currently carrying an actor
#define PLAYER_STATE1_CARRYING_ACTOR (1 << 11)
// charging spin attack
#define PLAYER_STATE1_1000 (1 << 12)
// Currently charging a spin attack (by holding down the B button)
#define PLAYER_STATE1_CHARGING_SPIN_ATTACK (1 << 12)
//
#define PLAYER_STATE1_2000 (1 << 13)
//
@ -1250,9 +1258,9 @@ typedef struct Player {
/* 0xADB */ s8 meleeWeaponState;
/* 0xADC */ s8 unk_ADC;
/* 0xADD */ s8 unk_ADD; // Some sort of combo counter
/* 0xADE */ u8 unk_ADE;
/* 0xADF */ s8 unk_ADF[4]; // Circular buffer used for testing for triggering a quickspin
/* 0xAE3 */ s8 unk_AE3[4]; // Circular buffer used for ?
/* 0xADE */ u8 controlStickDataIndex; // cycles between 0 - 3. Used to index `controlStickSpinAngles` and `controlStickDirections`
/* 0xADF */ s8 controlStickSpinAngles[4]; // Stores a modified version of the control stick angle for the last 4 frames. Used for checking spins.
/* 0xAE3 */ s8 controlStickDirections[4]; // Stores the control stick direction (relative to shape yaw) for the last 4 frames. See `PlayerStickDirection`.
/* 0xAE7 */ union {
s8 actionVar1;
} av1; // "Action Variable 1": context dependent variable that has different meanings depending on what action is currently running

View File

@ -648,7 +648,8 @@ void Attention_Update(Attention* attention, Player* player, Actor* playerFocusAc
actor = NULL;
if ((player->focusActor != NULL) && (player->unk_AE3[player->unk_ADE] == 2)) {
if ((player->focusActor != NULL) &&
(player->controlStickDirections[player->controlStickDataIndex] == PLAYER_STICK_DIR_BACKWARD)) {
// Holding backward on the control stick prevents an arrow appearing over the next lock-on actor.
// This helps escape a lock-on loop when using Switch Targeting, but note that this still works for
// Hold Targeting as well.
@ -2206,8 +2207,8 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 x
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 &
(PLAYER_STATE1_DEAD | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) &&
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 |
PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) &&
(Player_GetExplosiveHeld(player) <= PLAYER_EXPLOSIVE_NONE)) {
if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) {
if (((getItemId == GI_MASK_CIRCUS_LEADER) || (getItemId == GI_PENDANT_OF_MEMORIES) ||
@ -2294,9 +2295,10 @@ s32 Actor_HasRider(PlayState* play, Actor* horse) {
s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_1000 |
PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | PLAYER_STATE1_80000 |
PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) {
if (!(player->stateFlags1 &
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_2000 |
PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 |
PLAYER_STATE1_200000))) {
player->rideActor = horse;
player->mountSide = mountSide;
CutsceneManager_Queue(CS_ID_GLOBAL_TALK);

View File

@ -400,36 +400,10 @@ s32 func_800CB924(Camera* camera) {
}
s32 func_800CB950(Camera* camera) {
Player* player;
s32 phi_v0;
s32 ret;
f32 yDiff;
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
yDiff = Camera_fabsf(camera->focalActorPosRot.pos.y - camera->focalActorFloorHeight);
phi_v0 = false;
if (yDiff < 11.0f) {
phi_v0 = true;
}
ret = phi_v0;
if (!ret) {
ret = false;
if (camera->focalActor->gravity > -0.1f) {
ret = true;
}
player = (Player*)camera->focalActor;
if (!ret) {
ret = player->stateFlags1 & PLAYER_STATE1_200000;
ret = !!ret;
}
}
return ret;
return ((Camera_fabsf(camera->focalActorPosRot.pos.y - camera->focalActorFloorHeight)) < 11.0f) ||
(camera->focalActor->gravity > -0.1f) ||
(((Player*)camera->focalActor)->stateFlags1 & PLAYER_STATE1_200000);
} else {
return true;
}
@ -445,18 +419,12 @@ s32 Camera_IsClimbingLedge(Camera* camera) {
}
}
s32 Camera_IsChargingSwordOrDekuFlowerDive(Camera* camera) {
s32 Camera_IsChargingSpinAttackOrDekuFlowerDive(Camera* camera) {
Actor* focalActor = camera->focalActor;
s32 ret;
if (focalActor == &GET_PLAYER(camera->play)->actor) {
// Charging Sword
ret = !!(((Player*)focalActor)->stateFlags1 & PLAYER_STATE1_1000);
if (!ret) {
// Deku Flower Dive
ret = !!(((Player*)focalActor)->stateFlags3 & PLAYER_STATE3_100);
}
return ret;
return (((Player*)focalActor)->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) ||
(((Player*)focalActor)->stateFlags3 & PLAYER_STATE3_100);
} else {
return false;
}
@ -2953,7 +2921,7 @@ s32 Camera_Parallel1(Camera* camera) {
rwData->unk_1C = 0;
}
if (func_800CB950(camera) || (((Player*)camera->focalActor)->stateFlags1 & PLAYER_STATE1_1000) ||
if (func_800CB950(camera) || (((Player*)camera->focalActor)->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) ||
(((Player*)camera->focalActor)->stateFlags3 & PLAYER_STATE3_100)) {
rwData->unk_04 = camera->focalActorPosRot.pos.y;
sp72 = false;
@ -3594,7 +3562,7 @@ s32 Camera_Battle1(Camera* camera) {
swingPitchFinal = roData->swingPitchFinal;
fov = roData->fov;
if (Camera_IsChargingSwordOrDekuFlowerDive(camera)) {
if (Camera_IsChargingSpinAttackOrDekuFlowerDive(camera)) {
camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(18.0f, camera->pitchUpdateRateInv, 0.5f, 0.1f);
camera->yOffsetUpdateRate = Camera_ScaledStepToCeilF(0.2f, camera->yOffsetUpdateRate, 0.5f, 0.0001f);
camera->xzOffsetUpdateRate = Camera_ScaledStepToCeilF(0.2f, camera->xzOffsetUpdateRate, 0.5f, 0.0001f);
@ -3690,7 +3658,7 @@ s32 Camera_Battle1(Camera* camera) {
sp104 = PREG(86) + 800.0f;
}
if ((spA4.r > sp104) || Camera_IsChargingSwordOrDekuFlowerDive(camera)) {
if ((spA4.r > sp104) || Camera_IsChargingSpinAttackOrDekuFlowerDive(camera)) {
distRatio = 1.0f;
spF8 = 10.0f;
} else {

View File

@ -3,7 +3,6 @@
* Description: Set of library functions to interact with the Player system
*/
#include "prevent_bss_reordering.h"
#include "global.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

View File

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

View File

@ -221,7 +221,7 @@ void EnMThunder_Spin_AttackNoMagic(EnMThunder* this, PlayState* play) {
return;
}
if (!(player->stateFlags1 & PLAYER_STATE1_1000)) {
if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) {
Actor_Kill(&this->actor);
}
}
@ -313,7 +313,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
return;
}
if (!(player->stateFlags1 & PLAYER_STATE1_1000)) {
if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) {
if (this->actor.child != NULL) {
this->actor.child->parent = NULL;
}

View File

@ -507,9 +507,9 @@ typedef struct struct_8085D200 {
/* 0x9 */ u8 unk_9;
} struct_8085D200; // size = 0xC
f32 sPlayerControlStickMagnitude;
s16 sPlayerControlStickAngle;
s16 D_80862B02; // analog stick yaw + camera yaw
f32 sControlStickMagnitude;
s16 sControlStickAngle;
s16 sControlStickWorldYaw;
s32 sUpperBodyIsBusy; // see `Player_UpdateUpperBody`
FloorType sPlayerFloorType;
u32 sPlayerTouchedWallFlags;
@ -655,10 +655,10 @@ void func_8082DE50(PlayState* play, Player* this) {
}
s32 func_8082DE88(Player* this, s32 arg1, s32 arg2) {
s16 controlStickAngleDiff = this->prevControlStickAngle - sPlayerControlStickAngle;
s16 controlStickAngleDiff = this->prevControlStickAngle - sControlStickAngle;
this->av2.actionVar2 +=
arg1 + TRUNCF_BINANG(ABS_ALT(controlStickAngleDiff) * fabsf(sPlayerControlStickMagnitude) * (1.0f / 0x600F0));
arg1 + TRUNCF_BINANG(ABS_ALT(controlStickAngleDiff) * fabsf(sControlStickMagnitude) * (1.0f / 0x600F0));
if (CHECK_BTN_ANY(sPlayerControlInput->press.button, BTN_B | BTN_A)) {
this->av2.actionVar2 += 5;
@ -2032,32 +2032,32 @@ void Player_AnimReplace_PlayLoopNormalAdjusted(PlayState* play, Player* this, Pl
}
void Player_ProcessControlStick(PlayState* play, Player* this) {
s8 var_v0;
s8 var_v1;
s8 spinAngle;
s8 direction;
this->prevControlStickMagnitude = sPlayerControlStickMagnitude;
this->prevControlStickAngle = sPlayerControlStickAngle;
this->prevControlStickMagnitude = sControlStickMagnitude;
this->prevControlStickAngle = sControlStickAngle;
Lib_GetControlStickData(&sPlayerControlStickMagnitude, &sPlayerControlStickAngle, sPlayerControlInput);
Lib_GetControlStickData(&sControlStickMagnitude, &sControlStickAngle, sPlayerControlInput);
if (sPlayerControlStickMagnitude < 8.0f) {
sPlayerControlStickMagnitude = 0.0f;
if (sControlStickMagnitude < 8.0f) {
sControlStickMagnitude = 0.0f;
}
D_80862B02 = Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)) + sPlayerControlStickAngle;
sControlStickWorldYaw = Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)) + sControlStickAngle;
this->unk_ADE = (this->unk_ADE + 1) % ARRAY_COUNT(this->unk_ADF);
this->controlStickDataIndex = (this->controlStickDataIndex + 1) % ARRAY_COUNT(this->controlStickSpinAngles);
if (sPlayerControlStickMagnitude < 55.0f) {
var_v0 = -1;
var_v1 = -1;
if (sControlStickMagnitude < 55.0f) {
direction = PLAYER_STICK_DIR_NONE;
spinAngle = -1;
} else {
var_v1 = ((u16)(sPlayerControlStickAngle + 0x2000)) >> 9;
var_v0 = ((u16)(BINANG_SUB(D_80862B02, this->actor.shape.rot.y) + 0x2000)) >> 14;
spinAngle = ((u16)(sControlStickAngle + 0x2000)) >> 9;
direction = ((u16)(BINANG_SUB(sControlStickWorldYaw, this->actor.shape.rot.y) + 0x2000)) >> 14;
}
this->unk_ADF[this->unk_ADE] = var_v1;
this->unk_AE3[this->unk_ADE] = var_v0;
this->controlStickSpinAngles[this->controlStickDataIndex] = spinAngle;
this->controlStickDirections[this->controlStickDataIndex] = direction;
}
void Player_Anim_PlayOnceWaterAdjustment(PlayState* play, Player* this, PlayerAnimationHeader* anim) {
@ -4967,7 +4967,7 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) {
isTalking = Player_IsTalking(play);
if (isTalking || (this->zTargetActiveTimer != 0) ||
(this->stateFlags1 & (PLAYER_STATE1_1000 | PLAYER_STATE1_ZORA_BOOMERANG_THROWN))) {
(this->stateFlags1 & (PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_ZORA_BOOMERANG_THROWN))) {
if (!isTalking) {
if (!(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) &&
((this->heldItemAction != PLAYER_IA_FISHING_ROD) || (this->unk_B28 == 0)) &&
@ -5100,8 +5100,8 @@ s32 Player_CalcSpeedAndYawFromControlStick(PlayState* play, Player* this, f32* o
*outSpeedTarget = 0.0f;
*outYawTarget = this->actor.shape.rot.y;
} else {
*outSpeedTarget = sPlayerControlStickMagnitude;
*outYawTarget = sPlayerControlStickAngle;
*outSpeedTarget = sControlStickMagnitude;
*outYawTarget = sControlStickAngle;
// The value of `speedMode` is never actually used. It only toggles this condition.
// See the definition of `SPEED_MODE_LINEAR` and `SPEED_MODE_CURVED` for more information.
@ -5127,7 +5127,7 @@ s32 Player_CalcSpeedAndYawFromControlStick(PlayState* play, Player* this, f32* o
*outSpeedTarget *= 1.5f;
}
if (sPlayerControlStickMagnitude != 0.0f) {
if (sControlStickMagnitude != 0.0f) {
f32 floorPitchInfluence = Math_SinS(this->floorPitch);
f32 speedCap = this->unk_B50;
f32 var_fa1;
@ -5479,7 +5479,8 @@ void func_808332A0(PlayState* play, Player* this, s32 magicCost, s32 isSwordBeam
this->unk_B08 = 0.5f;
}
this->stateFlags1 |= PLAYER_STATE1_1000;
this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if ((this->actor.id == ACTOR_PLAYER) && (isSwordBeam || (this->transformation == PLAYER_FORM_HUMAN))) {
s16 pitch = 0;
Actor* thunder;
@ -5504,9 +5505,8 @@ void func_808332A0(PlayState* play, Player* this, s32 magicCost, s32 isSwordBeam
}
}
// Check for inputs for quickspin
s32 func_808333CC(Player* this) {
s8 sp3C[4];
s32 Player_CanSpinAttack(Player* this) {
s8 sp3C[ARRAY_COUNT(this->controlStickSpinAngles)];
s8* iter;
s8* iter2;
s8 temp1;
@ -5517,9 +5517,10 @@ s32 func_808333CC(Player* this) {
return false;
}
iter = &this->unk_ADF[0];
iter = &this->controlStickSpinAngles[0];
iter2 = &sp3C[0];
for (i = 0; i < 4; i++, iter++, iter2++) {
for (i = 0; i < ARRAY_COUNT(this->controlStickSpinAngles); i++, iter++, iter2++) {
if ((*iter2 = *iter) < 0) {
return false;
}
@ -5527,12 +5528,14 @@ s32 func_808333CC(Player* this) {
}
temp1 = sp3C[0] - sp3C[1];
if (ABS_ALT(temp1) < 10) {
return false;
}
iter2 = &sp3C[1];
for (i = 1; i < 3; i++, iter2++) {
for (i = 1; i < (ARRAY_COUNT(this->controlStickSpinAngles) - 1); i++, iter2++) {
temp2 = *iter2 - *(iter2 + 1);
if ((ABS_ALT(temp2) < 10) || (temp2 * temp1 < 0)) {
return false;
@ -5564,10 +5567,10 @@ void func_808335B0(PlayState* play, Player* this) {
}
s8 D_8085D090[] = {
PLAYER_MWA_STAB_1H,
PLAYER_MWA_RIGHT_SLASH_1H,
PLAYER_MWA_RIGHT_SLASH_1H,
PLAYER_MWA_LEFT_SLASH_1H,
PLAYER_MWA_STAB_1H, // PLAYER_STICK_DIR_FORWARD
PLAYER_MWA_RIGHT_SLASH_1H, // PLAYER_STICK_DIR_LEFT, TODO: verify MWA as left/right does not match stick dir
PLAYER_MWA_RIGHT_SLASH_1H, // PLAYER_STICK_DIR_BACKWARD
PLAYER_MWA_LEFT_SLASH_1H, // PLAYER_STICK_DIR_RIGHT
};
s8 D_8085D094[][3] = {
@ -5576,10 +5579,10 @@ s8 D_8085D094[][3] = {
};
PlayerMeleeWeaponAnimation func_808335F4(Player* this) {
s32 temp_a1;
s32 controlStickDirection;
PlayerMeleeWeaponAnimation meleeWeaponAnim;
temp_a1 = this->unk_AE3[this->unk_ADE];
controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
if ((this->transformation == PLAYER_FORM_ZORA) || (this->transformation == PLAYER_FORM_GORON)) {
s8* meleeWeaponAnims = (this->transformation == PLAYER_FORM_ZORA) ? D_8085D094[0] : D_8085D094[1];
s32 unk_ADD = this->unk_ADD;
@ -5593,13 +5596,13 @@ PlayerMeleeWeaponAnimation func_808335F4(Player* this) {
}
}
} else {
if (func_808333CC(this)) {
if (Player_CanSpinAttack(this)) {
meleeWeaponAnim = PLAYER_MWA_SPIN_ATTACK_1H;
} else {
if (temp_a1 < 0) {
if (controlStickDirection <= PLAYER_STICK_DIR_NONE) {
meleeWeaponAnim = Player_IsZTargeting(this) ? PLAYER_MWA_FORWARD_SLASH_1H : PLAYER_MWA_RIGHT_SLASH_1H;
} else {
meleeWeaponAnim = D_8085D090[temp_a1];
meleeWeaponAnim = D_8085D090[controlStickDirection];
if (meleeWeaponAnim == PLAYER_MWA_STAB_1H) {
this->stateFlags2 |= PLAYER_STATE2_40000000;
if (!Player_IsZTargeting(this)) {
@ -7075,7 +7078,8 @@ s32 func_80836F10(PlayState* play, Player* this) {
}
s32 func_808370D4(PlayState* play, Player* this) {
if ((this->fallDistance < 800) && (this->unk_AE3[this->unk_ADE] == 0) &&
if ((this->fallDistance < 800) &&
(this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) &&
!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) {
func_80836B3C(play, this, 0.0f);
@ -8150,34 +8154,51 @@ s32 func_80839770(Player* this, PlayState* play) {
}
s32 func_80839800(Player* this, PlayState* play) {
if ((this->unk_AE3[this->unk_ADE] == 0) && (sPlayerFloorType != FLOOR_TYPE_7)) {
if ((this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) &&
(sPlayerFloorType != FLOOR_TYPE_7)) {
func_80836B3C(play, this, 0.0f);
return true;
}
return false;
}
void func_80839860(Player* this, PlayState* play, s32 arg2) {
void func_80839860(Player* this, PlayState* play, s32 controlStickDirection) {
s32 pad;
f32 speed = (!(arg2 & 1) ? 5.8f : 3.5f);
f32 speed;
if (!(controlStickDirection & 1)) {
// forwards, backwards, or none
speed = 5.8f;
} else {
// left or right
speed = 3.5f;
}
if (this->currentBoots == PLAYER_BOOTS_GIANT) {
speed /= 2.0f;
}
//! FAKE
if (arg2 == 2) {}
if (controlStickDirection == PLAYER_STICK_DIR_BACKWARD) {}
func_80834D50(play, this, D_8085C2A4[arg2].unk_0, speed, NA_SE_VO_LI_SWORD_N);
func_80834D50(play, this, D_8085C2A4[controlStickDirection].unk_0, speed, NA_SE_VO_LI_SWORD_N);
this->av2.actionVar2 = 1;
this->av1.actionVar1 = arg2;
this->av1.actionVar1 = controlStickDirection;
this->yaw = this->actor.shape.rot.y + (arg2 << 0xE);
this->speedXZ = !(arg2 & 1) ? 6.0f : 8.5f;
this->yaw = this->actor.shape.rot.y + (controlStickDirection << 0xE);
if (!(controlStickDirection & 1)) {
// forwards, backwards, or none
this->speedXZ = 6.0f;
} else {
// left or right
this->speedXZ = 8.5f;
}
this->stateFlags2 |= PLAYER_STATE2_80000;
Player_PlaySfx(this, ((arg2 << 0xE) == 0x8000) ? NA_SE_PL_ROLL : NA_SE_PL_SKIP);
Player_PlaySfx(this, ((controlStickDirection << 0xE) == (PLAYER_STICK_DIR_BACKWARD << 0xE)) ? NA_SE_PL_ROLL
: NA_SE_PL_SKIP);
}
void func_80839978(PlayState* play, Player* this) {
@ -8221,12 +8242,12 @@ s32 func_80839A84(PlayState* play, Player* this) {
s32 Player_ActionHandler_10(Player* this, PlayState* play) {
if (CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
(sPlayerFloorType != FLOOR_TYPE_7) && (sPlayerFloorEffect != FLOOR_EFFECT_1)) {
s32 temp_a2 = this->unk_AE3[this->unk_ADE];
s32 controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
if (temp_a2 <= 0) {
if (controlStickDirection <= PLAYER_STICK_DIR_FORWARD) {
if (Player_IsZTargeting(this)) {
if (this->actor.category != ACTORCAT_PLAYER) {
if (temp_a2 < 0) {
if (controlStickDirection <= PLAYER_STICK_DIR_NONE) {
func_80834DB8(this, &gPlayerAnim_link_normal_jump, REG(69) / 100.0f, play);
} else {
func_80836B3C(play, this, 0.0f);
@ -8242,7 +8263,7 @@ s32 Player_ActionHandler_10(Player* this, PlayState* play) {
return true;
}
} else {
func_80839860(this, play, temp_a2);
func_80839860(this, play, controlStickDirection);
return true;
}
}
@ -10745,7 +10766,7 @@ s32 func_80840CD4(Player* this, PlayState* play) {
} else if (!CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_B)) {
PlayerMeleeWeaponAnimation meleeWeaponAnim;
if ((this->unk_B08 >= 0.85f) || func_808333CC(this)) {
if ((this->unk_B08 >= 0.85f) || Player_CanSpinAttack(this)) {
meleeWeaponAnim = D_8085CF84[Player_IsHoldingTwoHandedWeapon(this)];
} else {
meleeWeaponAnim = D_8085CF80[Player_IsHoldingTwoHandedWeapon(this)];
@ -10753,7 +10774,7 @@ s32 func_80840CD4(Player* this, PlayState* play) {
func_80833864(play, this, meleeWeaponAnim);
func_808339B4(this, -8);
this->stateFlags2 |= PLAYER_STATE2_20000;
if (this->unk_AE3[this->unk_ADE] == 0) {
if (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) {
this->stateFlags2 |= PLAYER_STATE2_40000000;
}
} else {
@ -11112,8 +11133,8 @@ void Player_Init(Actor* thisx, PlayState* play) {
this->unk_B92 = 0;
this->unk_B94 = 0;
this->unk_B96 = 0;
this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_1000 | PLAYER_STATE1_USING_ZORA_BOOMERANG |
PLAYER_STATE1_ZORA_BOOMERANG_THROWN);
this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_CHARGING_SPIN_ATTACK |
PLAYER_STATE1_USING_ZORA_BOOMERANG | PLAYER_STATE1_ZORA_BOOMERANG_THROWN);
this->stateFlags2 &= ~(PLAYER_STATE2_20000 | PLAYER_STATE2_1000000 | PLAYER_STATE2_40000000);
this->stateFlags3 &=
~(PLAYER_STATE3_8 | PLAYER_STATE3_40 | PLAYER_STATE3_80 | PLAYER_STATE3_100 | PLAYER_STATE3_200 |
@ -11421,7 +11442,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
Actor* heldActor = this->heldActor;
Actor* interactRangeActor = this->interactRangeActor;
s32 pad;
s32 sp28 = this->unk_AE3[this->unk_ADE];
s32 controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
s32 sp24;
DoAction doActionA =
((this->transformation == PLAYER_FORM_GORON) && !(this->stateFlags1 & PLAYER_STATE1_400000))
@ -11431,8 +11452,8 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) {
doActionA = DO_ACTION_SNAP;
} else if (Player_InBlockingCsMode(play, this) || (this->actor.flags & ACTOR_FLAG_20000000) ||
(this->stateFlags1 & PLAYER_STATE1_1000) || (this->stateFlags3 & PLAYER_STATE3_80000) ||
(Player_Action_80 == this->actionFunc)) {
(this->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) ||
(this->stateFlags3 & PLAYER_STATE3_80000) || (Player_Action_80 == this->actionFunc)) {
doActionA = DO_ACTION_NONE;
} else if (this->stateFlags1 & PLAYER_STATE1_100000) {
doActionA = DO_ACTION_RETURN;
@ -11523,14 +11544,16 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
if ((sp24 && (this->transformation != PLAYER_FORM_DEKU)) || !(this->stateFlags1 & PLAYER_STATE1_400000) ||
!Player_IsGoronOrDeku(this)) {
if ((this->transformation != PLAYER_FORM_GORON) &&
!(this->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_4000)) && (sp28 <= 0) &&
!(this->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_4000)) &&
(controlStickDirection <= PLAYER_STICK_DIR_FORWARD) &&
(Player_CheckHostileLockOn(this) ||
((sPlayerFloorType != FLOOR_TYPE_7) &&
(Player_FriendlyLockOnOrParallel(this) ||
((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
!(this->stateFlags1 & PLAYER_STATE1_400000) && (sp28 == 0)))))) {
((sPlayerFloorType != FLOOR_TYPE_7) && (Player_FriendlyLockOnOrParallel(this) ||
((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
!(this->stateFlags1 & PLAYER_STATE1_400000) &&
(controlStickDirection == PLAYER_STICK_DIR_FORWARD)))))) {
doActionA = DO_ACTION_ATTACK;
} else if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && sp24 && (sp28 > 0)) {
} else if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && sp24 &&
(controlStickDirection >= PLAYER_STICK_DIR_LEFT)) {
doActionA = DO_ACTION_JUMP;
} else if ((this->transformation == PLAYER_FORM_DEKU) && !(this->stateFlags1 & PLAYER_STATE1_8000000) &&
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
@ -11949,7 +11972,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
camMode = CAM_MODE_BATTLE;
}
Camera_SetViewParam(camera, CAM_VIEW_TARGET, this->focusActor);
} else if (this->stateFlags1 & PLAYER_STATE1_1000) {
} else if (this->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) {
camMode = CAM_MODE_CHARGE;
} else if (this->stateFlags3 & PLAYER_STATE3_100) {
camMode = CAM_MODE_DEKUHIDE;
@ -12624,7 +12647,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
this->stateFlags2 &= ~(PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER | PLAYER_STATE2_200000);
}
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_1000 | PLAYER_STATE1_400000);
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_400000);
this->stateFlags2 &=
~(PLAYER_STATE2_1 | PLAYER_STATE2_4 | PLAYER_STATE2_8 | PLAYER_STATE2_20 | PLAYER_STATE2_40 |
PLAYER_STATE2_100 | PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND | PLAYER_STATE2_1000 | PLAYER_STATE2_4000 |
@ -15182,7 +15205,8 @@ void Player_Action_25(Player* this, PlayState* play) {
(this->speedXZ > 0.0f)) {
if ((this->transformation != PLAYER_FORM_GORON) &&
((this->transformation != PLAYER_FORM_DEKU) || (this->remainingHopsCounter != 0))) {
if ((this->yDistToLedge >= 150.0f) && (this->unk_AE3[this->unk_ADE] == 0)) {
if ((this->yDistToLedge >= 150.0f) &&
(this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD)) {
if (func_8083D860(this, play)) {
func_8084C124(play, this);
}
@ -15275,7 +15299,8 @@ void Player_Action_26(Player* this, PlayState* play) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play);
speedTarget *= 1.5f;
if ((speedTarget < 3.0f) || (this->unk_AE3[this->unk_ADE] != 0)) {
if ((speedTarget < 3.0f) ||
(this->controlStickDirections[this->controlStickDataIndex] != PLAYER_STICK_DIR_FORWARD)) {
speedTarget = 3.0f;
}
func_8083CB58(this, speedTarget, this->actor.shape.rot.y);
@ -15368,7 +15393,7 @@ void Player_Action_30(Player* this, PlayState* play) {
s16 yawTarget;
s32 temp_v0;
this->stateFlags1 |= PLAYER_STATE1_1000;
this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (PlayerAnimation_Update(play, &this->skelAnime)) {
Player_Anim_ResetMove(this);
Player_SetParallel(this);
@ -15416,7 +15441,7 @@ void Player_Action_31(Player* this, PlayState* play) {
var_v1 = ABS_ALT(temp_v0);
temp_ft4 = fabsf(this->speedXZ);
this->stateFlags1 |= PLAYER_STATE1_1000;
this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
var_fa0 = temp_ft4 * 1.5f;
var_fa0 = CLAMP_MIN(var_fa0, 1.5f);
@ -15464,7 +15489,7 @@ void Player_Action_32(Player* this, PlayState* play) {
f32 sp5C = fabsf(this->speedXZ);
f32 var_fa0;
this->stateFlags1 |= PLAYER_STATE1_1000;
this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK;
if (sp5C == 0.0f) {
sp5C = ABS_ALT(this->unk_B4C) * 0.0015f;
@ -16238,7 +16263,7 @@ void Player_Action_48(Player* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 0x800);
if (this->av1.actionVar1 != 0) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play);
if (this->unk_ADF[this->unk_ADE] >= 0) {
if (this->controlStickSpinAngles[this->controlStickDataIndex] >= 0) {
func_808381A0(this,
(this->av1.actionVar1 > 0) ? D_8085BE84[PLAYER_ANIMGROUP_fall_up][this->modelAnimType]
: D_8085BE84[PLAYER_ANIMGROUP_jump_climb_up][this->modelAnimType],
@ -16764,7 +16789,7 @@ s32 func_80850734(PlayState* play, Player* this) {
s32 func_80850854(PlayState* play, Player* this) {
if ((this->transformation == PLAYER_FORM_DEKU) && (this->remainingHopsCounter != 0) &&
(gSaveContext.save.saveInfo.playerData.health != 0) && (sPlayerControlStickMagnitude != 0.0f)) {
(gSaveContext.save.saveInfo.playerData.health != 0) && (sControlStickMagnitude != 0.0f)) {
func_808373F8(play, this, 0);
return true;
}
@ -18275,7 +18300,7 @@ void Player_Action_84(Player* this, PlayState* play) {
if (PlayerAnimation_Update(play, &this->skelAnime) ||
((this->meleeWeaponAnimation >= PLAYER_MWA_FLIPSLASH_FINISH) &&
(this->meleeWeaponAnimation <= PLAYER_MWA_ZORA_JUMPKICK_FINISH) && (this->skelAnime.curFrame > 2.0f) &&
func_808333CC(this))) {
Player_CanSpinAttack(this))) {
sPlayerUseHeldItem = this->av2.actionVar2;
if (!Player_ActionHandler_7(this, play)) {

View File

@ -1137,7 +1137,7 @@
0x800CB924:("func_800CB924",),
0x800CB950:("func_800CB950",),
0x800CBA08:("Camera_IsClimbingLedge",),
0x800CBA34:("Camera_IsChargingSwordOrDekuFlowerDive",),
0x800CBA34:("Camera_IsChargingSpinAttackOrDekuFlowerDive",),
0x800CBA7C:("func_800CBA7C",),
0x800CBAAC:("func_800CBAAC",),
0x800CBAD4:("Camera_GetFocalActorPos",),
@ -4386,7 +4386,7 @@
0x80833058:("Player_TryActionHandlerList",),
0x808331FC:("Player_TryActionInterrupt",),
0x808332A0:("func_808332A0",),
0x808333CC:("func_808333CC",),
0x808333CC:("Player_CanSpinAttack",),
0x808334D4:("func_808334D4",),
0x808335B0:("func_808335B0",),
0x808335F4:("func_808335F4",),

View File

@ -5240,9 +5240,9 @@
0x8085E6F0:("D_8085E6F0","f32","",0x4),
0x8085E6F4:("D_8085E6F4","f32","",0x4),
0x80862AF0:("sDogSpawnPos","Vec3f","",0xC),
0x80862AFC:("sPlayerControlStickMagnitude","f32","",0x4),
0x80862B00:("sPlayerControlStickAngle","UNK_TYPE1","",0x1),
0x80862B02:("D_80862B02","UNK_TYPE1","",0x1),
0x80862AFC:("sControlStickMagnitude","f32","",0x4),
0x80862B00:("sControlStickAngle","UNK_TYPE1","",0x1),
0x80862B02:("sControlStickWorldYaw","UNK_TYPE1","",0x1),
0x80862B04:("sUpperBodyIsBusy","UNK_TYPE1","",0x1),
0x80862B08:("sPlayerFloorType","UNK_TYPE1","",0x1),
0x80862B0C:("sPlayerTouchedWallFlags","UNK_TYPE1","",0x1),

View File

@ -651,7 +651,7 @@ asm/non_matchings/code/z_camera/Camera_IsPlayerFormZora.s,Camera_IsPlayerFormZor
asm/non_matchings/code/z_camera/func_800CB924.s,func_800CB924,0x800CB924,0xB
asm/non_matchings/code/z_camera/func_800CB950.s,func_800CB950,0x800CB950,0x2E
asm/non_matchings/code/z_camera/Camera_IsClimbingLedge.s,Camera_IsClimbingLedge,0x800CBA08,0xB
asm/non_matchings/code/z_camera/Camera_IsChargingSwordOrDekuFlowerDive.s,Camera_IsChargingSwordOrDekuFlowerDive,0x800CBA34,0x12
asm/non_matchings/code/z_camera/Camera_IsChargingSpinAttackOrDekuFlowerDive.s,Camera_IsChargingSpinAttackOrDekuFlowerDive,0x800CBA34,0x12
asm/non_matchings/code/z_camera/func_800CBA7C.s,func_800CBA7C,0x800CBA7C,0xC
asm/non_matchings/code/z_camera/func_800CBAAC.s,func_800CBAAC,0x800CBAAC,0xA
asm/non_matchings/code/z_camera/Camera_GetFocalActorPos.s,Camera_GetFocalActorPos,0x800CBAD4,0x21

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
651 asm/non_matchings/code/z_camera/func_800CB924.s func_800CB924 0x800CB924 0xB
652 asm/non_matchings/code/z_camera/func_800CB950.s func_800CB950 0x800CB950 0x2E
653 asm/non_matchings/code/z_camera/Camera_IsClimbingLedge.s Camera_IsClimbingLedge 0x800CBA08 0xB
654 asm/non_matchings/code/z_camera/Camera_IsChargingSwordOrDekuFlowerDive.s asm/non_matchings/code/z_camera/Camera_IsChargingSpinAttackOrDekuFlowerDive.s Camera_IsChargingSwordOrDekuFlowerDive Camera_IsChargingSpinAttackOrDekuFlowerDive 0x800CBA34 0x12
655 asm/non_matchings/code/z_camera/func_800CBA7C.s func_800CBA7C 0x800CBA7C 0xC
656 asm/non_matchings/code/z_camera/func_800CBAAC.s func_800CBAAC 0x800CBAAC 0xA
657 asm/non_matchings/code/z_camera/Camera_GetFocalActorPos.s Camera_GetFocalActorPos 0x800CBAD4 0x21