mirror of
https://github.com/zeldaret/tmc
synced 2026-08-10 11:14:29 -04:00
remove redundant unions
This commit is contained in:
@@ -44,11 +44,11 @@ void sub_080A9334(Entity* this) {
|
||||
|
||||
void ArrowProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 0x6a;
|
||||
this->field_0xf = 0;
|
||||
this->hVelocity = 0xa00;
|
||||
this->zVelocity = 0xa00;
|
||||
sub_080A94C0(this, this->type);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void ArrowProjectile_Action1(Entity* this) {
|
||||
if (parent->field_0xf != 0) {
|
||||
this->action = 2;
|
||||
COLLISION_ON(this);
|
||||
parent->attachedEntity = NULL;
|
||||
parent->child = NULL;
|
||||
SoundReq(SFX_FC);
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void sub_080A9488(Entity* this) {
|
||||
this->action = 4;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 2;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->animationState = (this->knockbackDirection & 0x18) >> 3;
|
||||
EnqueueSFX(SFX_METAL_CLINK);
|
||||
sub_080A94C0(this, this->animationState);
|
||||
@@ -114,8 +114,8 @@ void sub_080A9488(Entity* this) {
|
||||
|
||||
void sub_080A94C0(Entity* this, u32 animationState) {
|
||||
const struct_081299F8* entry = &gUnk_081299F8[animationState];
|
||||
this->spriteSettings.b.flipX = entry->flipX;
|
||||
this->spriteSettings.b.flipY = entry->flipY;
|
||||
this->spriteSettings.flipX = entry->flipX;
|
||||
this->spriteSettings.flipY = entry->flipY;
|
||||
this->animIndex = entry->animIndex;
|
||||
this->hitbox = (Hitbox*)entry->hitbox;
|
||||
InitializeAnimation(this, this->animIndex);
|
||||
|
||||
@@ -33,7 +33,7 @@ void sub_080AB074(Entity* this) {
|
||||
this->x.WORD += gSineTable[parent->field_0x7c.BYTES.byte0] * (parent->field_0x7c.BYTES.byte2 << 8);
|
||||
this->y.WORD -= gSineTable[parent->field_0x7c.BYTES.byte0 + 0x40] * (parent->field_0x7c.BYTES.byte2 << 8);
|
||||
|
||||
this->height.HALF.HI += (s8)parent->field_0x7c.BYTES.byte3;
|
||||
this->z.HALF.HI += (s8)parent->field_0x7c.BYTES.byte3;
|
||||
if (parent->field_0x7a.HALF.HI != 0) {
|
||||
parent = CreateProjectile(0x19);
|
||||
if (parent != NULL) {
|
||||
|
||||
@@ -30,7 +30,7 @@ void sub_080A81C4(Entity* this) {
|
||||
void BoneProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x3c;
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
this->z.HALF.HI = 0xfffe;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ void BoneProjectile_Action2(Entity* this) {
|
||||
this->action = 3;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0xe0;
|
||||
this->hVelocity = 0xe000;
|
||||
this->zVelocity = 0xe000;
|
||||
}
|
||||
}
|
||||
|
||||
void BoneProjectile_Action3(Entity* this) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
this->spriteSettings.draw ^= 1;
|
||||
sub_0806F69C(this);
|
||||
GetNextFrame(this);
|
||||
if (sub_080044EC(this, 0x1800) == 0) {
|
||||
@@ -83,7 +83,7 @@ void BoneProjectile_Action4(Entity* this) {
|
||||
void sub_080A82D8(Entity* this) {
|
||||
this->action = 4;
|
||||
COLLISION_OFF(this);
|
||||
this->hVelocity = 0x10000;
|
||||
this->zVelocity = 0x10000;
|
||||
this->direction ^= 0x10;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void sub_080AB544(Entity* this) {
|
||||
void CannonballProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = this->type << 3;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
this->z.HALF.HI = 0xfffc;
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ bool32 sub_080AB5F4(Entity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_080AB634(Entity* this) {
|
||||
Entity** entities = ((Entity**)&this->parent->hVelocity);
|
||||
Entity** entities = ((Entity**)&this->parent->zVelocity);
|
||||
u32 i;
|
||||
for (i = 0; i <= 3; ++i) {
|
||||
if (entities[i] != NULL && (sub_080177A0(this, entities[i]) != 0)) {
|
||||
if (entities[i]->action < 3) {
|
||||
entities[i]->action = 3;
|
||||
entities[i]->actionDelay = 0x1e;
|
||||
entities[i]->spriteSettings.b.draw = 0;
|
||||
entities[i]->spriteSettings.draw = 0;
|
||||
CreateFx(entities[i], FX_WHITE_ROCK, 0);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
|
||||
@@ -21,7 +21,7 @@ void DarkNutSwordSlash(Entity* this) {
|
||||
InitAnimationForceUpdate(this, this->parent->animationState + 0x18);
|
||||
}
|
||||
}
|
||||
if ((this->parent == NULL) || (this->parent->currentHealth == 0)) {
|
||||
if ((this->parent == NULL) || (this->parent->health == 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
@@ -46,7 +46,7 @@ void DarkNutSwordSlash_OnTick(Entity* this) {
|
||||
|
||||
void DarkNutSwordSlash_UpdateType0(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = (Hitbox*)gUnk_081293E0[parent->animationState][(parent->frames.all & 0xf) - 1];
|
||||
this->hitbox = (Hitbox*)gUnk_081293E0[parent->animationState][(parent->frame & 0xf) - 1];
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType2(Entity* this) {
|
||||
@@ -55,7 +55,7 @@ void DarkNutSwordSlash_UpdateType2(Entity* this) {
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType34(Entity* this) {
|
||||
if ((this->parent->frames.all & 0x10) != 0) {
|
||||
if ((this->parent->frame & 0x10) != 0) {
|
||||
this->hitbox = (Hitbox*)gUnk_08129410[this->parent->animationState];
|
||||
} else {
|
||||
this->hitbox = (Hitbox*)gUnk_08129400[this->parent->animationState];
|
||||
|
||||
@@ -44,7 +44,7 @@ void DekuSeedProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x30;
|
||||
this->field_0xf = 0;
|
||||
this->height.HALF.HI -= 4;
|
||||
this->z.HALF.HI -= 4;
|
||||
if (CheckGlobalFlag(TABIDACHI) == 0) {
|
||||
this->hitType = 0x68;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void DekuSeedProjectile_Action2(Entity* this) {
|
||||
|
||||
void DekuSeedProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void DekuSeedProjectile_Action4(Entity* this) {
|
||||
break;
|
||||
}
|
||||
if ((this->flags & ENT_COLLIDE) == 0) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
this->spriteSettings.draw ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ void DirtBallProjectile(Entity* this) {
|
||||
|
||||
void DirtBallProjectile_OnTick(Entity* this) {
|
||||
if (this->type == 1) {
|
||||
if (this->attachedEntity == NULL) {
|
||||
if (this->child == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->attachedEntity->next == NULL) {
|
||||
if (this->child->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ void DirtBallProjectile_OnTick(Entity* this) {
|
||||
void sub_080A881C(Entity* this) {
|
||||
this->field_0x46 = 0;
|
||||
if (this->type == 0) {
|
||||
this->parent->attachedEntity = NULL;
|
||||
this->parent->child = NULL;
|
||||
if (this->bitfield == 0x80) {
|
||||
gPlayerState.hurtBlinkSpeed = 0xf0;
|
||||
ModHealth(-2);
|
||||
@@ -47,8 +47,8 @@ void sub_080A881C(Entity* this) {
|
||||
void DirtBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteSettings.b.shadow = 1;
|
||||
this->hVelocity = 0x8000;
|
||||
this->spriteSettings.shadow = 1;
|
||||
this->zVelocity = 0x8000;
|
||||
this->hitbox = (Hitbox*)&gUnk_08129764;
|
||||
this->field_0x3c |= 0x10;
|
||||
switch (this->type) {
|
||||
@@ -79,24 +79,24 @@ void DirtBallProjectile_Action1(Entity* this) {
|
||||
PositionRelative(parent, this, 0, -0x10000);
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->height.HALF.HI += 0x10;
|
||||
this->z.HALF.HI += 0x10;
|
||||
break;
|
||||
case 1:
|
||||
this->height.HALF.HI += 0xe;
|
||||
sub_08078954(this->attachedEntity);
|
||||
CopyPosition(this, this->attachedEntity);
|
||||
if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->attachedEntity, entity->actionDelay == 0)) {
|
||||
this->z.HALF.HI += 0xe;
|
||||
sub_08078954(this->child);
|
||||
CopyPosition(this, this->child);
|
||||
if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) {
|
||||
if ((this->actionDelay & 2) != 0) {
|
||||
entity->field_0xf += 1;
|
||||
}
|
||||
if ((this->attachedEntity->field_0xf < 0x20) && ((this->attachedEntity->field_0xf & 3) == 3)) {
|
||||
if ((this->child->field_0xf < 0x20) && ((this->child->field_0xf & 3) == 3)) {
|
||||
parent->field_0x82.HALF.HI = 0xc0;
|
||||
this->action = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this->height.HALF.HI += 0xe;
|
||||
this->z.HALF.HI += 0xe;
|
||||
if (sub_080041A0(this, &gPlayerEntity, 0xe, 0xe) != 0) {
|
||||
this->action = 2;
|
||||
parent->field_0x82.HALF.HI = 0xc0;
|
||||
@@ -112,7 +112,7 @@ void DirtBallProjectile_Action2(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (this->type == 1) {
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -161,7 +161,7 @@ void DirtBallProjectile_Action2(Entity* this) {
|
||||
|
||||
void DirtBallProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void FireProjectile_Action1(Entity* this) {
|
||||
if (parent->next == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
if (this->spriteSettings.b.draw == 1) {
|
||||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
if (this->actionDelay != 0) {
|
||||
direction = parent->direction & 0x18;
|
||||
@@ -68,7 +68,7 @@ void FireProjectile_Action2(Entity* this) {
|
||||
|
||||
void FireProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ void GleerokProjectile_Init(Entity* this) {
|
||||
s32 iVar2;
|
||||
|
||||
this->action = 1;
|
||||
this->hVelocity = -0x10000;
|
||||
this->zVelocity = -0x10000;
|
||||
if (this->type != 3) {
|
||||
CopyPosition(this->parent, this);
|
||||
sub_0806F5BC(this, 0x1000, this->direction);
|
||||
this->height.WORD = this->parent->y.WORD - this->attachedEntity->y.WORD;
|
||||
this->y.WORD -= this->height.WORD;
|
||||
this->z.WORD = this->parent->y.WORD - this->child->y.WORD;
|
||||
this->y.WORD -= this->z.WORD;
|
||||
InitializeAnimation(this, 0x51);
|
||||
SoundReq(SFX_1B5);
|
||||
}
|
||||
@@ -63,14 +63,14 @@ void GleerokProjectile_Init(Entity* this) {
|
||||
} else if (0x400 < iVar2) {
|
||||
iVar2 = 0x400;
|
||||
}
|
||||
this->hVelocity = this->height.WORD / (iVar2 << 8) << 0xd;
|
||||
this->zVelocity = this->z.WORD / (iVar2 << 8) << 0xd;
|
||||
this->field_0xf = 0x1e;
|
||||
break;
|
||||
case 2:
|
||||
this->hVelocity = (this->height.WORD / 0x18000) << 0xc;
|
||||
this->zVelocity = (this->z.WORD / 0x18000) << 0xc;
|
||||
break;
|
||||
case 3:
|
||||
this->height.WORD = 0xff600000;
|
||||
this->z.WORD = 0xff600000;
|
||||
uVar1 = (Random() & 3) * 2;
|
||||
this->x.HALF.HI = gUnk_08129978[uVar1] + this->x.HALF.HI;
|
||||
this->y.HALF.HI = gUnk_08129978[uVar1 + 1] + this->y.HALF.HI;
|
||||
@@ -126,7 +126,7 @@ void GleerokProjectile_Action2(Entity* this) {
|
||||
sub_080A90D8(this);
|
||||
}
|
||||
} else {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 3;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 0x53);
|
||||
@@ -136,7 +136,7 @@ void GleerokProjectile_Action2(Entity* this) {
|
||||
|
||||
void GleerokProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ void GuardLineOfSight(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = Random();
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
if (this->bitfield == 0x80) {
|
||||
if (this->parent != NULL) {
|
||||
@@ -47,7 +47,7 @@ void GuardLineOfSight(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x12;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->speed = 0x800;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD1E4;
|
||||
InitializeAnimation(this, 0);
|
||||
|
||||
@@ -66,7 +66,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) {
|
||||
void GyorgMaleEnergyProjectile_Action3(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
+16
-16
@@ -55,7 +55,7 @@ void GyorgTail_Init(Entity* this) {
|
||||
if (sub_080AC5E4(this) != 0) {
|
||||
this->action = 1;
|
||||
this->frameIndex = 0xc;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x7a.HWORD = gUnk_0812A9B4[Random() & 1];
|
||||
this->collisionLayer = 2;
|
||||
sub_080AC388(this);
|
||||
@@ -66,7 +66,7 @@ ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC388.inc", void sub_080AC388(Entity
|
||||
|
||||
void sub_080AC480(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->action = 1;
|
||||
this->hitType = 0x1d;
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ void sub_080AC510(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->frameIndex = gUnk_0812A9BA[this->type * 3 + this->type2 - 1];
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->collisionLayer = 2;
|
||||
if (*(u16*)&this->type == 0x300) {
|
||||
this->hitbox = &gUnk_080FD458;
|
||||
@@ -104,7 +104,7 @@ void sub_080AC560(Entity* this) {
|
||||
s32 factor;
|
||||
Entity* entity;
|
||||
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
if (entity->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void sub_080AC560(Entity* this) {
|
||||
this->hitbox = &gUnk_080FD448;
|
||||
}
|
||||
this->frameIndex = 0xff;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
factor = this->field_0x78.HALF.HI << 8;
|
||||
this->x.WORD = entity->x.WORD + gSineTable[entity->direction] * factor;
|
||||
@@ -142,21 +142,21 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Enti
|
||||
entity->type2 = 1;
|
||||
entity->parent = this->parent;
|
||||
entity->field_0x78.HALF.HI = 0x12;
|
||||
this->attachedEntity = entity;
|
||||
this->child = entity;
|
||||
entity2 = CreateProjectile(0x22);
|
||||
entity2->type = this->type;
|
||||
entity2->type2 = 2;
|
||||
entity2->parent = this->parent;
|
||||
entity2->field_0x78.HALF.HI = 0x14;
|
||||
uVar3 = entity2->field_0x78.HALF.HI;
|
||||
entity->attachedEntity = entity2;
|
||||
entity->child = entity2;
|
||||
entity3 = CreateProjectile(0x22);
|
||||
entity3->type = this->type;
|
||||
entity3->type2 = 3;
|
||||
entity3->parent = this->parent;
|
||||
entity3->attachedEntity = NULL;
|
||||
entity3->child = NULL;
|
||||
entity3->field_0x78.HALF.HI = 0;
|
||||
entity2->attachedEntity = entity3;
|
||||
entity2->child = entity3;
|
||||
} else {
|
||||
if (0x44 < gEntCount) {
|
||||
return 0;
|
||||
@@ -168,20 +168,20 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Enti
|
||||
entity->parent = this->parent;
|
||||
entity->field_0x78.HALF.HI = 0x10;
|
||||
uVar3 = entity->field_0x78.HALF.HI;
|
||||
this->attachedEntity = entity;
|
||||
this->child = entity;
|
||||
entity2 = CreateProjectile(0x22);
|
||||
entity2->type = this->type;
|
||||
entity2->type2 = 2;
|
||||
entity2->parent = this->parent;
|
||||
entity2->attachedEntity = NULL;
|
||||
entity2->child = NULL;
|
||||
entity2->field_0x78.HALF.HI = 0x20;
|
||||
entity->attachedEntity = entity2;
|
||||
entity->child = entity2;
|
||||
}
|
||||
entity4 = CreateProjectile(0x22);
|
||||
entity4->type = this->type;
|
||||
entity4->type2 = 4;
|
||||
entity4->parent = this->parent;
|
||||
entity4->attachedEntity = this;
|
||||
entity4->child = this;
|
||||
entity4->field_0x78.HALF.HI = uVar3;
|
||||
return 1;
|
||||
}
|
||||
@@ -200,9 +200,9 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC7C4.inc", void sub_080AC7C4(Entity
|
||||
s32 iVar2;
|
||||
s32 iVar3;
|
||||
|
||||
entity1 = this->attachedEntity;
|
||||
entity2 = entity1->attachedEntity;
|
||||
entity3 = entity2->attachedEntity;
|
||||
entity1 = this->child;
|
||||
entity2 = entity1->child;
|
||||
entity3 = entity2->child;
|
||||
if (entity3 != NULL) {
|
||||
CopyPosition(this->parent, entity3);
|
||||
} else {
|
||||
|
||||
@@ -39,7 +39,7 @@ void IceProjectile_Action1(Entity* this) {
|
||||
if (parent->next == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
if (this->spriteSettings.b.draw == 1) {
|
||||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
if (this->actionDelay != 0) {
|
||||
direction = parent->direction & 0x18;
|
||||
@@ -70,7 +70,7 @@ void IceProjectile_Action2(Entity* this) {
|
||||
|
||||
void IceProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void KeatonDagger(Entity* this) {
|
||||
this->action = 1;
|
||||
}
|
||||
parent = this->parent;
|
||||
if (((parent == NULL) || (parent->currentHealth == 0)) || (parent->next == NULL)) {
|
||||
if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) {
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
sub_0803C0AC(this);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void LakituCloudProjectile_Init(Entity* this) {
|
||||
|
||||
void LakituCloudProjectile_Action1(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
this->z.HALF.HI = 0xfffe;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void LakituLightning_OnTick(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080A9DD8(Entity* this) {
|
||||
if ((this->currentHealth == 0) || (this->bitfield == 0x80)) {
|
||||
if ((this->health == 0) || (this->bitfield == 0x80)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
LakituLightning_OnTick(this);
|
||||
@@ -28,7 +28,7 @@ void sub_080A9DD8(Entity* this) {
|
||||
void LakituLightning_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xb4;
|
||||
this->currentHealth = 1;
|
||||
this->health = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void sub_080AA3E0(Entity*, u32);
|
||||
bool32 sub_080AA374(Entity*);
|
||||
|
||||
void MandiblesProjectile(Entity* this) {
|
||||
Entity* entity = this->attachedEntity;
|
||||
Entity* entity = this->child;
|
||||
if (entity == NULL) {
|
||||
entity = this->parent;
|
||||
}
|
||||
@@ -104,8 +104,8 @@ void MandiblesProjectile_Action1(Entity* this) {
|
||||
|
||||
void MandiblesProjectile_Action2(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x40) != 0) {
|
||||
this->frames.all &= 0xbf;
|
||||
if ((this->frame & 0x40) != 0) {
|
||||
this->frame &= 0xbf;
|
||||
EnqueueSFX(SFX_15D);
|
||||
}
|
||||
this->field_0x78.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
|
||||
@@ -122,7 +122,7 @@ void MandiblesProjectile_Action3(Entity* this) {
|
||||
s8* tmp;
|
||||
Entity* entity;
|
||||
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void MandiblesProjectile_Action3(Entity* this) {
|
||||
this->field_0xf -= 1;
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 4;
|
||||
this->field_0x82.HALF.LO = 3;
|
||||
this->field_0xf = 0x40;
|
||||
@@ -164,16 +164,16 @@ void MandiblesProjectile_Action4(Entity* this) {
|
||||
u32 uVar2;
|
||||
Entity* entity;
|
||||
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
if (entity != NULL) {
|
||||
if (entity->next == NULL) {
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
if (this->field_0xf != 0) {
|
||||
this->field_0xf -= 1;
|
||||
} else {
|
||||
if (sub_080AA374(this) != 0) {
|
||||
if (entity->currentHealth == 0) {
|
||||
if (entity->health == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
EnqueueSFX(0xf2);
|
||||
@@ -183,8 +183,8 @@ void MandiblesProjectile_Action4(Entity* this) {
|
||||
this->actionDelay = 0;
|
||||
this->field_0x80.HWORD = 0x20;
|
||||
this->spriteOrientation.flipY = 2;
|
||||
this->parent = this->attachedEntity;
|
||||
this->attachedEntity = NULL;
|
||||
this->parent = this->child;
|
||||
this->child = NULL;
|
||||
sub_080AA270(this);
|
||||
entity = this->parent;
|
||||
entity->action = 1;
|
||||
@@ -306,13 +306,12 @@ NONMATCH("asm/non_matching/mandiblesProjectile/sub_080AA374.inc", bool32 sub_080
|
||||
bool32 result;
|
||||
|
||||
result = FALSE;
|
||||
if ((this->attachedEntity != NULL) && (this->attachedEntity->next != NULL)) {
|
||||
if ((this->child != NULL) && (this->child->next != NULL)) {
|
||||
// TODO regalloc
|
||||
animationState = this->attachedEntity->animationState;
|
||||
uVar1 =
|
||||
sub_0806F824(this, this->attachedEntity, gUnk_08129D14[animationState], gUnk_08129D14[animationState + 1]);
|
||||
if (sub_0806FCB8(this, this->attachedEntity->x.HALF.HI + gUnk_08129D14[animationState],
|
||||
this->attachedEntity->y.HALF.HI + gUnk_08129D14[animationState + 1], 8) != 0) {
|
||||
animationState = this->child->animationState;
|
||||
uVar1 = sub_0806F824(this, this->child, gUnk_08129D14[animationState], gUnk_08129D14[animationState + 1]);
|
||||
if (sub_0806FCB8(this, this->child->x.HALF.HI + gUnk_08129D14[animationState],
|
||||
this->child->y.HALF.HI + gUnk_08129D14[animationState + 1], 8) != 0) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
sub_08004596(this, uVar1);
|
||||
|
||||
@@ -11,7 +11,7 @@ void MazaalEnergyBeam(Entity* this) {
|
||||
void MazaalEnergyBeam_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 10;
|
||||
this->height.HALF.HI -= 2;
|
||||
this->z.HALF.HI -= 2;
|
||||
this->y.HALF.HI += 2;
|
||||
InitializeAnimation(this, 0);
|
||||
SoundReq(SFX_149);
|
||||
@@ -27,8 +27,8 @@ void MazaalEnergyBeam_Action1(Entity* this) {
|
||||
this->y.HALF.HI += 6;
|
||||
InitializeAnimation(this, 1);
|
||||
} else {
|
||||
if (this->height.HALF.HI != 0) {
|
||||
this->height.HALF.HI += 1;
|
||||
if (this->z.HALF.HI != 0) {
|
||||
this->z.HALF.HI += 1;
|
||||
}
|
||||
|
||||
tmp = &gSineTable[this->direction];
|
||||
@@ -40,7 +40,7 @@ void MazaalEnergyBeam_Action1(Entity* this) {
|
||||
|
||||
void MazaalEnergyBeam_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpea
|
||||
if (parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
frames = parent->frames.all * 4;
|
||||
frames = parent->frame * 4;
|
||||
a = &gUnk_0812966C[frames / 4];
|
||||
this->hitbox->offset_x = a->offsetX;
|
||||
// TODO offset used to increase a pointer is already increated here?
|
||||
|
||||
@@ -40,7 +40,7 @@ void OctorokBossProjectile_Init(Entity* this) {
|
||||
this->spriteRendering.b3 = 3;
|
||||
this->spritePriority.b0 = 6;
|
||||
this->speed = (Random() & 0x1ff) + 0x200;
|
||||
this->hVelocity = (Random() & 0x1fff) + 0x18000;
|
||||
this->zVelocity = (Random() & 0x1fff) + 0x18000;
|
||||
uVar1 = (((u8)Random() & 7) - 4);
|
||||
this->direction -= uVar1;
|
||||
*(u32*)&this->field_0x78 = 600;
|
||||
@@ -60,7 +60,7 @@ void OctorokBossProjectile_Init(Entity* this) {
|
||||
break;
|
||||
case 3:
|
||||
CopyPosition(&gPlayerEntity, this);
|
||||
this->height.WORD = 0xff600000;
|
||||
this->z.WORD = 0xff600000;
|
||||
this->x.HALF.HI += 0x60;
|
||||
this->y.HALF.HI += 0x40;
|
||||
this->x.HALF.HI -= (s32)Random() % 0xc0;
|
||||
@@ -96,7 +96,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
this->direction ^= 0x80;
|
||||
this->speed = 0x400;
|
||||
} else {
|
||||
this->parent->currentHealth -= 1;
|
||||
this->parent->health -= 1;
|
||||
this->parent->iframes = 0x1e;
|
||||
if (this->parent->field_0x7c.BYTES.byte0 != 0) {
|
||||
this->parent->knockbackDuration = 0x18;
|
||||
@@ -132,11 +132,11 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
return;
|
||||
}
|
||||
for (index = 0; index < 3; ++index) {
|
||||
this->attachedEntity = CreateProjectileWithParent(this, 0xf, 1);
|
||||
if (this->attachedEntity != NULL) {
|
||||
this->attachedEntity->parent = this->parent;
|
||||
this->attachedEntity->direction = this->direction + gUnk_08129ADC[index];
|
||||
CopyPosition(this, this->attachedEntity);
|
||||
this->child = CreateProjectileWithParent(this, 0xf, 1);
|
||||
if (this->child != NULL) {
|
||||
this->child->parent = this->parent;
|
||||
this->child->direction = this->direction + gUnk_08129ADC[index];
|
||||
CopyPosition(this, this->child);
|
||||
}
|
||||
}
|
||||
OctorokBossProjectile_Action2(this);
|
||||
@@ -156,9 +156,9 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
}
|
||||
if (*(u32*)&this->field_0x78 < 0x1e) {
|
||||
if ((*(u32*)&this->field_0x78 & 7) != 0) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
if (--*(u32*)&this->field_0x78 == -1) {
|
||||
@@ -175,8 +175,8 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
sub_0806F62C(this, this->speed, this->direction);
|
||||
return;
|
||||
}
|
||||
if (this->attachedEntity != NULL) {
|
||||
this->attachedEntity->actionDelay = 1;
|
||||
if (this->child != NULL) {
|
||||
this->child->actionDelay = 1;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
break;
|
||||
|
||||
@@ -59,7 +59,7 @@ void Projectile5_Action1(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
CopyPosition(parent, this);
|
||||
this->height.HALF.HI += 2;
|
||||
this->z.HALF.HI += 2;
|
||||
}
|
||||
|
||||
void (*const Projectile5_Functions[])(Entity*) = {
|
||||
|
||||
@@ -31,7 +31,7 @@ void sub_080A8064(Entity* this) {
|
||||
void RockProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x30;
|
||||
this->hVelocity = 0xa000;
|
||||
this->zVelocity = 0xa000;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ void RockProjectile_Action3(Entity* this) {
|
||||
break;
|
||||
}
|
||||
if ((this->flags & ENT_COLLIDE) == 0) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
this->spriteSettings.draw ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void sub_080A8178(Entity* this) {
|
||||
this->action = 2;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0x40;
|
||||
this->hVelocity = 0x14000;
|
||||
this->zVelocity = 0x14000;
|
||||
}
|
||||
|
||||
void (*const RockProjectile_Functions[])(Entity*) = {
|
||||
|
||||
@@ -80,15 +80,15 @@ void sub_080AA78C(Entity* this) {
|
||||
}
|
||||
if (sub_0806F520(this) != 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->frames.all &= 0xef;
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
this->frame &= 0xef;
|
||||
EnqueueSFX(SFX_100);
|
||||
}
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
sub_080AAAA8(this);
|
||||
}
|
||||
} else {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
if ((this->frame & 1) != 0) {
|
||||
sub_080AAAA8(this);
|
||||
} else {
|
||||
InitAnimationForceUpdate(this, this->type + 0x10);
|
||||
@@ -110,7 +110,7 @@ void SpiderWeb_Init(Entity* this) {
|
||||
}
|
||||
|
||||
void SpiderWeb_Action1(Entity* this) {
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
if ((this->frame & 0x80) == 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
sub_080AA9E0(this);
|
||||
@@ -144,10 +144,9 @@ void SpiderWeb_SubAction0(Entity* this) {
|
||||
InitAnimationForceUpdate(this, this->type + 4);
|
||||
}
|
||||
if ((entity->animationState >> 1 == this->type) && (gPlayerState.field_0xa8 == 0x1a) &&
|
||||
((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frames.all & 2) != 0) &&
|
||||
((this->frames.all & 0x80) == 0)) {
|
||||
((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frame & 2) != 0) && ((this->frame & 0x80) == 0)) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
if ((this->frame & 1) != 0) {
|
||||
entity->x.HALF.HI = gUnk_0812A06C[entity->animationState] + entity->x.HALF.HI;
|
||||
entity->y.HALF.HI = gUnk_0812A06C[entity->animationState + 1] + entity->y.HALF.HI;
|
||||
EnqueueSFX(0x100);
|
||||
|
||||
@@ -33,7 +33,7 @@ void sub_080A9A34(Entity* this) {
|
||||
if (this->bitfield == 0x9d) {
|
||||
this->action = 3;
|
||||
COLLISION_OFF(this);
|
||||
this->hVelocity = 0x2a000;
|
||||
this->zVelocity = 0x2a000;
|
||||
this->spritePriority.b1 = 1;
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void sub_080A9A64(Entity* this) {
|
||||
|
||||
void StalfosProjectile_SubAction0(Entity* this) {
|
||||
this->subAction = 2;
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
this->z.HALF.HI = 0xfffe;
|
||||
}
|
||||
|
||||
void StalfosProjectile_SubAction1(Entity* this) {
|
||||
@@ -77,7 +77,7 @@ void StalfosProjectile_Init(Entity* this) {
|
||||
break;
|
||||
case 2:
|
||||
this->action = 3;
|
||||
this->hVelocity = 0x2a000;
|
||||
this->zVelocity = 0x2a000;
|
||||
this->spritePriority.b1 = 1;
|
||||
break;
|
||||
default:
|
||||
@@ -117,8 +117,8 @@ void StalfosProjectile_Action2(Entity* this) {
|
||||
}
|
||||
|
||||
void StalfosProjectile_Action3(Entity* this) {
|
||||
if (this->hVelocity < 0) {
|
||||
this->spriteSettings.b.flipY = 1;
|
||||
if (this->zVelocity < 0) {
|
||||
this->spriteSettings.flipY = 1;
|
||||
}
|
||||
if (sub_08003FC4(this, 0x2000) == 0) {
|
||||
sub_080A9BA8(this);
|
||||
@@ -155,7 +155,7 @@ void sub_080A9BD0(Entity* this) {
|
||||
}
|
||||
entry = &gUnk_08129B20[tmp + parent->animationState * 4];
|
||||
sub_0806FA90(parent, this, entry->unk_0, entry->unk_1);
|
||||
this->height.HALF.HI = entry->unk_2 + this->height.HALF.HI;
|
||||
this->z.HALF.HI = entry->unk_2 + this->z.HALF.HI;
|
||||
}
|
||||
|
||||
void sub_080A9C34(Entity* this) {
|
||||
|
||||
@@ -22,7 +22,7 @@ void V1DarkMagicProjectile(Entity* this) {
|
||||
void V1DarkMagicProjectile_OnTick(Entity* this) {
|
||||
V1DarkMagicProjectile_Actions[this->action](this);
|
||||
if ((this->type2 == 0) && (--this->cutsceneBeh.HWORD == 0)) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ void sub_080AAC44(Entity* this) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
}
|
||||
if (gPlayerEntity.currentHealth == 0) {
|
||||
this->currentHealth = 0;
|
||||
if (gPlayerEntity.health == 0) {
|
||||
this->health = 0;
|
||||
}
|
||||
} else {
|
||||
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
|
||||
@@ -58,7 +58,7 @@ ASM_FUNC("asm/non_matching/v1DarkMagicProjectile/sub_080AACE0.inc", void sub_080
|
||||
|
||||
void sub_080AAD70(Entity* this) {
|
||||
if (sub_0806F520() == 0) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
V1DarkMagicProjectile_SubActions[this->subAction](this);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void V1DarkMagicProjectile_SubAction1(Entity* this) {
|
||||
|
||||
void V1DarkMagicProjectile_SubAction2(Entity* this) {
|
||||
if (sub_0806F3E4(this) != 0) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +91,8 @@ void V1DarkMagicProjectile_Init(Entity* this) {
|
||||
this->field_0xf = 4;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->currentHealth = 0x10;
|
||||
this->height.HALF.HI += 4;
|
||||
this->health = 0x10;
|
||||
this->z.HALF.HI += 4;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 4;
|
||||
@@ -131,7 +131,7 @@ void V1DarkMagicProjectile_Action1(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
case 2:
|
||||
if (this->parent->spriteSettings.b.draw == 0) {
|
||||
if (this->parent->spriteSettings.draw == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
CopyPosition(this->parent, this);
|
||||
@@ -148,9 +148,9 @@ void V1DarkMagicProjectile_Action2(Entity* this) {
|
||||
void V1DarkMagicProjectile_Action3(Entity* this) {
|
||||
CopyPosition(this->parent, this);
|
||||
sub_080AB034(this);
|
||||
this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
|
||||
this->spriteSettings.draw = this->parent->spriteSettings.draw;
|
||||
if (this->type != 0) {
|
||||
this->currentHealth = this->parent->currentHealth;
|
||||
this->health = this->parent->health;
|
||||
}
|
||||
#ifndef EU
|
||||
if (this->parent->action == 2) {
|
||||
@@ -174,8 +174,8 @@ void sub_080AAF74(Entity* this) {
|
||||
gPlayerEntity.iframes = 8;
|
||||
ModHealth(-4);
|
||||
sub_0800449C(&gPlayerEntity, 0x7a);
|
||||
if (gPlayerEntity.currentHealth == 0) {
|
||||
this->currentHealth = 0;
|
||||
if (gPlayerEntity.health == 0) {
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
if (!((this->field_0x80.HALF.LO < 0x31) && (this->field_0x80.HALF.HI != 0x10))) {
|
||||
@@ -183,13 +183,13 @@ void sub_080AAF74(Entity* this) {
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
gPlayerEntity.iframes = 0xf0;
|
||||
gPlayerState.field_0x1a[0] = 0;
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
} else {
|
||||
ResetPlayer();
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
CopyPosition(&gPlayerEntity, this);
|
||||
this->height.HALF.HI = gPlayerEntity.height.HALF.HI - 4;
|
||||
this->z.HALF.HI = gPlayerEntity.z.HALF.HI - 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void sub_080AB758(Entity*);
|
||||
void sub_080AB888(Entity*);
|
||||
|
||||
void V1EyeLaser(Entity* this) {
|
||||
if (this->parent->spriteSettings.b.draw == 0) {
|
||||
if (this->parent->spriteSettings.draw == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
V1EyeLaser_Actions[this->action](this);
|
||||
@@ -32,7 +32,7 @@ void V1EyeLaser_Init(Entity* this) {
|
||||
|
||||
void V1EyeLaser_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
sub_080AB758(this);
|
||||
|
||||
@@ -42,12 +42,12 @@ void V1FireProjectile_Init(Entity* this) {
|
||||
s8* data;
|
||||
|
||||
this->action = 1;
|
||||
this->hVelocity = -0x10000;
|
||||
this->zVelocity = -0x10000;
|
||||
this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
|
||||
CopyPosition(this->parent, this);
|
||||
sub_0806F5BC(this, 0x1000, this->direction);
|
||||
this->spritePriority.b0 = 1;
|
||||
this->height = this->parent->height;
|
||||
this->z = this->parent->z;
|
||||
InitializeAnimation(this, 0x51);
|
||||
SoundReq(SFX_1B5);
|
||||
data = sub_080AB4F8(this);
|
||||
@@ -68,7 +68,7 @@ void V1FireProjectile_Init(Entity* this) {
|
||||
iVar2 = 0x20;
|
||||
}
|
||||
}
|
||||
this->hVelocity = (this->height.WORD / (iVar2 << 8)) << 0xd;
|
||||
this->zVelocity = (this->z.WORD / (iVar2 << 8)) << 0xd;
|
||||
|
||||
this->direction = sub_080045B4(this, x, y);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void V1FireProjectile_Action1(Entity* this) {
|
||||
|
||||
void V1FireProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 3;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 0x53);
|
||||
@@ -99,7 +99,7 @@ void V1FireProjectile_Action2(Entity* this) {
|
||||
|
||||
void V1FireProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ void sub_080ABD44(Entity* this) {
|
||||
void sub_080ABD70(Entity* this) {
|
||||
u32 tmp;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->frames.all &= 0xef;
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
this->frame &= 0xef;
|
||||
this->speed = 0;
|
||||
this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
|
||||
this->field_0x76.HWORD = GetTileType(this->field_0x74.HWORD, 2);
|
||||
@@ -88,7 +88,7 @@ void sub_080ABD70(Entity* this) {
|
||||
SetTileType(0x6d, this->field_0x74.HWORD, 2);
|
||||
}
|
||||
}
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,14 +33,14 @@ void V3ElectricProjectile_Action1(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
this->height.HALF.HI -= 0x14;
|
||||
this->z.HALF.HI -= 0x14;
|
||||
if (this->cutsceneBeh.HALF.HI != 0) {
|
||||
if (((--this->cutsceneBeh.HALF.HI) & 7) == 0) {
|
||||
SoundReq(SFX_149);
|
||||
}
|
||||
}
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
if ((this->frame & 1) != 0) {
|
||||
if (this->type == 0) {
|
||||
this->action = 2;
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
@@ -50,7 +50,7 @@ void V3ElectricProjectile_Action1(Entity* this) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0x10;
|
||||
}
|
||||
this->height.HALF.HI -= 0x28;
|
||||
this->z.HALF.HI -= 0x28;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ void V3ElectricProjectile_Action2(Entity* this) {
|
||||
s32 iVar2;
|
||||
u32 uVar3;
|
||||
|
||||
if (this->height.HALF.HI < -6) {
|
||||
this->height.HALF.HI += 3;
|
||||
if (this->z.HALF.HI < -6) {
|
||||
this->z.HALF.HI += 3;
|
||||
}
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
|
||||
@@ -19,8 +19,8 @@ void V3HandProjectile_OnTick(Entity* this) {
|
||||
InitializeAnimation(this, 0);
|
||||
SoundReq(SFX_199);
|
||||
}
|
||||
if (this->height.HALF.HI < -6) {
|
||||
this->height.HALF.HI += 2;
|
||||
if (this->z.HALF.HI < -6) {
|
||||
this->z.HALF.HI += 2;
|
||||
}
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
|
||||
@@ -25,8 +25,8 @@ ASM_FUNC("asm/non_matching/v3TennisBallProjectile/sub_080ACA68.inc", void sub_08
|
||||
void V3TennisBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = 0x10;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
this->attachedEntity = NULL;
|
||||
this->z.HALF.HI = 0xfffc;
|
||||
this->child = NULL;
|
||||
InitializeAnimation(this, 7);
|
||||
SoundReq(SFX_199);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void WindProjectile_Action1(Entity* this) {
|
||||
if (parent->next == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
if (this->spriteSettings.b.draw == 1) {
|
||||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
direction = (parent->direction + 4) & 0x18;
|
||||
if (this->actionDelay != 0) {
|
||||
@@ -74,7 +74,7 @@ void WindProjectile_Action2(Entity* this) {
|
||||
|
||||
void WindProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ void Winder_Init(Entity* this) {
|
||||
|
||||
this->action += 1;
|
||||
this->speed = 0x140;
|
||||
this->height.WORD = 0;
|
||||
this->z.WORD = 0;
|
||||
if (this->type == 0) {
|
||||
this->direction = Random() & 0x18;
|
||||
this->parent = this;
|
||||
@@ -31,7 +31,7 @@ void Winder_Init(Entity* this) {
|
||||
entity = CreateProjectile(0x1d);
|
||||
entity->type = this->type + 1;
|
||||
entity->parent = this->parent;
|
||||
entity->attachedEntity = this;
|
||||
entity->child = this;
|
||||
CopyPosition(this, entity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user