mirror of https://github.com/zeldaret/oot.git
Reevaluate player knockback types names
This commit is contained in:
parent
88f452af10
commit
3c106ac107
|
@ -643,17 +643,17 @@ typedef enum PlayerStickDirection {
|
||||||
/* 3 */ PLAYER_STICK_DIR_RIGHT
|
/* 3 */ PLAYER_STICK_DIR_RIGHT
|
||||||
} PlayerStickDirection;
|
} PlayerStickDirection;
|
||||||
|
|
||||||
typedef enum PlayerKnockbackType {
|
typedef enum PlayerKnockType {
|
||||||
/* 0 */ PLAYER_KNOCKBACK_NONE, // No knockback
|
/* 0 */ PLAYER_KNOCK_NONE, // No knockback
|
||||||
/* 1 */ PLAYER_KNOCKBACK_SMALL, // A small hop, remains standing up
|
/* 1 */ PLAYER_KNOCK_BACK, // A small hop, remains standing up
|
||||||
/* 2 */ PLAYER_KNOCKBACK_LARGE, // Sent flying in the air and lands laying down on the floor
|
/* 2 */ PLAYER_KNOCK_DOWN, // Sent flying in the air and lands laying down on the floor
|
||||||
/* 3 */ PLAYER_KNOCKBACK_LARGE_ELECTRIFIED // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect
|
/* 3 */ PLAYER_KNOCK_DOWN_ELECTRIFIED // Same as`PLAYER_KNOCK_DOWN` with a shock effect
|
||||||
} PlayerKnockbackType;
|
} PlayerKnockType;
|
||||||
|
|
||||||
typedef enum PlayerHitResponseType {
|
typedef enum PlayerHitResponseType {
|
||||||
/* 0 */ PLAYER_HIT_RESPONSE_NONE,
|
/* 0 */ PLAYER_HIT_RESPONSE_NONE,
|
||||||
/* 1 */ PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE,
|
/* 1 */ PLAYER_HIT_RESPONSE_KNOCK_DOWN,
|
||||||
/* 2 */ PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL,
|
/* 2 */ PLAYER_HIT_RESPONSE_KNOCK_BACK,
|
||||||
/* 3 */ PLAYER_HIT_RESPONSE_FROZEN,
|
/* 3 */ PLAYER_HIT_RESPONSE_FROZEN,
|
||||||
/* 4 */ PLAYER_HIT_RESPONSE_ELECTRIFIED
|
/* 4 */ PLAYER_HIT_RESPONSE_ELECTRIFIED
|
||||||
} PlayerHitResponseType;
|
} PlayerHitResponseType;
|
||||||
|
|
|
@ -1983,7 +1983,7 @@ void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot,
|
||||||
* @param damage additional amount of damage to deal to the player
|
* @param damage additional amount of damage to deal to the player
|
||||||
*/
|
*/
|
||||||
void Actor_SetPlayerKnockbackLarge(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
|
void Actor_SetPlayerKnockbackLarge(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
|
||||||
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_LARGE, damage);
|
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCK_DOWN, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2010,7 +2010,7 @@ void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 sp
|
||||||
* @param damage additional amount of damage to deal to the player
|
* @param damage additional amount of damage to deal to the player
|
||||||
*/
|
*/
|
||||||
void Actor_SetPlayerKnockbackSmall(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
|
void Actor_SetPlayerKnockbackSmall(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
|
||||||
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_SMALL, damage);
|
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCK_BACK, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -550,7 +550,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
|
||||||
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_LAUGH);
|
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_LAUGH);
|
||||||
}
|
}
|
||||||
Actor_SetPlayerKnockback(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f,
|
Actor_SetPlayerKnockback(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f,
|
||||||
PLAYER_KNOCKBACK_LARGE_ELECTRIFIED, 0x10);
|
PLAYER_KNOCK_DOWN_ELECTRIFIED, 0x10);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FHGFIRE_LIGHT_BLUE:
|
case FHGFIRE_LIGHT_BLUE:
|
||||||
|
|
|
@ -602,7 +602,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
|
||||||
if (!Actor_ApplyDamage(&this->actor)) {
|
if (!Actor_ApplyDamage(&this->actor)) {
|
||||||
func_800F5B58();
|
func_800F5B58();
|
||||||
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
|
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
|
||||||
this->knockbackType = PLAYER_KNOCKBACK_LARGE;
|
this->knockbackType = PLAYER_KNOCK_DOWN;
|
||||||
this->knockbackSpeed = 6.0f;
|
this->knockbackSpeed = 6.0f;
|
||||||
this->knockbackYVelocity = 6.0f;
|
this->knockbackYVelocity = 6.0f;
|
||||||
this->knockbackDamage = this->actor.colChkInfo.damage;
|
this->knockbackDamage = this->actor.colChkInfo.damage;
|
||||||
|
@ -623,7 +623,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
|
||||||
} else {
|
} else {
|
||||||
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
|
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
|
||||||
this->knockbackDamage = this->actor.colChkInfo.damage;
|
this->knockbackDamage = this->actor.colChkInfo.damage;
|
||||||
this->knockbackType = PLAYER_KNOCKBACK_SMALL;
|
this->knockbackType = PLAYER_KNOCK_BACK;
|
||||||
this->knockbackYVelocity = 6.0f;
|
this->knockbackYVelocity = 6.0f;
|
||||||
this->knockbackSpeed = 8.0f;
|
this->knockbackSpeed = 8.0f;
|
||||||
this->knockbackRot = this->actor.yawTowardsPlayer + 0x8000;
|
this->knockbackRot = this->actor.yawTowardsPlayer + 0x8000;
|
||||||
|
|
|
@ -4673,8 +4673,8 @@ void func_80837C0C(PlayState* play, Player* this, s32 hitResponseType, f32 speed
|
||||||
anim = &gPlayerAnim_link_swimer_swim_hit;
|
anim = &gPlayerAnim_link_swimer_swim_hit;
|
||||||
|
|
||||||
Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S);
|
Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S);
|
||||||
} else if ((hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE) ||
|
} else if ((hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_DOWN) ||
|
||||||
(hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) ||
|
(hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_BACK) ||
|
||||||
!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
|
!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
|
||||||
(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) {
|
(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) {
|
||||||
Player_SetupAction(play, this, Player_Action_8084377C, 0);
|
Player_SetupAction(play, this, Player_Action_8084377C, 0);
|
||||||
|
@ -4684,7 +4684,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 hitResponseType, f32 speed
|
||||||
Player_RequestRumble(this, 255, 20, 150, 0);
|
Player_RequestRumble(this, 255, 20, 150, 0);
|
||||||
func_80832224(this);
|
func_80832224(this);
|
||||||
|
|
||||||
if (hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) {
|
if (hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_BACK) {
|
||||||
this->av2.actionVar2 = 4;
|
this->av2.actionVar2 = 4;
|
||||||
|
|
||||||
this->actor.speed = 3.0f;
|
this->actor.speed = 3.0f;
|
||||||
|
@ -4857,17 +4857,17 @@ s32 func_808382DC(Player* this, PlayState* play) {
|
||||||
Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY);
|
Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY);
|
||||||
play->haltAllActors = true;
|
play->haltAllActors = true;
|
||||||
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);
|
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);
|
||||||
} else if ((this->knockbackType != PLAYER_KNOCKBACK_NONE) &&
|
} else if ((this->knockbackType != PLAYER_KNOCK_NONE) &&
|
||||||
((this->knockbackType >= PLAYER_KNOCKBACK_LARGE) || (this->invincibilityTimer == 0))) {
|
((this->knockbackType >= PLAYER_KNOCK_DOWN) || (this->invincibilityTimer == 0))) {
|
||||||
u8 knockbackResponse[] = {
|
u8 knockbackResponse[] = {
|
||||||
PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL,
|
PLAYER_HIT_RESPONSE_KNOCK_BACK,
|
||||||
PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE,
|
PLAYER_HIT_RESPONSE_KNOCK_DOWN,
|
||||||
PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE,
|
PLAYER_HIT_RESPONSE_KNOCK_DOWN,
|
||||||
};
|
};
|
||||||
|
|
||||||
func_80838280(this);
|
func_80838280(this);
|
||||||
|
|
||||||
if (this->knockbackType == PLAYER_KNOCKBACK_LARGE_ELECTRIFIED) {
|
if (this->knockbackType == PLAYER_KNOCK_DOWN_ELECTRIFIED) {
|
||||||
this->bodyShockTimer = 40;
|
this->bodyShockTimer = 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4943,7 +4943,7 @@ s32 func_808382DC(Player* this, PlayState* play) {
|
||||||
} else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_ELECTRIC) {
|
} else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_ELECTRIC) {
|
||||||
sp4C = PLAYER_HIT_RESPONSE_ELECTRIFIED;
|
sp4C = PLAYER_HIT_RESPONSE_ELECTRIFIED;
|
||||||
} else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_KNOCKBACK) {
|
} else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_KNOCKBACK) {
|
||||||
sp4C = PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE;
|
sp4C = PLAYER_HIT_RESPONSE_KNOCK_DOWN;
|
||||||
} else {
|
} else {
|
||||||
func_80838280(this);
|
func_80838280(this);
|
||||||
sp4C = PLAYER_HIT_RESPONSE_NONE;
|
sp4C = PLAYER_HIT_RESPONSE_NONE;
|
||||||
|
@ -9302,7 +9302,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) {
|
||||||
func_808382BC(this);
|
func_808382BC(this);
|
||||||
|
|
||||||
if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->av2.actionVar2 == 0) &&
|
if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->av2.actionVar2 == 0) &&
|
||||||
(this->knockbackType != PLAYER_KNOCKBACK_NONE)) {
|
(this->knockbackType != PLAYER_KNOCK_NONE)) {
|
||||||
s16 temp = this->actor.shape.rot.y - this->knockbackRot;
|
s16 temp = this->actor.shape.rot.y - this->knockbackRot;
|
||||||
|
|
||||||
this->yaw = this->actor.shape.rot.y = this->knockbackRot;
|
this->yaw = this->actor.shape.rot.y = this->knockbackRot;
|
||||||
|
@ -9325,7 +9325,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) {
|
||||||
func_80853080(this, play);
|
func_80853080(this, play);
|
||||||
}
|
}
|
||||||
} else if ((this->stateFlags1 & PLAYER_STATE1_29) ||
|
} else if ((this->stateFlags1 & PLAYER_STATE1_29) ||
|
||||||
(!(this->cylinder.base.acFlags & AC_HIT) && (this->knockbackType == PLAYER_KNOCKBACK_NONE))) {
|
(!(this->cylinder.base.acFlags & AC_HIT) && (this->knockbackType == PLAYER_KNOCK_NONE))) {
|
||||||
if (this->stateFlags1 & PLAYER_STATE1_29) {
|
if (this->stateFlags1 & PLAYER_STATE1_29) {
|
||||||
this->av2.actionVar2++;
|
this->av2.actionVar2++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -9790,7 +9790,7 @@ void Player_Action_80844A44(Player* this, PlayState* play) {
|
||||||
|
|
||||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||||
this->actor.colChkInfo.damage = 0x10;
|
this->actor.colChkInfo.damage = 0x10;
|
||||||
func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 4.0f, 5.0f, this->actor.shape.rot.y, 20);
|
func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCK_DOWN, 4.0f, 5.0f, this->actor.shape.rot.y, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10616,7 +10616,7 @@ void Player_StartMode_Grotto(PlayState* play, Player* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player_StartMode_KnockedOver(PlayState* play, Player* this) {
|
void Player_StartMode_KnockedOver(PlayState* play, Player* this) {
|
||||||
func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0);
|
func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCK_DOWN, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player_StartMode_WarpSong(PlayState* play, Player* this) {
|
void Player_StartMode_WarpSong(PlayState* play, Player* this) {
|
||||||
|
@ -12030,7 +12030,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
|
||||||
temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y;
|
temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y;
|
||||||
|
|
||||||
this->doorType = PLAYER_DOORTYPE_NONE;
|
this->doorType = PLAYER_DOORTYPE_NONE;
|
||||||
this->knockbackType = PLAYER_KNOCKBACK_NONE;
|
this->knockbackType = PLAYER_KNOCK_NONE;
|
||||||
this->autoLockOnActor = NULL;
|
this->autoLockOnActor = NULL;
|
||||||
|
|
||||||
phi_f12 =
|
phi_f12 =
|
||||||
|
|
Loading…
Reference in New Issue