finish player.c

This commit is contained in:
theo3
2021-12-27 17:14:52 -08:00
parent 079260dbd6
commit 24750a6bb5
89 changed files with 2566 additions and 4879 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ u32* GetLayerByIndex(u32 param_1) {
}
}
void sub_08080964(u32 time, u32 magnitude) {
void InitScreenShake(u32 time, u32 magnitude) {
gRoomControls.screenShakeTime = time;
gRoomControls.screenShakeMagnitude = magnitude & 7;
}
+18 -17
View File
@@ -7,6 +7,7 @@
#include "functions.h"
#include "enemy.h"
#include "effects.h"
#include "object.h"
extern u8 gCollidableCount;
extern u8 gUnk_080B3740[];
@@ -30,7 +31,7 @@ extern ColSettings gCollisionMtx[173 * 34];
extern void gDoCollision(void);
u32 sub_08081420(Entity*);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
s32 sub_08018308(Entity*, Entity*, u32, ColSettings*);
void sub_08079D84(void);
void sub_080180BC(Entity*, Entity*);
@@ -232,7 +233,7 @@ s32 sub_08017874(Entity* a, Entity* b) {
if (newDmg <= 0)
newDmg = 1;
v5 = ModHealth(-newDmg);
sub_0800449C(a, 122);
SoundReqClipped(a, 122);
} else {
v6 = b->damage;
if (b->kind == 8) {
@@ -248,9 +249,9 @@ s32 sub_08017874(Entity* a, Entity* b) {
v5 = a->health - v6;
if (a->kind == 3) {
if ((a->field_0x6c.HALF.HI & 1) != 0)
sub_0800449C(a, 295);
SoundReqClipped(a, 295);
else
sub_0800449C(a, 254);
SoundReqClipped(a, 254);
}
}
if (v5 <= 0) {
@@ -389,11 +390,11 @@ s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
}
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((gPlayerState.flags & (0x1 | 0x80 | 0x400 | 0x1000)) == 0) {
Entity* e = CreateObject(66, 1, 0);
if ((gPlayerState.flags & (PL_BUSY | PL_MINISH | PL_BURNING | 0x1000)) == 0) {
Entity* e = CreateObject(OBJECT_42, 1, 0);
if (e != NULL) {
e->child = org;
gPlayerState.flags |= 0x400;
gPlayerState.flags |= PL_BURNING;
org->animationState = (direction ^ 0x10) >> 2;
}
}
@@ -408,12 +409,12 @@ s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
}
s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((gPlayerState.flags & (0x1 | 0x80 | 0x800 | 0x1000)) == 0 && gPlayerState.playerAction == 0) {
if ((gPlayerState.flags & (PL_BUSY | PL_MINISH | PL_FROZEN | 0x1000)) == 0 && gPlayerState.queued_action == 0) {
if (org->action == 1 || org->action == 24) {
tgt->damage = 4;
org->health = sub_08017874(org, tgt);
gPlayerState.flags = 0x800;
gPlayerState.playerAction = 13;
gPlayerState.flags = PL_FROZEN;
gPlayerState.queued_action = PLAYER_FROZEN;
}
}
org->knockbackDuration = 12;
@@ -533,7 +534,7 @@ s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
if (org == &gPlayerEntity) {
if (sub_08079F8C() &&
#ifdef EU
(gPlayerState.flags & 0x81) == 0 &&
(gPlayerState.flags & (PL_MINISH | PL_BUSY)) == 0 &&
#else
(gPlayerState.flags & PL_MINISH) == 0 &&
#endif
@@ -622,18 +623,18 @@ s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
s32 sub_08018168(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if (tgt->field_0x43 == 0) {
if (org == &gPlayerEntity) {
if (((sub_08079F8C() != 0) &&
if (sub_08079F8C() &&
#ifdef EU
((gPlayerState.flags & 0x81) == 0)) &&
(gPlayerState.flags & (PL_MINISH | PL_BUSY)) == 0 &&
#else
((gPlayerState.flags & 0x40080) == 0)) &&
(gPlayerState.flags & (PL_MINISH | PL_ROLLING)) == 0 &&
#endif
(gPlayerState.swimState == 0)) {
gPlayerState.swimState == 0) {
gPlayerState.field_0x1a[0] |= 0x80;
gPlayerState.field_0xa |= 0x80;
gPlayerState.flags |= 0x100;
gPlayerState.jumpStatus = 0;
gPlayerEntity.flags &= ~0x80;
COLLISION_OFF(&gPlayerEntity);
gPlayerEntity.spriteRendering.b3 = tgt->spriteRendering.b3;
gPlayerEntity.spriteOrientation.flipY = tgt->spriteOrientation.flipY;
gPlayerEntity.iframes = 0xff;
@@ -749,7 +750,7 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
}
} else if (org->id == 3) {
if (settings->_9) {
sub_0800449C(tgt, 254);
SoundReqClipped(tgt, 254);
}
} else if (org->id == 5) {
gPlayerEntity.iframes = 0x80;
+1 -1
View File
@@ -213,7 +213,7 @@ void sub_08021AD8(Entity* this) {
}
void sub_08021B64(Entity* this) {
if (gPlayerState.flags & 4) {
if (gPlayerState.flags & PL_DROWNING) {
this->action = 3;
this->z.WORD = 0;
InitializeAnimation(this, 2);
+4 -4
View File
@@ -21,7 +21,7 @@ void sub_08037A14();
extern void sub_0804A4E4(Entity*, Entity*);
extern Entity* sub_08049DF4(u32);
u32 sub_0804A044(Entity*, Entity*, u32);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern void (*const gGibdo[6])(Entity*);
extern void (*const gUnk_080CF2AC[9])(Entity*);
@@ -347,8 +347,8 @@ void sub_08037A58(Entity* this) {
}
void sub_08037ACC(Entity* this) {
gPlayerState.flags &= 0xFFFFFEFF;
gPlayerEntity.flags |= 0x80;
gPlayerState.flags &= ~0x100;
COLLISION_ON(&gPlayerEntity);
gPlayerEntity.iframes = 0x1e;
gPlayerEntity.knockbackDirection = DirectionFromAnimationState(this->animationState);
gPlayerEntity.knockbackDuration = 4;
@@ -359,7 +359,7 @@ void sub_08037B10(Entity* this) {
u32 h;
gPlayerEntity.iframes = 0xc;
h = ModHealth(-8);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
if (h == 0) {
sub_08037A58(this);
this->field_0x76.HALF.LO = 0xf0;
+1 -1
View File
@@ -186,7 +186,7 @@ void sub_0802BE18(Entity* this) {
void sub_0802BE48(Entity* this) {
if (!sub_080AEFE0(this)) {
sub_0802C218(this);
sub_08080964(8, 0);
InitScreenShake(8, 0);
} else {
GetNextFrame(this);
sub_0802C1CC(this);
+2 -2
View File
@@ -11,7 +11,7 @@ extern void (*const gUnk_080D0418[6])(Entity*);
extern void (*const gUnk_080D0430[3])(Entity*);
extern void (*const gUnk_080D043C[3])(Entity*);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern void sub_0803CE14(Entity*);
extern void sub_0803CE3C(Entity*);
extern void sub_08079D84(void);
@@ -56,7 +56,7 @@ void sub_0803CD40(Entity* this) {
ModHealth(-2);
sub_0800449C(&gPlayerEntity, 122);
SoundReqClipped(&gPlayerEntity, 122);
sub_08079D84();
sub_0803CE3C(this);
+7 -7
View File
@@ -20,7 +20,7 @@ void sub_0803B798(void);
void sub_0803BA8C(Entity*, u32);
void sub_0803B724(Entity*);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
void sub_0803A170(Entity*);
void sub_0803A188(Entity*);
@@ -434,7 +434,7 @@ void sub_0803A740(Entity* this) {
this->actionDelay = 10;
this->parent->field_0x7c.BYTES.byte1 |= 0x40;
sub_0803B8E8(this, 0x13);
sub_08080964(10, 0);
InitScreenShake(10, 0);
SoundReq(SFX_158);
}
}
@@ -713,7 +713,7 @@ void sub_0803ACC0(Entity* this) {
this->z.HALF.HI = 0;
this->actionDelay = 0xc;
this->subAction = 3;
sub_08080964(8, 0);
InitScreenShake(8, 0);
SoundReq(SFX_158);
sub_0803B804(this);
}
@@ -735,7 +735,7 @@ void sub_0803ACC0(Entity* this) {
this->z.HALF.HI = 0;
this->action = 0x1a;
this->actionDelay = 0x3c;
sub_08080964(0x1e, 0);
InitScreenShake(0x1e, 0);
SoundReq(SFX_158);
sub_0803B804(this);
return;
@@ -859,7 +859,7 @@ void sub_0803AFE0(Entity* this) {
this->actionDelay = 0xf0;
*(u8*)&this->cutsceneBeh = 3;
this->z.HALF.HI = 0;
sub_08080964(0xa0, 0);
InitScreenShake(0xa0, 0);
SoundReq(SFX_158);
}
}
@@ -931,7 +931,7 @@ void sub_0803B144(Entity* this) {
this->action = 0x2a;
InitializeAnimation(this, 0x16);
sub_0803B8E8(this, 0x14);
sub_08080964(8, 0);
InitScreenShake(8, 0);
}
}
@@ -1238,7 +1238,7 @@ void sub_0803B798(void) {
void sub_0803B804(Entity* this) {
gPlayerEntity.iframes = 30;
ModHealth(-4);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
}
void sub_0803B824(Entity* this) {
+1 -1
View File
@@ -320,7 +320,7 @@ void sub_080342C8(Entity* this) {
this->field_0x7c.HALF.HI = 0x708;
this->field_0x7c.BYTES.byte1 = 0;
this->field_0x80.HALF.HI = 0;
sub_08080964(0x1e, 0);
InitScreenShake(0x1e, 0);
SoundReq(SFX_1A1);
}
}
+1 -1
View File
@@ -195,7 +195,7 @@ void sub_08034F70(Entity* this) {
void sub_08034FA0(Entity* this) {
if (0 < this->iframes) {
this->child->iframes = this->iframes;
sub_08080964(0xc, 1);
InitScreenShake(0xc, 1);
}
switch (this->type2) {
case 0:
+4 -4
View File
@@ -1,7 +1,7 @@
#include "enemy.h"
#include "functions.h"
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern bool32 sub_08023A38(u32);
extern void sub_08023990(Entity*, u32, u32);
extern void sub_08023A88(Entity*, u32);
@@ -263,7 +263,7 @@ void sub_0802351C(Entity* this) {
if (this->field_0x7c.BYTES.byte3 == 0) {
if (this->type2 == 0) {
gPlayerEntity.animationState = this->animationState & 7;
gPlayerState.flags |= 0x80000;
gPlayerState.flags |= PL_TRAPPED;
PositionRelative(this, &gPlayerEntity, 0, gUnk_080CBC90[this->animationState & 7] << 0x10);
gPlayerEntity.spriteOffsetY = -gUnk_080CBC90[this->animationState & 7];
}
@@ -398,14 +398,14 @@ void sub_08023894(Entity* this) {
this->parent->field_0x7c.BYTES.byte3 = 1;
InitializeAnimation(this, this->animationState);
if (this->parent->type2 == 0) {
gPlayerState.flags |= 0x200000;
gPlayerState.flags |= PL_RELEASED;
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
gPlayerEntity.direction = DirectionRoundUp(GetFacingDirection(*(Entity**)&this->field_0x74, this));
gPlayerEntity.animationState = gPlayerEntity.direction >> 2;
gPlayerEntity.iframes = 12;
ModHealth(-0x10);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
}
}
}
+3 -3
View File
@@ -811,7 +811,7 @@ void OctorokBoss_Action1_ChargeAttack(Entity* this) {
this->knockbackDirection = this->direction ^ 0x10;
GET_HELPER(this)->fallingStonesTimer += 0x3c;
OctorokBoss_SetAttackTimer(this);
sub_08080964(0x3c, 0);
InitScreenShake(0x3c, 0);
SoundReq(SFX_158);
SoundReq(SFX_14C);
}
@@ -946,7 +946,7 @@ void OctorokBoss_ExecuteAttackVacuum(Entity* this) {
}
}
} else {
gPlayerState.flags &= 0xfffff7ff;
gPlayerState.flags &= ~PL_FROZEN;
}
}
}
@@ -1077,7 +1077,7 @@ void OctorokBoss_Burning_SubAction1(Entity* this) {
this->field_0x46 = 0x200;
this->knockbackDirection = this->direction ^ 0x10;
GET_HELPER(this)->fallingStonesTimer += 0x1e;
sub_08080964(0x1e, 0);
InitScreenShake(0x1e, 0);
SoundReq(SFX_158);
SoundReq(SFX_14C);
}
+5 -5
View File
@@ -5,7 +5,7 @@
#include "save.h"
extern u32 sub_080002E0(u16, u32);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern u32 sub_08049F1C(Entity*, Entity*, u32);
extern u32 PlayerInRange(Entity*, u32, u32);
extern void sub_080AEFB4(Entity*);
@@ -809,7 +809,7 @@ NONMATCH("asm/non_matching/pesto/sub_08024E4C.inc", void sub_08024E4C(Entity* th
ResetPlayer();
gPlayerState.flags |= 0x100;
gPlayerState.field_0xa |= 0x80;
gPlayerState.playerAction = 0xe;
gPlayerState.queued_action = PLAYER_0807204C;
gPlayerState.field_0x38 = 0x14;
gPlayerState.field_0x39 = 1;
*(u8*)&gPlayerState.field_0x3a = 0;
@@ -821,7 +821,7 @@ NONMATCH("asm/non_matching/pesto/sub_08024E4C.inc", void sub_08024E4C(Entity* th
this->field_0x86.HALF.HI++;
player->iframes = 8;
ModHealth(-2);
sub_0800449C(player, 0x7a);
SoundReqClipped(player, 0x7a);
}
}
}
@@ -830,10 +830,10 @@ END_NONMATCH
void sub_08024F50(Entity* this) {
gPlayerState.field_0xa = 0;
gPlayerState.flags &= 0xfffffeff;
gPlayerState.flags &= ~0x100;
CopyPosition(this, &gPlayerEntity);
gPlayerEntity.action = 1;
gPlayerEntity.flags |= 0x80;
COLLISION_ON(&gPlayerEntity);
gPlayerEntity.iframes = -0x3c;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.speed = 0;
+1 -1
View File
@@ -233,7 +233,7 @@ void sub_080296C8(Entity* this) {
void sub_080296D8(Entity* this) {
gPlayerState.jumpStatus = 0x41;
gPlayerState.flags &= 0xffffffef;
gPlayerState.flags &= ~0x10;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.iframes = 0xa6;
+1 -1
View File
@@ -662,7 +662,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
}
if (0 < this->iframes) {
SoundReq(0x127);
sub_08080964(0xc, 1);
InitScreenShake(0xc, 1);
if (this->actionDelay == 0)
this->actionDelay = 0x48;
}
+4 -4
View File
@@ -266,7 +266,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
this->actionDelay = 0xc0;
COLLISION_ON(this);
SoundReq(SFX_14C);
sub_08080964(0x14, 4);
InitScreenShake(0x14, 4);
break;
case 1:
if (--this->actionDelay == 0) {
@@ -321,7 +321,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
this->field_0x86.HALF.LO = 0;
sub_080408EC(this);
SoundReq(SFX_14C);
sub_08080964(0x1e, 4);
InitScreenShake(0x1e, 4);
} else {
if (this->field_0xf != 0) {
if (--this->field_0xf == 0) {
@@ -399,7 +399,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
this->field_0xf = 1;
}
SoundReq(SFX_14C);
sub_08080964(0x1e, 4);
InitScreenShake(0x1e, 4);
break;
case 2:
if (--this->actionDelay == 0) {
@@ -1069,7 +1069,7 @@ void sub_080409B0(Entity* this) {
}
} else {
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
sub_08080964(0xc, 1);
InitScreenShake(0xc, 1);
SoundReq(SFX_BOSS_HIT);
}
if ((this->bitfield == 0x8a) && (gPlayerState.field_0xa0[0] == 5)) {
+2 -2
View File
@@ -475,7 +475,7 @@ void VaatiWrathType0ActionB(Entity* this) {
this->actionDelay = 0xf0;
this->health = 8;
this->hitType = 0x38;
sub_08080964(0x14, 0);
InitScreenShake(0x14, 0);
InitAnimationForceUpdate(this, 6);
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x16);
}
@@ -709,7 +709,7 @@ void sub_08041E78(Entity* this) {
fx->x.HALF.HI += *temp++;
fx->y.HALF.HI += *temp;
fx->spritePriority.b0 = 3;
sub_08080964(4, 0);
InitScreenShake(4, 0);
}
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ void sub_08033564(Entity* this) {
this->spriteSettings.draw = FALSE;
COLLISION_OFF(this);
this->field_0x7c.HALF.LO = 0x27c;
gPlayerState.flags |= 0x4000;
gPlayerState.flags |= PL_DRUGGED;
gSave.stats.effect = this->type + 1;
gSave.stats.effectTimer = 600;
if (this->type == 0) {
+2 -1
View File
@@ -1,6 +1,7 @@
#include "entity.h"
#include "definitions.h"
#include "functions.h"
#include "object.h"
extern EnemyDefinition gEnemyDefinitions[];
@@ -46,7 +47,7 @@ bool32 EnemyInit(Entity* this) {
if ((this->field_0x6c.HALF.HI & 0x20) != 0) {
u32 uVar4 = gUnk_080D3E74[this->id >> 3] >> ((this->id & 7) << 1) & 3;
if (uVar4 != 0) {
Entity* object = CreateObject(0xa9, uVar4 - 1, 0);
Entity* object = CreateObject(OBJECT_A9, uVar4 - 1, 0);
if (object != NULL) {
object->actionDelay = this->flags;
object->field_0xf = this->spriteSettings.draw;
+15 -15
View File
@@ -21,7 +21,7 @@ extern u16* gUnk_0200B650;
extern u8 gUpdateVisibleTiles;
extern u8 gUnk_03003DF0[];
extern u8 gUnk_03003BE0;
extern Entity* gUnk_03004040[3];
extern Entity* gPlayerClones[3];
extern u16 gUnk_080B2CD8[];
extern u32 gUnk_03000FBC;
@@ -181,16 +181,16 @@ void WaitForNextFrame(void) {
void PlayerUpdate(Entity* this) {
if (gSave.stats.effect != 0)
gPlayerState.flags |= 0x4000;
gPlayerState.flags |= PL_DRUGGED;
else
gPlayerState.flags &= ~0x4000;
gPlayerState.flags &= ~PL_DRUGGED;
if (CheckDontUpdate(this) == 0) {
if ((gPlayerState.flags & 0x80000) != 0) {
if (gPlayerState.flags & PL_TRAPPED) {
sub_08077B20();
if ((gPlayerState.flags & 0x200000) != 0) {
gPlayerState.playerAction = PLAYER_ROLL;
gPlayerState.flags &= ~0x80000;
if (gPlayerState.flags & PL_RELEASED) {
gPlayerState.queued_action = PLAYER_ROLL;
gPlayerState.flags &= ~PL_TRAPPED;
gPlayerState.hurtBlinkSpeed = 240;
COLLISION_ON(this);
} else {
@@ -223,10 +223,10 @@ void HandlePlayerLife(Entity* this) {
if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0))
SoundReq(SFX_86);
gPlayerState.flags &= ~(0x2000000 | 0x200);
gPlayerState.flags &= ~(0x2000000 | PL_FALLING);
if (gPlayerState.flags & PL_BURNING)
ResetPlayer();
if ((gPlayerState.flags & 0x400000) && !gPlayerState.field_0xa0[0])
if ((gPlayerState.flags & PL_CLONING) && !gPlayerState.field_0xa0[0])
sub_0807A108();
if (sub_08079B24() == 0)
sub_08079708(this);
@@ -300,7 +300,7 @@ void sub_080171F0(void) {
gPlayerState.flags &= ~2;
sub_080028E0(&gPlayerEntity);
if (gPlayerState.flags & 0x400000)
if (gPlayerState.flags & PL_CLONING)
gUnk_0200AF00.filler25[10] = 1;
sub_08078180();
@@ -315,13 +315,13 @@ void sub_080171F0(void) {
gPlayerState.field_0x3f = 0;
sub_0807B0C8();
if (gPlayerState.flags & 0x400000)
gUnk_03004040[0]->spriteOffsetY = gUnk_03004040[1]->spriteOffsetY = gUnk_03004040[2]->spriteOffsetY = 0;
if (gPlayerState.flags & PL_CLONING)
gPlayerClones[0]->spriteOffsetY = gPlayerClones[1]->spriteOffsetY = gPlayerClones[2]->spriteOffsetY = 0;
if (gPlayerEntity.action == PLAYER_08072F34)
gPlayerState.flags |= 0x20000000;
if (gPlayerEntity.action == PLAYER_CLIMB)
gPlayerState.flags |= PL_CLIMBING;
else
gPlayerState.flags &= ~0x20000000;
gPlayerState.flags &= ~PL_CLIMBING;
sub_0807A8D8(&gPlayerEntity);
if (gPlayerState.jumpStatus & 0xc0)
+4
View File
@@ -10,3 +10,7 @@ void (*const gItemFunctions[])(ItemBehavior*, u32) = {
ItemPegasusBoots, ItemDebug, ItemOcarina, ItemDebug, ItemDebug, ItemDebug, ItemTryPickupObject,
ItemJarEmpty, ItemJarEmpty, ItemJarEmpty, ItemJarEmpty,
};
void sub_080752E8(ItemBehavior* behavior, u32 arg1) {
gItemFunctions[behavior->behaviorID](behavior, arg1);
}
+2 -2
View File
@@ -3,7 +3,7 @@
extern void (*const gUnk_0811BD78[])(ItemBehavior*, u32);
extern void sub_08078F60(void);
extern void ResetPlayerVelocity(void);
void ItemBoomerang(ItemBehavior* this, u32 arg1) {
gUnk_0811BD78[this->stateID](this, arg1);
@@ -24,7 +24,7 @@ void sub_08075D2C(ItemBehavior* this, u32 arg1) {
void sub_08075D88(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x3[1] & 0x80) == 0) {
if (((this->behaviorID == 0xc) && ((gPlayerState.field_0xa & 0x80) != 0)) && ((this->field_0x5[9] & 2) != 0)) {
sub_08078F60();
ResetPlayerVelocity();
return;
}
UpdateItemAnim(this);
+9 -9
View File
@@ -1,6 +1,7 @@
#include "item.h"
#include "functions.h"
#include "audio.h"
#include "object.h"
extern void (*const gUnk_0811BD68[])(ItemBehavior*, u32);
@@ -20,22 +21,21 @@ void sub_08075A0C(ItemBehavior* this, u32 arg1) {
u32 itemSlot;
s8* tmp;
itemSlot = IsItemEquipped(this->behaviorID);
if (gPlayerState.heldObject != 0 || gPlayerState.playerAction == 0x18 || gPlayerState.jumpStatus != 0 ||
if (gPlayerState.heldObject != 0 || gPlayerState.queued_action == PLAYER_ROLL || gPlayerState.jumpStatus != 0 ||
gPlayerState.item != NULL || (gPlayerState.flags & PL_MINISH) != 0) {
ForceEquipItem(0xf, itemSlot);
gPlayerState.flags &= 0xff7fffff;
gPlayerState.flags &= ~PL_USE_LANTERN;
ForceEquipItem(0xf, itemSlot);
sub_08077E78(this, arg1);
} else {
this->field_0x5[4] |= 0x80;
sub_08077D38(this, arg1);
sub_08077BD4(this);
sub_0806F948(&gPlayerEntity);
this->behaviorID = 0x10;
ForceEquipItem(0x10, itemSlot);
ForceEquipItem(ITEM_LANTERN_ON, itemSlot);
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_45, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
@@ -54,7 +54,7 @@ void sub_08075ADC(ItemBehavior* this, u32 arg1) {
sub_08079D48() == 0) {
this->field_0xf = 0;
this->stateID += 1;
gPlayerState.flags |= 0x800000;
gPlayerState.flags |= PL_USE_LANTERN;
bVar1 = 8 >> arg1;
gPlayerState.field_0x3[1] = gPlayerState.field_0x3[1] & ~((bVar1 << 4) | bVar1);
bVar1 = ~bVar1;
@@ -77,11 +77,11 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
itemSlot = IsItemEquipped(this->behaviorID);
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jumpStatus != 0))) {
ForceEquipItem(0xf, itemSlot);
gPlayerState.flags &= 0xff7fffff;
gPlayerState.flags &= ~PL_USE_LANTERN;
sub_08077E78(this, arg1);
SoundReq(SFX_ITEM_LANTERN_OFF);
} else {
if (((gPlayerState.playerAction != 0x18) && (gPlayerEntity.frameIndex < 0x37)) &&
if (((gPlayerState.queued_action != PLAYER_ROLL) && (gPlayerEntity.frameIndex < 0x37)) &&
((u16)gPlayerEntity.spriteIndex == 6)) {
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
@@ -91,7 +91,7 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
this->field_0xf = 0xf;
this->stateID += 1;
gPlayerEntity.field_0x7a.HWORD = 2;
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_45, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
+5 -5
View File
@@ -4,7 +4,7 @@
extern void (*const gOcarinaStates[4])(ItemBehavior*, u32);
extern void sub_08078F60(void);
extern void ResetPlayerVelocity(void);
extern void SetPlayerEventPriority(void);
extern void CreateBird(void);
@@ -16,7 +16,7 @@ void ItemOcarina(ItemBehavior* this, u32 arg1) {
}
void OcarinaUse(ItemBehavior* this, u32 arg1) {
if (gPlayerState.playerAction == 0x18) {
if (gPlayerState.queued_action == PLAYER_ROLL) {
sub_08077E78(this, arg1);
} else {
this->field_0x5[4] |= 0xf;
@@ -24,12 +24,12 @@ void OcarinaUse(ItemBehavior* this, u32 arg1) {
gPlayerEntity.spriteSettings.flipX = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.field_0x7a.HWORD = 2;
gPlayerState.flags |= 0x10000000;
gPlayerState.flags |= PL_USE_OCARINA;
gPlayerState.field_0x27[0] = -1;
gUnk_02034490[0] = 1;
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
gPlayerState.keepFacing = (8 >> arg1) | gPlayerState.keepFacing;
sub_08078F60();
ResetPlayerVelocity();
sub_08077D38(this, arg1);
SoundReq(SFX_216);
SetPlayerEventPriority();
@@ -41,7 +41,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= 0x80;
gPlayerState.flags &= 0xefffffff;
gPlayerState.flags &= ~PL_USE_OCARINA;
gPlayerState.field_0x27[0] = 0;
gUnk_02034490[0] = 0;
CreateBird();
+1 -1
View File
@@ -24,7 +24,7 @@ void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
SoundReq(SFX_PLY_LAND);
}
if (((gPlayerState.flags & PL_MINISH) == 0) && ((this->field_0x5[2] & 7) == 0)) {
if (gPlayerState.floor_type == SURFACE_11) {
if (gPlayerState.floor_type == SURFACE_SWAMP) {
if (gPlayerEntity.spriteOffsetY == 0) {
CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0);
}
+5 -5
View File
@@ -72,9 +72,9 @@ void sub_0807564C(ItemBehavior* this, u32 arg1) {
void sub_08075694(ItemBehavior* this, u32 arg1) {
this->field_0x5[2] = 1;
if ((gPlayerState.flags & 0x8000000) != 0) {
gPlayerState.flags &= 0xf7ffffff;
gPlayerState.flags &= 0xfffbffff;
if (gPlayerState.flags & PL_SWORD_THRUST) {
gPlayerState.flags &= ~PL_SWORD_THRUST;
gPlayerState.flags &= ~PL_ROLLING;
sub_08077DF4(this, 300);
} else {
gPlayerState.field_0xab = 1;
@@ -86,7 +86,7 @@ void sub_08075694(ItemBehavior* this, u32 arg1) {
gPlayerEntity.hurtType = 0x1e;
gPlayerState.field_0x1a[1] |= 0x40;
gPlayerState.field_0x1a[1] &= 0xdf;
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags & 0x400000) == 0)) {
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags & PL_CLONING) == 0)) {
gPlayerState.field_0xa0[0] = 0x01;
sub_0807A108();
}
@@ -124,7 +124,7 @@ void sub_080759B8(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.flags & PL_MINISH) == 0) {
gPlayerEntity.hurtType = 0;
}
gPlayerState.flags &= 0xf7ffffff;
gPlayerState.flags &= ~PL_SWORD_THRUST;
gPlayerState.field_0x1a[1] = 0;
gPlayerState.item = NULL;
sub_08077E78(this, arg1);
+2 -2
View File
@@ -315,8 +315,8 @@ void sub_0805A76C(Manager15* this) {
}
void sub_0805A7E4(Manager15* this) {
if (gPlayerState.playerAction != PLAYER_WARP) {
gPlayerState.playerAction = PLAYER_WARP;
if (gPlayerState.queued_action != PLAYER_WARP) {
gPlayerState.queued_action = PLAYER_WARP;
gPlayerState.field_0x38 = 0;
gPlayerState.field_0x39 = 0;
}
+1 -1
View File
@@ -137,7 +137,7 @@ void sub_0805B168(Manager1A* this) {
u32 sub_0805B1CC(Manager1A* this) {
u32 re = 0;
if (CheckPlayerProximity(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) {
if ((gPlayerState.flags & 0x4) && (gPlayerState.flags & 0x1)) {
if ((gPlayerState.flags & PL_DROWNING) && (gPlayerState.flags & PL_BUSY)) {
gPlayerState.flags |= 0x8000;
} else if (gPlayerState.flags & 0x8000) {
re = 1;
+3 -3
View File
@@ -39,11 +39,11 @@ void sub_0805DBF0(Manager34* this) {
sub_0805DC70();
} else {
if (this->field_0x20 == 0x78) {
sub_08080964(0x78, 2);
InitScreenShake(0x78, 2);
} else if (this->field_0x20 == 0xd2) {
sub_08080964(0x5a, 1);
InitScreenShake(0x5a, 1);
} else if (this->field_0x20 == 0x12c) {
sub_08080964(0x5a, 0);
InitScreenShake(0x5a, 0);
}
if (this->field_0x20 < 0x78) {
+1 -1
View File
@@ -117,7 +117,7 @@ static u32 PlayerStateValid(ManagerA* this) {
static void sub_08058514(ManagerA* this) {
switch (this->manager.unk_0d) {
case 1:
if (gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_USE_PORTAL | 0x1210))
if (gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_USE_PORTAL | PL_FALLING | 0x1010))
return;
if (gPlayerEntity.z.HALF.HI != 0)
return;
+1 -1
View File
@@ -156,7 +156,7 @@ void sub_08058A04(ManagerC* this) {
s32 tmp2 = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY;
if ((this->unk_20 - 0x118 < 0xDu) && CheckGlobalFlag(LV1TARU_OPEN) && (tmp - 0x6d < 0x17u) &&
(tmp2 - 0x45 < 0x17u) && (gPlayerEntity.z.HALF.HI == 0)) {
gPlayerState.playerAction = 3;
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x78;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x50;
+1 -1
View File
@@ -15,7 +15,7 @@ void Carlov(Entity* this) {
if ((this->frame & 0x10) != 0) {
this->frame = this->frame & 0xef;
EnqueueSFX(0x104);
sub_08080964(0x10, 0);
InitScreenShake(0x10, 0);
}
if ((this->frame & 0x20) != 0) {
this->frame = this->frame & 0xdf;
+1 -1
View File
@@ -97,7 +97,7 @@ void sub_08067534(Entity* this) {
}
}
EnqueueSFX(0x14c);
sub_08080964(0x28, 4);
InitScreenShake(0x28, 4);
}
void sub_0806757C(Entity* this) {
+1 -1
View File
@@ -131,7 +131,7 @@ void sub_0806A550(Entity* this) {
} else {
if (this->frame == 1) {
this->frame = 0;
sub_08080964(8, 2);
InitScreenShake(8, 2);
gActiveScriptInfo.unk_00 |= 0x100;
SoundReq(SFX_CHEST_OPEN);
}
+1 -1
View File
@@ -85,7 +85,7 @@ void sub_08066D94(Entity* this) {
DeleteThisEntity();
}
void sub_08066DE4(Entity* this) {
void SetZeldaFollowTarget(Entity* this) {
Entity* pEVar1;
pEVar1 = DeepFindEntityByID(7, 0x2E);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "object.h"
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern u32 sub_0806FC80(Entity*, Entity*, s32);
extern void sub_0809CDF0(Entity*);
@@ -61,7 +61,7 @@ void sub_0809CD0C(Entity* this) {
sub_0806FC80(this, &gPlayerEntity, 4)) {
this->field_0xf++;
ModHealth(-2);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
gPlayerEntity.iframes = 16;
gPlayerEntity.knockbackDirection = 16;
gPlayerEntity.knockbackDuration = 12;
+1 -1
View File
@@ -67,7 +67,7 @@ void sub_08098DC4(Entity* this) {
sub_08004542(&gPlayerEntity);
gPlayerEntity.collisionLayer = 1;
ResolveEntityOnTop(this, &gPlayerEntity);
gPlayerState.playerAction = 0x1f;
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x34[4] = 1;
gPlayerState.field_0x34[5] = this->type2;
this->action = 4;
+2 -2
View File
@@ -92,8 +92,8 @@ void sub_0809B4A8(Entity* this) {
this->direction = 16;
gPlayerState.pushedObject = 0x9e;
gPlayerState.playerAction = 5;
gPlayerState.flags |= 1;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
+10 -10
View File
@@ -138,7 +138,7 @@ u32 sub_08081D28(Entity* this) {
}
extern u32 sub_080002E0(u32, u32);
extern Entity* gUnk_03004040[3];
extern Entity* gPlayerClones[3];
u32 sub_08081E0C(Entity*);
Entity* sub_08081D74(Entity* this) {
@@ -152,13 +152,13 @@ Entity* sub_08081D74(Entity* this) {
ent = &gPlayerEntity;
}
} else {
if (gPlayerState.flags & 0x400000) {
if (EntityInRectRadius(this, gUnk_03004040[0], 5, 6)) {
ent = gUnk_03004040[0];
} else if (EntityInRectRadius(this, gUnk_03004040[1], 5, 6)) {
ent = gUnk_03004040[1];
} else if (EntityInRectRadius(this, gUnk_03004040[2], 5, 6)) {
ent = gUnk_03004040[2];
if (gPlayerState.flags & PL_CLONING) {
if (EntityInRectRadius(this, gPlayerClones[0], 5, 6)) {
ent = gPlayerClones[0];
} else if (EntityInRectRadius(this, gPlayerClones[1], 5, 6)) {
ent = gPlayerClones[1];
} else if (EntityInRectRadius(this, gPlayerClones[2], 5, 6)) {
ent = gPlayerClones[2];
}
}
}
@@ -272,8 +272,8 @@ void sub_08081FF8(Entity* this) {
direction = GetFacingDirection(this->child, this);
sub_080044AE(this->child, 0x200, direction);
for (i = 0; i < 3; i++) {
if (gUnk_03004040[i]) {
sub_080044AE(gUnk_03004040[i], 0x200, direction);
if (gPlayerClones[i]) {
sub_080044AE(gPlayerClones[i], 0x200, direction);
}
}
}
-1
View File
@@ -17,7 +17,6 @@ void sub_080813BC(Entity*);
void sub_080810FC(Entity*);
bool32 CheckShouldPlayItemGetCutscene(Entity*);
extern u32 sub_080002D0(Entity*);
extern u32 sub_080177A0(Entity*, Entity*);
extern void GiveItem(u32, u32);
+1 -1
View File
@@ -108,7 +108,7 @@ void sub_0808C01C(Entity* this, u32 r1) {
type = 2;
gArea.curPortalType = type;
if (r1 == 1) {
if (((gPlayerState.flags & 0x20) != 0) && (gPlayerState.jumpStatus == 0)) {
if ((gPlayerState.flags & PL_USE_PORTAL) && (gPlayerState.jumpStatus == 0)) {
gArea.field_0x18 = 2;
} else {
if (sub_08057810() != 0) {
+11 -12
View File
@@ -55,7 +55,6 @@ void sub_080916EC(Entity* this) {
}
void sub_080917DC(Entity* this) {
if ((this->bitfield & 0x7f) == 0x1d) {
this->zVelocity = 0x2a000;
this->action = 7;
@@ -63,8 +62,8 @@ void sub_080917DC(Entity* this) {
SoundReq(SFX_13B);
} else {
if (sub_0800445C(this) != 0) {
if (((gPlayerState.flags & 0x40080) == 0) && (gPlayerState.field_0x1c == 0) &&
(gPlayerState.heldObject == 0) && (gPlayerState.jumpStatus == 0)) {
if (!((gPlayerState.flags & (PL_MINISH | PL_ROLLING)) || gPlayerState.field_0x1c ||
gPlayerState.heldObject || gPlayerState.jumpStatus)) {
this->actionDelay++;
} else {
this->actionDelay = 0;
@@ -73,13 +72,13 @@ void sub_080917DC(Entity* this) {
this->actionDelay = 0;
}
if (this->type2 == 0) {
if (8 < this->actionDelay) {
this->action = this->action + 1;
if (this->actionDelay > 8) {
this->action++;
gPlayerState.jumpStatus = 0x81;
gPlayerState.flags |= 0x4000000;
gPlayerState.flags |= PL_MINECART;
gPlayerEntity.zVelocity = 0x20000;
gPlayerEntity.speed = 0x100;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.flags &= ~PL_MINISH;
ResetPlayer();
sub_0807A108();
SoundReq(SFX_PLY_JUMP);
@@ -95,11 +94,11 @@ void sub_080918A4(Entity* this) {
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
if (gPlayerEntity.z.HALF.HI > -0x10) {
if ((s32)gPlayerEntity.zVelocity > -1) {
if (gPlayerEntity.zVelocity >= 0) {
return;
}
gPlayerEntity.animationState = this->animationState << 1;
gPlayerState.flags = (gPlayerState.flags ^ 0x4000000) | 0x1000;
gPlayerState.flags = (gPlayerState.flags ^ PL_MINECART) | 0x1000;
this->action++;
this->field_0xf = 1;
this->flags |= ENT_20;
@@ -158,7 +157,7 @@ void sub_080919AC(Entity* this) {
gUnk_081223C8[this->animationState * 2 + 1]);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = this->direction ^ 0x10;
this->direction = DirectionTurnAround(this->direction);
this->animationState = this->animationState ^ 2;
} else {
switch (uVar3) {
@@ -171,12 +170,12 @@ void sub_080919AC(Entity* this) {
this->action = 6;
sub_08017744(this);
gPlayerState.jumpStatus = 0x41;
gPlayerState.flags = (gPlayerState.flags ^ 0x1000) | 0x4000000;
gPlayerState.flags = (gPlayerState.flags ^ 0x1000) | PL_MINECART;
gPlayerEntity.zVelocity = 0x20000;
gPlayerEntity.speed = 0x200;
gPlayerEntity.animationState = this->animationState << 1;
gPlayerEntity.direction = this->direction;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.flags |= PL_MINISH;
sub_08004168(this);
InitAnimationForceUpdate(this, this->animationState + 0xc);
SoundReq(SFX_PLY_VO4);
+1 -1
View File
@@ -398,7 +398,7 @@ void sub_08094FA8(Object6AEntity* this) {
super->interactType = 0;
super->action = 2;
sub_080788E0(super);
gPlayerState.playerAction = 12;
gPlayerState.queued_action = PLAYER_EMPTYBOTTLE;
gPlayerState.field_0x38 = 54;
#ifndef EU
SetPlayerControl(2);
+1 -1
View File
@@ -69,7 +69,7 @@ void nullsub_534(Entity* this) {
void sub_08099ECC(Entity* this) {
this->subAction = 1;
CopyPosition(this, &gPlayerEntity);
gPlayerState.playerAction = 3;
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x34[4] = 0;
gPlayerState.flags |= 0x8000;
}
+3 -3
View File
@@ -351,7 +351,7 @@ void InitializePlayer(void) {
pl = &gPlayerEntity;
gRoomControls.cameraTarget = pl;
gPlayerState.playerAction = sPlayerSpawnStates[gScreenTransition.player_status.spawn_type];
gPlayerState.queued_action = sPlayerSpawnStates[gScreenTransition.player_status.spawn_type];
if (!CheckGlobalFlag(EZERO_1ST)) {
gPlayerState.flags |= PL_NO_CAP;
}
@@ -607,7 +607,7 @@ static u32 StairsAreValid(void) {
for (i = sStairTypes; i[0] != 0; i += 2) {
if (tgt == i[0]) {
gPlayerState.playerAction = 30;
gPlayerState.queued_action = PLAYER_USEENTRANCE;
gPlayerState.field_0x38 = 0;
gPlayerState.field_0x39 = i[1];
if (!gScreenTransition.player_status.spawn_type)
@@ -666,7 +666,7 @@ u32 sub_08052B24(void) {
gUnk_0200AF00.filler0[1])
return 0;
if ((gPlayerState.flags & 0x118) || (gPlayerState.framestate_last > tmp) || gPlayerState.item ||
if ((gPlayerState.flags & (PL_NO_CAP | 0x110)) || (gPlayerState.framestate_last > tmp) || gPlayerState.item ||
gPlayerEntity.field_0x7a.HWORD)
return 0;
+1634 -66
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -4,7 +4,7 @@
#include "player.h"
#include "effects.h"
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern void sub_08079D84(void);
extern void (*const LakituCloudProjectile_Functions[])(Entity*);
@@ -44,7 +44,7 @@ void LakituCloudProjectile_SubAction2(Entity* this) {
if (sub_0806F3E4(this) != 0) {
if (this->hitType == 0xa6) {
ModHealth(-2);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
sub_08079D84();
}
CreateFx(this, FX_DEATH, 0);
+2 -2
View File
@@ -6,7 +6,7 @@
#include "functions.h"
#include "asm.h"
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern void (*const V1DarkMagicProjectile_Functions[])(Entity*);
extern void (*const V1DarkMagicProjectile_Actions[])(Entity*);
@@ -173,7 +173,7 @@ void sub_080AAF74(Entity* this) {
this->actionDelay = 0x1e;
gPlayerEntity.iframes = 8;
ModHealth(-4);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
if (gPlayerEntity.health == 0) {
this->health = 0;
}
+2 -2
View File
@@ -12,7 +12,7 @@ extern void (*const gUnk_0812A7F8[])(Entity*);
extern void (*const gUnk_0812A800[])(Entity*);
extern void (*const gUnk_0812A808[])(Entity*);
extern void sub_0800449C(Entity*, u32);
extern void SoundReqClipped(Entity*, u32);
extern void sub_08079D84(void);
extern s32 sub_080AF090(Entity*);
@@ -43,7 +43,7 @@ void nullsub_542(Entity* this) {
void sub_080ABC90(Entity* this) {
if (sub_0806F3E4(this) != 0) {
ModHealth(-2);
sub_0800449C(&gPlayerEntity, 0x7a);
SoundReqClipped(&gPlayerEntity, 0x7a);
sub_08079D84();
CreateFx(this, FX_DEATH, 0);
DeleteThisEntity();
+2 -2
View File
@@ -1010,7 +1010,7 @@ void sub_0804BF38(u32 arg0, struct_0804BF38* arg1)
}
}
sub_08080964(gUnk_080D8E50[iVar3].shakeTime, gUnk_080D8E50[iVar3].shakeMag);
InitScreenShake(gUnk_080D8E50[iVar3].shakeTime, gUnk_080D8E50[iVar3].shakeMag);
SoundReq(gUnk_080D8E50[iVar2].sfx);
}
#else
@@ -4819,7 +4819,7 @@ void sub_StateChange_HouseInteriors2_LinksHouseBedroom(void) {
gArea.musicIndex = gArea.pMusicIndex;
SoundReq(SONG_PLAY_VOL_RESET | BGM_MINISH_CAP);
}
if ((gPlayerState.flags & 8) == 0) {
if ((gPlayerState.flags & PL_NO_CAP) == 0) {
LoadRoomEntityList(&gUnk_080F31D8);
}
}
+3 -3
View File
@@ -223,7 +223,7 @@ void StartPlayerScript(u16* script) {
gPlayerScriptExecutionContext.scriptInstructionPointer = script;
player = &gPlayerEntity;
*(ScriptExecutionContext**)&player->cutsceneBeh = &gPlayerScriptExecutionContext;
gPlayerState.playerAction = 0x1c;
gPlayerState.queued_action = PLAYER_08074C44;
gPlayerState.field_0x3a = 0;
gPlayerState.field_0x39 = 0;
gPlayerState.field_0x38 = 0;
@@ -1072,7 +1072,7 @@ void ScriptCommand_0807E888(Entity* entity, ScriptExecutionContext* context) {
void ScriptCommand_SetPlayerAction(Entity* entity, ScriptExecutionContext* context) {
u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer);
gPlayerState.playerAction = tmp;
gPlayerState.queued_action = tmp;
gPlayerState.field_0x38 = tmp >> 8;
gPlayerState.field_0x39 = tmp >> 0x10;
gPlayerState.field_0x3a = tmp >> 0x18;
@@ -1527,7 +1527,7 @@ void ScriptCommand_0807F0B4(Entity* entity, ScriptExecutionContext* context) {
}
void ScriptCommand_0807F0C8(Entity* entity, ScriptExecutionContext* context) {
sub_08080964(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]);
InitScreenShake(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]);
}
extern u8 gUnk_0811E750[];
+1 -1
View File
@@ -5,7 +5,7 @@ extern void sub_0807B778(u32, u32);
void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) {
if (param_1 == 53) {
sub_08000152(53);
sub_08000152(53, param_2, param_3);
sub_0807B778(param_2, param_3);
sub_0807B778(param_2 + 1, param_3);
sub_0807B778(param_2 - 1, param_3);