mirror of
https://github.com/zeldaret/tmc
synced 2026-07-09 23:01:43 -04:00
Merge remote-tracking branch 'upstream/master' into coord
This commit is contained in:
@@ -75,7 +75,7 @@ void BoneProjectile_Action3(Entity* this) {
|
||||
void BoneProjectile_Action4(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
LinearMoveUpdate(this);
|
||||
if (GravityUpdate(this, 0x1800) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ void BoneProjectile_Action4(Entity* this) {
|
||||
void sub_080A82D8(Entity* this) {
|
||||
this->action = 4;
|
||||
COLLISION_OFF(this);
|
||||
this->zVelocity = 0x10000;
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
this->direction ^= 0x10;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ extern void CreateItemOnGround(Entity*);
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern void sub_080043A8(Entity*);
|
||||
extern void CreateChestSpawner(Entity*);
|
||||
extern u32 sub_080177A0(Entity*, Entity*);
|
||||
extern u32 IsColliding(Entity*, Entity*);
|
||||
|
||||
extern void (*const CannonballProjectile_Functions[])(Entity*);
|
||||
extern void (*const CannonballProjectile_Actions[])(Entity*);
|
||||
@@ -79,7 +79,7 @@ bool32 sub_080AB634(Entity* this) {
|
||||
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] != NULL && (IsColliding(this, entities[i]) != 0)) {
|
||||
if (entities[i]->action < 3) {
|
||||
entities[i]->action = 3;
|
||||
entities[i]->actionDelay = 0x1e;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 IsProjectileOffScreen(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
extern u32 sub_080177A0(Entity*, Entity*);
|
||||
extern u32 IsColliding(Entity*, Entity*);
|
||||
|
||||
extern void (*const DekuSeedProjectile_Functions[])(Entity*);
|
||||
extern void (*const DekuSeedProjectile_Actions[])(Entity*);
|
||||
@@ -70,7 +70,7 @@ void DekuSeedProjectile_Action1(Entity* this) {
|
||||
}
|
||||
if (this->field_0xf != 0) {
|
||||
parent = this->parent;
|
||||
if ((parent->next != NULL) && (sub_080177A0(this, parent) != 0)) {
|
||||
if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) {
|
||||
this->iframes = 0x10;
|
||||
this->knockbackDirection = -this->direction;
|
||||
this->bitfield = 0x80;
|
||||
|
||||
@@ -48,7 +48,7 @@ void DirtBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteSettings.shadow = 1;
|
||||
this->zVelocity = 0x8000;
|
||||
this->zVelocity = Q_16_16(0.5);
|
||||
this->hitbox = (Hitbox*)&gUnk_08129764;
|
||||
this->field_0x3c |= 0x10;
|
||||
switch (this->type) {
|
||||
@@ -76,13 +76,13 @@ void DirtBallProjectile_Action1(Entity* this) {
|
||||
if (parent->next == NULL) {
|
||||
this->action = 2;
|
||||
}
|
||||
PositionRelative(parent, this, 0, -0x10000);
|
||||
PositionRelative(parent, this, 0, Q_16_16(-1.0));
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->z.HALF.HI += 0x10;
|
||||
this->z.HALF.HI += Q_8_8(1.0 / 16.0);
|
||||
break;
|
||||
case 1:
|
||||
this->z.HALF.HI += 0xe;
|
||||
this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0);
|
||||
sub_08078954(this->child);
|
||||
CopyPosition(this, this->child);
|
||||
if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) {
|
||||
@@ -96,7 +96,7 @@ void DirtBallProjectile_Action1(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this->z.HALF.HI += 0xe;
|
||||
this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0);
|
||||
if (EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe) != 0) {
|
||||
this->action = 2;
|
||||
parent->field_0x82.HALF.HI = 0xc0;
|
||||
|
||||
@@ -32,10 +32,10 @@ void GleerokProjectile_Init(Entity* this) {
|
||||
s32 iVar2;
|
||||
|
||||
this->action = 1;
|
||||
this->zVelocity = -0x10000;
|
||||
this->zVelocity = Q_16_16(-1.0);
|
||||
if (this->type != 3) {
|
||||
CopyPosition(this->parent, this);
|
||||
sub_0806F5BC(this, 0x1000, this->direction);
|
||||
LinearMoveDirection(this, 0x1000, this->direction);
|
||||
this->z.WORD = this->parent->y.WORD - this->child->y.WORD;
|
||||
this->y.WORD -= this->z.WORD;
|
||||
InitializeAnimation(this, 0x51);
|
||||
|
||||
@@ -60,8 +60,8 @@ void GyorgMaleEnergyProjectile_Action1(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
animationState = this->parent->animationState;
|
||||
PositionRelative(this->parent, this, gSineTable[animationState] * 0x2800,
|
||||
gSineTable[animationState + 0x40] * -0x2800);
|
||||
PositionRelative(this->parent, this, gSineTable[animationState] * Q_16_16(5.0 / 32.0),
|
||||
gSineTable[animationState + 0x40] * Q_16_16(-5.0 / 32.0));
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 2;
|
||||
|
||||
@@ -57,8 +57,8 @@ void LakituCloudProjectile_Init(Entity* this) {
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_Action1(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
this->z.HALF.HI = 0xfffe;
|
||||
PositionRelative(this->parent, this, 0, Q_16_16(-1.0));
|
||||
this->z.HALF.HI = -2;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void MandiblesProjectile_Init(Entity* this) {
|
||||
this->animationState = 0xff;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
this->spritePriority.b0 = 4;
|
||||
ResolveEntityBelow(this, this->parent);
|
||||
SortEntityBelow(this, this->parent);
|
||||
sub_080AA270(this);
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ void MandiblesProjectile_Action3(Entity* this) {
|
||||
} else {
|
||||
tmp = GetSpriteSubEntryOffsetDataPointer((u16)entity->spriteIndex, entity->frameIndex);
|
||||
if ((entity->animationState & 4) != 0) {
|
||||
PositionRelative(entity, this, -tmp[0] * 0x10000, tmp[1] << 0x10);
|
||||
PositionRelative(entity, this, Q_16_16(-tmp[0]), Q_16_16(tmp[1]));
|
||||
} else {
|
||||
PositionRelative(entity, this, tmp[0] << 0x10, tmp[1] << 0x10);
|
||||
PositionRelative(entity, this, Q_16_16(tmp[0]), Q_16_16(tmp[1]));
|
||||
}
|
||||
}
|
||||
if (entity->field_0x43 == 0) {
|
||||
@@ -212,9 +212,9 @@ void sub_080AA1D8(Entity* this) {
|
||||
if ((parent->frameIndex & 0x20) == 0) {
|
||||
tmp = GetSpriteSubEntryOffsetDataPointer((u16)parent->spriteIndex, parent->frameIndex);
|
||||
if ((parent->animationState & 4) != 0) {
|
||||
PositionRelative(parent, this, -tmp[0] * 0x10000, tmp[1] << 0x10);
|
||||
PositionRelative(parent, this, Q_16_16(-tmp[0]), Q_16_16(tmp[1]));
|
||||
} else {
|
||||
PositionRelative(parent, this, tmp[0] << 0x10, tmp[1] << 0x10);
|
||||
PositionRelative(parent, this, Q_16_16(tmp[0]), Q_16_16(tmp[1]));
|
||||
}
|
||||
if (parent->field_0x43 != 0) {
|
||||
if ((this->flags & ENT_COLLIDE) != 0) {
|
||||
|
||||
@@ -33,7 +33,7 @@ void OctorokBossProjectile_Init(Entity* this) {
|
||||
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
sub_0806F62C(this, 0x4800, this->direction);
|
||||
LinearMoveAngle(this, 0x4800, this->direction);
|
||||
this->speed = 0x200;
|
||||
this->actionDelay = 0;
|
||||
this->field_0xf = this->direction;
|
||||
@@ -44,11 +44,11 @@ void OctorokBossProjectile_Init(Entity* this) {
|
||||
this->spriteRendering.b3 = 3;
|
||||
this->spritePriority.b0 = 6;
|
||||
this->speed = (Random() & 0x1ff) + 0x200;
|
||||
this->zVelocity = (Random() & 0x1fff) + 0x18000;
|
||||
this->zVelocity = (Random() & 0x1fff) + Q_16_16(1.5);
|
||||
uVar1 = (((u8)Random() & 7) - 4);
|
||||
this->direction -= uVar1;
|
||||
*(u32*)&this->field_0x78 = 600;
|
||||
sub_0806F62C(this, this->speed, this->direction);
|
||||
LinearMoveAngle(this, this->speed, this->direction);
|
||||
InitializeAnimation(this, 4);
|
||||
break;
|
||||
case 2:
|
||||
@@ -59,7 +59,7 @@ void OctorokBossProjectile_Init(Entity* this) {
|
||||
}
|
||||
this->speed = 0x200;
|
||||
this->actionDelay = 0x30;
|
||||
sub_0806F62C(this, 0x5000, this->direction);
|
||||
LinearMoveAngle(this, 0x5000, this->direction);
|
||||
InitializeAnimation(this, 5);
|
||||
break;
|
||||
case 3:
|
||||
@@ -113,7 +113,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
this->field_0x78.HWORD--;
|
||||
sub_0806F62C(this, this->speed, this->direction);
|
||||
LinearMoveAngle(this, this->speed, this->direction);
|
||||
sub_080AE58C(this, this->direction >> 3, 0);
|
||||
if ((this->collisions & 0xee00) != 0) {
|
||||
this->direction = -this->direction;
|
||||
@@ -153,7 +153,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
if (GravityUpdate(this, 0x1800) != 0) {
|
||||
sub_080AE58C(this, this->direction >> 3, 0);
|
||||
if (this->collisions == 0) {
|
||||
sub_0806F62C(this, (s32)this->speed, (u32)this->direction);
|
||||
LinearMoveAngle(this, (s32)this->speed, (u32)this->direction);
|
||||
} else {
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
||||
case 2:
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay != 0xff) {
|
||||
sub_0806F62C(this, this->speed, this->direction);
|
||||
LinearMoveAngle(this, this->speed, this->direction);
|
||||
return;
|
||||
}
|
||||
if (this->child != NULL) {
|
||||
|
||||
@@ -31,7 +31,7 @@ void sub_080A8064(Entity* this) {
|
||||
void RockProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x30;
|
||||
this->zVelocity = 0xa000;
|
||||
this->zVelocity = Q_16_16(0.625);
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void sub_080A8178(Entity* this) {
|
||||
this->action = 2;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0x40;
|
||||
this->zVelocity = 0x14000;
|
||||
this->zVelocity = Q_16_16(1.25);
|
||||
}
|
||||
|
||||
void (*const RockProjectile_Functions[])(Entity*) = {
|
||||
|
||||
@@ -32,7 +32,7 @@ void sub_080A9A34(Entity* this) {
|
||||
if (this->bitfield == 0x9d) {
|
||||
this->action = 3;
|
||||
COLLISION_OFF(this);
|
||||
this->zVelocity = 0x2a000;
|
||||
this->zVelocity = Q_16_16(2.625);
|
||||
this->spritePriority.b1 = 1;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void StalfosProjectile_Init(Entity* this) {
|
||||
break;
|
||||
case 2:
|
||||
this->action = 3;
|
||||
this->zVelocity = 0x2a000;
|
||||
this->zVelocity = Q_16_16(2.625);
|
||||
this->spritePriority.b1 = 1;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -31,9 +31,9 @@ void sub_080AAC44(Entity* this) {
|
||||
this->action = 2;
|
||||
COLLISION_OFF(this);
|
||||
if (this->type == 0) {
|
||||
ResolveEntityOnTop(&gPlayerEntity, this);
|
||||
SortEntityAbove(&gPlayerEntity, this);
|
||||
} else {
|
||||
ResolveEntityOnTop(this->parent, this);
|
||||
SortEntityAbove(this->parent, this);
|
||||
}
|
||||
ResetPlayer();
|
||||
gPlayerState.mobility |= 0x80;
|
||||
@@ -114,7 +114,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
|
||||
} else {
|
||||
this->action = 3;
|
||||
this->hitType = 0x2c;
|
||||
ResolveEntityOnTop(this->parent, this);
|
||||
SortEntityAbove(this->parent, this);
|
||||
}
|
||||
if (this->type == 0) {
|
||||
this->actionDelay = 0;
|
||||
@@ -136,7 +136,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
|
||||
entity->parent = this;
|
||||
}
|
||||
} else {
|
||||
ResolveEntityOnTop(this->parent, this);
|
||||
SortEntityAbove(this->parent, this);
|
||||
COLLISION_OFF(this);
|
||||
CopyPosition(this->parent, this);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void sub_080AB844(Entity* this, s32 param_1, s32 param_2) {
|
||||
entity->type = 1;
|
||||
entity->actionDelay = param_1;
|
||||
entity->parent = this->parent;
|
||||
PositionRelative(this, entity, 0, param_2 << 0x10);
|
||||
PositionRelative(this, entity, 0, Q_16_16(param_2));
|
||||
if (param_1 != 1) {
|
||||
entity->hitbox = (Hitbox*)&gUnk_0812A61C;
|
||||
} else {
|
||||
|
||||
@@ -39,10 +39,10 @@ void V1FireProjectile_Init(Entity* this) {
|
||||
s8* data;
|
||||
|
||||
this->action = 1;
|
||||
this->zVelocity = -0x10000;
|
||||
this->zVelocity = Q_16_16(-1.0);
|
||||
this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
|
||||
CopyPosition(this->parent, this);
|
||||
sub_0806F5BC(this, 0x1000, this->direction);
|
||||
LinearMoveDirection(this, 0x1000, this->direction);
|
||||
this->spritePriority.b0 = 1;
|
||||
this->z = this->parent->z;
|
||||
InitializeAnimation(this, 0x51);
|
||||
|
||||
@@ -138,7 +138,7 @@ void sub_080ABE04(Entity* this) {
|
||||
u32 rand = Random() & 0xff;
|
||||
u32 newX;
|
||||
this->action = 1;
|
||||
this->zVelocity = 0xffff0000;
|
||||
this->zVelocity = Q_16_16(-1.0);
|
||||
this->z.HALF.HI -= 0xa0;
|
||||
this->x.HALF.HI = (gRoomControls.origin_x & 0x7ff0) | 0x8;
|
||||
this->y.HALF.HI = (gRoomControls.origin_y & 0x7ff0) | 0x8;
|
||||
|
||||
Reference in New Issue
Block a user