1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 14:31:17 +00:00

PlayerMeleeWeaponAnimation enum (#1154)

* Move `PlayerSwordAnimation` from `z_en_torch2.c` to `z64player.h`

* `PlayerSwordAnimation` -> `PlayerMeleeWeaponAnimation`

* Add `PWMA_` prefix to `PlayerMeleeWeaponAnimation` values

* Use `PlayerMeleeWeaponAnimation` enum more

* Add `PWMA_MAX`

* Update comments in z_en_kanban.c

* Some cleanup around conditionals with `meleeWeaponAnimation`

* Comment `PWMA_` index value in `D_80854190`

* `PMWA_` -> `PLAYER_MWA_`

* Minor fixup

* Missed one spot

* Run formatter
This commit is contained in:
Dragorn421 2022-03-09 18:52:28 +01:00 committed by GitHub
parent 5cadc5df8a
commit c55a8530ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 174 additions and 111 deletions

View file

@ -495,7 +495,7 @@ void EnTest_Idle(EnTest* this, GlobalContext* globalCtx) {
if ((player->meleeWeaponState != 0) && (ABS(yawDiff) >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f && player->meleeWeaponAnimation != 0x11) {
if (Rand_ZeroOne() > 0.7f && player->meleeWeaponAnimation != PLAYER_MWA_JUMPSLASH_START) {
EnTest_SetupJumpBack(this);
} else {
func_808627C4(this, globalCtx);
@ -626,7 +626,7 @@ void EnTest_WalkAndBlock(EnTest* this, GlobalContext* globalCtx) {
if (ABS(yawDiff) >= 0x1F40) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != PLAYER_MWA_JUMPSLASH_START)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1239,7 +1239,7 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->meleeWeaponAnimation != 0x11)) {
(player->meleeWeaponAnimation != PLAYER_MWA_JUMPSLASH_START)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1279,7 +1279,7 @@ void func_80862418(EnTest* this, GlobalContext* globalCtx) {
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->meleeWeaponAnimation != 0x11)) {
(player->meleeWeaponAnimation != PLAYER_MWA_JUMPSLASH_START)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1325,7 +1325,7 @@ void EnTest_Stunned(EnTest* this, GlobalContext* globalCtx) {
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
} else if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != PLAYER_MWA_JUMPSLASH_START)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);