diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2022-03-11 17:08:38 +0100 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2022-03-11 17:08:38 +0100 |
| commit | caa87bb89a5ea23a2b3b47e3c575909ff6d6e4d6 (patch) | |
| tree | 3f723d8bc871e811b5d7bbca68b6095ddee8792f /src | |
| parent | 3006233238ac10faa86975afa75e0488ffe06bcf (diff) | |
Decompile Object70
Diffstat (limited to 'src')
| -rw-r--r-- | src/object/object70.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/object/object70.c b/src/object/object70.c new file mode 100644 index 00000000..fa0a4bb4 --- /dev/null +++ b/src/object/object70.c @@ -0,0 +1,77 @@ +/** + * @file object70.c + * @ingroup Objects + * + * @brief Object70 object + */ + +#define NENT_DEPRECATED +#include "global.h" +#include "object.h" +#include "functions.h" + +void Object70_Init(Entity*); +void Object70_Action1(Entity*); + +void Object70(Entity* this) { + static void (*const Object70_Actions[])(Entity*) = { + Object70_Init, + Object70_Action1, + }; + Object70_Actions[this->action](this); +} + +void Object70_Init(Entity* this) { + this->action = 1; + this->spriteSettings.draw = 1; + this->frameIndex = this->type + 0xb; + if (this->type != 0) { + sub_08004168(this); + gPlayerEntity.spriteOrientation.flipY = 3; + if ((gPlayerEntity.spritePriority.b0) != 7) { + this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1; + } else { + this->spritePriority.b0 = 7; + } + } +} + +void Object70_Action1(Entity* this) { + u8 bVar1; + + if (this->type == 0) { + if (gPlayerEntity.z.WORD == 0) { + if ((((gPlayerState.dash_state & 0x40) == 0) && (gPlayerState.floor_type == 0x11)) && + ((gPlayerEntity.action == 1 || ((gPlayerEntity.action == 0x18 || (gPlayerEntity.action == 4)))))) { + goto _080974FA; + } else { + if (gPlayerEntity.z.WORD == 0) { + CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0); + } + } + } + gPlayerEntity.spriteOrientation.flipY = 2; + DeleteThisEntity(); + _080974FA: + this->x = gPlayerEntity.x; + this->y = gPlayerEntity.y; + if (gPlayerState.jump_status == 0) { + gPlayerEntity.spriteOrientation.flipY = 3; + if (gPlayerEntity.spritePriority.b0 != 7) { + this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1; + } else { + this->spritePriority.b0 = 7; + } + } + + } else { + if (gPlayerEntity.action != 0x1e) { + if (this->collisionLayer == 1) { + gPlayerEntity.spriteOrientation.flipY = 2; + } else { + gPlayerEntity.spriteOrientation.flipY = 1; + } + DeleteThisEntity(); + } + } +} |
