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

sword -> meleeWeapon (#1147)

This commit is contained in:
Dragorn421 2022-02-21 00:45:12 +01:00 committed by GitHub
parent b9cc31dc74
commit 145b14dbc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 194 additions and 182 deletions

View file

@ -492,10 +492,10 @@ void EnTest_Idle(EnTest* this, GlobalContext* globalCtx) {
yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 100.0f) {
if ((player->swordState != 0) && (ABS(yawDiff) >= 0x1F40)) {
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->swordAnimation != 0x11) {
if (Rand_ZeroOne() > 0.7f && player->meleeWeaponAnimation != 0x11) {
EnTest_SetupJumpBack(this);
} else {
func_808627C4(this, globalCtx);
@ -622,11 +622,11 @@ void EnTest_WalkAndBlock(EnTest* this, GlobalContext* globalCtx) {
yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0)) {
if (ABS(yawDiff) >= 0x1F40) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if ((Rand_ZeroOne() > 0.7f) && (player->swordAnimation != 0x11)) {
if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1233,13 +1233,13 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
}
}
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((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) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
(player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1273,13 +1273,13 @@ void func_80862418(EnTest* this, GlobalContext* globalCtx) {
}
}
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((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) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
(player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1320,12 +1320,12 @@ void EnTest_Stunned(EnTest* this, GlobalContext* globalCtx) {
if (this->actor.colorFilterTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
func_80862FA8(this, globalCtx);
} else if (player->swordState != 0) {
} else if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((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->swordAnimation != 0x11)) {
} else if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);