Decompile marcy

This commit is contained in:
octorock
2021-05-12 18:49:23 +02:00
parent bbc78fd2d2
commit 8466d7e8e8
8 changed files with 106 additions and 201 deletions
+8 -8
View File
@@ -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;
+8 -8
View File
@@ -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;
+63
View File
@@ -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);
}
+8 -8
View File
@@ -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;
+14 -14
View File
@@ -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
+4 -4
View File
@@ -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) {