summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-08-09 16:24:35 -0700
committerGitHub <noreply@github.com>2020-08-09 16:24:35 -0700
commit2bd083c9332daf8b75904d79c2f068db2c4231dc (patch)
tree93c37ee73b1fdd735c5ae1e355f966b39876f26b /src
parent2ae15a04f78492667c18aaeb82d8bab49de248a6 (diff)
parent4a4ac6fc9139cf9373a0307cb85ae6dc72de5c3c (diff)
Merge branch 'master' into pot
Diffstat (limited to 'src')
-rw-r--r--src/enemy/miniFireballGuy.c17
-rw-r--r--src/ezloNag.c123
-rw-r--r--src/manager/managerA.c168
-rwxr-xr-xsrc/object/object48.c1
-rwxr-xr-xsrc/object/pot.c2
-rw-r--r--src/sub_08070680.c53
6 files changed, 362 insertions, 2 deletions
diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c
index a4c169d7..9ca6ad24 100644
--- a/src/enemy/miniFireballGuy.c
+++ b/src/enemy/miniFireballGuy.c
@@ -56,4 +56,21 @@ void sub_08045654(Entity *this)
if (sub_08003FC4(this, 0x1800) == 0) {
sub_08045678(this);
}
+}
+
+void sub_08045678(Entity *this)
+{
+
+ this->field_0x20 = 0x1c000;
+ if (this->actionDelay != 0) {
+ this->actionDelay--;
+ } else {
+ this->actionDelay = Random() & 3;
+ if ((sub_08049FA0(this) == 0) && (Random() & 3)) {
+ this->direction = (sub_08049EE4(this) - 4 + (Random() & 8)) & 0x18;
+ }
+ else {
+ this->direction = Random() & 0x18;
+ }
+ }
} \ No newline at end of file
diff --git a/src/ezloNag.c b/src/ezloNag.c
new file mode 100644
index 00000000..bce5c8d5
--- /dev/null
+++ b/src/ezloNag.c
@@ -0,0 +1,123 @@
+#include "global.h"
+#include "entity.h"
+#include "functions.h"
+#include "textbox.h"
+
+typedef struct {
+ s8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+ u8 unk5;
+ u8 unk6;
+ u8 unk7;
+ u8 unk8;
+ u8 unk9;
+ u8 unkA;
+ u8 unkB;
+ u16 unkC;
+ u16 unkE;
+ u16 unk10;
+ u8 unk12;
+ u8 unk13;
+} Element;
+
+typedef struct {
+ u8 unk0[0x24];
+ u8 ezloNagFuncIndex;
+} struct_0200AF00;
+
+extern struct_0200AF00 gUnk_0200AF00;
+
+///////////////////////////////////////////////////////////////
+
+extern void sub_0805ECEC(u32, u32, u32, u32);
+extern void sub_0801CAD0(Element*);
+
+extern void (*const gUnk_080C904C[])(Element*);
+
+extern u16 gUnk_080C9058[];
+
+void EzloNag(Element* arg0) {
+ gUnk_080C904C[arg0->unk4](arg0);
+}
+
+#ifdef NON_MATCHING // REG SWAP
+extern u32 gUnk_080C9094;
+
+void sub_0801CED8(Element* arg0) {
+ if (gUnk_0200AF00.ezloNagFuncIndex == 1) {
+ gUnk_0200AF00.ezloNagFuncIndex = 2;
+ arg0->unkC = 0x10;
+ arg0->unkE = 0x90;
+ arg0->unk6 = 0;
+ arg0->unk1 = 7;
+ arg0->unk4 = 1;
+ arg0->unk0 |= 2;
+ sub_0801CAB8(arg0, &gUnk_080C9094);
+ }
+}
+#else
+NAKED
+void sub_0801CED8(Element* arg0) {
+ asm_unified("\
+ push {r4, lr}\n\
+ adds r3, r0, #0\n\
+ ldr r0, _0801CF10 @ =gUnk_0200AF00\n\
+ adds r1, r0, #0\n\
+ adds r1, #0x24\n\
+ ldrb r4, [r1]\n\
+ cmp r4, #1\n\
+ bne _0801CF0E\n\
+ movs r2, #2\n\
+ movs r0, #2\n\
+ strb r0, [r1]\n\
+ movs r1, #0\n\
+ movs r0, #0x10\n\
+ strh r0, [r3, #0xc]\n\
+ movs r0, #0x90\n\
+ strh r0, [r3, #0xe]\n\
+ strb r1, [r3, #6]\n\
+ movs r0, #7\n\
+ strb r0, [r3, #1]\n\
+ strb r4, [r3, #4]\n\
+ ldrb r0, [r3]\n\
+ orrs r0, r2\n\
+ strb r0, [r3]\n\
+ ldr r1, _0801CF14 @ =gUnk_080C9094\n\
+ adds r0, r3, #0\n\
+ bl sub_0801CAB8\n\
+ _0801CF0E:\n\
+ pop {r4, pc}\n\
+ .align 2, 0\n\
+ _0801CF10: .4byte gUnk_0200AF00\n\
+ _0801CF14: .4byte gUnk_080C9094");
+}
+#endif
+
+void sub_0801CF18(Element* arg0) {
+ u32 temp;
+
+ temp = gUnk_080C9058[arg0->unk6++];
+ sub_0805ECEC(0, temp, temp, 0);
+ if (temp == 0) {
+ arg0->unk4 = 2;
+ arg0->unk1 = 8;
+ gUnk_0200AF00.ezloNagFuncIndex = 3;
+ PlaySFX(0x173);
+ }
+}
+
+void sub_0801CF60(Element* arg0) {
+
+ if ((gUnk_0200AF00.ezloNagFuncIndex >= 5) || (gTextBox.doTextBox & 0x7f)) {
+ arg0->unk4 = 0;
+ arg0->unk0 &= -3;
+ return;
+ }
+ sub_0801CAD0(arg0);
+ if (arg0->unk13 == 1) {
+ gUnk_0200AF00.ezloNagFuncIndex = 4;
+ }
+} \ No newline at end of file
diff --git a/src/manager/managerA.c b/src/manager/managerA.c
new file mode 100644
index 00000000..699c5634
--- /dev/null
+++ b/src/manager/managerA.c
@@ -0,0 +1,168 @@
+#include "global.h"
+#include "entity.h"
+#include "player.h"
+#include "manager.h"
+#include "flags.h"
+#include "area.h"
+
+
+extern void (*gUnk_081081F4[])(Manager*);
+
+void sub_08058380(Manager* this) {
+ gUnk_081081F4[this->unk_0c](this);
+}
+
+
+
+extern void sub_0805E3A0(Manager*, u32);
+
+void sub_08058398(Manager* this) {
+
+ if (CheckFlags(this->unk_3c) != 0) {
+ DeleteThisEntity();
+ }
+ this->unk_24 = this->unk_3a<<3;
+ this->unk_26 = this->unk_3b<<3;
+ this->unk_20 = this->unk_24 + (this->unk_38<<4);
+ this->unk_22 = this->unk_26 + (this->unk_39<<4);
+ sub_0805E3A0(this, 0x06);
+ if (this->unk_3e == 0) {
+ this->unk_0c = 2;
+ } else {
+ this->unk_0c = 1;
+ }
+}
+
+
+void sub_08058408(Manager*);
+
+void sub_080583EC(Manager* this) {
+ if (CheckFlags(this->unk_3e) != 0) {
+ this->unk_0c = 2;
+ sub_08058408(this);
+ }
+}
+
+extern u32 CheckPlayerInRegion(u32, u32, u32, u32);
+extern void sub_0805E544(void);
+extern void sub_08078A90(u32);
+extern void sub_08078AA8(u32, u32);
+extern void sub_080186C0(u16);
+extern void sub_08078B48(void);
+
+u32 sub_0805848C(Manager*);
+void sub_080585DC(Manager*);
+
+void sub_08058408(Manager* this){
+ u32 tmp2;
+ tmp2 = (gPlayerState.flags.all & 0x08);
+ if (tmp2 != 0) return;
+ if (!CheckPlayerInRegion(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) return;
+ switch (this->unk_0a) {
+ case 1:
+ return;
+ case 2:
+ sub_080585DC(this);
+ if ((gPlayerState.flags.all & 0x80) == 0) return;
+ case 0:
+ default:
+ sub_080585DC(this);
+ if (sub_0805848C(this) == 0) return;
+ sub_08078A90(3);
+ sub_08078B48();
+ sub_0805E544();
+ this->unk_0c = 3;
+ this->unk_0d = 0;
+ this->unk_0e = 0x1e;
+ return;
+ case 3:
+ this->unk_0c = 4;
+ this->unk_0d = tmp2;
+ sub_080186C0(this->unk_36);
+ return;
+ }
+}
+
+
+u32 sub_0805848C(Manager* this) {
+ switch (gPlayerState.field_0xa8[0]-5) {
+ case 0:
+ case 2:
+ case 3:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 22:
+ case 23:
+ return 0;
+ case 1:
+ case 4:
+ case 20:
+ case 21:
+ default:
+ return 1;
+ }
+}
+
+
+extern void UnfreezeTime(void);
+
+void sub_08058514(Manager* this) {
+ switch (this->unk_0d) {
+ case 1:
+ if ((gPlayerState.flags.all & 0x1235) != 0)
+ return;
+ if (gPlayerEntity.height.HALF.HI != 0)
+ return;
+ gPlayerState.jumpStatus = 0;
+ sub_08078AA8(this->unk_36, this->unk_35);
+ this->unk_0d++;
+ this->unk_0e = 0x1E;
+ return;
+ case 0:
+ case 2:
+ if (((--this->unk_0e)<<0x18) == 0) {
+ this->unk_0d++;
+ }
+ return;
+ case 3:
+ if (gPlayerEntity.action != 1 && gPlayerEntity.action != 9) return;
+ gPlayerState.field_0x8b = 1;
+ UnfreezeTime();
+ SetFlag(this->unk_3c);
+ DeleteThisEntity();
+ return;
+ default:
+ return;
+ }
+}
+
+
+extern void sub_0801855C(void);
+
+void sub_080585B0(Manager* this) {
+ if (gArea.filler4[0] != 0xFF) {
+ DeleteThisEntity();
+ }
+ if (CheckFlags(this->unk_3c)) {
+ sub_0801855C();
+ DeleteThisEntity();
+ }
+}
+void sub_080585DC(Manager* this) {
+ if (CheckFlags(this->unk_3c)) {
+ DeleteThisEntity();
+ }
+}
diff --git a/src/object/object48.c b/src/object/object48.c
index c2a25071..57d772a9 100755
--- a/src/object/object48.c
+++ b/src/object/object48.c
@@ -9,7 +9,6 @@
#include "readKeyInput.h"
#include "structures.h"
-extern bool32 sub_080AE008(Entity*, int, int);
extern int sub_0807A094(int);
extern u32 sub_0801D754(const u8*, u8, u8);
extern u32 sub_080041EC(int, int);
diff --git a/src/object/pot.c b/src/object/pot.c
index 07ee87ec..5ea63ab5 100755
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -38,7 +38,7 @@ void sub_0808222C(Entity* this) {
this->boundingBox = &gUnk_080FD338;
this->nonPlanarMovement = 0x80;
this->y.HALF.HI += 3;
- this->possibleBool = 0;
+ this->field_0x16 = 0;
this->flags |= 0x80;
this->currentHealth = 1;
this->field_0x3c = 7;
diff --git a/src/sub_08070680.c b/src/sub_08070680.c
index d5b5b517..642167df 100644
--- a/src/sub_08070680.c
+++ b/src/sub_08070680.c
@@ -1,9 +1,62 @@
#include "global.h"
#include "entity.h"
+#include "player.h"
+#include "functions.h"
extern void (*gUnk_0811B9E0[])(Entity*);
+extern BoundingBox gUnk_08114F88;
+
// inject
void sub_08070680(Entity* this) {
gUnk_0811B9E0[this->action](this);
}
+
+
+void sub_08070698(Entity *this)
+{
+ u32 uVar1;
+ int iVar2;
+ Entity *ent;
+
+ gPlayerState.field_0x0[0] = 0xff;
+ gPlayerState.field_0x14[1] = gPlayerEntity.x.HALF.HI;
+ gPlayerState.field_0x14[2] = gPlayerEntity.y.HALF.HI;
+ this->flags = this->flags | 0x80;
+ this->spritePriority.b0 = 0xc;
+ this->spritePriority.b1 = 1;
+ this->spriteSettings.b.shadow = 1;
+ this->field_0x16 = 0x20;
+ this->flags2 = 8;
+ this->damageType = 0x79;
+ this->boundingBox = &gUnk_08114F88;
+ this->spriteIndex = 1;
+ gPlayerState.field_0x8 = 0x100;
+ sub_0806FDA0(this);
+ sub_080AE008(this, 1, 2);
+ InitAnimationForceUpdate(this, 2);
+ if (this->collisionLayer == 0) {
+ sub_08016A30(this);
+ }
+ uVar1 = IsItemEquipped(0x10);
+ if (uVar1 != 2) {
+ sub_08077728();
+ }
+ sub_0807A108();
+ sub_0807AEE4();
+ iVar2 = sub_08078EFC();
+ if (iVar2 == 0) {
+ sub_0807921C();
+ sub_0807A1B8();
+ if (gPlayerState.swimState != 0) {
+ gPlayerState.swimState = 1;
+ sub_08079938();
+ gPlayerState.field_0xa8[0] = 7;
+ sub_0807ACCC(this);
+ ent = sub_0805EB2C(0x6, 0xf, 0x6, 0xb, 0x0);
+ if (ent != NULL) {
+ DeleteEntity(ent);
+ }
+ }
+ }
+} \ No newline at end of file