diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-02-11 16:47:08 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-11 16:47:08 -0800 |
| commit | b9876fd30f2bc04036a3a223c193fd8fd833cafa (patch) | |
| tree | ebfdf248a3221607ae4640833d77b2d8150324b8 /src | |
| parent | faaf9c768d8f26f98f605f158c1e412c8d7a8980 (diff) | |
| parent | 18eb4a2247e2a7bdb32330dfbdb1b5eaa2d49322 (diff) | |
Merge pull request #374 from hatal175/pina
Diffstat (limited to 'src')
| -rw-r--r-- | src/npc/brocco.c | 37 | ||||
| -rw-r--r-- | src/npc/pina.c | 37 |
2 files changed, 66 insertions, 8 deletions
diff --git a/src/npc/brocco.c b/src/npc/brocco.c index 0030dd0f..794acd30 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -5,8 +5,9 @@ void sub_08063544(Entity*); void sub_0806362C(Entity*); - -extern void (*gUnk_0810CAA0[])(Entity*); +void sub_0806355C(Entity*); +void sub_08063584(Entity*); +void sub_08063608(Entity*); extern Dialog gUnk_0810CAAC[]; @@ -19,7 +20,12 @@ void Brocco(Entity* this) { } void sub_08063544(Entity* this) { - gUnk_0810CAA0[this->action](this); + static void (*const Brocco_Actions[])(Entity*) = { + sub_0806355C, + sub_08063584, + sub_08063608, + }; + Brocco_Actions[this->action](this); } void sub_0806355C(Entity* this) { @@ -29,7 +35,30 @@ void sub_0806355C(Entity* this) { sub_08078778(this); } -ASM_FUNC("asm/non_matching/brocco/sub_08063584.inc", void sub_08063584(Entity* this)) +void sub_08063584(Entity* this) { + if (sub_0806ED9C(this, 0x20, 0x20) >= 0) { + if (this->field_0xf == 0) { + if ((Random() & 0x3f) == 0) { + this->field_0xf = 1; + InitAnimationForceUpdate(this, 0); + } + } + } + + if (this->field_0xf != 0) { + UpdateAnimationSingleFrame(this); + if ((this->frame & 0x80) != 0) { + this->field_0xf = 0; + } + } + + if (this->interactType != 0) { + this->action = 2; + InitAnimationForceUpdate(this, GetAnimationState(this) + 4); + MessageFromTarget(this->actionDelay + 0xa01); + } + sub_0806ED78(this); +} void sub_08063608(Entity* this) { u8 tmp = gMessage.doTextBox & 0x7f; diff --git a/src/npc/pina.c b/src/npc/pina.c index 703a8061..5d49e1b3 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -7,8 +7,9 @@ void sub_08063B68(Entity* this); void sub_08063A80(Entity* this); - -extern void (*gUnk_0810CDF8[])(Entity*); +void sub_08063A98(Entity* this); +void sub_08063AC0(Entity* this); +void sub_08063B44(Entity* this); extern Dialog gUnk_0810CE04[]; @@ -21,7 +22,12 @@ void Pina(Entity* this) { } void sub_08063A80(Entity* this) { - gUnk_0810CDF8[this->action](this); + static void (*const Pina_Actions[])(Entity*) = { + sub_08063A98, + sub_08063AC0, + sub_08063B44, + }; + Pina_Actions[this->action](this); } void sub_08063A98(Entity* this) { @@ -31,7 +37,30 @@ void sub_08063A98(Entity* this) { sub_08078778(this); } -ASM_FUNC("asm/non_matching/pina/sub_08063AC0.inc", void sub_08063AC0(Entity* this)) +void sub_08063AC0(Entity* this) { + if (sub_0806ED9C(this, 0x20, 0x20) >= 0) { + if (this->field_0xf == 0) { + if ((Random() & 0x3f) == 0) { + InitAnimationForceUpdate(this, 0); + this->field_0xf = 1; + } + } + } + + if (this->field_0xf != 0) { + UpdateAnimationSingleFrame(this); + if ((this->frame & 0x80) != 0) { + this->field_0xf = 0; + } + } + + if (this->interactType != 0) { + this->action = 2; + InitAnimationForceUpdate(this, GetAnimationState(this) + 4); + MessageFromTarget(this->actionDelay + 0xa01); + } + sub_0806ED78(this); +} void sub_08063B44(Entity* this) { u8 tmp = gMessage.doTextBox & 0x7f; |
