Skip to content

Commit

Permalink
Match SurfaceAction_Swamp
Browse files Browse the repository at this point in the history
  • Loading branch information
hatal175 committed Feb 19, 2022
1 parent 8c17345 commit 01a4583
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 147 deletions.
146 changes: 0 additions & 146 deletions asm/non_matching/player/SurfaceAction_Swamp.inc

This file was deleted.

48 changes: 47 additions & 1 deletion src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -3567,7 +3567,53 @@ void SurfaceAction_SlopeGndWater(Entity* this) {
}
}

ASM_FUNC("asm/non_matching/player/SurfaceAction_Swamp.inc", void SurfaceAction_Swamp(Entity* this));
void SurfaceAction_Swamp(Entity* this) {
if (sub_080741C4()) {
gPlayerState.field_0x11 = 0;
gPlayerState.field_0x37 = 0;
return;
}

if (this->health) {
if (sub_08079C30(this) == 0) {
gPlayerState.field_0x11 = 0;
gPlayerState.field_0x37 = 0;
return;
}
if ((gPlayerState.flags & 0x80) == 0) {
if (gPlayerState.dash_state) {
if ((gPlayerState.dash_state & 0x40) != 0) {
gPlayerState.field_0x11 = 0;
gPlayerState.field_0x37 = 0;
return;
}
} else {
sub_08077B20();
}

if (gPlayerState.field_0x37 == 1) {
CreateObjectWithParent(this, OBJECT_70, 0, 0);
CreateFx(this, FX_GREEN_SPLASH, 0);
SoundReq(SFX_161);
} else if ((gPlayerState.field_0x92 & 0xf00) != 0) {
SoundReq(SFX_161);
} else if ((gRoomTransition.frameCount & 0xf) == 0) {
SoundReq(SFX_161);
}
gPlayerState.speed_modifier -= 0xf0;
gPlayerState.framestate = 0x1b;
if (gPlayerState.field_0x37 < 0xf0) {
gPlayerState.field_0x3f = gPlayerState.field_0x3f + 4 + (gPlayerState.field_0x37 >> 5);
return;
}
}
}
gPlayerState.flags &= ~PL_ROLLING;
CreateFx(this, FX_GREEN_SPLASH, 0);
this->iframes = 0x20;
ModHealth(-4);
RespawnPlayer();
}

void SurfaceAction_Water(Entity* this) {
if (!sub_080741C4()) {
Expand Down

0 comments on commit 01a4583

Please sign in to comment.