mirror of https://github.com/zeldaret/tmc.git
				
				
				
			Document various fields
This commit is contained in:
		
							parent
							
								
									b6c1671203
								
							
						
					
					
						commit
						3a151b343d
					
				| 
						 | 
				
			
			@ -22,32 +22,23 @@ script_080145F8:
 | 
			
		|||
	Wait 0x0018
 | 
			
		||||
	EnablePlayerControl
 | 
			
		||||
	Jump script_080145F8
 | 
			
		||||
.endif
 | 
			
		||||
script_08014632:
 | 
			
		||||
	CheckRoomFlag 0x0000
 | 
			
		||||
	JumpIfNot script_08014632
 | 
			
		||||
	SetPlayerIdle
 | 
			
		||||
	Call DisablePauseMenuAndPutAwayItems
 | 
			
		||||
script_08014642:
 | 
			
		||||
.ifdef EU
 | 
			
		||||
	CheckRoomFlag 0x0009
 | 
			
		||||
.else
 | 
			
		||||
	CheckRoomFlag 0x0004
 | 
			
		||||
.endif
 | 
			
		||||
	JumpIf script_08014642
 | 
			
		||||
	SetSyncFlag 0x00000004
 | 
			
		||||
	WaitForSyncFlagAndClear 0x00000008
 | 
			
		||||
	Call EnablePauseMenu
 | 
			
		||||
	EnablePlayerControl
 | 
			
		||||
	Jump script_080145F8
 | 
			
		||||
.else
 | 
			
		||||
	CheckRoomFlag 0x0000
 | 
			
		||||
	JumpIfNot script_080145F8
 | 
			
		||||
	SetPlayerIdle
 | 
			
		||||
	Call DisablePauseMenuAndPutAwayItems
 | 
			
		||||
script_08014608:
 | 
			
		||||
	CheckRoomFlag 0x0004
 | 
			
		||||
	JumpIf script_08014608
 | 
			
		||||
	SetSyncFlag 0x00000004
 | 
			
		||||
	WaitForSyncFlagAndClear 0x00000008
 | 
			
		||||
	Call EnablePauseMenu
 | 
			
		||||
	EnablePlayerControl
 | 
			
		||||
	Jump script_080145F8
 | 
			
		||||
