diff options
| author | notyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com> | 2020-07-15 01:40:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-15 01:40:49 -0700 |
| commit | 6b01f03ce6e5e7e54fa48917574b0c4cf66c5a3d (patch) | |
| tree | 5b5aa98a20542432c8e9b0ce3c42180eb8c91a9f /src/object | |
| parent | f89035be43b3c4dc7dcf511fd774679a8e74b140 (diff) | |
| parent | 4b1bbd23e915f9d7a532c34359d7f7369190c5f5 (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/cloud.c | 2 | ||||
| -rw-r--r-- | src/object/jailBars.c | 64 | ||||
| -rw-r--r-- | src/object/object86.c | 2 | ||||
| -rw-r--r-- | src/object/objectAF.c | 56 | ||||
| -rw-r--r-- | src/object/objectB2.c | 44 |
5 files changed, 166 insertions, 2 deletions
diff --git a/src/object/cloud.c b/src/object/cloud.c index 734559c4..027899cd 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -131,7 +131,7 @@ void sub_0809F69C(Entity* this) { void sub_0809F6CC(Entity* this) { if (((gRoomControls.unk6 & 4) == 0) && (--this->actionDelay == 0)) { - gLinkState.unk7 = 1; + gLinkState.field_0x8b = 1; DeleteThisEntity(); } } diff --git a/src/object/jailBars.c b/src/object/jailBars.c new file mode 100644 index 00000000..c72713b6 --- /dev/null +++ b/src/object/jailBars.c @@ -0,0 +1,64 @@ +#include "global.h" +#include "entity.h" +#include "flags.h" +#include "room.h" + +extern void sub_080A0960(Entity*, u32); +extern void PlaySFX(u32); +extern void sub_0801AF18(u8*, u32, u32); + +extern void (*const gUnk_08124950[])(Entity*); +extern u8 gUnk_08124960; +extern u8 gUnk_0812497A; + +void JailBars(Entity *this) +{ + gUnk_08124950[this->action](this); +} + +void sub_080A08C4(Entity *this) +{ + if (CheckFlags(this->field_0x86) == 0) { + this->action = 1; + sub_080A0960(this, 0); + } + else { + this->action = 3; + InitializeAnimation(this,1); + sub_080A0960(this, 1); + } + this->spriteSettings.b.draw = 3; // ??? + this->collisionLayer = 1; + UpdateSpriteForCollisionLayer(this); +} + +void sub_080A0910(Entity *this) +{ + if (CheckFlags(this->field_0x86) != 0) { + this->action = 2; + sub_080A0960(this, 1); + PlaySFX(0x10b); + } +} + +void sub_080A0938(Entity *this) +{ + GetNextFrame(this); + if ((this->frames.b.f3) != 0) { + this->action = 3; + InitializeAnimation(this, 1); + } +} + +void nullsub_127(Entity* this) {} + +void sub_080A0960(Entity *this, u32 arg1) +{ + u8 *puVar1; + + puVar1 = &gUnk_08124960; + if (arg1 == 1) { + puVar1 = &gUnk_0812497A; + } + sub_0801AF18(puVar1, COORD_TO_TILE(this), 1); +}
\ No newline at end of file diff --git a/src/object/object86.c b/src/object/object86.c index 979ab47a..5a1c0aec 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -76,6 +76,6 @@ void sub_08099ECC(Entity *this) this->previousActionFlag = 1; CopyPosition(this, &gLinkEntity); gLinkState.linkAction = 3; - gLinkState.filler12[4] = 0; + gLinkState.field_0x34[4] = 0; gLinkState.flags.all |= 0x8000; } diff --git a/src/object/objectAF.c b/src/object/objectAF.c new file mode 100644 index 00000000..0415398b --- /dev/null +++ b/src/object/objectAF.c @@ -0,0 +1,56 @@ +#include "global.h" +#include "entity.h" + +extern void sub_080A0640(Entity*); +extern void PositionRelative(Entity*, Entity*, s32, s32); +extern void CopyPosition(Entity*, Entity*); + +extern void (*const gUnk_081248C4[])(Entity*); + +void ObjectAF(Entity* this) { + gUnk_081248C4[this->action](this); +} + +void sub_080A05A4(Entity* this) { + if ((this->entityType).form != 2) { + this->action = 1; + this->spritePriority.b0 = 6; + sub_080A0640(this); + InitializeAnimation(this, 1); + } else { + this->action = 2; + this->y.HALF.HI++; + this->height.HALF.HI = 0; + this->spriteOffsetY--; + InitializeAnimation(this, 3); + } +} + +void sub_080A05F4(Entity* this) { + if (this->parent == NULL) { + this->action = 2; + InitializeAnimation(this, 2); + } else { + if (this->parent->field_0x4 == NULL) { + DeleteThisEntity(); + } + sub_080A0640(this); + GetNextFrame(this); + } +} + +void sub_080A0624(Entity* this) { + GetNextFrame(this); + if ((this->frames.b.f3) != 0) { + DeleteThisEntity(); + } +} + +void sub_080A0640(Entity* this) { + if (this->entityType.form == 0) { + PositionRelative(*(Entity**)(this->parent->otherEntity + 0x4), this, 0, 0x80000); + } else { + CopyPosition(this->parent, this); + } + this->height.HALF.HI = 0; +}
\ No newline at end of file diff --git a/src/object/objectB2.c b/src/object/objectB2.c new file mode 100644 index 00000000..3c7e7fe2 --- /dev/null +++ b/src/object/objectB2.c @@ -0,0 +1,44 @@ +#include "global.h" +#include "entity.h" + +extern void sub_0806F69C(Entity*); +extern u32 sub_080AE4CC(Entity*, u32, u32, u32); + +extern void* gUnk_02027EB4; +extern void* gUnk_0200D654; + +#if 0 + +void ObjectB2(Entity *this) +{ + void* pEVar3; + + if (this->action == 0) { + this->action = 1; + this->actionDelay = 0x10; + this->direction = (this->entityType).form << 3; + if (this->collisionLayer == 2) { + pEVar3 = &gUnk_0200D654; + } + else { + pEVar3 = &gUnk_02027EB4; + } + this->attachedEntity = pEVar3; + InitializeAnimation(this, this->entityType.form); + } + this->nonPlanarMovement = this->parent->nonPlanarMovement; + sub_0806F69C(this); + if (sub_080AE4CC(this->attachedEntity, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) { + DeleteThisEntity(); + } + if (this->nonPlanarMovement < 0x41) { + this->spriteSettings.b.draw ^= 1; + + if (--this->actionDelay == 0) { + DeleteThisEntity(); + } + } + GetNextFrame(this); +} + +#endif
\ No newline at end of file |
