1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 05:15:16 +00:00

Document Player Knockback related functions (#1601)

* document knockback related functions

* rotation -> yRot

* implement some changes

* Renames and comments

* mq bss

* format

* Intangibility and Invulnerability

* bss

* .bss

* add #pragma increment_block_number to z_en_item00.c

* .bss
This commit is contained in:
mzxrules 2024-09-23 18:31:00 -04:00 committed by GitHub
parent 0f725405d1
commit 56981d5297
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 298 additions and 187 deletions

View file

@ -1901,30 +1901,79 @@ s32 Actor_NotMounted(PlayState* play, Actor* horse) {
}
}
void func_8002F698(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
/**
* Sets the player's knockback properties
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
* @param type PlayerKnockbackType
* @param damage additional amount of damage to deal to the player
*/
void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage) {
Player* player = GET_PLAYER(play);
player->unk_8A0 = arg6;
player->unk_8A1 = arg5;
player->unk_8A4 = arg2;
player->unk_8A2 = arg3;
player->unk_8A8 = arg4;
player->knockbackDamage = damage;
player->knockbackType = type;
player->knockbackSpeed = speed;
player->knockbackRot = rot;
player->knockbackYVelocity = yVelocity;
}
void func_8002F6D4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(play, actor, arg2, arg3, arg4, 2, arg5);
/**
* Knocks the player to the ground
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
* @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) {
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_LARGE, damage);
}
void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) {
func_8002F6D4(play, actor, arg2, arg3, arg4, 0);
/**
* Knocks the player to the ground, without applying additional damage
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
*/
void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) {
Actor_SetPlayerKnockbackLarge(play, actor, speed, rot, yVelocity, 0);
}
void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(play, actor, arg2, arg3, arg4, 1, arg5);
/**
* Knocks the player back while keeping them on their feet
*
* @param play
* @param actor
* @param speed overridden
* @param rot the direction the player will be pushed
* @param yVelocity overridden
* @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) {
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_SMALL, damage);
}
void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) {
func_8002F758(play, actor, arg2, arg3, arg4, 0);
/**
* Knocks the player back while keeping them on their feet, without applying additional damage
*
* @param play
* @param actor
* @param speed overridden
* @param rot the direction the player will be pushed
* @param yVelocity overridden
*/
void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) {
Actor_SetPlayerKnockbackSmall(play, actor, speed, rot, yVelocity, 0);
}
/**