mirror of
https://github.com/zeldaret/tmc
synced 2026-07-11 07:25:23 -04:00
finish player.c
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user