diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-08-06 15:21:41 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-08-06 15:21:41 +0300 |
| commit | 18ef0d34b4ce9801ae26449e3a32ac9d985e43de (patch) | |
| tree | 38faf63b8f005c8860746273cae12b101d7e8f57 /src/object | |
| parent | 64c2f2476d3090856bfa450f06b19b87709a8170 (diff) | |
Document various fields and functions
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/bigPushableLever.c | 2 | ||||
| -rw-r--r-- | src/object/bird.c | 2 | ||||
| -rw-r--r-- | src/object/chestSpawner.c | 2 | ||||
| -rw-r--r-- | src/object/chuchuBossStartParticle.c | 8 | ||||
| -rw-r--r-- | src/object/graveyardKey.c | 2 | ||||
| -rw-r--r-- | src/object/gyorgBossObject.c | 4 | ||||
| -rw-r--r-- | src/object/itemForSale.c | 2 | ||||
| -rw-r--r-- | src/object/keyStealingTakkuri.c | 2 | ||||
| -rw-r--r-- | src/object/lightRay.c | 12 | ||||
| -rw-r--r-- | src/object/minishEmoticon.c | 2 | ||||
| -rw-r--r-- | src/object/object70.c | 5 | ||||
| -rw-r--r-- | src/object/objectBlockingStairs.c | 2 | ||||
| -rw-r--r-- | src/object/objectOnPillar.c | 2 | ||||
| -rw-r--r-- | src/object/octorokBossObject.c | 2 | ||||
| -rw-r--r-- | src/object/playerClone.c | 4 | ||||
| -rw-r--r-- | src/object/pullableMushroom.c | 8 | ||||
| -rw-r--r-- | src/object/pushableFurniture.c | 6 | ||||
| -rw-r--r-- | src/object/pushableLever.c | 2 | ||||
| -rw-r--r-- | src/object/pushableStatue.c | 2 | ||||
| -rw-r--r-- | src/object/vaati1Portal.c | 2 | ||||
| -rw-r--r-- | src/object/whirlwind.c | 8 |
21 files changed, 41 insertions, 40 deletions
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c index 8f5a3808..1f62e640 100644 --- a/src/object/bigPushableLever.c +++ b/src/object/bigPushableLever.c @@ -59,7 +59,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) { RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { gPlayerState.pushedObject = 0x98; - gPlayerState.queued_action = 5; + gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; diff --git a/src/object/bird.c b/src/object/bird.c index 480cc984..55f080ad 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -225,7 +225,7 @@ void Bird_Type8(Entity* this) { PlayerCanBeMoved() && (EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe))) { s32 z = gPlayerEntity.z.HALF.HI - this->z.HALF.HI - 8; if ((u16)z < 0x20 && gPlayerEntity.health != 0) { - pEVar5 = CreateObject(0x95, 10, 0); + pEVar5 = CreateObject(BIRD, 10, 0); if (pEVar5 != NULL) { this->child = pEVar5; this->action = 2; diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 731e8042..899b336f 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -123,7 +123,7 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { super->subAction = 1; break; case 1: - if ((super->type == 5) || (gPlayerEntity.action == 1)) { + if ((super->type == 5) || (gPlayerEntity.action == PLAYER_NORMAL)) { super->subAction = 2; super->timer = 8; super->subtimer = 0; diff --git a/src/object/chuchuBossStartParticle.c b/src/object/chuchuBossStartParticle.c index 370b8d4b..ae8dfd15 100644 --- a/src/object/chuchuBossStartParticle.c +++ b/src/object/chuchuBossStartParticle.c @@ -221,7 +221,7 @@ void sub_0808F3DC(Entity* this) { } if (this->type == 5 && (this->frame & 1)) { - Entity* entity = CreateObjectWithParent(this->child, 0x49, 8, 0); + Entity* entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 8, 0); if (entity != NULL) { entity->parent = this->parent; entity->child = this->parent->parent; @@ -288,19 +288,19 @@ void sub_0808F554(Entity* this) { } void sub_0808F5EC(Entity* this) { - Entity* entity = CreateObjectWithParent(this->child, 0x49, 5, 0); + Entity* entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 5, 0); if (entity != NULL) { entity->parent = this; entity->child = this->child; } - entity = CreateObjectWithParent(this->child, 0x49, 6, 0); + entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 6, 0); if (entity != NULL) { entity->parent = this; entity->child = this->child; } - entity = CreateObjectWithParent(this->child, 0x49, 7, 0); + entity = CreateObjectWithParent(this->child, CHUCHU_BOSS_START_PARTICLE, 7, 0); if (entity != NULL) { entity->parent = this; entity->child = this->child; diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c index 0a0dfc0b..e4c4f2ef 100644 --- a/src/object/graveyardKey.c +++ b/src/object/graveyardKey.c @@ -173,7 +173,7 @@ void sub_0809D91C(Entity* this) { bool32 sub_0809D93C(Entity* this, const struct_gUnk_08123FB0* param_2) { u32 uVar1; - if (gPlayerEntity.action == 6 && ((param_2->unk0c >> gPlayerEntity.animationState & 1) != 0)) { + if (gPlayerEntity.action == PLAYER_BOUNCE && ((param_2->unk0c >> gPlayerEntity.animationState & 1) != 0)) { uVar1 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI) + param_2->unk08 + param_2->unk0a; if (param_2->unk0a * 2 <= (u16)uVar1) { return 0; diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index f66fdee7..d9f44c6d 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -421,12 +421,12 @@ void GyorgBossObject_SpawnChildren(u32 unk0, bool32 fromBlue, u32 animationState tmp->attackOffsetY = -p->offsetY; break; case 1: - tmp->attackOffsetX = p->offsetY + 0xF0; + tmp->attackOffsetX = p->offsetY + DISPLAY_WIDTH; tmp->attackOffsetY = p->offsetX; break; case 2: tmp->attackOffsetX = p->offsetX; - tmp->attackOffsetY = p->offsetY + 0xA0; + tmp->attackOffsetY = p->offsetY + DISPLAY_HEIGHT; break; case 3: tmp->attackOffsetX = -p->offsetY; diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index 20664a1c..283969f8 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -92,7 +92,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) { super->interactType = 0; super->action = 3; gRoomVars.animFlags = 1; - gPlayerState.queued_action = 7; + gPlayerState.queued_action = PLAYER_08070E9C; } } else { if (super->interactType != 0) { diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index bc4c4dd5..68fac5a3 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -518,7 +518,7 @@ u32 sub_0809E2C4(KeyStealingTakkuriEntity* this, u32 param_2) { uVar1 = roomY - tmp->unk_2 + tmp->unk_5; uVar2 = tmp->unk_5 * 2; if (uVar2 > (u16)uVar1) { - if (tmp->unk_6 == gPlayerEntity.animationState && gPlayerEntity.action == 6) { + if (tmp->unk_6 == gPlayerEntity.animationState && gPlayerEntity.action == PLAYER_BOUNCE) { return 1; } return 2; diff --git a/src/object/lightRay.c b/src/object/lightRay.c index 4aae9aac..c353a862 100644 --- a/src/object/lightRay.c +++ b/src/object/lightRay.c @@ -94,14 +94,14 @@ void sub_0809B97C(LightRayEntity* this, u32 param_2) { if (tmp1 < 0) { tmp1 = 0; } - if (0xf0 < tmp1) { - tmp1 = 0xf0; + if (DISPLAY_WIDTH < tmp1) { + tmp1 = DISPLAY_WIDTH; } if (tmp2 < 0) { tmp2 = 0; } - if (0xf0 < tmp2) { - tmp2 = 0xf0; + if (DISPLAY_WIDTH < tmp2) { + tmp2 = DISPLAY_WIDTH; } gScreen.controls.window0HorizontalDimensions = (tmp1 << 8) | tmp2; } @@ -124,8 +124,8 @@ void LightRay_Type1(LightRayEntity* this) { } gPlayerEntity.animationState = tmp; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2000; - gScreen.controls.window0HorizontalDimensions = 0xf0; - gScreen.controls.window0VerticalDimensions = 0xa0; + gScreen.controls.window0HorizontalDimensions = DISPLAY_WIDTH; + gScreen.controls.window0VerticalDimensions = DISPLAY_HEIGHT; break; case 1: if (super->timer != 0) { diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c index a42a9ac8..0904b1cb 100644 --- a/src/object/minishEmoticon.c +++ b/src/object/minishEmoticon.c @@ -72,7 +72,7 @@ void MinishEmoticon_Action1(Entity* this) { animIndex = origAnimIndex + 0x19; } } else { - if ((gPlayerState.framestate == 1) || (gPlayerState.framestate == 25)) { + if (gPlayerState.framestate == PL_STATE_WALK || gPlayerState.framestate == PL_STATE_PUSH) { animIndex = origAnimIndex + 4; if (this->animIndex != animIndex) { this->z.WORD = 0; diff --git a/src/object/object70.c b/src/object/object70.c index 7cc2664f..064f6808 100644 --- a/src/object/object70.c +++ b/src/object/object70.c @@ -42,7 +42,8 @@ void Object70_Action1(Entity* this) { if (this->type == 0) { if (gPlayerEntity.z.WORD == 0) { if ((((gPlayerState.dash_state & 0x40) == 0) && (gPlayerState.floor_type == SURFACE_SWAMP)) && - ((gPlayerEntity.action == 1 || ((gPlayerEntity.action == 0x18 || (gPlayerEntity.action == 4)))))) { + ((gPlayerEntity.action == PLAYER_NORMAL || + ((gPlayerEntity.action == PLAYER_ROLL || (gPlayerEntity.action == PLAYER_JUMP)))))) { goto _080974FA; } else { if (gPlayerEntity.z.WORD == 0) { @@ -65,7 +66,7 @@ void Object70_Action1(Entity* this) { } } else { - if (gPlayerEntity.action != 0x1e) { + if (gPlayerEntity.action != PLAYER_USEENTRANCE) { if (this->collisionLayer == 1) { gPlayerEntity.spriteOrientation.flipY = 2; } else { diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index 8664a365..5473531d 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -162,7 +162,7 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { } else { if (gPlayerState.heldObject == 0x12) { if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) { - gPlayerState.queued_action = 16; + gPlayerState.queued_action = PLAYER_PULL; gPlayerState.field_0x38 = 0x40; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index 1b82f909..371d8ec2 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -129,7 +129,7 @@ void ObjectOnPillar_SubAction0(ObjectOnPillarEntity* this) { } sub_08097008(this); if (sub_080896B0()) { - gPlayerState.queued_action = 0x10; + gPlayerState.queued_action = PLAYER_PULL; gPlayerState.field_0x38 = 0x20; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index a1f974de..ad3afd84 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -79,7 +79,7 @@ void OctorokBossObject_Init(Entity* this) { } } - this->speed = 0xf0 - (Random() & 0x3f); + this->speed = DISPLAY_WIDTH - (Random() & 0x3f); LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction); LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction); InitializeAnimation(this, 5); diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 485975d9..3dd8b990 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -105,8 +105,8 @@ void PlayerClone_Action2(PlayerCloneEntity* this) { super->subtimer--; } - if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL && gPlayerState.framestate != 19 && - super->health != 0) { + if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL && + gPlayerState.framestate != PL_STATE_TALKEZLO && super->health != 0) { if (gPlayerEntity.iframes >= 1) { gPlayerState.chargeState.action = 1; } else { diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index 408cff7d..c03f3444 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -234,8 +234,8 @@ void sub_0808AEB0(PullableMushroomEntity* this) { super->subtimer = 1; } else { - if (((super->subtimer != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) { - gPlayerState.queued_action = 0x1b; + if (((super->subtimer != 0) && (gPlayerEntity.action == PLAYER_NORMAL)) && (gPlayerState.swim_state == 0)) { + gPlayerState.queued_action = PLAYER_08072C9C; gPlayerState.field_0x38 = uVar1; gPlayerState.field_0x39 = super->direction ^ 0x10; gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity); @@ -315,9 +315,9 @@ void sub_0808B0BC(PullableMushroomEntity* this) { ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.x.HALF.HI; ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.y.HALF.HI; if (sub_0800419C(&ent.base, super, 7, 7)) { - if ((gPlayerEntity.action != 1) || (gPlayerState.swim_state != 0)) + if ((gPlayerEntity.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0)) return; - gPlayerState.queued_action = 0x1b; + gPlayerState.queued_action = PLAYER_08072C9C; gPlayerState.field_0x38 = uVar2; gPlayerState.field_0x39 = super->direction ^ 0x10; gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity); diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index 22efed6f..42f3b333 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -352,9 +352,9 @@ void sub_0808FDE8(PushableFurnitureEntity* this) { bool32 sub_0808FECC(PushableFurnitureEntity* this) { bool32 result = TRUE; - if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == 6) && (gPlayerEntity.animationState == 0) && - (gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) && (super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) && - (super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) { + if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == PLAYER_BOUNCE) && + (gPlayerEntity.animationState == 0) && (gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) && + (super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) && (super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) { result = FALSE; } return result; diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c index 3c8ee887..dec3fcb7 100644 --- a/src/object/pushableLever.c +++ b/src/object/pushableLever.c @@ -58,7 +58,7 @@ void PushableLever_Idle(PushableLeverEntity* this) { RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { gPlayerState.pushedObject = 0x90; - gPlayerState.queued_action = 5; + gPlayerState.queued_action = PLAYER_PUSH; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index 099d96e5..d24e44c7 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -130,7 +130,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) { } } if (sub_080896B0()) { - gPlayerState.queued_action = 0x10; + gPlayerState.queued_action = PLAYER_PULL; gPlayerState.field_0x38 = 0x20; gPlayerState.flags |= 1; gPlayerEntity.x.HALF.LO = 0; diff --git a/src/object/vaati1Portal.c b/src/object/vaati1Portal.c index dd60a587..dfbc8487 100644 --- a/src/object/vaati1Portal.c +++ b/src/object/vaati1Portal.c @@ -59,7 +59,7 @@ void Vaati1Portal_Action2(Entity* this) { void sub_080A0190(Entity* this) { this->subAction = 1; CopyPosition(this, &gPlayerEntity); - gPlayerState.queued_action = 3; + gPlayerState.queued_action = PLAYER_FALL; gPlayerState.field_0x38 = 0; gPlayerState.flags |= PL_PIT_IS_EXIT; } diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c index 8dbd8959..b7933500 100644 --- a/src/object/whirlwind.c +++ b/src/object/whirlwind.c @@ -62,9 +62,9 @@ void Whirlwind_Action1(Entity* this) { if (this->spriteSettings.draw != 0) { GetNextFrame(this); 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)) { + ((gPlayerEntity.action == PLAYER_JUMP || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) && + ((gPlayerEntity.action != PLAYER_BOUNCE && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) { + if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != PLAYER_JUMP)) { if ((this->type2 != 1) && (-0x10 < gPlayerEntity.z.HALF.HI)) { return; } @@ -76,7 +76,7 @@ void Whirlwind_Action1(Entity* this) { sub_08004542(&gPlayerEntity); gPlayerEntity.collisionLayer = 1; gPlayerEntity.flags |= ENT_COLLIDE; - gPlayerState.queued_action = 0x1f; + gPlayerState.queued_action = PLAYER_PARACHUTE; gPlayerState.field_0x38 = this->type2; gPlayerState.field_0x39 = 0xff; this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1; |
