mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-15 06:06:04 +00:00
Pause doc: Trade quest marker (#2158)
* Pause doc: Trade quest location * trade quest location -> marker * comment on tradeQuestMarker
This commit is contained in:
parent
e52d135e15
commit
fa39da2a57
4 changed files with 39 additions and 33 deletions
|
@ -112,6 +112,8 @@ typedef enum WorldMapPoint {
|
||||||
/* 12 */ WORLD_MAP_POINT_MAX
|
/* 12 */ WORLD_MAP_POINT_MAX
|
||||||
} WorldMapPoint;
|
} WorldMapPoint;
|
||||||
|
|
||||||
|
#define TRADE_QUEST_MARKER_NONE 0xFF
|
||||||
|
|
||||||
typedef enum WorldMapPointState {
|
typedef enum WorldMapPointState {
|
||||||
/* 0 */ WORLD_MAP_POINT_STATE_HIDE,
|
/* 0 */ WORLD_MAP_POINT_STATE_HIDE,
|
||||||
/* 1 */ WORLD_MAP_POINT_STATE_SHOW,
|
/* 1 */ WORLD_MAP_POINT_STATE_SHOW,
|
||||||
|
@ -184,7 +186,7 @@ typedef struct PauseContext {
|
||||||
/* 0x0262 */ s16 promptChoice; // save/continue choice: 0 = yes; 4 = no
|
/* 0x0262 */ s16 promptChoice; // save/continue choice: 0 = yes; 4 = no
|
||||||
/* 0x0264 */ s16 ocarinaSongIdx;
|
/* 0x0264 */ s16 ocarinaSongIdx;
|
||||||
/* 0x0266 */ u8 worldMapPoints[20]; // indices: `WorldMapPoint` enum, values: `WorldMapPointState` enum
|
/* 0x0266 */ u8 worldMapPoints[20]; // indices: `WorldMapPoint` enum, values: `WorldMapPointState` enum
|
||||||
/* 0x027A */ u8 tradeQuestLocation;
|
/* 0x027A */ u8 tradeQuestMarker; // Can be either a `WorldMapPoint` value or `TRADE_QUEST_MARKER_NONE`
|
||||||
/* 0x027C */ SkelAnime playerSkelAnime;
|
/* 0x027C */ SkelAnime playerSkelAnime;
|
||||||
} PauseContext; // size = 0x2C0
|
} PauseContext; // size = 0x2C0
|
||||||
|
|
||||||
|
|
|
@ -873,9 +873,9 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
|
||||||
KaleidoScope_DrawCursor(play, PAUSE_MAP);
|
KaleidoScope_DrawCursor(play, PAUSE_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[176], 16, 0);
|
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + QUAD_MAP_TRADE_QUEST_MARKER) * 4], 16, 0);
|
||||||
|
|
||||||
if (pauseCtx->tradeQuestLocation != 0xFF) {
|
if (pauseCtx->tradeQuestMarker != TRADE_QUEST_MARKER_NONE) {
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, pointPulsePrimColor[0], 0, pauseCtx->alpha);
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, pointPulsePrimColor[0], 0, pauseCtx->alpha);
|
||||||
|
|
|
@ -580,7 +580,7 @@ s16 gVtxPageMapWorldQuadsWidth[VTX_PAGE_MAP_WORLD_QUADS] = {
|
||||||
8, // WORLD_MAP_POINT_KOKIRI_FOREST
|
8, // WORLD_MAP_POINT_KOKIRI_FOREST
|
||||||
8, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
8, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
||||||
8, // QUAD_MAP_28
|
8, // QUAD_MAP_28
|
||||||
8, // QUAD_MAP_29
|
8, // QUAD_MAP_TRADE_QUEST_MARKER
|
||||||
80, // QUAD_MAP_30
|
80, // QUAD_MAP_30
|
||||||
64, // QUAD_MAP_31
|
64, // QUAD_MAP_31
|
||||||
};
|
};
|
||||||
|
@ -615,7 +615,7 @@ s16 gVtxPageMapWorldQuadsHeight[VTX_PAGE_MAP_WORLD_QUADS] = {
|
||||||
8, // WORLD_MAP_POINT_KOKIRI_FOREST
|
8, // WORLD_MAP_POINT_KOKIRI_FOREST
|
||||||
8, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
8, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
||||||
8, // QUAD_MAP_28
|
8, // QUAD_MAP_28
|
||||||
16, // QUAD_MAP_29
|
16, // QUAD_MAP_TRADE_QUEST_MARKER
|
||||||
32, // QUAD_MAP_30
|
32, // QUAD_MAP_30
|
||||||
8, // QUAD_MAP_31
|
8, // QUAD_MAP_31
|
||||||
};
|
};
|
||||||
|
@ -2225,7 +2225,7 @@ static s16 sVtxPageMapWorldQuadsX[VTX_PAGE_MAP_WORLD_QUADS] = {
|
||||||
74, // WORLD_MAP_POINT_KOKIRI_FOREST
|
74, // WORLD_MAP_POINT_KOKIRI_FOREST
|
||||||
89, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
89, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
||||||
0, // QUAD_MAP_28
|
0, // QUAD_MAP_28
|
||||||
-58, // QUAD_MAP_29
|
-58, // QUAD_MAP_TRADE_QUEST_MARKER
|
||||||
19, // QUAD_MAP_30
|
19, // QUAD_MAP_30
|
||||||
28, // QUAD_MAP_31
|
28, // QUAD_MAP_31
|
||||||
};
|
};
|
||||||
|
@ -2279,7 +2279,7 @@ static s16 sVtxPageMapWorldQuadsY[VTX_PAGE_MAP_WORLD_QUADS] = {
|
||||||
-9, // WORLD_MAP_POINT_KOKIRI_FOREST
|
-9, // WORLD_MAP_POINT_KOKIRI_FOREST
|
||||||
25, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
25, // WORLD_MAP_POINT_ZORAS_DOMAIN
|
||||||
0, // QUAD_MAP_28
|
0, // QUAD_MAP_28
|
||||||
1, // QUAD_MAP_29
|
1, // QUAD_MAP_TRADE_QUEST_MARKER
|
||||||
-32, // QUAD_MAP_30
|
-32, // QUAD_MAP_30
|
||||||
-26, // QUAD_MAP_31
|
-26, // QUAD_MAP_31
|
||||||
};
|
};
|
||||||
|
@ -2434,9 +2434,9 @@ static s16 sVtxMapWorldAreaHeight[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 numQuads) {
|
s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 numQuads) {
|
||||||
static s16 D_8082B110 = 0;
|
static s16 sTradeQuestMarkerBobY = 0;
|
||||||
static s16 D_8082B114 = 1;
|
static s16 sTradeQuestMarkerBobTimer = 1;
|
||||||
static s16 D_8082B118 = 0;
|
static s16 sTradeQuestMarkerBobState = 0;
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
s16* quadsX;
|
s16* quadsX;
|
||||||
s16* quadsWidth;
|
s16* quadsWidth;
|
||||||
|
@ -2556,32 +2556,32 @@ s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 num
|
||||||
|
|
||||||
bufI += 12;
|
bufI += 12;
|
||||||
|
|
||||||
if (pauseCtx->tradeQuestLocation != 0xFF) {
|
if (pauseCtx->tradeQuestMarker != TRADE_QUEST_MARKER_NONE) {
|
||||||
if (D_8082B114 == 0) {
|
if (sTradeQuestMarkerBobTimer == 0) {
|
||||||
D_8082B118++;
|
sTradeQuestMarkerBobState++;
|
||||||
switch (D_8082B118) {
|
switch (sTradeQuestMarkerBobState) {
|
||||||
case 1:
|
case 1:
|
||||||
D_8082B110 = 3;
|
sTradeQuestMarkerBobY = 3;
|
||||||
D_8082B114 = 8;
|
sTradeQuestMarkerBobTimer = 8;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
D_8082B110 = 0;
|
sTradeQuestMarkerBobY = 0;
|
||||||
D_8082B114 = 6;
|
sTradeQuestMarkerBobTimer = 6;
|
||||||
D_8082B118 = 0;
|
sTradeQuestMarkerBobState = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
D_8082B114--;
|
sTradeQuestMarkerBobTimer--;
|
||||||
}
|
}
|
||||||
|
|
||||||
j = bufIAfterPageSections + (pauseCtx->tradeQuestLocation * 4) + 64;
|
j = bufIAfterPageSections + ((QUAD_MAP_WORLD_POINT_FIRST + pauseCtx->tradeQuestMarker) * 4);
|
||||||
i = bufIAfterPageSections + 116;
|
i = bufIAfterPageSections + (QUAD_MAP_TRADE_QUEST_MARKER * 4);
|
||||||
|
|
||||||
vtx[i + 0].v.ob[0] = vtx[i + 2].v.ob[0] = vtx[j + 0].v.ob[0];
|
vtx[i + 0].v.ob[0] = vtx[i + 2].v.ob[0] = vtx[j + 0].v.ob[0];
|
||||||
|
|
||||||
vtx[i + 1].v.ob[0] = vtx[i + 3].v.ob[0] = vtx[i + 0].v.ob[0] + 8;
|
vtx[i + 1].v.ob[0] = vtx[i + 3].v.ob[0] = vtx[i + 0].v.ob[0] + 8;
|
||||||
|
|
||||||
vtx[i + 0].v.ob[1] = vtx[i + 1].v.ob[1] = vtx[j + 0].v.ob[1] - D_8082B110 + 10;
|
vtx[i + 0].v.ob[1] = vtx[i + 1].v.ob[1] = vtx[j + 0].v.ob[1] - sTradeQuestMarkerBobY + 10;
|
||||||
|
|
||||||
vtx[i + 0].v.ob[2] = vtx[i + 1].v.ob[2] = vtx[i + 2].v.ob[2] = vtx[i + 3].v.ob[2] = 0;
|
vtx[i + 0].v.ob[2] = vtx[i + 1].v.ob[2] = vtx[i + 2].v.ob[2] = vtx[i + 3].v.ob[2] = 0;
|
||||||
|
|
||||||
|
@ -3699,33 +3699,37 @@ void KaleidoScope_Update(PlayState* play) {
|
||||||
pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_SHOW;
|
pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_SHOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
pauseCtx->tradeQuestLocation = 0xFF;
|
// Trade quest marker
|
||||||
|
|
||||||
|
pauseCtx->tradeQuestMarker = TRADE_QUEST_MARKER_NONE;
|
||||||
|
|
||||||
i = INV_CONTENT(ITEM_TRADE_ADULT);
|
i = INV_CONTENT(ITEM_TRADE_ADULT);
|
||||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
||||||
if ((i <= ITEM_POCKET_CUCCO) || (i == ITEM_ODD_MUSHROOM)) {
|
if ((i <= ITEM_POCKET_CUCCO) || (i == ITEM_ODD_MUSHROOM)) {
|
||||||
pauseCtx->tradeQuestLocation = 8;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_KAKARIKO_VILLAGE;
|
||||||
}
|
}
|
||||||
if ((i == ITEM_COJIRO) || (i == ITEM_ODD_POTION)) {
|
if ((i == ITEM_COJIRO) || (i == ITEM_ODD_POTION)) {
|
||||||
pauseCtx->tradeQuestLocation = 9;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_LOST_WOODS;
|
||||||
}
|
}
|
||||||
if (i == ITEM_POACHERS_SAW) {
|
if (i == ITEM_POACHERS_SAW) {
|
||||||
pauseCtx->tradeQuestLocation = 2;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_GERUDO_VALLEY;
|
||||||
}
|
}
|
||||||
if ((i == ITEM_BROKEN_GORONS_SWORD) || (i == ITEM_EYE_DROPS)) {
|
if ((i == ITEM_BROKEN_GORONS_SWORD) || (i == ITEM_EYE_DROPS)) {
|
||||||
pauseCtx->tradeQuestLocation = 7;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_DEATH_MOUNTAIN;
|
||||||
}
|
}
|
||||||
if (i == ITEM_PRESCRIPTION) {
|
if (i == ITEM_PRESCRIPTION) {
|
||||||
pauseCtx->tradeQuestLocation = 11;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_ZORAS_DOMAIN;
|
||||||
}
|
}
|
||||||
if (i == ITEM_EYEBALL_FROG) {
|
if (i == ITEM_EYEBALL_FROG) {
|
||||||
pauseCtx->tradeQuestLocation = 3;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_LAKE_HYLIA;
|
||||||
}
|
}
|
||||||
if ((i == ITEM_CLAIM_CHECK) && (gSaveContext.save.info.playerData.bgsFlag == 0)) {
|
if ((i == ITEM_CLAIM_CHECK) && !gSaveContext.save.info.playerData.bgsFlag) {
|
||||||
pauseCtx->tradeQuestLocation = 7;
|
pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_DEATH_MOUNTAIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Next state
|
||||||
|
|
||||||
pauseCtx->state = PAUSE_STATE_OPENING_1;
|
pauseCtx->state = PAUSE_STATE_OPENING_1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef enum MapQuad {
|
||||||
// 16 to 27 follows the `WorldMapPoint` enum
|
// 16 to 27 follows the `WorldMapPoint` enum
|
||||||
/* 27 */ QUAD_MAP_WORLD_POINT_LAST = QUAD_MAP_WORLD_POINT_FIRST + WORLD_MAP_POINT_MAX - 1,
|
/* 27 */ QUAD_MAP_WORLD_POINT_LAST = QUAD_MAP_WORLD_POINT_FIRST + WORLD_MAP_POINT_MAX - 1,
|
||||||
/* 28 */ QUAD_MAP_28,
|
/* 28 */ QUAD_MAP_28,
|
||||||
/* 29 */ QUAD_MAP_29,
|
/* 29 */ QUAD_MAP_TRADE_QUEST_MARKER,
|
||||||
/* 30 */ QUAD_MAP_30,
|
/* 30 */ QUAD_MAP_30,
|
||||||
/* 31 */ QUAD_MAP_31,
|
/* 31 */ QUAD_MAP_31,
|
||||||
/* 32 */ QUAD_MAP_WORLD_IMAGE_FIRST,
|
/* 32 */ QUAD_MAP_WORLD_IMAGE_FIRST,
|
||||||
|
|
Loading…
Reference in a new issue