summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2021-05-12 18:49:23 +0200
committeroctorock <79596758+octorock@users.noreply.github.com>2021-05-27 22:10:26 +0200
commit8466d7e8e87b95fc6c751aad6a2ef8e4ffd6b614 (patch)
treecfd55641b776d05abd6babc7d3c504dcf957419c /src
parentbbc78fd2d277c44b144e3d5d23fdb587b8d4ea74 (diff)
Decompile marcy
Diffstat (limited to 'src')
-rw-r--r--src/npc/din.c16
-rw-r--r--src/npc/farore.c16
-rw-r--r--src/npc/marcy.c63
-rw-r--r--src/npc/nayru.c16
-rw-r--r--src/npc/npc5.c28
-rw-r--r--src/npc/pita.c8
6 files changed, 105 insertions, 42 deletions
diff --git a/src/npc/din.c b/src/npc/din.c
index 2800f883..ec340fb1 100644
--- a/src/npc/din.c
+++ b/src/npc/din.c
@@ -8,23 +8,23 @@
extern u32 sub_08002632(Entity*);
void Din(Entity* this) {
- switch(this->action) {
+ switch (this->action) {
case 0:
this->action = 1;
this->spriteSettings.b.draw = 1;
sub_0807DD50(this);
break;
case 1:
- if (this->interactType ==2) {
- this->action = 2;
- this->interactType = 0;
- sub_0806F118(this);
- this->field_0x68.HALF.LO = this->animIndex;
- InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
+ if (this->interactType == 2) {
+ this->action = 2;
+ this->interactType = 0;
+ sub_0806F118(this);
+ this->field_0x68.HALF.LO = this->animIndex;
+ InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DD94(this, NULL);
}
- break;
+ break;
case 2:
if (UpdateFuseInteraction(this) != 0) {
this->action = 1;
diff --git a/src/npc/farore.c b/src/npc/farore.c
index 858217a6..8629827a 100644
--- a/src/npc/farore.c
+++ b/src/npc/farore.c
@@ -8,23 +8,23 @@
extern u32 sub_08002632(Entity*);
void Farore(Entity* this) {
- switch(this->action) {
+ switch (this->action) {
case 0:
this->action = 1;
this->spriteSettings.b.draw = 1;
sub_0807DD50(this);
break;
case 1:
- if (this->interactType ==2) {
- this->action = 2;
- this->interactType = 0;
- sub_0806F118(this);
- this->field_0x68.HALF.LO = this->animIndex;
- InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
+ if (this->interactType == 2) {
+ this->action = 2;
+ this->interactType = 0;
+ sub_0806F118(this);
+ this->field_0x68.HALF.LO = this->animIndex;
+ InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DD94(this, NULL);
}
- break;
+ break;
case 2:
if (UpdateFuseInteraction(this) != 0) {
this->action = 1;
diff --git a/src/npc/marcy.c b/src/npc/marcy.c
new file mode 100644
index 00000000..35e66f8f
--- /dev/null
+++ b/src/npc/marcy.c
@@ -0,0 +1,63 @@
+#include "entity.h"
+#include "functions.h"
+#include "script.h"
+#include "flags.h"
+#include "textbox.h"
+
+extern u16 gUnk_0810C34C[];
+
+void Marcy(Entity* this) {
+ if (this->action == 0) {
+ this->action += 1;
+ sub_0805E3A0(this, 2);
+ sub_0807DD64(this);
+ }
+ sub_0807DD94(this, NULL);
+}
+
+void sub_08062D18(Entity* this, ScriptExecutionContext* context) {
+ u8 tmp = 0;
+ if ((GetInventoryValue(0x4f) != 0) && (CheckLocalFlag(0x26) == 0)) {
+ tmp = 7;
+ }
+ if ((GetInventoryValue(0x4e) != 0) && (CheckLocalFlag(0x25) == 0)) {
+ tmp = 6;
+ }
+ if ((GetInventoryValue(0x4d) != 0) && (CheckLocalFlag(0x24) == 0)) {
+ tmp = 5;
+ }
+ if ((GetInventoryValue(0x4c) != 0) && (CheckLocalFlag(0x23) == 0)) {
+ tmp = 4;
+ }
+ if ((GetInventoryValue(0x4b) != 0) && (CheckLocalFlag(0x22) == 0)) {
+ tmp = 3;
+ }
+ if ((GetInventoryValue(0x4a) != 0) && (CheckLocalFlag(0x21) == 0)) {
+ tmp = 2;
+ }
+ if ((GetInventoryValue(0x49) != 0) && (CheckLocalFlag(0x20) == 0)) {
+ tmp = 1;
+ }
+ this->type2 = tmp;
+
+ tmp = 0;
+ if (CheckFlags(0x1c1f) != 0) {
+ tmp = 1;
+ } else if (CheckLocalFlag(0x8c) != 0) {
+ tmp = 2;
+ ClearLocalFlag(0x8c);
+ } else if (CheckLocalFlag(0x8b) != 0) {
+ tmp = 3;
+ }
+
+ TextboxNoOverlap(gUnk_0810C34C[tmp], this);
+ if (tmp == 0) {
+ context->condition = TRUE;
+ } else {
+ context->condition = FALSE;
+ }
+}
+
+void sub_08062E14(Entity* this, ScriptExecutionContext* context) {
+ SetLocalFlag(0x8b);
+}
diff --git a/src/npc/nayru.c b/src/npc/nayru.c
index fd8332a3..7bfd89ba 100644
--- a/src/npc/nayru.c
+++ b/src/npc/nayru.c
@@ -8,23 +8,23 @@
extern u32 sub_08002632(Entity*);
void Nayru(Entity* this) {
- switch(this->action) {
+ switch (this->action) {
case 0:
this->action = 1;
this->spriteSettings.b.draw = 1;
sub_0807DD50(this);
break;
case 1:
- if (this->interactType ==2) {
- this->action = 2;
- this->interactType = 0;
- sub_0806F118(this);
- this->field_0x68.HALF.LO = this->animIndex;
- InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
+ if (this->interactType == 2) {
+ this->action = 2;
+ this->interactType = 0;
+ sub_0806F118(this);
+ this->field_0x68.HALF.LO = this->animIndex;
+ InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DD94(this, NULL);
}
- break;
+ break;
case 2:
if (UpdateFuseInteraction(this) != 0) {
this->action = 1;
diff --git a/src/npc/npc5.c b/src/npc/npc5.c
index 6d1a7699..b8e9d488 100644
--- a/src/npc/npc5.c
+++ b/src/npc/npc5.c
@@ -908,25 +908,25 @@ void sub_08061AFC(Entity* this) {
NONMATCH("asm/non_matching/npc5/sub_08061B18.inc", void sub_08061B18(Entity* this)) {
u8 bVar1;
u16* puVar2;
-
+
typedef struct {
u16 unk_0;
u16 unk_2;
} Tmp;
- switch(this->interactType) {
- case 0:
- break;
- case 1:
- this->interactType = 0;
- sub_08061AFC(this);
- //puVar2 = (u16*)(*(int*)&this->field_0x68 + (((u32)this->actionDelay << 0x18) >> 0x17));
- // if puVar2[1] == 0
- if ((((Tmp**)&this->field_0x68))[++this->actionDelay]->unk_2 == 0) {
- this->actionDelay = 0;
- }
- TextboxNoOverlap((u32)*puVar2, this);
- break;
+ switch (this->interactType) {
+ case 0:
+ break;
+ case 1:
+ this->interactType = 0;
+ sub_08061AFC(this);
+ // puVar2 = (u16*)(*(int*)&this->field_0x68 + (((u32)this->actionDelay << 0x18) >> 0x17));
+ // if puVar2[1] == 0
+ if ((((Tmp**)&this->field_0x68))[++this->actionDelay]->unk_2 == 0) {
+ this->actionDelay = 0;
+ }
+ TextboxNoOverlap((u32)*puVar2, this);
+ break;
}
}
END_NONMATCH
diff --git a/src/npc/pita.c b/src/npc/pita.c
index 0d43bda6..ebd369bc 100644
--- a/src/npc/pita.c
+++ b/src/npc/pita.c
@@ -28,10 +28,10 @@ void Pita(Entity* this) {
}
void sub_08062EB8(void) {
- sub_0807CAA0(0x68,0);
- sub_0807CAA0(0x69,0);
- sub_0807CAA0(0x6a,0);
- sub_0807CAA0(0x6b,0);
+ sub_0807CAA0(0x68, 0);
+ sub_0807CAA0(0x69, 0);
+ sub_0807CAA0(0x6a, 0);
+ sub_0807CAA0(0x6b, 0);
}
bool32 sub_08062EDC(Entity* this, ScriptExecutionContext* context) {