mirror of
https://github.com/zeldaret/tmc
synced 2026-08-30 17:29:40 -04:00
Merge branch 'master' into tilemap-docs
This commit is contained in:
+2
-2
@@ -38,8 +38,8 @@ void sub_08075FF8(ItemBehavior* this, u32 index) {
|
||||
if (maxBombs > bombCount) {
|
||||
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]));
|
||||
pos = &gUnk_0811BDAC[gPlayerEntity.base.animationState & 6];
|
||||
PositionRelative(&gPlayerEntity.base, entity, Q_16_16(pos[0]), Q_16_16(pos[1]));
|
||||
ModBombs(-1);
|
||||
SoundReq(SFX_PLACE_OBJ);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void ItemBoomerang(ItemBehavior* this, u32 index) {
|
||||
void sub_08075D2C(ItemBehavior* this, u32 index) {
|
||||
if (((gPlayerState.attack_status & 8) == 0) && (FindPlayerItemForItem(this, this->behaviorId) == NULL)) {
|
||||
this->priority |= 0xf;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
CreatePlayerItemIfNotExists(this, ITEM_BOOMERANG);
|
||||
sub_08077D38(this, index);
|
||||
gPlayerState.attack_status |= 8;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ void ItemBow(ItemBehavior* this, u32 index) {
|
||||
void sub_08075DF4(ItemBehavior* this, u32 index) {
|
||||
if ((gPlayerState.attack_status & 8) == 0) {
|
||||
this->priority |= 0x80;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
sub_08077BB8(this);
|
||||
sub_08077D38(this, index);
|
||||
gPlayerState.bow_state = 1;
|
||||
|
||||
+17
-16
@@ -1,6 +1,6 @@
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "playeritem.h"
|
||||
#include "tiles.h"
|
||||
|
||||
@@ -12,15 +12,15 @@ void ItemGustJar(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
|
||||
void sub_08076DF4(ItemBehavior* this, u32 index) {
|
||||
if (GetVvvInFront(&gPlayerEntity) != VVV_41 && gPlayerState.floor_type != SURFACE_DOOR &&
|
||||
if (GetVvvInFront(&gPlayerEntity.base) != VVV_41 && gPlayerState.floor_type != SURFACE_DOOR &&
|
||||
gPlayerState.floor_type != SURFACE_DOOR_13 && gPlayerState.jump_status == 0) {
|
||||
sub_08077D38(this, index);
|
||||
this->timer = 0;
|
||||
this->playerAnimationState = gPlayerEntity.animationState;
|
||||
this->playerAnimationState = gPlayerEntity.base.animationState;
|
||||
this->priority |= 0x80;
|
||||
this->priority++;
|
||||
gPlayerState.gustJarSpeed = 1;
|
||||
*(u32*)&gPlayerEntity.field_0x74 = 0;
|
||||
gPlayerEntity.unk_74 = NULL;
|
||||
gPlayerState.field_0x1c = 1;
|
||||
sub_08077BB8(this);
|
||||
} else {
|
||||
@@ -40,7 +40,7 @@ void sub_08076E60(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> index);
|
||||
playerItem = CreatePlayerItem(PLAYER_ITEM_GUST, 0, 0, 0);
|
||||
if (playerItem != NULL) {
|
||||
playerItem->parent = &gPlayerEntity;
|
||||
playerItem->parent = &gPlayerEntity.base;
|
||||
}
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
@@ -63,7 +63,7 @@ void sub_08076EC8(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.gustJarSpeed = 1;
|
||||
}
|
||||
|
||||
if (gPlayerEntity.subAction == 0x1b) {
|
||||
if (gPlayerEntity.base.subAction == 0x1b) {
|
||||
animIndex = ANIM_GUSTJAR_524;
|
||||
} else {
|
||||
if (gPlayerState.direction & DIR_NOT_MOVING_CHECK) {
|
||||
@@ -87,7 +87,7 @@ void sub_08076EC8(ItemBehavior* this, u32 index) {
|
||||
|
||||
void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
Entity* item;
|
||||
Entity* player;
|
||||
PlayerEntity* player;
|
||||
switch (gPlayerState.field_0x1c & 0xf) {
|
||||
case 5:
|
||||
if (this->playerFrame & 0x80) {
|
||||
@@ -96,14 +96,14 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
this->timer = 0;
|
||||
gPlayerState.gustJarSpeed = 1;
|
||||
player = &gPlayerEntity;
|
||||
*(u32*)&player->field_0x74 = 0;
|
||||
player->unk_74 = NULL;
|
||||
gPlayerState.field_0x1c = 1;
|
||||
gPlayerState.field_0xa &= ~(8 >> index);
|
||||
this->stateID = 2;
|
||||
SetItemAnim(this, ANIM_GUSTJAR_SUCK);
|
||||
item = CreatePlayerItem(PLAYER_ITEM_GUST, 0, 0, 0);
|
||||
if (item) {
|
||||
item->parent = player;
|
||||
item->parent = &player->base;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
@@ -119,9 +119,9 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
UpdateItemAnim(this);
|
||||
if ((gPlayerState.flags & PL_FLAGS2))
|
||||
return;
|
||||
gPlayerEntity.direction =
|
||||
DirectionTurnAround(Direction8FromAnimationState(gPlayerEntity.animationState));
|
||||
gPlayerEntity.speed = 0x80;
|
||||
gPlayerEntity.base.direction =
|
||||
DirectionTurnAround(Direction8FromAnimationState(gPlayerEntity.base.animationState));
|
||||
gPlayerEntity.base.speed = 0x80;
|
||||
UpdatePlayerMovement();
|
||||
|
||||
return;
|
||||
@@ -137,7 +137,7 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
UpdateItemAnim(this);
|
||||
if (this->playerFrame & 1) {
|
||||
gPlayerState.field_0x1c = 5;
|
||||
gPlayerEntity.field_0x70.WORD = 0;
|
||||
gPlayerEntity.unk_70 = NULL;
|
||||
if (gPlayerState.gustJarSpeed) {
|
||||
CreatePlayerItem(PLAYER_ITEM_GUST_BIG, 0, 0, 0);
|
||||
}
|
||||
@@ -145,8 +145,9 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
|
||||
if (gPlayerState.flags & PL_FLAGS2)
|
||||
return;
|
||||
gPlayerEntity.direction = DirectionTurnAround(Direction8FromAnimationState(gPlayerEntity.animationState));
|
||||
gPlayerEntity.speed = 0x80;
|
||||
gPlayerEntity.base.direction =
|
||||
DirectionTurnAround(Direction8FromAnimationState(gPlayerEntity.base.animationState));
|
||||
gPlayerEntity.base.speed = 0x80;
|
||||
UpdatePlayerMovement();
|
||||
return;
|
||||
case 6:
|
||||
@@ -169,7 +170,7 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
|
||||
break;
|
||||
}
|
||||
gPlayerState.field_0x1c = 0;
|
||||
gPlayerEntity.field_0x70.WORD = 0;
|
||||
gPlayerEntity.unk_70 = NULL;
|
||||
DeleteItemBehavior(this, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ void ItemJarEmpty(ItemBehavior* this, u32 index) {
|
||||
void sub_08077534(ItemBehavior* this, u32 index) {
|
||||
u32 tmp;
|
||||
sub_08077D38(this, index);
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
sub_08077BB8(this);
|
||||
this->priority |= 0xf;
|
||||
tmp = this->behaviorId;
|
||||
@@ -41,8 +41,8 @@ void sub_08077534(ItemBehavior* this, u32 index) {
|
||||
case ITEM_BOTTLE_PICOLYTE_BLUE:
|
||||
case ITEM_BOTTLE_PICOLYTE_WHITE:
|
||||
this->stateID = 3;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.spriteSettings.flipX = 0;
|
||||
gPlayerEntity.base.animationState = 4;
|
||||
gPlayerEntity.base.spriteSettings.flipX = 0;
|
||||
SetItemAnim(this, ANIM_BOTTLE_DRINK);
|
||||
break;
|
||||
case BOTTLE_CHARM_NAYRU:
|
||||
@@ -53,7 +53,7 @@ void sub_08077534(ItemBehavior* this, u32 index) {
|
||||
SetItemAnim(this, ANIM_BOTTLE_POUR);
|
||||
break;
|
||||
}
|
||||
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
||||
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
|
||||
}
|
||||
|
||||
void sub_08077618(ItemBehavior* this, u32 index) {
|
||||
@@ -68,7 +68,7 @@ void sub_08077618(ItemBehavior* this, u32 index) {
|
||||
void sub_08077640(ItemBehavior* this, u32 index) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||
gPlayerEntity.base.flags |= ENT_COLLIDE;
|
||||
DeleteItemBehavior(this, index);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void sub_08077640(ItemBehavior* this, u32 index) {
|
||||
void sub_0807766C(ItemBehavior* this, u32 index) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||
gPlayerEntity.base.flags |= ENT_COLLIDE;
|
||||
DeleteItemBehavior(this, index);
|
||||
}
|
||||
}
|
||||
|
||||
+18
-18
@@ -1,8 +1,8 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "object.h"
|
||||
#include "game.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
#include "sound.h"
|
||||
|
||||
extern s8 gUnk_08126EEC[];
|
||||
extern Entity* CreatePlayerItemForItemIfNotExists(ItemBehavior*);
|
||||
@@ -37,13 +37,13 @@ void sub_08075A0C(ItemBehavior* this, u32 index) {
|
||||
this->priority |= 0x80;
|
||||
sub_08077D38(this, index);
|
||||
CreatePlayerItemForItemIfNotExists(this);
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
this->behaviorId = 0x10;
|
||||
ForceEquipItem(ITEM_LANTERN_ON, equipSlot);
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
object = CreateObjectWithParent(&gPlayerEntity, LAMP_PARTICLE, 1, 0);
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.base.animationState & 6];
|
||||
object = CreateObjectWithParent(&gPlayerEntity.base, LAMP_PARTICLE, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
object->spriteVramOffset = gPlayerEntity.base.spriteVramOffset;
|
||||
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
|
||||
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
|
||||
}
|
||||
@@ -88,19 +88,19 @@ void sub_08075B54(ItemBehavior* this, u32 index) {
|
||||
DeleteItemBehavior(this, index);
|
||||
SoundReq(SFX_ITEM_LANTERN_OFF);
|
||||
} else {
|
||||
if (((gPlayerState.queued_action != PLAYER_ROLL) && (gPlayerEntity.frameIndex < 0x37)) &&
|
||||
((u16)gPlayerEntity.spriteIndex == 6)) {
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
if (((gPlayerState.queued_action != PLAYER_ROLL) && (gPlayerEntity.base.frameIndex < 0x37)) &&
|
||||
((u16)gPlayerEntity.base.spriteIndex == 6)) {
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.base.animationState & 6];
|
||||
|
||||
if ((gPlayerState.jump_status == 0) &&
|
||||
(sub_080B1BA4(TILE(gPlayerEntity.x.HALF.HI + tmp[0], gPlayerEntity.y.HALF.HI + tmp[1]),
|
||||
gPlayerEntity.collisionLayer, 0x40) != 0)) {
|
||||
(sub_080B1BA4(TILE(gPlayerEntity.base.x.HALF.HI + tmp[0], gPlayerEntity.base.y.HALF.HI + tmp[1]),
|
||||
gPlayerEntity.base.collisionLayer, 0x40) != 0)) {
|
||||
this->animPriority = 0xf;
|
||||
this->stateID++;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
object = CreateObjectWithParent(&gPlayerEntity, LAMP_PARTICLE, 1, 0);
|
||||
gPlayerEntity.unk_7a = 2;
|
||||
object = CreateObjectWithParent(&gPlayerEntity.base, LAMP_PARTICLE, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
object->spriteVramOffset = gPlayerEntity.base.spriteVramOffset;
|
||||
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
|
||||
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
|
||||
}
|
||||
@@ -119,8 +119,8 @@ void sub_08075C9C(ItemBehavior* this, u32 index) {
|
||||
|
||||
UpdateItemAnim(this);
|
||||
if ((this->playerFrame & 0x10) != 0) {
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
sub_0807AB44(&gPlayerEntity, tmp[0], tmp[1]);
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.base.animationState & 6];
|
||||
sub_0807AB44(&gPlayerEntity.base, tmp[0], tmp[1]);
|
||||
}
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
this->animPriority = 0;
|
||||
@@ -128,6 +128,6 @@ void sub_08075C9C(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.field_0xa = (~(8 >> index)) & gPlayerState.field_0xa;
|
||||
gPlayerState.keepFacing = (~(8 >> index)) & gPlayerState.keepFacing;
|
||||
} else {
|
||||
gPlayerEntity.field_0x7a.HWORD++;
|
||||
gPlayerEntity.unk_7a++;
|
||||
}
|
||||
}
|
||||
|
||||
+28
-28
@@ -38,10 +38,10 @@ void sub_08077130(ItemBehavior* this, u32 index) {
|
||||
SetItemAnim(this, ANIM_MOLEMITTS_DIG);
|
||||
this->stateID = 2;
|
||||
if (iVar1 == 0x56) {
|
||||
if ((gPlayerEntity.animationState & 2) != 0) {
|
||||
gPlayerEntity.y.HALF.HI = (gPlayerEntity.y.HALF.HI & 0xfff0) | 6;
|
||||
if ((gPlayerEntity.base.animationState & 2) != 0) {
|
||||
gPlayerEntity.base.y.HALF.HI = (gPlayerEntity.base.y.HALF.HI & 0xfff0) | 6;
|
||||
} else {
|
||||
gPlayerEntity.x.HALF.HI = (gPlayerEntity.x.HALF.HI & 0xfff0) | 8;
|
||||
gPlayerEntity.base.x.HALF.HI = (gPlayerEntity.base.x.HALF.HI & 0xfff0) | 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,22 +68,22 @@ void sub_080771C8(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.moleMittsState = 0;
|
||||
} else {
|
||||
if (((this->playerFrame & 0x20) != 0) && (this->subtimer == 0xff)) {
|
||||
CreateObjectWithParent(&gPlayerEntity, MOLE_MITTS_PARTICLE, this->playerFrame, 1);
|
||||
CreateObjectWithParent(&gPlayerEntity.base, MOLE_MITTS_PARTICLE, this->playerFrame, 1);
|
||||
}
|
||||
if ((this->playerFrame & 0x10) != 0) {
|
||||
if (sub_0800875A(&gPlayerEntity, 0xd, this) == 0) {
|
||||
if (sub_0800875A(&gPlayerEntity.base, 0xd, this) == 0) {
|
||||
SetItemAnim(this, ANIM_MOLEMITTS_MISS);
|
||||
this->stateID = 3;
|
||||
SoundReq(SFX_ITEM_GLOVES_AIR);
|
||||
} else {
|
||||
if (this->subtimer != 0xff) {
|
||||
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_1F, 0, this->field_0x2[1]);
|
||||
object = CreateObjectWithParent(&gPlayerEntity.base, OBJECT_1F, 0, this->field_0x2[1]);
|
||||
if (object != NULL) {
|
||||
object->timer = this->timer;
|
||||
object->subtimer = this->subtimer;
|
||||
object->animationState = gPlayerEntity.animationState & 6;
|
||||
gPlayerEntity.frame = 0;
|
||||
gPlayerEntity.frameDuration = gUnk_0811BE14[this->subtimer];
|
||||
object->animationState = gPlayerEntity.base.animationState & 6;
|
||||
gPlayerEntity.base.frame = 0;
|
||||
gPlayerEntity.base.frameDuration = gUnk_0811BE14[this->subtimer];
|
||||
}
|
||||
} else {
|
||||
if ((this->field_0x2[1] == 0x0f) && (this->timer == 0x17)) {
|
||||
@@ -111,22 +111,22 @@ void sub_080772A8(ItemBehavior* this, u32 index) {
|
||||
if (GetInventoryValue(ITEM_DIG_BUTTERFLY) == 1) {
|
||||
if ((this->playerFrame & 7) != 3) {
|
||||
sub_08077E3C(this, 2);
|
||||
gPlayerEntity.speed = gUnk_0811BE16[this->playerFrame & 7] << 1;
|
||||
gPlayerEntity.base.speed = gUnk_0811BE16[this->playerFrame & 7] << 1;
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
gPlayerEntity.speed = gUnk_0811BE16[this->playerFrame & 7];
|
||||
gPlayerEntity.base.speed = gUnk_0811BE16[this->playerFrame & 7];
|
||||
}
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
gPlayerEntity.speed = gUnk_0811BE16[this->playerFrame & 7];
|
||||
gPlayerEntity.base.speed = gUnk_0811BE16[this->playerFrame & 7];
|
||||
}
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
|
||||
if (gPlayerEntity.speed != 0) {
|
||||
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
|
||||
if (gPlayerEntity.base.speed != 0) {
|
||||
UpdatePlayerMovement();
|
||||
}
|
||||
if ((this->playerFrame & 0x10) != 0) {
|
||||
if (this->timer != 0) {
|
||||
gPlayerEntity.frameDuration = 1;
|
||||
gPlayerEntity.base.frameDuration = 1;
|
||||
if (sub_080774A0()) {
|
||||
this->timer = 0;
|
||||
return;
|
||||
@@ -136,21 +136,21 @@ void sub_080772A8(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.moleMittsState = 0;
|
||||
} else {
|
||||
if ((this->playerFrame & 0x60) != 0) {
|
||||
gPlayerEntity.frameDuration = 1;
|
||||
if (sub_0807B5B0(&gPlayerEntity)) {
|
||||
gPlayerEntity.base.frameDuration = 1;
|
||||
if (sub_0807B5B0(&gPlayerEntity.base)) {
|
||||
SoundReq(SFX_108);
|
||||
CreateObjectWithParent(&gPlayerEntity, MOLE_MITTS_PARTICLE, this->playerFrame, 0);
|
||||
CreateObjectWithParent(&gPlayerEntity.base, MOLE_MITTS_PARTICLE, this->playerFrame, 0);
|
||||
} else {
|
||||
SetItemAnim(this, ANIM_MOLEMITTS_CLANG);
|
||||
effect = CreateFx(&gPlayerEntity, FX_STARS_STRIKE, 0);
|
||||
effect = CreateFx(&gPlayerEntity.base, FX_STARS_STRIKE, 0);
|
||||
if (effect != NULL) {
|
||||
effect->animationState = this->playerAnimationState;
|
||||
effect->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
|
||||
effect->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
|
||||
}
|
||||
effect = CreateFx(&gPlayerEntity, FX_STARS_STRIKE, 0);
|
||||
effect = CreateFx(&gPlayerEntity.base, FX_STARS_STRIKE, 0);
|
||||
if (effect != NULL) {
|
||||
effect->animationState = this->playerAnimationState;
|
||||
effect->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
|
||||
effect->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
|
||||
effect->subtimer = 1;
|
||||
}
|
||||
this->stateID = 3;
|
||||
@@ -162,8 +162,8 @@ void sub_080772A8(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
|
||||
void sub_08077448(ItemBehavior* this, u32 index) {
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2 ^ 0x10;
|
||||
gPlayerEntity.speed = 0x100;
|
||||
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2 ^ 0x10;
|
||||
gPlayerEntity.base.speed = 0x100;
|
||||
if (((this->playerFrame & 1) != 0) && (this->field_0x5 != 0)) {
|
||||
UpdatePlayerMovement();
|
||||
}
|
||||
@@ -179,16 +179,16 @@ s32 sub_080774A0(void) {
|
||||
u32 collisionData;
|
||||
u32 metaTilePos;
|
||||
|
||||
metaTilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity), -gUnk_0811BE1E[gPlayerEntity.animationState & 6],
|
||||
-gUnk_0811BE1E[(gPlayerEntity.animationState & 6) + 1]);
|
||||
metaTilePos = COORD_TO_TILE_OFFSET((&gPlayerEntity.base), -gUnk_0811BE1E[gPlayerEntity.base.animationState & 6],
|
||||
-gUnk_0811BE1E[(gPlayerEntity.base.animationState & 6) + 1]);
|
||||
|
||||
collisionData = GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.collisionLayer);
|
||||
collisionData = GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer);
|
||||
|
||||
if (collisionData > 0x16)
|
||||
return 0;
|
||||
if (collisionData < 0xf)
|
||||
return 0;
|
||||
if (GetVvvAtMetaTilePos(metaTilePos, gPlayerEntity.collisionLayer) != VVV_86) {
|
||||
if (GetVvvAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer) != VVV_86) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0x56;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void ResetPlayerVelocity(void);
|
||||
extern void CreateBird(Entity*);
|
||||
@@ -13,7 +13,7 @@ void ItemOcarina(ItemBehavior* this, u32 index) {
|
||||
OcarinaUpdate,
|
||||
};
|
||||
gOcarinaStates[this->stateID](this, index);
|
||||
gPlayerEntity.field_0x7a.HWORD++;
|
||||
gPlayerEntity.unk_7a++;
|
||||
}
|
||||
|
||||
void OcarinaUse(ItemBehavior* this, u32 index) {
|
||||
@@ -21,10 +21,10 @@ void OcarinaUse(ItemBehavior* this, u32 index) {
|
||||
DeleteItemBehavior(this, index);
|
||||
} else {
|
||||
this->priority |= 0xf;
|
||||
gPlayerEntity.animationState = 0x04;
|
||||
gPlayerEntity.spriteSettings.flipX = 0;
|
||||
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerEntity.base.animationState = 0x04;
|
||||
gPlayerEntity.base.spriteSettings.flipX = 0;
|
||||
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
|
||||
gPlayerEntity.unk_7a = 2;
|
||||
gPlayerState.flags |= PL_USE_OCARINA;
|
||||
gPlayerState.field_0x27[0] = -1;
|
||||
gPauseMenuOptions.disabled = 1;
|
||||
@@ -40,11 +40,11 @@ void OcarinaUse(ItemBehavior* this, u32 index) {
|
||||
void OcarinaUpdate(ItemBehavior* this, u32 index) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||
gPlayerEntity.base.flags |= ENT_COLLIDE;
|
||||
gPlayerState.flags &= ~PL_USE_OCARINA;
|
||||
gPlayerState.field_0x27[0] = 0;
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
CreateBird(&gPlayerEntity);
|
||||
CreateBird(&gPlayerEntity.base);
|
||||
ResetPlayerEventPriority();
|
||||
DeleteItemBehavior(this, index);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ void ItemPacciCane(ItemBehavior* this, u32 index) {
|
||||
void sub_08076C98(ItemBehavior* this, u32 index) {
|
||||
this->priority |= 0xf;
|
||||
sub_08077D38(this, index);
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
sub_08077BB8(this);
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -1,11 +1,11 @@
|
||||
#include "asm.h"
|
||||
#include "item.h"
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
#include "effects.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "save.h"
|
||||
#include "item.h"
|
||||
#include "playeritem.h"
|
||||
#include "save.h"
|
||||
#include "sound.h"
|
||||
|
||||
void sub_08076964(ItemBehavior*, u32);
|
||||
void sub_080768F8(ItemBehavior*, u32);
|
||||
@@ -24,7 +24,7 @@ void ItemPegasusBoots(ItemBehavior* this, u32 index) {
|
||||
Entity* fx;
|
||||
u32 uVar4;
|
||||
|
||||
if (gPlayerEntity.field_0x7a.HWORD != 0) {
|
||||
if (gPlayerEntity.unk_7a != 0) {
|
||||
gPlayerState.dash_state = 0;
|
||||
gPlayerState.itemAnimPriority = 0;
|
||||
DeleteItemBehavior(this, index);
|
||||
@@ -35,11 +35,11 @@ void ItemPegasusBoots(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
if (((gPlayerState.flags & PL_MINISH) == 0) && ((this->timer & 7) == 0)) {
|
||||
if (gPlayerState.floor_type == SURFACE_SWAMP) {
|
||||
if (gPlayerEntity.spriteOffsetY == 0) {
|
||||
CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0);
|
||||
if (gPlayerEntity.base.spriteOffsetY == 0) {
|
||||
CreateFx(&gPlayerEntity.base, FX_GREEN_SPLASH, 0);
|
||||
}
|
||||
} else {
|
||||
fx = CreateFx(&gPlayerEntity, FX_DASH, 0x40);
|
||||
fx = CreateFx(&gPlayerEntity.base, FX_DASH, 0x40);
|
||||
if ((fx != NULL) && (fx->y.HALF.HI = fx->y.HALF.HI + 2, this->stateID != 2)) {
|
||||
uVar4 = Random() & 3;
|
||||
if ((Random() & 1) != 0) {
|
||||
@@ -85,7 +85,7 @@ void sub_080768F8(ItemBehavior* this, u32 index) {
|
||||
void sub_08076964(ItemBehavior* this, u32 index) {
|
||||
Entity* entity;
|
||||
u32 uVar3;
|
||||
if (IsItemActive(this) && gPlayerEntity.z.WORD == 0 && gPlayerState.dash_state) {
|
||||
if (IsItemActive(this) && gPlayerEntity.base.z.WORD == 0 && gPlayerState.dash_state) {
|
||||
UpdateItemAnim(this);
|
||||
|
||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||
@@ -107,12 +107,12 @@ void sub_08076964(ItemBehavior* this, u32 index) {
|
||||
SetItemAnim(this, ANIM_DASH);
|
||||
entity = CreatePlayerItemWithParent(this, PLAYER_ITEM_DASH_SWORD);
|
||||
if (entity != NULL) {
|
||||
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != 0) {
|
||||
uVar3 = gSave.stats.itemButtons[SLOT_A];
|
||||
if (ItemIsSword(gSave.stats.equipped[SLOT_A]) != 0) {
|
||||
uVar3 = gSave.stats.equipped[SLOT_A];
|
||||
} else {
|
||||
uVar3 = gSave.stats.itemButtons[SLOT_B];
|
||||
uVar3 = gSave.stats.equipped[SLOT_B];
|
||||
}
|
||||
entity->field_0x68.HALF.LO = uVar3;
|
||||
((GenericEntity*)entity)->field_0x68.HALF.LO = uVar3;
|
||||
return;
|
||||
}
|
||||
} else if (!(gPlayerState.flags & PL_MINISH)) {
|
||||
@@ -137,16 +137,16 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
|
||||
|
||||
if ((IsItemActive(this) != 0) && (gPlayerState.dash_state != 0)) {
|
||||
if (!(gPlayerState.flags & PL_MINISH)) {
|
||||
gPlayerEntity.speed = 0x300;
|
||||
gPlayerEntity.base.speed = 0x300;
|
||||
} else {
|
||||
gPlayerEntity.speed = 0x280;
|
||||
gPlayerEntity.base.speed = 0x280;
|
||||
}
|
||||
uVar2 = gUnk_0800275C[(gPlayerEntity.animationState & 0xe) * 4];
|
||||
if (uVar2 == (gPlayerEntity.collisions & uVar2)) {
|
||||
uVar2 = gUnk_0800275C[(gPlayerEntity.base.animationState & 0xe) * 4];
|
||||
if (uVar2 == (gPlayerEntity.base.collisions & uVar2)) {
|
||||
if (this->subtimer != 0) {
|
||||
gPlayerEntity.action = PLAYER_BOUNCE;
|
||||
gPlayerEntity.subAction = 0;
|
||||
COLLISION_OFF(&gPlayerEntity);
|
||||
gPlayerEntity.base.action = PLAYER_BOUNCE;
|
||||
gPlayerEntity.base.subAction = 0;
|
||||
COLLISION_OFF(&gPlayerEntity.base);
|
||||
gPlayerState.field_0x38 = 0;
|
||||
gPlayerState.direction = DIR_NONE;
|
||||
return;
|
||||
@@ -155,7 +155,7 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
|
||||
return;
|
||||
}
|
||||
ptr = gUnk_0811BE38;
|
||||
if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) {
|
||||
if ((*(u16*)&ptr[(gPlayerEntity.base.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) {
|
||||
this->direction = (this->playerAnimationState & 0xe) * 4;
|
||||
if ((gPlayerState.direction != DIR_NONE) && (gPlayerState.direction != this->direction)) {
|
||||
if (((gPlayerState.direction - this->direction) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast |
|
||||
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
|
||||
void sub_08076758(ItemBehavior*, u32);
|
||||
extern void sub_08077F84(void);
|
||||
@@ -14,16 +14,16 @@ void ItemRocsCape(ItemBehavior* this, u32 index) {
|
||||
if (gPlayerState.grab_status) {
|
||||
if (((gPlayerState.attack_status | gPlayerState.heldObject) == 0) &&
|
||||
(((gPlayerState.floor_type != SURFACE_DOOR && (gPlayerState.floor_type != SURFACE_PIT)) ||
|
||||
((gPlayerEntity.z.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
|
||||
((gPlayerEntity.base.z.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
|
||||
if ((gPlayerState.jump_status == 0) || ((gPlayerState.jump_status & 7) == 3)) {
|
||||
if (-1 < gPlayerEntity.z.WORD) {
|
||||
if (-1 < gPlayerEntity.base.z.WORD) {
|
||||
gPlayerState.grab_status = 0;
|
||||
this->stateID++;
|
||||
gPlayerState.keepFacing = 0;
|
||||
gPlayerState.jump_status = 1;
|
||||
gPlayerState.itemAnimPriority = -1;
|
||||
gPlayerState.item = NULL;
|
||||
gPlayerEntity.zVelocity = Q_16_16(2.0);
|
||||
gPlayerEntity.base.zVelocity = Q_16_16(2.0);
|
||||
sub_08077F84();
|
||||
SoundReq(SFX_PLY_VO4);
|
||||
return;
|
||||
@@ -38,13 +38,13 @@ void ItemRocsCape(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.moleMittsState) == 0) &&
|
||||
((((gPlayerState.floor_type != SURFACE_DOOR && gPlayerState.floor_type != SURFACE_DOOR_13 &&
|
||||
gPlayerState.floor_type != SURFACE_PIT) ||
|
||||
(gPlayerEntity.z.WORD != 0)) ||
|
||||
(gPlayerEntity.base.z.WORD != 0)) ||
|
||||
(gPlayerState.field_0x14 != 0)))) {
|
||||
if ((gPlayerState.jump_status != 0) && ((gPlayerState.jump_status & 7) != 3)) {
|
||||
sub_08076758(this, index);
|
||||
return;
|
||||
} else if (gPlayerEntity.z.WORD >= 0) {
|
||||
gPlayerEntity.zVelocity = Q_16_16(2.0);
|
||||
} else if (gPlayerEntity.base.z.WORD >= 0) {
|
||||
gPlayerEntity.base.zVelocity = Q_16_16(2.0);
|
||||
gPlayerState.jump_status = 1;
|
||||
gPlayerState.item = NULL;
|
||||
this->stateID++;
|
||||
@@ -64,20 +64,20 @@ void sub_08076758(ItemBehavior* this, u32 index) {
|
||||
((gPlayerState.jump_status & 7) != 3)) {
|
||||
if (IsItemActive(this)) {
|
||||
if (this->stateID < 2) {
|
||||
if ((gPlayerEntity.zVelocity <= 0) && ((gPlayerState.jump_status & 0x10) == 0)) {
|
||||
if ((gPlayerEntity.base.zVelocity <= 0) && ((gPlayerState.jump_status & 0x10) == 0)) {
|
||||
this->stateID = 2;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerEntity.zVelocity = Q_16_16(2.0);
|
||||
gPlayerEntity.unk_7a = 2;
|
||||
gPlayerEntity.base.zVelocity = Q_16_16(2.0);
|
||||
gPlayerState.jump_status |= 0x10;
|
||||
gPlayerState.animation = ANIM_ROCS_CAPE;
|
||||
SoundReq(SFX_172);
|
||||
}
|
||||
} else {
|
||||
gPlayerEntity.field_0x7a.HWORD++;
|
||||
gPlayerEntity.unk_7a++;
|
||||
}
|
||||
} else {
|
||||
if (this->stateID > 1) {
|
||||
gPlayerEntity.field_0x7a.HWORD++;
|
||||
gPlayerEntity.unk_7a++;
|
||||
gPlayerState.jump_status &= 0xef;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ void ItemShield(ItemBehavior* this, u32 index) {
|
||||
void sub_08076D04(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.shield_status = 0x81;
|
||||
this->priority = 2;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
sub_08077D38(this, index);
|
||||
sub_08077BB8(this);
|
||||
}
|
||||
|
||||
+16
-16
@@ -38,8 +38,8 @@ void sub_08075338(ItemBehavior* this, u32 index) {
|
||||
|
||||
if (gPlayerState.jump_status) {
|
||||
if ((gPlayerState.jump_status & 7) != 3) {
|
||||
if ((gPlayerState.jump_status & 0x78) == 0 && (u32)gPlayerEntity.zVelocity < Q_16_16(1.5) &&
|
||||
(gPlayerState.skills & SKILL_DOWN_THRUST) && gPlayerEntity.z.WORD != 0) {
|
||||
if ((gPlayerState.jump_status & 0x78) == 0 && (u32)gPlayerEntity.base.zVelocity < Q_16_16(1.5) &&
|
||||
(gPlayerState.skills & SKILL_DOWN_THRUST) && gPlayerEntity.base.z.WORD != 0) {
|
||||
gPlayerState.jump_status |= 0x20;
|
||||
gPlayerState.lastSwordMove = SWORD_MOVE_DOWN_THRUST;
|
||||
gPlayerState.attack_status |= (8 >> index) | ((8 >> index) << 4);
|
||||
@@ -52,7 +52,7 @@ void sub_08075338(ItemBehavior* this, u32 index) {
|
||||
#ifndef EU
|
||||
sub_080759B8(this, index);
|
||||
return;
|
||||
} else if (gPlayerEntity.z.WORD) {
|
||||
} else if (gPlayerEntity.base.z.WORD) {
|
||||
#endif
|
||||
sub_080759B8(this, index);
|
||||
return;
|
||||
@@ -87,7 +87,7 @@ void sub_08075338(ItemBehavior* this, u32 index) {
|
||||
|
||||
if ((gPlayerState.sword_state & 0x80) == 0) {
|
||||
gPlayerState.sword_state = 0;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
}
|
||||
|
||||
if (gPlayerState.item) {
|
||||
@@ -112,7 +112,7 @@ void sub_080754B8(ItemBehavior* this, u32 index) {
|
||||
this->priority &= ~0x80;
|
||||
}
|
||||
|
||||
if (gPlayerEntity.frameSpriteSettings & 1) {
|
||||
if (gPlayerEntity.base.frameSpriteSettings & 1) {
|
||||
swordBeam = GetSwordBeam();
|
||||
if (swordBeam && FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_SWORD_BEAM1, 2) == 0) {
|
||||
CreatePlayerItemWithParent(this, PLAYER_ITEM_SWORD_BEAM1);
|
||||
@@ -198,7 +198,7 @@ void sub_08075694(ItemBehavior* this, u32 index) {
|
||||
gPlayerState.field_0xa = (8 >> index) | gPlayerState.field_0xa;
|
||||
this->stateID = 4;
|
||||
this->animPriority = 6;
|
||||
gPlayerEntity.hurtType = 0x1e;
|
||||
gPlayerEntity.base.hurtType = 0x1e;
|
||||
gPlayerState.sword_state |= 0x40;
|
||||
gPlayerState.sword_state &= 0xdf;
|
||||
if ((gPlayerState.chargeState.action == 4) && ((gPlayerState.flags & PL_CLONING) == 0)) {
|
||||
@@ -223,8 +223,8 @@ void sub_08075738(ItemBehavior* this, u32 index) {
|
||||
if (!(gPlayerState.direction & DIR_NOT_MOVING_CHECK)) {
|
||||
this->direction = gPlayerState.direction;
|
||||
}
|
||||
gPlayerEntity.direction = this->direction;
|
||||
gPlayerEntity.speed = 0x180;
|
||||
gPlayerEntity.base.direction = this->direction;
|
||||
gPlayerEntity.base.speed = 0x180;
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
bVar6 = 10;
|
||||
if ((gPlayerState.skills & SKILL_LONG_SPIN) != 0) {
|
||||
@@ -236,19 +236,19 @@ void sub_08075738(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (((((gPlayerEntity.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
if (((((gPlayerEntity.base.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
((gPlayerState.skills & SKILL_FOURSWORD) != 0))) {
|
||||
Entity* bombEnt = CreatePlayerItemWithParent(this, PLAYER_ITEM_SPIRAL_BEAM);
|
||||
if (bombEnt) {
|
||||
bombEnt->animationState = (gPlayerEntity.animationState & 6) | 0x80;
|
||||
bombEnt->animationState = (gPlayerEntity.base.animationState & 6) | 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
if ((((gPlayerEntity.frameSpriteSettings & 2) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
if ((((gPlayerEntity.base.frameSpriteSettings & 2) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
(((gPlayerState.skills & SKILL_GREAT_SPIN) != 0 && (--this->timer != 0)))) {
|
||||
gPlayerState.sword_state |= 0x10;
|
||||
gPlayerState.lastSwordMove = SWORD_MOVE_GREAT_SPIN;
|
||||
this->direction = gPlayerEntity.animationState << 2;
|
||||
this->direction = gPlayerEntity.base.animationState << 2;
|
||||
this->timer = 1;
|
||||
this->subtimer = 1;
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> index);
|
||||
@@ -300,11 +300,11 @@ void sub_08075900(ItemBehavior* this, u32 index) {
|
||||
if (--this->timer == 0) {
|
||||
SetItemAnim(this, ANIM_ROLLATTACK_END);
|
||||
}
|
||||
gPlayerEntity.direction = (gPlayerEntity.animationState >> 1) << 3;
|
||||
gPlayerEntity.speed = 0x300;
|
||||
gPlayerEntity.base.direction = (gPlayerEntity.base.animationState >> 1) << 3;
|
||||
gPlayerEntity.base.speed = 0x300;
|
||||
UpdatePlayerMovement();
|
||||
if ((gRoomTransition.frameCount & 3) == 0) {
|
||||
CreateFx(&gPlayerEntity, FX_DASH, 0x40);
|
||||
CreateFx(&gPlayerEntity.base, FX_DASH, 0x40);
|
||||
}
|
||||
} else {
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
@@ -318,7 +318,7 @@ void sub_08075900(ItemBehavior* this, u32 index) {
|
||||
|
||||
void sub_080759B8(ItemBehavior* this, u32 index) {
|
||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||
gPlayerEntity.hurtType = 0;
|
||||
gPlayerEntity.base.hurtType = 0;
|
||||
}
|
||||
gPlayerState.flags &= ~PL_SWORD_THRUST;
|
||||
gPlayerState.sword_state = 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "item.h"
|
||||
#include "playeritem.h"
|
||||
#include "sound.h"
|
||||
|
||||
u32 sub_08077F64(ItemBehavior* arg0, u32 index);
|
||||
u32 sub_080789A8(void);
|
||||
@@ -38,9 +38,9 @@ void sub_08076088(ItemBehavior* this, Entity* param_2, u32 param_3) {
|
||||
gPlayerState.framestate = 4;
|
||||
this->stateID = 2;
|
||||
this->animPriority = 0xf;
|
||||
if ((gPlayerEntity.field_0x78.HALF.HI & 0x80)) {
|
||||
gPlayerEntity.field_0x78.HALF.HI = 0;
|
||||
COLLISION_ON(&gPlayerEntity);
|
||||
if ((gPlayerEntity.unk_79 & 0x80)) {
|
||||
gPlayerEntity.unk_79 = 0;
|
||||
COLLISION_ON(&gPlayerEntity.base);
|
||||
gPlayerState.heldObject = 4;
|
||||
gPlayerState.keepFacing = ~(8 >> param_3) & gPlayerState.keepFacing;
|
||||
gPlayerState.field_0xa = ~(8 >> param_3) & gPlayerState.field_0xa;
|
||||
@@ -55,11 +55,11 @@ void sub_08076088(ItemBehavior* this, Entity* param_2, u32 param_3) {
|
||||
if (param_2 == NULL) {
|
||||
PlayerCancelHoldItem(this, param_3);
|
||||
} else {
|
||||
Entity* playerEnt = &gPlayerEntity;
|
||||
*(Entity**)&playerEnt->field_0x74 = param_2;
|
||||
playerEnt->subtimer = 0;
|
||||
PlayerEntity* playerEnt = &gPlayerEntity;
|
||||
playerEnt->unk_74 = param_2;
|
||||
playerEnt->base.subtimer = 0;
|
||||
param_2->child = this->field_0x18;
|
||||
param_2->carryFlags = playerEnt->carryFlags;
|
||||
param_2->carryFlags = playerEnt->base.carryFlags;
|
||||
param_2->parent = (Entity*)this;
|
||||
this->field_0x18 = param_2;
|
||||
param_2->type2 = this->field_0x2[1];
|
||||
@@ -86,7 +86,7 @@ void ItemPickupCheck(ItemBehavior* this, u32 index) {
|
||||
|
||||
if (gPlayerState.attack_status == 0 &&
|
||||
(gPlayerState.jump_status == 0 || (gPlayerState.flags & (PL_BUSY | PL_FALLING | PL_IN_MINECART)) != 0) &&
|
||||
(gPlayerState.grab_status = gPlayerEntity.animationState | 0x80, gPlayerEntity.iframes <= 8)) {
|
||||
(gPlayerState.grab_status = gPlayerEntity.base.animationState | 0x80, gPlayerEntity.base.iframes <= 8)) {
|
||||
|
||||
switch (sub_080789A8()) {
|
||||
case 2:
|
||||
@@ -142,10 +142,10 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gPlayerEntity.iframes < 9 && gPlayerEntity.knockbackDuration == 0) {
|
||||
if (gPlayerEntity.base.iframes < 9 && gPlayerEntity.base.knockbackDuration == 0) {
|
||||
if (this->field_0x18 != NULL) {
|
||||
if (this->field_0x18->action == 2 && this->field_0x18->subAction == 5) {
|
||||
if (!(gPlayerState.playerInput.heldInput & PLAYER_INPUT_80)) { // Pressing R
|
||||
if (!(gPlayerState.playerInput.heldInput & INPUT_ACTION)) { // Pressing R
|
||||
this->field_0x18->subAction = 6;
|
||||
PlayerCancelHoldItem(this, index);
|
||||
return;
|
||||
@@ -168,10 +168,10 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
|
||||
|
||||
if (!gPlayerState.jump_status) {
|
||||
|
||||
if (gPlayerState.heldObject == 1 && sub_0800875A(&gPlayerEntity, 6, this) != 0) {
|
||||
if (gPlayerState.heldObject == 1 && sub_0800875A(&gPlayerEntity.base, 6, this) != 0) {
|
||||
sub_08076088(this, NULL, index);
|
||||
return;
|
||||
} else if (gUnk_0811BE38[gPlayerEntity.animationState >> 1] & gPlayerState.playerInput.heldInput) {
|
||||
} else if (gUnk_0811BE38[gPlayerEntity.base.animationState >> 1] & gPlayerState.playerInput.heldInput) {
|
||||
UpdateItemAnim(this);
|
||||
|
||||
if (!(gPlayerState.flags & PL_NO_CAP)) {
|
||||
@@ -193,9 +193,9 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
|
||||
|
||||
sub_08076088(this, this->field_0x18, index);
|
||||
} else {
|
||||
if (gPlayerState.playerInput.heldInput & gUnk_0811BE40[gPlayerEntity.animationState >> 1]) {
|
||||
if (gPlayerEntity.subtimer < 6) {
|
||||
gPlayerEntity.subtimer++;
|
||||
if (gPlayerState.playerInput.heldInput & gUnk_0811BE40[gPlayerEntity.base.animationState >> 1]) {
|
||||
if (gPlayerEntity.base.subtimer < 6) {
|
||||
gPlayerEntity.base.subtimer++;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
|
||||
SetItemAnim(this, animIndex);
|
||||
}
|
||||
} else {
|
||||
gPlayerEntity.subtimer = 0;
|
||||
gPlayerEntity.base.subtimer = 0;
|
||||
|
||||
if (!(gPlayerState.flags & PL_NO_CAP)) {
|
||||
SetItemAnim(this, ANIM_PULL);
|
||||
@@ -241,7 +241,7 @@ void sub_08076488(ItemBehavior* this, u32 index) {
|
||||
}
|
||||
UpdateItemAnim(this);
|
||||
if ((this->playerFrame & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||
gPlayerEntity.base.flags |= ENT_COLLIDE;
|
||||
gPlayerState.heldObject = 4;
|
||||
bVar1 = ~(8 >> index);
|
||||
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
|
||||
@@ -260,14 +260,14 @@ void sub_08076518(ItemBehavior* this, u32 index) {
|
||||
if (PlayerTryDropObject(this, index)) {
|
||||
gPlayerState.framestate = PL_STATE_HOLD;
|
||||
if ((gPlayerState.jump_status & 0x80) == 0 && gPlayerState.field_0x1f[0] == 0) {
|
||||
if (gPlayerEntity.knockbackDuration != 0) {
|
||||
if (gPlayerEntity.base.knockbackDuration != 0) {
|
||||
PlayerCancelHoldItem(this, index);
|
||||
} else {
|
||||
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_8000 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0) {
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
if ((gPlayerState.playerInput.newInput & (INPUT_LIFT_THROW | INPUT_CANCEL | INPUT_INTERACT)) != 0) {
|
||||
sub_0806F948(&gPlayerEntity.base);
|
||||
gPlayerState.heldObject = 5;
|
||||
this->field_0x18->subAction = 2;
|
||||
this->field_0x18->direction = (gPlayerEntity.animationState & 0xe) << 2;
|
||||
this->field_0x18->direction = (gPlayerEntity.base.animationState & 0xe) << 2;
|
||||
this->field_0x18 = NULL;
|
||||
this->stateID++;
|
||||
this->animPriority = 0x0f;
|
||||
|
||||
Reference in New Issue
Block a user