.endif
 | 
			
		||||
	.align 2, 0
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -302,10 +302,11 @@ typedef struct {
 | 
			
		|||
    /*0x39*/ u8 field_0x39;
 | 
			
		||||
    /*0x3a*/ u8 field_0x3a;
 | 
			
		||||
    /*0x3b*/ u8 field_0x3b;
 | 
			
		||||
    /*0x3c*/ u8 field_0x3c[2];
 | 
			
		||||
    /*0x3c*/ u8 field_0x3c;
 | 
			
		||||
    /*0x3d*/ u8 moleMittsState;
 | 
			
		||||
    /*0x3e*/ u8 swordDamage : 2;
 | 
			
		||||
    /*    */ u8 filler14 : 6;
 | 
			
		||||
    /*0x3f*/ u8 field_0x3f;
 | 
			
		||||
    /*0x3f*/ s8 spriteOffsetY;
 | 
			
		||||
    /*0x40*/ u32 path_memory[16];
 | 
			
		||||
    /*0x80*/ u16 speed_modifier;
 | 
			
		||||
    /*0x82*/ u8 field_0x82[9];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ Entity* sub_08049DF4(u32 arg0) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
Entity* sub_08049E18(void) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c[0] == 0) &&
 | 
			
		||||
    if ((gPlayerState.field_0x3c == 0) &&
 | 
			
		||||
        !(gPlayerState.flags &
 | 
			
		||||
          (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN |
 | 
			
		||||
           PL_IN_MINECART | PL_PIT_IS_EXIT | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING))) {
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ Entity* sub_08049E18(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
Entity* sub_08049E4C(void) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c[0] == 0) &&
 | 
			
		||||
    if ((gPlayerState.field_0x3c == 0) &&
 | 
			
		||||
        !(gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_MINISH |
 | 
			
		||||
                                PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN | PL_IN_MINECART | PL_PIT_IS_EXIT |
 | 
			
		||||
                                PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING))) {
 | 
			
		||||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ Entity* sub_08049E4C(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
Entity* sub_08049E80(void) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c[0] != 0) || !(gPlayerState.flags & 0x80)) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c != 0) || !(gPlayerState.flags & 0x80)) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
    gUnk_020000B0 = &gPlayerEntity;
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +51,7 @@ Entity* sub_08049E80(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
Entity* sub_08049EB0(void) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c[0] == 0) && !(gPlayerState.flags & 0x80190)) {
 | 
			
		||||
    if ((gPlayerState.field_0x3c == 0) && !(gPlayerState.flags & 0x80190)) {
 | 
			
		||||
        gUnk_020000B0 = &gPlayerEntity;
 | 
			
		||||
        return &gPlayerEntity;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -167,8 +167,8 @@ void sub_08037690(GibdoEntity* this) {
 | 
			
		|||
void sub_080376D0(GibdoEntity* this) {
 | 
			
		||||
    if (!sub_080379EC(this)) {
 | 
			
		||||
        ResetPlayerItem();
 | 
			
		||||
        gPlayerState.mobility = gPlayerState.mobility | 0x80;
 | 
			
		||||
        gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
 | 
			
		||||
        gPlayerState.mobility |= 0x80;
 | 
			
		||||
        gPlayerState.field_0xa |= 0x80;
 | 
			
		||||
        CopyPositionAndSpriteOffset(&gPlayerEntity, super);
 | 
			
		||||
        UpdateAnimationSingleFrame(super);
 | 
			
		||||
        if ((super->frame & 1) != 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,7 +126,7 @@ void Gleerok_OnDeath(GleerokEntity* this) {
 | 
			
		|||
            gPlayerState.field_0x14 = 1;
 | 
			
		||||
 | 
			
		||||
            if (sub_0806FC80(super, &gPlayerEntity, super->frame & 0x3f)) {
 | 
			
		||||
                gPlayerState.field_0x3f = 0xfa;
 | 
			
		||||
                gPlayerState.spriteOffsetY = -6;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            gUnk_080CD75C[super->action](this);
 | 
			
		||||
| 
						 | 
				
			
			@ -523,7 +523,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
 | 
			
		|||
                return;
 | 
			
		||||
 | 
			
		||||
            gPlayerState.field_0x14 = 1;
 | 
			
		||||
            gPlayerState.field_0x3f = 0xfc;
 | 
			
		||||
            gPlayerState.spriteOffsetY = -4;
 | 
			
		||||
 | 
			
		||||
            break;
 | 
			
		||||
        case 4:
 | 
			
		||||
| 
						 | 
				
			
			@ -956,7 +956,7 @@ void sub_0802E0B8(GleerokEntity* this) {
 | 
			
		|||
    if (val) {
 | 
			
		||||
        if (sub_0806FC80(super, &gPlayerEntity, val)) {
 | 
			
		||||
            gPlayerState.field_0x14 = 1;
 | 
			
		||||
            gPlayerState.field_0x3f = 0xfa;
 | 
			
		||||
            gPlayerState.spriteOffsetY = -6;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1006,7 +1006,7 @@ void sub_0802E1D0(GleerokEntity* this) {
 | 
			
		|||
    if (super->frame & 0x3f) {
 | 
			
		||||
        if (sub_0806FC80(super, &gPlayerEntity, super->frame & 0x3f)) {
 | 
			
		||||
            gPlayerState.field_0x14 = 1;
 | 
			
		||||
            gPlayerState.field_0x3f = 0xfa;
 | 
			
		||||
            gPlayerState.spriteOffsetY = -6;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (super->frame & 0x40) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,211 +5,219 @@
 | 
			
		|||
 * @brief Like Like enemy
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define NENT_DEPRECATED
 | 
			
		||||
#include "enemy.h"
 | 
			
		||||
#include "message.h"
 | 
			
		||||
#include "save.h"
 | 
			
		||||
#include "object.h"
 | 
			
		||||
#include "item.h"
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    Entity base;
 | 
			
		||||
    u8 filler[0x18];
 | 
			
		||||
    u8 stolenItem;
 | 
			
		||||
    u8 filler2;
 | 
			
		||||
    u8 field_0x82;
 | 
			
		||||
    u8 prevSpritePriority;
 | 
			
		||||
} LikeLikeEntity;
 | 
			
		||||
 | 
			
		||||
extern bool32 ItemIsShield(u32);
 | 
			
		||||
 | 
			
		||||
void sub_0802810C(Entity*);
 | 
			
		||||
void sub_080281A0(Entity*);
 | 
			
		||||
bool32 sub_080281E0(u32);
 | 
			
		||||
void sub_08028224(u32);
 | 
			
		||||
void LikeLike_ReleasePlayer(LikeLikeEntity*);
 | 
			
		||||
void sub_080281A0(LikeLikeEntity*);
 | 
			
		||||
bool32 LikeLike_StealItem(u32);
 | 
			
		||||
void LikeLike_ReturnStolenItem(u32);
 | 
			
		||||
 | 
			
		||||
extern void (*const LikeLike_Functions[])(Entity*);
 | 
			
		||||
extern void (*const gUnk_080CC714[])(Entity*);
 | 
			
		||||
extern void (*const gUnk_080CC714[])(LikeLikeEntity*);
 | 
			
		||||
 | 
			
		||||
void LikeLike(Entity* this) {
 | 
			
		||||
    EnemyFunctionHandler(this, LikeLike_Functions);
 | 
			
		||||
    SetChildOffset(this, 0, 1, -0x10);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LikeLike_OnTick(Entity* this) {
 | 
			
		||||
    gUnk_080CC714[this->action](this);
 | 
			
		||||
void LikeLike_OnTick(LikeLikeEntity* this) {
 | 
			
		||||
    gUnk_080CC714[super->action](this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LikeLike_OnCollision(Entity* this) {
 | 
			
		||||
    if (this->hitType == 1) {
 | 
			
		||||
        this->action = 3;
 | 
			
		||||
        COLLISION_OFF(this);
 | 
			
		||||
        this->hitType = 0x8c;
 | 
			
		||||
void LikeLike_OnCollision(LikeLikeEntity* this) {
 | 
			
		||||
    if (super->hitType == 1) {
 | 
			
		||||
        super->action = 3;
 | 
			
		||||
        COLLISION_OFF(super);
 | 
			
		||||
        super->hitType = 0x8c;
 | 
			
		||||
    } else {
 | 
			
		||||
        if (this->action == 7) {
 | 
			
		||||
            sub_0802810C(this);
 | 
			
		||||
        } else if (this->contactFlags & 0x80) {
 | 
			
		||||
            u8 tmp = this->contactFlags & ~0x80;
 | 
			
		||||
        if (super->action == 7) {
 | 
			
		||||
            LikeLike_ReleasePlayer(this);
 | 
			
		||||
        } else if (super->contactFlags & 0x80) {
 | 
			
		||||
            u8 tmp = super->contactFlags & ~0x80;
 | 
			
		||||
            if (tmp == 0) {
 | 
			
		||||
                this->action = 7;
 | 
			
		||||
                this->timer = 95;
 | 
			
		||||
                this->subtimer = tmp;
 | 
			
		||||
                this->flags2 &= 0xfc;
 | 
			
		||||
                this->field_0x82.HALF.HI = gPlayerEntity.spritePriority.b1;
 | 
			
		||||
                super->action = 7;
 | 
			
		||||
                super->timer = 95;
 | 
			
		||||
                super->subtimer = tmp;
 | 
			
		||||
                super->flags2 &= 0xfc;
 | 
			
		||||
                this->prevSpritePriority = gPlayerEntity.spritePriority.b1;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (this->health == 0) {
 | 
			
		||||
        this->timer = 32;
 | 
			
		||||
    if (super->health == 0) {
 | 
			
		||||
        super->timer = 32;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (this->confusedTime) {
 | 
			
		||||
        Create0x68FX(this, FX_STARS);
 | 
			
		||||
    if (super->confusedTime) {
 | 
			
		||||
        Create0x68FX(super, FX_STARS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    EnemyFunctionHandlerAfterCollision(this, LikeLike_Functions);
 | 
			
		||||
    EnemyFunctionHandlerAfterCollision(super, LikeLike_Functions);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LikeLike_OnDeath(Entity* this) {
 | 
			
		||||
    if (this->timer == 2 && this->field_0x80.HALF.LO != 0xff) {
 | 
			
		||||
        SetDefaultPriority(this, PRIO_NO_BLOCK);
 | 
			
		||||
        sub_08028224(this->field_0x80.HALF.LO);
 | 
			
		||||
void LikeLike_OnDeath(LikeLikeEntity* this) {
 | 
			
		||||
    if (super->timer == 2 && this->stolenItem != 0xff) {
 | 
			
		||||
        SetDefaultPriority(super, PRIO_NO_BLOCK);
 | 
			
		||||
        LikeLike_ReturnStolenItem(this->stolenItem);
 | 
			
		||||
    }
 | 
			
		||||
    GenericDeath(this);
 | 
			
		||||
    GenericDeath(super);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LikeLike_OnGrabbed(Entity* this) {
 | 
			
		||||
    /* ... */
 | 
			
		||||
void LikeLike_OnGrabbed(LikeLikeEntity* this) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_08027E70(Entity* this) {
 | 
			
		||||
    sub_0804A720(this);
 | 
			
		||||
void LikeLike_Init(LikeLikeEntity* this) {
 | 
			
		||||
    sub_0804A720(super);
 | 
			
		||||
 | 
			
		||||
    switch (this->type) {
 | 
			
		||||
    switch (super->type) {
 | 
			
		||||
        case 0:
 | 
			
		||||
            this->action = 3;
 | 
			
		||||
            this->spriteSettings.draw = 0;
 | 
			
		||||
            COLLISION_OFF(this);
 | 
			
		||||
            this->timer = 0;
 | 
			
		||||
            super->action = 3;
 | 
			
		||||
            super->spriteSettings.draw = 0;
 | 
			
		||||
            COLLISION_OFF(super);
 | 
			
		||||
            super->timer = 0;
 | 
			
		||||
            break;
 | 
			
		||||
        case 1:
 | 
			
		||||
            this->action = 1;
 | 
			
		||||
            this->spriteSettings.draw = 1;
 | 
			
		||||
            this->timer = 8;
 | 
			
		||||
            InitializeAnimation(this, 1);
 | 
			
		||||
            super->action = 1;
 | 
			
		||||
            super->spriteSettings.draw = 1;
 | 
			
		||||
            super->timer = 8;
 | 
			
		||||
            InitializeAnimation(super, 1);
 | 
			
		||||
            break;
 | 
			
		||||
        case 2:
 | 
			
		||||
            this->action = 1;
 | 
			
		||||
            this->spriteSettings.draw = 0;
 | 
			
		||||
            this->timer = 0;
 | 
			
		||||
            this->hitType = 1;
 | 
			
		||||
            InitializeAnimation(this, 0);
 | 
			
		||||
            super->action = 1;
 | 
			
		||||
            super->spriteSettings.draw = 0;
 | 
			
		||||
            super->timer = 0;
 | 
			
		||||
            super->hitType = 1;
 | 
			
		||||
            InitializeAnimation(super, 0);
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this->direction = 0;
 | 
			
		||||
    this->field_0x82.HALF.LO = 0;
 | 
			
		||||
    this->animationState = 0;
 | 
			
		||||
    this->field_0x82.HALF.HI = 0;
 | 
			
		||||
    this->field_0x80.HALF.LO = 0xff;
 | 
			
		||||
    super->direction = 0;
 | 
			
		||||
    this->field_0x82 = 0;
 | 
			
		||||
    super->animationState = 0;
 | 
			
		||||
    this->prevSpritePriority = 0;
 | 
			
		||||
    this->stolenItem = 0xff;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_08027EFC(Entity* this) {
 | 
			
		||||
    if (this->hitType == 1)
 | 
			
		||||
void sub_08027EFC(LikeLikeEntity* this) {
 | 
			
		||||
    if (super->hitType == 1)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    if (sub_08049FDC(this, 1)) {
 | 
			
		||||
        if (!sub_08049FA0(this) && (Random() & 0x30)) {
 | 
			
		||||
            this->direction = sub_08049EE4(this);
 | 
			
		||||
    if (sub_08049FDC(super, 1)) {
 | 
			
		||||
        if (!sub_08049FA0(super) && (Random() & 0x30)) {
 | 
			
		||||
            super->direction = sub_08049EE4(super);
 | 
			
		||||
        } else {
 | 
			
		||||
            this->direction = this->field_0x82.HALF.LO;
 | 
			
		||||
            super->direction = this->field_0x82;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (--this->timer == 0) {
 | 
			
		||||
            this->direction = sub_08049F84(this, 1);
 | 
			
		||||
            this->field_0x82.HALF.LO = this->direction;
 | 
			
		||||
            this->timer = 8;
 | 
			
		||||
        if (--super->timer == 0) {
 | 
			
		||||
            super->direction = sub_08049F84(super, 1);
 | 
			
		||||
            this->field_0x82 = super->direction;
 | 
			
		||||
            super->timer = 8;
 | 
			
		||||
        }
 | 
			
		||||
        ProcessMovement0(this);
 | 
			
		||||
        GetNextFrame(this);
 | 
			
		||||
        ProcessMovement0(super);
 | 
			
		||||
        GetNextFrame(super);
 | 
			
		||||
    } else {
 | 
			
		||||
        this->action = 6;
 | 
			
		||||
        COLLISION_OFF(this);
 | 
			
		||||
        InitializeAnimation(this, 2);
 | 
			
		||||
        super->action = 6;
 | 
			
		||||
        COLLISION_OFF(super);
 | 
			
		||||
        InitializeAnimation(super, 2);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nullsub_12(Entity* this) {
 | 
			
		||||
    /* ... */
 | 
			
		||||
void nullsub_12(LikeLikeEntity* this) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_08027F84(Entity* this) {
 | 
			
		||||
    if (sub_08049FDC(this, 1)) {
 | 
			
		||||
        this->action = 5;
 | 
			
		||||
        this->spriteSettings.draw = 1;
 | 
			
		||||
        InitializeAnimation(this, 0);
 | 
			
		||||
        CreateDust(this);
 | 
			
		||||
void sub_08027F84(LikeLikeEntity* this) {
 | 
			
		||||
    if (sub_08049FDC(super, 1)) {
 | 
			
		||||
        super->action = 5;
 | 
			
		||||
        super->spriteSettings.draw = 1;
 | 
			
		||||
        InitializeAnimation(super, 0);
 | 
			
		||||
        CreateDust(super);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_08027FB4(Entity* this) {
 | 
			
		||||
    if (--this->timer == 0) {
 | 
			
		||||
        this->action = 1;
 | 
			
		||||
        this->timer = 1;
 | 
			
		||||
        this->flags2 |= 1;
 | 
			
		||||
void sub_08027FB4(LikeLikeEntity* this) {
 | 
			
		||||
    if (--super->timer == 0) {
 | 
			
		||||
        super->action = 1;
 | 
			
		||||
        super->timer = 1;
 | 
			
		||||
        super->flags2 |= 1;
 | 
			
		||||
    }
 | 
			
		||||
    GetNextFrame(this);
 | 
			
		||||
    GetNextFrame(super);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_08027FE0(Entity* this) {
 | 
			
		||||
    GetNextFrame(this);
 | 
			
		||||
    if (this->frame & 1) {
 | 
			
		||||
        this->action = 1;
 | 
			
		||||
        COLLISION_ON(this);
 | 
			
		||||
        this->direction = sub_08049F84(this, 1);
 | 
			
		||||
        this->timer = 8;
 | 
			
		||||
        this->spritePriority.b1 = 1;
 | 
			
		||||
        InitializeAnimation(this, 1);
 | 
			
		||||
void sub_08027FE0(LikeLikeEntity* this) {
 | 
			
		||||
    GetNextFrame(super);
 | 
			
		||||
    if (super->frame & 1) {
 | 
			
		||||
        super->action = 1;
 | 
			
		||||
        COLLISION_ON(super);
 | 
			
		||||
        super->direction = sub_08049F84(super, 1);
 | 
			
		||||
        super->timer = 8;
 | 
			
		||||
        super->spritePriority.b1 = 1;
 | 
			
		||||
        InitializeAnimation(super, 1);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_0802802C(Entity* this) {
 | 
			
		||||
    GetNextFrame(this);
 | 
			
		||||
    if (this->frame & 1) {
 | 
			
		||||
        this->action = 3;
 | 
			
		||||
        this->spriteSettings.draw = 0;
 | 
			
		||||
        this->direction = 0;
 | 
			
		||||
        this->timer = 0;
 | 
			
		||||
        CreateDust(this);
 | 
			
		||||
void sub_0802802C(LikeLikeEntity* this) {
 | 
			
		||||
    GetNextFrame(super);
 | 
			
		||||
    if (super->frame & 1) {
 | 
			
		||||
        super->action = 3;
 | 
			
		||||
        super->spriteSettings.draw = 0;
 | 
			
		||||
        super->direction = 0;
 | 
			
		||||
        super->timer = 0;
 | 
			
		||||
        CreateDust(super);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_0802805C(Entity* this) {
 | 
			
		||||
void sub_0802805C(LikeLikeEntity* this) {
 | 
			
		||||
    u8* tmp;
 | 
			
		||||
 | 
			
		||||
    UpdateAnimationVariableFrames(this, 2);
 | 
			
		||||
    UpdateAnimationVariableFrames(super, 2);
 | 
			
		||||
 | 
			
		||||
    if (sub_0807953C()) {
 | 
			
		||||
        u32 tmp2 = Random();
 | 
			
		||||
        u32 tmp3 = this->subtimer + 1;
 | 
			
		||||
        u32 tmp3 = super->subtimer + 1;
 | 
			
		||||
        tmp3 += (tmp2 & 1);
 | 
			
		||||
        this->subtimer = tmp3;
 | 
			
		||||
        super->subtimer = tmp3;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (this->subtimer >= 0x19 || gSave.stats.health == 0) {
 | 
			
		||||
        sub_0802810C(this);
 | 
			
		||||
    if (super->subtimer >= 0x19 || gSave.stats.health == 0) {
 | 
			
		||||
        LikeLike_ReleasePlayer(this);
 | 
			
		||||
    } else {
 | 
			
		||||
        ResetPlayerItem();
 | 
			
		||||
        gPlayerState.mobility |= 0x80;
 | 
			
		||||
        PositionRelative(this, &gPlayerEntity, 0, Q_16_16(1.0));
 | 
			
		||||
        PositionRelative(super, &gPlayerEntity, 0, Q_16_16(1.0));
 | 
			
		||||
 | 
			
		||||
        tmp = GetSpriteSubEntryOffsetDataPointer((u16)this->spriteIndex, this->frameIndex);
 | 
			
		||||
        tmp = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex);
 | 
			
		||||
        gPlayerEntity.spriteOffsetX = tmp[0];
 | 
			
		||||
        gPlayerEntity.spriteOffsetY = tmp[1];
 | 
			
		||||
        gPlayerEntity.spritePriority.b1 = 0;
 | 
			
		||||
 | 
			
		||||
        if (--this->timer == 0) {
 | 
			
		||||
        if (--super->timer == 0) {
 | 
			
		||||
            sub_080281A0(this);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((this->timer & 3) == 0) {
 | 
			
		||||
        if ((super->timer & 3) == 0) {
 | 
			
		||||
            EnqueueSFX(SFX_PLACE_OBJ);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_0802810C(Entity* this) {
 | 
			
		||||
void LikeLike_ReleasePlayer(LikeLikeEntity* this) {
 | 
			
		||||
// This matches but ugly
 | 
			
		||||
#ifndef NON_MATCHING
 | 
			
		||||
    register u32 tmp asm("r3");
 | 
			
		||||
| 
						 | 
				
			
			@ -223,34 +231,33 @@ void sub_0802810C(Entity* this) {
 | 
			
		|||
    gPlayerEntity.zVelocity = Q_16_16(1.5);
 | 
			
		||||
    gPlayerEntity.iframes = -60;
 | 
			
		||||
    tmp = 0;
 | 
			
		||||
    gPlayerEntity.direction = gPlayerEntity.animationState << 2;
 | 
			
		||||
    gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI;
 | 
			
		||||
    gPlayerEntity.direction = Direction8FromAnimationState(gPlayerEntity.animationState);
 | 
			
		||||
    gPlayerEntity.spritePriority.b1 = this->prevSpritePriority;
 | 
			
		||||
    gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
 | 
			
		||||
    gPlayerEntity.spriteOffsetY = tmp;
 | 
			
		||||
    this->action = 4;
 | 
			
		||||
    this->timer = 80;
 | 
			
		||||
    this->subtimer = tmp;
 | 
			
		||||
    this->flags2 |= 2;
 | 
			
		||||
    if (this->iframes == 0) {
 | 
			
		||||
        this->iframes = -18;
 | 
			
		||||
    super->action = 4;
 | 
			
		||||
    super->timer = 80;
 | 
			
		||||
    super->subtimer = tmp;
 | 
			
		||||
    super->flags2 |= 2;
 | 
			
		||||
    if (super->iframes == 0) {
 | 
			
		||||
        super->iframes = -18;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_080281A0(Entity* this) {
 | 
			
		||||
    this->subtimer = 25;
 | 
			
		||||
    if (sub_080281E0(ITEM_MIRROR_SHIELD)) {
 | 
			
		||||
        this->field_0x80.HALF.LO = ITEM_MIRROR_SHIELD;
 | 
			
		||||
void sub_080281A0(LikeLikeEntity* this) {
 | 
			
		||||
    super->subtimer = 25;
 | 
			
		||||
    if (LikeLike_StealItem(ITEM_MIRROR_SHIELD)) {
 | 
			
		||||
        this->stolenItem = ITEM_MIRROR_SHIELD;
 | 
			
		||||
        MessageFromTarget(TEXT_INDEX(TEXT_ITEM_GET, 0x78));
 | 
			
		||||
    } else if (sub_080281E0(ITEM_SHIELD)) {
 | 
			
		||||
        this->field_0x80.HALF.LO = ITEM_SHIELD;
 | 
			
		||||
    } else if (LikeLike_StealItem(ITEM_SHIELD)) {
 | 
			
		||||
        this->stolenItem = ITEM_SHIELD;
 | 
			
		||||
        MessageFromTarget(TEXT_INDEX(TEXT_ITEM_GET, 0x78));
 | 
			
		||||
    } else {
 | 
			
		||||
        ModHealth(-1);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Can steal item */
 | 
			
		||||
bool32 sub_080281E0(u32 item) {
 | 
			
		||||
bool32 LikeLike_StealItem(u32 item) {
 | 
			
		||||
    bool32 ret = FALSE;
 | 
			
		||||
    if (GetInventoryValue(item) == 1) {
 | 
			
		||||
        if (ItemIsShield(gSave.stats.itemButtons[SLOT_A])) {
 | 
			
		||||
| 
						 | 
				
			
			@ -268,8 +275,7 @@ bool32 sub_080281E0(u32 item) {
 | 
			
		|||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Return stolen item */
 | 
			
		||||
void sub_08028224(u32 item) {
 | 
			
		||||
void LikeLike_ReturnStolenItem(u32 item) {
 | 
			
		||||
#ifdef EU
 | 
			
		||||
    CreateItemEntity(item, 0, 1);
 | 
			
		||||
#else
 | 
			
		||||
| 
						 | 
				
			
			@ -279,9 +285,14 @@ void sub_08028224(u32 item) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void (*const LikeLike_Functions[])(Entity*) = {
 | 
			
		||||
    LikeLike_OnTick, LikeLike_OnCollision, GenericKnockback, LikeLike_OnDeath, GenericConfused, LikeLike_OnGrabbed,
 | 
			
		||||
    (EntityActionPtr)LikeLike_OnTick,
 | 
			
		||||
    (EntityActionPtr)LikeLike_OnCollision,
 | 
			
		||||
    GenericKnockback,
 | 
			
		||||
    (EntityActionPtr)LikeLike_OnDeath,
 | 
			
		||||
    GenericConfused,
 | 
			
		||||
    (EntityActionPtr)LikeLike_OnGrabbed,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void (*const gUnk_080CC714[])(Entity*) = {
 | 
			
		||||
    sub_08027E70, sub_08027EFC, nullsub_12, sub_08027F84, sub_08027FB4, sub_08027FE0, sub_0802802C, sub_0802805C,
 | 
			
		||||
void (*const gUnk_080CC714[])(LikeLikeEntity*) = {
 | 
			
		||||
    LikeLike_Init, sub_08027EFC, nullsub_12, sub_08027F84, sub_08027FB4, sub_08027FE0, sub_0802802C, sub_0802805C,
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1245,7 +1245,7 @@ void sub_0803B804(Entity* this) {
 | 
			
		|||
 | 
			
		||||
void sub_0803B824(Entity* this) {
 | 
			
		||||
    ResetPlayerItem();
 | 
			
		||||
    gPlayerState.mobility = gPlayerState.mobility | 0x80;
 | 
			
		||||
    gPlayerState.mobility |= 0x80;
 | 
			
		||||
    sub_0806FA90(this, &gPlayerEntity, gUnk_080CFD1D[this->type], 1);
 | 
			
		||||
    gPlayerEntity.spriteOffsetY = -6;
 | 
			
		||||
    gPlayerEntity.spritePriority.b1 = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -227,8 +227,8 @@ void VaatiProjectileFunction0Action9(Entity* this) {
 | 
			
		|||
 | 
			
		||||
void sub_0803E444(Entity* this) {
 | 
			
		||||
    ResetPlayerItem();
 | 
			
		||||
    gPlayerState.mobility = gPlayerState.mobility | 0x80;
 | 
			
		||||
    gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
 | 
			
		||||
    gPlayerState.mobility |= 0x80;
 | 
			
		||||
    gPlayerState.field_0xa |= 0x80;
 | 
			
		||||
    sub_0806FA90(this, this->contactedEntity, 0, -2);
 | 
			
		||||
    gPlayerEntity.spriteOffsetY += 0xe;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -333,8 +333,8 @@ static void sub_080171F0(void) {
 | 
			
		|||
    gPlayerState.speed_modifier = 0;
 | 
			
		||||
    gPlayerState.field_0xaa = 0;
 | 
			
		||||
    MemClear(&gCarriedEntity, 0x8c);
 | 
			
		||||
    gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
 | 
			
		||||
    gPlayerState.field_0x3f = 0;
 | 
			
		||||
    gPlayerEntity.spriteOffsetY = gPlayerState.spriteOffsetY;
 | 
			
		||||
    gPlayerState.spriteOffsetY = 0;
 | 
			
		||||
    sub_0807B0C8();
 | 
			
		||||
 | 
			
		||||
    if (gPlayerState.flags & PL_CLONING)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ void sub_08077130(ItemBehavior* this, u32 idx) {
 | 
			
		|||
 | 
			
		||||
    if (gPlayerState.jump_status == 0) {
 | 
			
		||||
        sub_08077D38(this, idx);
 | 
			
		||||
        gPlayerState.field_0x3c[1] = 1;
 | 
			
		||||
        gPlayerState.moleMittsState = 1;
 | 
			
		||||
        this->field_0x5[4] |= 0x80;
 | 
			
		||||
        iVar1 = sub_080774A0();
 | 
			
		||||
        if (iVar1 != 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -50,7 +50,7 @@ void sub_08077130(ItemBehavior* this, u32 idx) {
 | 
			
		|||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        DeletePlayerItem(this, idx);
 | 
			
		||||
        gPlayerState.field_0x3c[1] = 0;
 | 
			
		||||
        gPlayerState.moleMittsState = 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +64,7 @@ void sub_080771C8(ItemBehavior* this, u32 idx) {
 | 
			
		|||
    UpdateItemAnim(this);
 | 
			
		||||
    if ((this->field_0x5[9] & 0x80) != 0) {
 | 
			
		||||
        DeletePlayerItem(this, idx);
 | 
			
		||||
        gPlayerState.field_0x3c[1] = 0;
 | 
			
		||||
        gPlayerState.moleMittsState = 0;
 | 
			
		||||
    } else {
 | 
			
		||||
        if (((this->field_0x5[9] & 0x20) != 0) && (this->field_0x5[3] == 0xff)) {
 | 
			
		||||
            CreateObjectWithParent(&gPlayerEntity, 0x1e, this->field_0x5[9], 1);
 | 
			
		||||
| 
						 | 
				
			
			@ -132,7 +132,7 @@ void sub_080772A8(ItemBehavior* this, u32 idx) {
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
        DeletePlayerItem(this, idx);
 | 
			
		||||
        gPlayerState.field_0x3c[1] = 0;
 | 
			
		||||
        gPlayerState.moleMittsState = 0;
 | 
			
		||||
    } else {
 | 
			
		||||
        if ((this->field_0x5[9] & 0x60) != 0) {
 | 
			
		||||
            gPlayerEntity.frameDuration = 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -168,7 +168,7 @@ void sub_08077448(ItemBehavior* this, u32 idx) {
 | 
			
		|||
    }
 | 
			
		||||
    UpdateItemAnim(this);
 | 
			
		||||
    if ((this->field_0x5[9] & 0x80) != 0) {
 | 
			
		||||
        gPlayerState.field_0x3c[1] = 0;
 | 
			
		||||
        gPlayerState.moleMittsState = 0;
 | 
			
		||||
        DeletePlayerItem(this, idx);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ void ItemRocsCape(ItemBehavior* this, u32 arg1) {
 | 
			
		|||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            if (((u8)(gPlayerState.sword_state | gPlayerState.field_0xa | gPlayerState.field_0x3[1] |
 | 
			
		||||
                      gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) &&
 | 
			
		||||
                      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)) ||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,12 +11,12 @@ void Carlov(Entity* this) {
 | 
			
		|||
        sub_0807DD94(this, 0);
 | 
			
		||||
    }
 | 
			
		||||
    if ((this->frame & 0x10) != 0) {
 | 
			
		||||
        this->frame = this->frame & 0xef;
 | 
			
		||||
        this->frame &= ~0x10;
 | 
			
		||||
        EnqueueSFX(SFX_PLACE_OBJ);
 | 
			
		||||
        InitScreenShake(16, 0);
 | 
			
		||||
    }
 | 
			
		||||
    if ((this->frame & 0x20) != 0) {
 | 
			
		||||
        this->frame = this->frame & 0xdf;
 | 
			
		||||
        this->frame &= ~0x20;
 | 
			
		||||
        EnqueueSFX(SFX_PLY_JUMP);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,12 +58,12 @@ void BakerOven_Action1(Entity* this) {
 | 
			
		|||
    if (this->type) {
 | 
			
		||||
        GetNextFrame(this);
 | 
			
		||||
        frames = &this->frame;
 | 
			
		||||
        if (*frames & 1) {
 | 
			
		||||
            *frames &= 0xfe;
 | 
			
		||||
        if (this->frame & 1) {
 | 
			
		||||
            this->frame &= ~1;
 | 
			
		||||
            this->y.HALF.HI++;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((*frames & 0x80) && this->frameDuration == 1) {
 | 
			
		||||
        if ((*frames & ANIM_DONE) && this->frameDuration == 1) {
 | 
			
		||||
            this->action = 2;
 | 
			
		||||
            this->spriteSettings.draw = 0;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -418,12 +418,12 @@ void sub_08094FA8(CutsceneMiscObjectEntity* this) {
 | 
			
		|||
                super->action = 4;
 | 
			
		||||
#ifndef EU
 | 
			
		||||
                if (!CheckGlobalFlag(BIN_DOGFOOD)) {
 | 
			
		||||
                    CreateItemEntity(0x1c, 0, 0);
 | 
			
		||||
                    CreateItemEntity(ITEM_BOTTLE1, 0, 0);
 | 
			
		||||
                    SetGlobalFlag(BIN_DOGFOOD);
 | 
			
		||||
                    super->timer = 60;
 | 
			
		||||
                }
 | 
			
		||||
#else
 | 
			
		||||
                CreateItemEntity(0x1c, 0, 0);
 | 
			
		||||
                CreateItemEntity(ITEM_BOTTLE1, 0, 0);
 | 
			
		||||
#endif
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ void sub_08095088(CutsceneMiscObjectEntity* this) {
 | 
			
		|||
            break;
 | 
			
		||||
        case 2:
 | 
			
		||||
            if ((gMessage.doTextBox & 0x7F) == 0) {
 | 
			
		||||
                CreateItemEntity(0x5b, 0, 0);
 | 
			
		||||
                CreateItemEntity(ITEM_JABBERNUT, 0, 0);
 | 
			
		||||
                DeleteThisEntity();
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,7 +68,7 @@ static void HeartContainer_Action3(Entity* this) {
 | 
			
		|||
    sub_08080CB4(this);
 | 
			
		||||
    if (!(gPlayerState.flags & PL_MINISH) && IsCollidingPlayer(this)) {
 | 
			
		||||
        SetFlag(this->cutsceneBeh.HWORD);
 | 
			
		||||
        CreateItemEntity(0x62, 0, 0);
 | 
			
		||||
        CreateItemEntity(ITEM_HEART_CONTAINER, 0, 0);
 | 
			
		||||
        DeleteThisEntity();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,7 +141,7 @@ void LavaPlatform_Type1Action2(LavaPlatformEntity* this) {
 | 
			
		|||
            super->action = 3;
 | 
			
		||||
            super->flags &= ~ENT_COLLIDE;
 | 
			
		||||
            super->timer = 20;
 | 
			
		||||
            gPlayerState.field_0x3f = 0xfd;
 | 
			
		||||
            gPlayerState.spriteOffsetY = -3;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -149,7 +149,7 @@ void LavaPlatform_Type1Action2(LavaPlatformEntity* this) {
 | 
			
		|||
/** Player is standing on the platform. */
 | 
			
		||||
void LavaPlatform_Type1Action3(LavaPlatformEntity* this) {
 | 
			
		||||
    if (LavaPlatform_IsPlayerOnPlatform(this)) {
 | 
			
		||||
        gPlayerState.field_0x3f = 0xfd;
 | 
			
		||||
        gPlayerState.spriteOffsetY = -3;
 | 
			
		||||
    }
 | 
			
		||||
    if (--super->timer == 0) {
 | 
			
		||||
        super->action = 4;
 | 
			
		||||
| 
						 | 
				
			
			@ -219,7 +219,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) {
 | 
			
		|||
        if ((super->frame & ANIM_DONE) != 0) {
 | 
			
		||||
            sub_0809264C(this);
 | 
			
		||||
            if (tmp) {
 | 
			
		||||
                gPlayerState.field_0x3f = 0xfd;
 | 
			
		||||
                gPlayerState.spriteOffsetY = -3;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,7 +69,7 @@ void Object1F_Action1(Object1FEntity* this) {
 | 
			
		|||
 | 
			
		||||
    if (this->unk6c) {
 | 
			
		||||
        this->unk6c--;
 | 
			
		||||
        uVar1 = gPlayerState.field_0x3c[1];
 | 
			
		||||
        uVar1 = gPlayerState.moleMittsState;
 | 
			
		||||
    } else {
 | 
			
		||||
        ProcessMovement2(super);
 | 
			
		||||
        uVar1 = GravityUpdate(super, Q_8_8(40.0));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ void Whirlwind_Action1(Entity* this) {
 | 
			
		|||
    }
 | 
			
		||||
    if (this->spriteSettings.draw != 0) {
 | 
			
		||||
        GetNextFrame(this);
 | 
			
		||||
        if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c[0] == 0)) &&
 | 
			
		||||
        if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) &&
 | 
			
		||||
             ((gPlayerEntity.action == 4 || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
 | 
			
		||||
            ((gPlayerEntity.action != 6 && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
 | 
			
		||||
            if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != 4)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								src/player.c
								
								
								
								
							
							
						
						
									
										10
									
								
								src/player.c
								
								
								
								
							| 
						 | 
				
			
			@ -1561,7 +1561,7 @@ static void sub_08071D04(Entity* this) {
 | 
			
		|||
    if (deltaHealth != 0) {
 | 
			
		||||
        ModHealth(deltaHealth);
 | 
			
		||||
        this->subAction = 3;
 | 
			
		||||
        gPlayerState.field_0x3c[0] = 0;
 | 
			
		||||
        gPlayerState.field_0x3c = 0;
 | 
			
		||||
        this->direction = 0xff;
 | 
			
		||||
        this->speed = 0;
 | 
			
		||||
        this->zVelocity = Q_16_16(1.5);
 | 
			
		||||
| 
						 | 
				
			
			@ -2749,7 +2749,7 @@ static void sub_08073504(Entity* this) {
 | 
			
		|||
static void sub_08073584(Entity* this) {
 | 
			
		||||
    u32 state, dir, idx;
 | 
			
		||||
 | 
			
		||||
    if ((gPlayerState.playerInput.field_0x92 & PLAYER_INPUT_80) || this->iframes > 0 || gPlayerState.field_0x3c[0] ||
 | 
			
		||||
    if ((gPlayerState.playerInput.field_0x92 & PLAYER_INPUT_80) || this->iframes > 0 || gPlayerState.field_0x3c ||
 | 
			
		||||
        (gPlayerState.flags & PL_PARACHUTE) == 0) {
 | 
			
		||||
        gPlayerState.jump_status |= 0x40;
 | 
			
		||||
        PlayerSetNormalAndCollide();
 | 
			
		||||
| 
						 | 
				
			
			@ -3570,7 +3570,7 @@ void SurfaceAction_Swamp(Entity* this) {
 | 
			
		|||
            gPlayerState.speed_modifier -= 0xf0;
 | 
			
		||||
            gPlayerState.framestate = 0x1b;
 | 
			
		||||
            if (gPlayerState.field_0x37 < 0xf0) {
 | 
			
		||||
                gPlayerState.field_0x3f = gPlayerState.field_0x3f + 4 + (gPlayerState.field_0x37 >> 5);
 | 
			
		||||
                gPlayerState.spriteOffsetY = gPlayerState.spriteOffsetY + 4 + (gPlayerState.field_0x37 >> 5);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -3585,7 +3585,7 @@ void SurfaceAction_Swamp(Entity* this) {
 | 
			
		|||
void SurfaceAction_Water(Entity* this) {
 | 
			
		||||
    if (!sub_080741C4()) {
 | 
			
		||||
        if (gPlayerState.field_0x14 == 0) {
 | 
			
		||||
            gPlayerState.field_0x3f += 2;
 | 
			
		||||
            gPlayerState.spriteOffsetY += 2;
 | 
			
		||||
        } else {
 | 
			
		||||
            gPlayerState.swim_state = 0;
 | 
			
		||||
            this->spritePriority.b0 = 4;
 | 
			
		||||
| 
						 | 
				
			
			@ -3625,7 +3625,7 @@ static void sub_08074808(Entity* this) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void SurfaceAction_Button(Entity* this) {
 | 
			
		||||
    gPlayerState.field_0x3f -= 2;
 | 
			
		||||
    gPlayerState.spriteOffsetY -= 2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sub_080748D4(void) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ void PlayerItemCellOverwriteSet(Entity* this) {
 | 
			
		|||
                     TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe],
 | 
			
		||||
                          player->y.HALF.HI + gUnk_080B7B6C[(player->animationState & 0xe) + 1]),
 | 
			
		||||
                     this->collisionLayer);
 | 
			
		||||
        gPlayerState.mobility &= 0x7f;
 | 
			
		||||
        gPlayerState.mobility &= ~0x80;
 | 
			
		||||
        DeleteThisEntity();
 | 
			
		||||
    }
 | 
			
		||||
    if ((gInput.heldKeys & B_BUTTON) != 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ void OpenSmallChest(u32 pos, u32 layer) {
 | 
			
		|||
            SetLocalFlag(t->localFlag);
 | 
			
		||||
            CreateItemEntity(t->_2, t->_3, 0);
 | 
			
		||||
        } else {
 | 
			
		||||
            CreateItemEntity(0x60, 0, 0);
 | 
			
		||||
            CreateItemEntity(ITEM_FAIRY, 0, 0);
 | 
			
		||||
        }
 | 
			
		||||
        sub_0807B7D8(0x74, pos, layer);
 | 
			
		||||
        RequestPriorityDuration(NULL, 120);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -405,7 +405,7 @@ void ResetPlayerItem() {
 | 
			
		|||
        index++;
 | 
			
		||||
    } while (index <= 2);
 | 
			
		||||
 | 
			
		||||
    gPlayerState.field_0x3c[1] = 0;
 | 
			
		||||
    gPlayerState.moleMittsState = 0;
 | 
			
		||||
    gPlayerState.field_0x1c = 0;
 | 
			
		||||
    gPlayerState.field_0x1f[2] = 0;
 | 
			
		||||
    gPlayerState.field_0x0[1] = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1201,8 +1201,8 @@ void ClearPlayerState(void) {
 | 
			
		|||
    gPlayerState.field_0x38 = 0;
 | 
			
		||||
    gPlayerState.field_0x39 = 0;
 | 
			
		||||
    gPlayerState.field_0x3a = 0;
 | 
			
		||||
    gPlayerState.field_0x3f = 0;
 | 
			
		||||
    gPlayerState.field_0x3c[0] = 0;
 | 
			
		||||
    gPlayerState.spriteOffsetY = 0;
 | 
			
		||||
    gPlayerState.field_0x3c = 0;
 | 
			
		||||
    MemFill32(0xffffffff, gPlayerState.path_memory, 0x40);
 | 
			
		||||
    MemClear(&gUnk_03003DF0, 0x188);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1515,7 +1515,7 @@ ASM_FUNC("asm/non_matching/playerUtils/sub_08079550.inc", u32 sub_08079550(void)
 | 
			
		|||
 | 
			
		||||
void sub_08079708(Entity* this) {
 | 
			
		||||
    gPlayerState.framestate = 0x12;
 | 
			
		||||
    gPlayerState.field_0x3c[0] = 0xff;
 | 
			
		||||
    gPlayerState.field_0x3c = 0xff;
 | 
			
		||||
    this->flags &= ~ENT_COLLIDE;
 | 
			
		||||
    this->action = 0xa;
 | 
			
		||||
    this->subAction = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1570,7 +1570,7 @@ void ResolvePlayerAnimation(void) {
 | 
			
		|||
        if (gPlayerState.heldObject != 0) {
 | 
			
		||||
            anim = 0x92c;
 | 
			
		||||
        } else {
 | 
			
		||||
            if ((gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) != 0) {
 | 
			
		||||
            if ((gPlayerState.field_0x1c | gPlayerState.moleMittsState) != 0) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if ((gPlayerState.flags & PL_FLAGS2000000) != 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1613,7 +1613,7 @@ void ResolvePlayerAnimation(void) {
 | 
			
		|||
        if (gPlayerState.heldObject != 0) {
 | 
			
		||||
            anim = 0x350;
 | 
			
		||||
        } else {
 | 
			
		||||
            if ((gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) != 0) {
 | 
			
		||||
            if ((gPlayerState.field_0x1c | gPlayerState.moleMittsState) != 0) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if ((gPlayerState.flags & PL_MOLDWORM_CAPTURED) != 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1854,7 +1854,7 @@ bool32 PlayerCanBeMoved(void) {
 | 
			
		|||
    if ((gPlayerState.flags &
 | 
			
		||||
         (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_FROZEN | PL_FALLING | PL_DISABLE_ITEMS |
 | 
			
		||||
          PL_PIT_IS_EXIT | PL_IN_MINECART | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING)) != 0 ||
 | 
			
		||||
        gPlayerState.field_0x3c[0] != 0 || gPlayerEntity.action == PLAYER_FALL ||
 | 
			
		||||
        gPlayerState.field_0x3c != 0 || gPlayerEntity.action == PLAYER_FALL ||
 | 
			
		||||
        gPlayerEntity.action == PLAYER_08071DB8) {
 | 
			
		||||
        return FALSE;
 | 
			
		||||
    } else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,7 +98,7 @@ void MandiblesProjectile_Action1(Entity* this) {
 | 
			
		|||
void MandiblesProjectile_Action2(Entity* this) {
 | 
			
		||||
    UpdateAnimationSingleFrame(this);
 | 
			
		||||
    if ((this->frame & 0x40) != 0) {
 | 
			
		||||
        this->frame &= 0xbf;
 | 
			
		||||
        this->frame &= ~0x40;
 | 
			
		||||
        EnqueueSFX(SFX_15D);
 | 
			
		||||
    }
 | 
			
		||||
    this->field_0x78.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3644,7 +3644,7 @@ void sub_StateChange_DarkHyruleCastleOutside_ZeldaStatuePlatform(void) {
 | 
			
		|||
        LoadRoomEntityList(&gUnk_080EADB8);
 | 
			
		||||
        SetTileType(0x4072, 0x145, 1);
 | 
			
		||||
        SetTileType(0x4072, 0x149, 1);
 | 
			
		||||
        gArea.queued_bgm = 0;
 | 
			
		||||
        gArea.queued_bgm = SFX_NONE;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3689,7 +3689,7 @@ void sub_StateChange_DarkHyruleCastleOutside_Garden(void) {
 | 
			
		|||
        if (!CheckLocalFlag(0x7f)) {
 | 
			
		||||
            LoadRoomEntityList(&gUnk_080EAEC0);
 | 
			
		||||
            SetLocalFlag(0x7f);
 | 
			
		||||
            gArea.queued_bgm = 0x11;
 | 
			
		||||
            gArea.queued_bgm = BGM_BEAT_VAATI;
 | 
			
		||||
        } else {
 | 
			
		||||
            LoadRoomEntityList(&gUnk_080EAF20);
 | 
			
		||||
            gArea.queued_bgm = gArea.bgm;
 | 
			
		||||
| 
						 | 
				
			
			@ -5785,9 +5785,9 @@ void sub_StateChange_HyruleField_OutsideCastle(void) {
 | 
			
		|||
    }
 | 
			
		||||
    if (!CheckGlobalFlag(TABIDACHI)) {
 | 
			
		||||
#ifdef EU
 | 
			
		||||
        gArea.queued_bgm = 0x10;
 | 
			
		||||
        gArea.queued_bgm = BGM_FESTIVAL_APPROACH;
 | 
			
		||||
#else
 | 
			
		||||
        gArea.queued_bgm = 0x13;
 | 
			
		||||
        gArea.queued_bgm = BGM_BEANSTALK;
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue