summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-12-27 17:14:52 -0800
committertheo3 <arisstephenson2@gmail.com>2021-12-27 17:14:52 -0800
commit24750a6bb59eebab95a9ef0a020ba612cac908e1 (patch)
treeb242f49ec7f5eb4b0e8478cdf7e64565586d7ec9 /src/object
parent079260dbd64b6d090e05b409ded30a95bf33a9e9 (diff)
finish player.c
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bakerOven.c4
-rw-r--r--src/object/bigVortex.c2
-rw-r--r--src/object/book.c4
-rw-r--r--src/object/button.c20
-rw-r--r--src/object/itemOnGround.c1
-rw-r--r--src/object/jarPortal.c2
-rw-r--r--src/object/minecart.c23
-rw-r--r--src/object/object6A.c2
-rw-r--r--src/object/object86.c2
9 files changed, 29 insertions, 31 deletions
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c
index ffe11cd9..c7f21f7c 100644
--- a/src/object/bakerOven.c
+++ b/src/object/bakerOven.c
@@ -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;
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index 5e7f87eb..9118cb67 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -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;
diff --git a/src/object/book.c b/src/object/book.c
index 9a99b928..25faf3ab 100644
--- a/src/object/book.c
+++ b/src/object/book.c
@@ -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;
diff --git a/src/object/button.c b/src/object/button.c
index 76b48da8..1db2cafb 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -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);
}
}
}
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index 78d8c881..c062d75b 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -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);
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index 8adb45e7..89142cbc 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -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) {
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 8f5e9360..619e1a7b 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -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);
diff --git a/src/object/object6A.c b/src/object/object6A.c
index d0063f60..11dcfc48 100644
--- a/src/object/object6A.c
+++ b/src/object/object6A.c
@@ -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);
diff --git a/src/object/object86.c b/src/object/object86.c
index b5c9e60b..62d30b6b 100644
--- a/src/object/object86.c
+++ b/src/object/object86.c
@@ -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;
}