summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKEKW555 <152369890+KEKW555@users.noreply.github.com>2023-11-29 12:20:59 +0530
committerGitHub <noreply@github.com>2023-11-29 12:20:59 +0530
commit43f25e93af27eb393517bb05261d0966a263240f (patch)
tree065e6d80e955380bd93afa2c79586963db1c78a4
parentd05f7dff2d8436b98e99e07bbab584afb114e343 (diff)
OK sub_0807A5B8
-rw-r--r--src/playerUtils.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/playerUtils.c b/src/playerUtils.c
index 7678ab5a..5a3c0225 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -1688,7 +1688,45 @@ void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {
gPlayerEntity.direction = direction;
}
-ASM_FUNC("asm/non_matching/playerUtils/sub_080792D8.inc", void sub_080792D8())
+void sub_080792D8(void) {
+ Entity* playerEntity = &gPlayerEntity;
+
+ if (playerEntity->knockbackDuration != 0) {
+ if (((((playerEntity->action == 0xb) || (gPlayerState.dash_state != 0)) ||
+ ((u8)(gPlayerState.heldObject - 1) < 4)) ||
+ (((gPlayerState.jump_status != 0 || (gPlayerState.floor_type == 0xff)) ||
+ (((gPlayerState.field_0x7 & 0x80) != 0 ||
+ ((0 < (s32)((gPlayerState.swim_state & 0xf) - 1) || (playerEntity->action == 3)))))))) ||
+ ((gPlayerState.flags & 0x40000) != 0)) {
+ playerEntity->knockbackDuration = 0;
+ } else if ((playerEntity->action == 0x1d) && (playerEntity->knockbackDirection != 0x10)) {
+ playerEntity->knockbackDuration = 0;
+ } else {
+
+ if ((s8)(playerEntity->knockbackDuration) >= 1) {
+ playerEntity->knockbackDuration--;
+
+ } else {
+ playerEntity->knockbackDuration++;
+ }
+ if (playerEntity->knockbackDuration != 0) {
+ gPlayerState.field_0x7 &= 0xdf;
+ if ((((0 < playerEntity->iframes) && (gPlayerState.swim_state == 0)) &&
+ ((gPlayerState.flags & 0x80) == 0)) &&
+ gPlayerState.jump_status == 0) {
+ ResetActiveItems();
+ if ((gPlayerState.flags & 8) == 0) {
+ gPlayerState.animation = 0x114;
+ } else {
+ gPlayerState.animation = 0x418;
+ }
+ }
+ sub_080027EA(playerEntity, 0x280, playerEntity->knockbackDirection);
+ sub_0807A5B8(playerEntity->knockbackDirection);
+ }
+ }
+ }
+}
bool32 sub_080793E4(u32 param_1) {
u32 tmp;