mirror of
https://github.com/zeldaret/tmc
synced 2026-06-06 19:51:53 -04:00
create enemy struct and enemy flags
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ void Bush_Init(BushEntity* this) {
|
||||
if (super->type == 3) {
|
||||
Bush_Action2SubAction5(this);
|
||||
}
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
if (super->type == 4) {
|
||||
Bush_Action2SubAction5(this);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ void CrackingGround(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->timer = 20;
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
} else {
|
||||
if (this->timer-- == 0) {
|
||||
sub_0807B7D8(0x35, COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
||||
@@ -326,7 +326,7 @@ void sub_080969A4(CrenelBeanSproutEntity* this) {
|
||||
void sub_08096A78(CrenelBeanSproutEntity* this) {
|
||||
SetGlobalFlag(WATERBEAN_PUT);
|
||||
InitAnimationForceUpdate(super, (super->type >> 1) + 8);
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
super->y.HALF.HI += 4;
|
||||
super->action = 3;
|
||||
SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void Flame_Init(FlameEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
super->timer = 15;
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
break;
|
||||
case 3:
|
||||
CopyPosition(super->parent, super);
|
||||
|
||||
@@ -186,7 +186,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
gPlayerEntity.base.animationState = super->animationState << 1;
|
||||
gPlayerEntity.base.direction = super->direction;
|
||||
gPlayerEntity.base.flags |= PL_MINISH;
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
InitAnimationForceUpdate(super, super->animationState + 0xc);
|
||||
SoundReq(SFX_PLY_VO4);
|
||||
SoundReq(SFX_139);
|
||||
@@ -219,7 +219,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
}
|
||||
|
||||
void Minecart_Action4(MinecartEntity* this) {
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
CopyPosition(super, &gPlayerEntity.base);
|
||||
switch (GetActTile(super)) {
|
||||
case 0x67:
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "entity.h"
|
||||
#include "sound.h"
|
||||
#include "enemy.h"
|
||||
|
||||
void MulldozerSpawnPoint_Init(Entity*);
|
||||
void MulldozerSpawnPoint_Action1(Entity*);
|
||||
@@ -37,6 +38,6 @@ void MulldozerSpawnPoint_Action1(Entity* this) {
|
||||
parent = this->parent;
|
||||
parent->flags = this->timer;
|
||||
parent->spriteSettings.draw = this->subtimer;
|
||||
((GenericEntity*)parent)->field_0x6c.HALF.HI &= 0xef;
|
||||
((Enemy*)parent)->enemyFlags &= ~EM_FLAG_SUPPORT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void Object53_Init(Entity* this) {
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->zVelocity = Q_16_16(2.625);
|
||||
InitializeAnimation(this, gUnk_08122288[this->type].animationState);
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
}
|
||||
|
||||
void Object53_Action1(Entity* this) {
|
||||
|
||||
@@ -23,7 +23,7 @@ void Object70_Init(Entity* this) {
|
||||
this->spriteSettings.draw = 1;
|
||||
this->frameIndex = this->type + 0xb;
|
||||
if (this->type != 0) {
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
gPlayerEntity.base.spriteOrientation.flipY = 3;
|
||||
if ((gPlayerEntity.base.spritePriority.b0) != 7) {
|
||||
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
|
||||
|
||||
@@ -106,13 +106,13 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
this->unk_83 = 1;
|
||||
index = gPlayerEntity.base.animationState;
|
||||
ptr = &gUnk_08120CB4[index];
|
||||
PositionRelative(super, &gPlayerEntity.base, *(ptr) << 0x10, *(ptr + 1) << 0x10);
|
||||
PositionRelative(super, &gPlayerEntity.base, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
|
||||
}
|
||||
tileType = GetTileType(this->unk_84, super->collisionLayer);
|
||||
if (tileType != 0x400b) {
|
||||
switch (sub_0808968C(tileType)) {
|
||||
case 1:
|
||||
super->direction = (((tileType - 0xc) & 3) << 3);
|
||||
super->direction = DirectionFromAnimationState((tileType - 0xc) & 3);
|
||||
sub_08089538(this);
|
||||
break;
|
||||
case 0:
|
||||
@@ -133,7 +133,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
gPlayerState.flags |= PL_BUSY;
|
||||
gPlayerEntity.base.x.HALF.LO = 0;
|
||||
gPlayerEntity.base.y.HALF.LO = 0;
|
||||
super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
|
||||
super->direction = Direction8FromAnimationState(AnimationStateFlip180(gPlayerEntity.base.animationState));
|
||||
sub_08089538(this);
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void sub_080894C8(PushableStatueEntity* this) {
|
||||
|
||||
void sub_080894FC(PushableStatueEntity* this) {
|
||||
u32 index;
|
||||
for (index = 0; index <= 7; index++) {
|
||||
for (index = 0; index < 8; index++) {
|
||||
if (super == gRoomVars.puzzleEntities[index]) {
|
||||
gRoomVars.puzzleEntities[index] = NULL;
|
||||
break;
|
||||
|
||||
@@ -168,7 +168,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
|
||||
x = ((rand >> 0x10) % 9) - 4;
|
||||
y = rand & 0xf;
|
||||
obj->spritePriority.b0 = 3;
|
||||
PositionRelative(super, obj, x * 0x10000, -y * 0x10000);
|
||||
PositionRelative(super, obj, Q_16_16(x), Q_16_16(-y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user