Match sub_08076088

This commit is contained in:
Tal Hayon
2022-05-21 19:37:34 +03:00
parent 7c7fbef8f9
commit 6243626efe
6 changed files with 63 additions and 154 deletions
+55 -2
View File
@@ -36,7 +36,7 @@ void sub_08075FF8(ItemBehavior* this, u32 idx) {
}
maxBombs = this->behaviorID == 7 ? 3 : 1;
if (maxBombs > bombCount) {
entity = CreatePlayerItemWithParent(this, 2);
entity = CreatePlayerItemWithParent(this, PLAYER_ITEM_BOMB);
if (entity != NULL) {
pos = &gUnk_0811BDAC[gPlayerEntity.animationState & 6];
PositionRelative(&gPlayerEntity, entity, Q_16_16(pos[0]), Q_16_16(pos[1]));
@@ -48,4 +48,57 @@ void sub_08075FF8(ItemBehavior* this, u32 idx) {
DeletePlayerItem(this, idx);
}
ASM_FUNC("asm/non_matching/itemBomb/sub_08076088.inc", void sub_08076088(ItemBehavior* this, void* arg1))
void sub_08076088(ItemBehavior* this, Entity* param_2, u32 param_3) {
if (param_2 != NULL) {
if ((param_2->carryFlags & 1) != 0) {
return;
}
param_2->action = 2;
param_2->subAction = param_2->carryFlags & 1;
}
this->field_0x18 = param_2;
if ((gPlayerState.flags & PL_NO_CAP)) {
sub_08077DF4(this, 0x928);
} else {
sub_08077DF4(this, 0x338);
}
gPlayerState.heldObject = 3;
gPlayerState.framestate = 4;
this->stateID = 2;
this->field_0xf = 0xf;
if ((gPlayerEntity.field_0x78.HALF.HI & 0x80)) {
gPlayerEntity.field_0x78.HALF.HI = 0;
COLLISION_ON(&gPlayerEntity);
gPlayerState.heldObject = 4;
gPlayerState.keepFacing = ~(8 >> param_3) & gPlayerState.keepFacing;
gPlayerState.field_0xa = ~(8 >> param_3) & gPlayerState.field_0xa;
this->stateID = 3;
this->field_0xf = 0;
} else {
gPlayerState.field_0xa |= (8 >> param_3);
gPlayerState.keepFacing |= (8 >> param_3);
}
param_2 = CreatePlayerItemWithParent(this, PLAYER_ITEM_13);
if (param_2 == NULL) {
PlayerCancelHoldItem(this, param_3);
} else {
Entity* playerEnt = &gPlayerEntity;
*(Entity**)&playerEnt->field_0x74 = param_2;
playerEnt->subtimer = 0;
param_2->child = this->field_0x18;
param_2->carryFlags = playerEnt->carryFlags;
param_2->parent = (Entity*)this;
this->field_0x18 = param_2;
param_2->type2 = this->field_0x2[1];
param_2->timer = this->field_0x5[2];
param_2->subtimer = this->field_0x5[3];
if ((this->field_0x18->carryFlags & 0xf0) == 0x10) {
this->field_0x5[2] = 8;
} else {
this->field_0x5[2] = 0;
}
SoundReq(SFX_PLY_LIFT);
}
}
+2 -1
View File
@@ -2,6 +2,7 @@
#include "entity.h"
#include "item.h"
#include "functions.h"
#include "playeritem.h"
void sub_08076C98(ItemBehavior*, u32);
void sub_08076CBC(ItemBehavior*, u32);
@@ -26,7 +27,7 @@ void sub_08076CBC(ItemBehavior* beh, u32 idx) {
DeletePlayerItem(beh, idx);
} else {
if ((beh->field_0x5[9] & 0x40) != 0) {
CreatePlayerItemWithParent(beh, 0x12);
CreatePlayerItemWithParent(beh, PLAYER_ITEM_12);
}
UpdateItemAnim(beh);
}
+2 -1
View File
@@ -5,6 +5,7 @@
#include "effects.h"
#include "game.h"
#include "save.h"
#include "playeritem.h"
void sub_08076964(ItemBehavior*, u32);
void sub_080768F8(ItemBehavior*, u32);
@@ -105,7 +106,7 @@ void sub_08076964(ItemBehavior* this, u32 idx) {
(gPlayerState.skills & SKILL_DASH_ATTACK) != 0) {
gPlayerState.field_0xab = 3;
sub_08077DF4(this, 0x298);
bombEntity = CreatePlayerItemWithParent(this, 0xc);
bombEntity = CreatePlayerItemWithParent(this, PLAYER_ITEM_C);
if (bombEntity != NULL) {
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != 0) {
uVar3 = gSave.stats.itemButtons[SLOT_A];
+2 -2
View File
@@ -114,7 +114,7 @@ void sub_080754B8(ItemBehavior* this, u32 idx) {
if (gPlayerEntity.frameSpriteSettings & 1) {
iVar1 = sub_0807B014();
if (iVar1 && FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_SWORD_BEAM1, 2) == 0) {
CreatePlayerItemWithParent(this, 0xf);
CreatePlayerItemWithParent(this, PLAYER_ITEM_SWORD_BEAM1);
if (iVar1 == 0xf) {
gPlayerState.field_0xab = 5;
} else {
@@ -235,7 +235,7 @@ void sub_08075738(ItemBehavior* this, u32 idx) {
} else {
if (((((gPlayerEntity.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
((gPlayerState.skills & SKILL_FOURSWORD) != 0))) {
Entity* bombEnt = CreatePlayerItemWithParent(this, 0x14);
Entity* bombEnt = CreatePlayerItemWithParent(this, PLAYER_ITEM_14);
if (bombEnt) {
bombEnt->animationState = (gPlayerEntity.animationState & 6) | 0x80;
}
+2 -1
View File
@@ -22,6 +22,7 @@
#include "game.h"
#include "screen.h"
#include "main.h"
#include "playeritem.h"
#define GRAVITY_RATE Q_8_8(32)
#define SLOPE_SPEED_MODIFIER 0x50
@@ -1657,7 +1658,7 @@ static void PlayerEmptyBottleInit(Entity* this) {
Entity* ent;
ResetPlayerItem();
ent = CreatePlayerItemWithParent((ItemBehavior*)this, 0xe);
ent = CreatePlayerItemWithParent((ItemBehavior*)this, PLAYER_ITEM_BOTTLE);
if (ent != NULL) {
ent->field_0x68.HALF.LO = gPlayerState.field_0x38;
this->subAction++;