swordsmanNewsletter.c OK

This commit is contained in:
theo3
2020-07-10 22:34:55 -07:00
parent 1bd6c3b5a4
commit 02cb79b6c4
5 changed files with 85 additions and 221 deletions
+53
View File
@@ -8,11 +8,13 @@ void sub_0808F14C(Entity*);
extern void PlaySFX(u32);
extern void sub_0806FCF4(Entity*, u32, u32, u32);
extern void sub_0808F244(Entity*);
extern void sub_0805EC9C(Entity*, u32, u32, u32);
extern void (*const gUnk_08121E5C[])(Entity*);
extern void (*const gUnk_08121E88[])(Entity*);
extern void (*const gUnk_08121E98[])(Entity*);
void Object49(Entity* this) {
gUnk_08121E5C[this->entityType.form](this);
}
@@ -99,4 +101,55 @@ void sub_0808F1F8(Entity *this)
this->spritePriority.b0 = 7;
InitializeAnimation(this, 1);
sub_0808F244(this);
}
void sub_0808F244(Entity *this)
{
this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI);
this->height.WORD = 0;
*(u32 *)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x70 = *((u8 *)&this->parent->field_0x7c + 3);
sub_0808F2B0(this);
if ((this->parent->field_0x6d & 2) != 0) {
DeleteThisEntity();
}
}
void sub_0808F2B0(Entity *this)
{
sub_0805EC9C(this, *(u32 *)&this->field_0x74, *(u32 *)&this->field_0x78, this->field_0x70);
}
void sub_0808F2C0(Entity *this)
{
if (this->action == 0) {
this->action++;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteSettings.b.draw = 1;
this->spritePriority.b0 = 7;
this->height.WORD = 0;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
this->x.HALF.HI = this->parent->x.HALF.HI;
InitializeAnimation(this,3);
}
if (this->parent->height.HALF.HI == 0) {
*(u32 *)&this->field_0x74 = *(u32 *)&this->parent->field_0x74;
*(u32 *)&this->field_0x78 = *(u32 *)&this->parent->field_0x78;
}
else {
*(u32 *)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI;
*(u32 *)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300;
}
*(u32 *)&this->field_0x70 = 0;
sub_0808F2B0(this);
sub_0806FCF4(this,*(u32 *)&this->field_0x78,8,2);
if (this->action == 0xff) {
DeleteThisEntity();
}
}
+31
View File
@@ -0,0 +1,31 @@
#include "global.h"
#include "entity.h"
#include "textbox.h"
extern void sub_080787B4(Entity*);
extern void (*const gUnk_081228B0[])(Entity*);
extern BoundingBox gUnk_081228A8;
extern u16 gUnk_081228B8[];
void SwordsmanNewsletter(Entity* this) {
gUnk_081228B0[this->action](this);
}
void sub_080933D8(Entity *this)
{
this->action = 1;
this->frameIndex = this->entityType.form;
UpdateSpriteForCollisionLayer(this);
this->boundingBox = &gUnk_081228A8;
sub_080787B4(this);
}
void sub_080933FC(Entity *this)
{
if (this->interactType != 0) {
this->interactType = 0;
TextboxNoOverlap(gUnk_081228B8[this->entityType.form], this);
}
}