summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinmmar <herwig.orlich@gmail.com>2023-09-17 22:00:45 +0200
committerReinmmar <herwig.orlich@gmail.com>2023-09-17 22:00:45 +0200
commit203f691dff9ded169ae64f0b6b7ea7279795d843 (patch)
tree8401b729d9530789faab50b612872f7934d82f9f /src
parent4c37e6cf5e8ee468b047aff9dafb6f1afe8b5bad (diff)
the rest of the portal types (2 unknown to me)
Diffstat (limited to 'src')
-rw-r--r--src/enterPortalSubtask.c18
-rw-r--r--src/manager/minishPortalManager.c4
-rw-r--r--src/object/jarPortal.c4
-rw-r--r--src/player.c17
-rw-r--r--src/playerUtils.c6
5 files changed, 24 insertions, 25 deletions
diff --git a/src/enterPortalSubtask.c b/src/enterPortalSubtask.c
index fbb94ccc..3bac0702 100644
--- a/src/enterPortalSubtask.c
+++ b/src/enterPortalSubtask.c
@@ -179,8 +179,8 @@ void Subtask_PortalCutscene_0(void) {
gScreen.bg1.yOffset = 0;
controls->scroll_y = 0;
portalId = gArea.portal_type;
- if ((portalId == 2) && (gUI.roomControls.area != 2)) {
- portalId = 3;
+ if ((portalId == PT_2) && (gUI.roomControls.area != 2)) {
+ portalId = PT_DUNGEON;
}
ptr = &gUnk_080D4138[portalId];
LoadPaletteGroup(ptr->paletteGroup);
@@ -247,19 +247,19 @@ void RespawnAsMinish(void) {
bool32 sub_0804AD18(void) {
switch (gArea.portal_type) {
- case 0:
- case 1:
- case 2:
+ case PT_TREESTUMP:
+ case PT_ROCK:
+ case PT_2:
if (!CheckGlobalFlag(ENTRANCE_0 + gArea.portal_type)) {
return FALSE;
}
// else: return TRUE implicitely, because it's stored in r0. But does not match if returning explicitely.
break;
- case 6:
+ case PT_TOD:
return FALSE;
- case 3:
- case PT_POT:
- case 5:
+ case PT_DUNGEON:
+ case PT_JAR:
+ case PT_5:
default:
return FALSE;
}
diff --git a/src/manager/minishPortalManager.c b/src/manager/minishPortalManager.c
index 47307dea..21855b00 100644
--- a/src/manager/minishPortalManager.c
+++ b/src/manager/minishPortalManager.c
@@ -34,7 +34,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) {
gArea.portal_type = super->type;
if (!CheckGlobalFlag(EZERO_1ST)) {
gArea.portal_mode = 1;
- gArea.portal_type = 5;
+ gArea.portal_type = PT_5;
} else {
if ((gPlayerState.flags & PL_USE_PORTAL) && gPlayerState.jump_status == 0) {
gArea.portal_mode = 2;
@@ -83,7 +83,7 @@ void CreateMagicSparkles(u32 baseX, u32 baseY, u32 layer) {
}
bool32 PortalReadyForMinish(void) {
- if ((gPlayerState.flags & PL_MINISH) && gPlayerState.attachedBeetleCount == 0 && (gArea.portal_type != 0x6) &&
+ if ((gPlayerState.flags & PL_MINISH) && gPlayerState.attachedBeetleCount == 0 && (gArea.portal_type != PT_TOD) &&
(gPlayerState.heldObject == 0)) {
switch (gPlayerState.framestate) {
case PL_STATE_IDLE:
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index 19c05a57..90aaf6a0 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -122,9 +122,9 @@ void sub_0808C01C(JarPortalEntity* this, u32 r1) {
gArea.portal_x = super->x.HALF.HI;
gArea.portal_y = super->y.HALF.HI;
gArea.portal_exit_dir = 2;
- type = PT_POT;
+ type = PT_JAR;
if (r1 != 0)
- type = 2;
+ type = PT_2;
gArea.portal_type = type;
if (r1 == 1) {
if ((gPlayerState.flags & PL_USE_PORTAL) && (gPlayerState.jump_status == 0)) {
diff --git a/src/player.c b/src/player.c
index baaca605..420b0429 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1015,7 +1015,7 @@ static void PlayerUsePortal(Entity* this) {
if ((gInput.newKeys & (B_BUTTON | R_BUTTON)) == 0)
return;
- if (AreaIsDungeon() || gArea.portal_type == 3) {
+ if (AreaIsDungeon() || gArea.portal_type == PT_DUNGEON) {
this->subAction = 7;
this->timer = 30;
SetFade(FADE_IN_OUT | FADE_BLACK_WHITE | FADE_INSTANT, 16);
@@ -1031,7 +1031,6 @@ static void PortalJumpOnUpdate(Entity* this) {
COLLISION_OFF(this);
this->knockbackDuration = 0;
-
x = gArea.portal_x;
y = gArea.portal_y;
@@ -1049,22 +1048,22 @@ static void PortalJumpOnUpdate(Entity* this) {
this->subAction = 1;
this->animationState = IdleSouth;
this->spriteSettings.flipX = FALSE;
- if (gArea.portal_type == PT_POT) {
+ if (gArea.portal_type == PT_JAR) {
gPlayerState.animation = ANIM_ENTER_POT;
}
}
this->timer = 8;
- if (gArea.portal_type != 3) {
+ if (gArea.portal_type != PT_DUNGEON) {
this->spritePriority.b0 = 3;
}
}
static void PortalStandUpdate(Entity* this) {
switch (gArea.portal_type) {
- case 4:
- case 5:
+ case PT_JAR:
+ case PT_5:
sub_0806F948(&gPlayerEntity);
break;
}
@@ -1090,7 +1089,7 @@ static void PortalStandUpdate(Entity* this) {
this->timer = 8;
}
- if (gArea.portal_type == PT_POT) {
+ if (gArea.portal_type == PT_JAR) {
if (this->frame == 0) {
UpdateAnimationSingleFrame(this);
return;
@@ -1217,12 +1216,12 @@ static void PortalEnterUpdate(Entity* this) {
this->spriteSettings.draw = FALSE;
- if (gArea.portal_type == 3) {
+ if (gArea.portal_type == PT_DUNGEON) {
if (--this->subtimer == 0)
sub_080717F8(this);
return;
}
- if (gArea.portal_type == 6)
+ if (gArea.portal_type == PT_TOD)
DoExitTransition(&gUnk_0813AB58);
else
gArea.portal_in_use = TRUE;
diff --git a/src/playerUtils.c b/src/playerUtils.c
index f88af901..4fb789f3 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -1972,10 +1972,10 @@ void ResolvePlayerAnimation(void) {
}
if ((gPlayerState.flags & PL_USE_PORTAL) != 0) {
switch (gArea.portal_type) {
- case 5:
+ case PT_5:
anim = ANIM_DEFAULT_NOCAP;
break;
- case PT_POT:
+ case PT_JAR:
anim = ANIM_DEFAULT;
break;
default:
@@ -2016,7 +2016,7 @@ void ResolvePlayerAnimation(void) {
return;
}
if ((gPlayerState.flags & PL_USE_PORTAL) != 0) {
- anim = (gArea.portal_type == PT_POT) ? ANIM_IN_POT : ANIM_PORTAL;
+ anim = (gArea.portal_type == PT_JAR) ? ANIM_IN_POT : ANIM_PORTAL;
} else {
if (gPlayerState.sword_state != 0) {
anim = ANIM_SWORD_CHARGE_END;