define collisions

This commit is contained in:
theo3
2023-12-31 21:24:07 -08:00
parent 48fdf9d827
commit dcc596ed87
125 changed files with 388 additions and 336 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ void PlayerItemBoomerang_Action1(PlayerItemBoomerangEntity* this) {
super->spriteVramOffset = 0xd5;
COLLISION_ON(super);
super->collisionFlags |= 1;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
super->spriteIndex = 0xa6;
super->spriteSettings.flipX = 0;
super->spriteSettings.draw = 1;
@@ -184,7 +184,7 @@ void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this) {
if (super->timer == 0) {
uVar6 = TRUE;
}
if (super->contactFlags & CONTACT_TAKE_DAMAGE) {
if (super->contactFlags & CONTACT_NOW) {
uVar6 = TRUE;
}
if (!uVar6) {
+1 -1
View File
@@ -48,7 +48,7 @@ void PlayerItemBottle_Init(PlayerItemBottleEntity* this) {
}
COLLISION_ON(super);
super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
super->hurtType = 0x1f;
super->type = 1;
super->type2 = ITEM_BOTTLE_EMPTY;
+1 -1
View File
@@ -87,7 +87,7 @@ void PlayerItemBow_Init(PlayerItemBowEntity* this) {
}
super->direction = super->animationState << 2;
super->collisionFlags = gPlayerEntity.base.collisionFlags + 1;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
if (super->collisionLayer == 2) {
super->type2 = 1;
} else {
+1 -1
View File
@@ -29,7 +29,7 @@ void PlayerItemDashSword_Init(Entity* this) {
gPlayerState.item = this;
this->flags |= ENT_PERSIST;
this->action = 1;
this->flags2 = 8;
this->collisionMask = 8;
LoadSwapGFX(this, 1, 3);
sub_08079BD8(this);
sub_0801766C(this);
+1 -1
View File
@@ -70,7 +70,7 @@ void PlayerItemGust(Entity* this) {
static void PlayerItemGust_Init(PlayerItemGustEntity* this) {
super->action = GUST_UPDATE;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
super->direction = super->animationState << 2;
super->speed = 0x200;
super->flags |= ENT_COLLIDE | ENT_PERSIST;
+2 -2
View File
@@ -73,7 +73,7 @@ void PlayerItemGustBig_Init(PlayerItemGustBigEntity* this) {
super->speed = 0x400;
super->hitType = 0x96;
super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x80;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
pEVar3 = super->child;
if (pEVar3 != NULL) {
super->action = 1;
@@ -141,7 +141,7 @@ void PlayerItemGustBig_Action2(PlayerItemGustBigEntity* this) {
if ((super->child->gustJarState & 4) == 0) {
DeleteThisEntity();
}
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if ((super->contactFlags & CONTACT_NOW) != 0) {
PlayerItemGustBig_Action3(this);
return;
}
+1 -1
View File
@@ -112,7 +112,7 @@ void PlayerItemHeldObject_SubAction2(PlayerItemHeldObjectEntity* this) {
if ((child->base).action != 2) {
DeleteThisEntity();
}
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if ((super->contactFlags & CONTACT_NOW) != 0) {
super->z.WORD = 0;
}
if (super->speed != 0) {
+1 -1
View File
@@ -29,7 +29,7 @@ void PlayerItemLantern_Init(Entity* this) {
this->frameIndex = -1;
this->updatePriority = 6;
this->collisionFlags = 7;
this->flags2 = -0x80;
this->collisionMask = -0x80;
this->animationState = gPlayerEntity.base.animationState & 0xe;
if (AllocMutableHitbox(this) == NULL) {
DeleteThisEntity();
@@ -74,7 +74,7 @@ void PlayerItemPacciCaneProjectile_Init(PlayerItemPacciCaneProjectileEntity* thi
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + gUnk_0811B9A0[super->animationState];
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + gUnk_0811B9A0[super->animationState + 1];
super->collisionFlags = 7;
super->flags2 = 0x8a;
super->collisionMask = 0x8a;
super->hitbox = (Hitbox*)&gUnk_0811B9D0;
if (super->collisionLayer == 2) {
super->type = 1;
+1 -1
View File
@@ -102,7 +102,7 @@ void PlayerItemShield_Action1(PlayerItemShieldEntity* this) {
gPlayerState.shield_status &= ~0x80;
sub_080176E4(super);
} else {
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if ((super->contactFlags & CONTACT_NOW) != 0) {
if ((((super->contactFlags & 0x7f) == 0x42) && this->unk_68 == 0xe) &&
((gPlayerState.shield_status & 0x40) == 0)) {
playerItem = CreatePlayerItem(PLAYER_ITEM_FIRE_ROD_PROJECTILE, 0, 0, this->unk_68);
+2 -2
View File
@@ -59,7 +59,7 @@ void PlayerItemSword_Init(PlayerItemSwordEntity* this) {
}
LoadSwapGFX(super, 1, 3);
super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20;
super->flags2 = gPlayerEntity.base.flags2;
super->collisionMask = gPlayerEntity.base.collisionMask;
super->updatePriority = 6;
super->contactFlags = 0;
super->iframes = 0;
@@ -285,7 +285,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) {
}
super->spriteSettings.flipX = flipX;
}
if ((super->contactFlags & CONTACT_TAKE_DAMAGE) != 0) {
if ((super->contactFlags & CONTACT_NOW) != 0) {
if ((param_2->iframes == 0) || ((u8)param_2->iframes == 0x81)) {
param_2->iframes = super->iframes;
param_2->knockbackDirection = super->knockbackDirection;