diff --git a/Source/inv.cpp b/Source/inv.cpp index c852a4ace..29d111af0 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -2272,7 +2272,7 @@ int InvPutItem(int pnum, int x, int y) if (currlevel == 21 && x == CornerStone.x && y == CornerStone.y) { CornerStone.item = item[ii]; - InitQTextMsg(296); + InitQTextMsg(TEXT_CORNSTN); quests[Q_CORNSTN]._qlog = FALSE; quests[Q_CORNSTN]._qactive = QUEST_DONE; } @@ -2358,7 +2358,7 @@ int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, in if (currlevel == 21 && x == CornerStone.x && y == CornerStone.y) { CornerStone.item = item[ii]; - InitQTextMsg(296); + InitQTextMsg(TEXT_CORNSTN); quests[Q_CORNSTN]._qlog = 0; quests[Q_CORNSTN]._qactive = 3; } @@ -2669,7 +2669,7 @@ BOOL UseInvItem(int pnum, int cii) if (speedlist) { if (plr[pnum].SpdList[c]._iMiscId == IMISC_NOTE) { - InitQTextMsg(322); + InitQTextMsg(TEXT_BOOK9); invflag = FALSE; return TRUE; } @@ -2679,7 +2679,7 @@ BOOL UseInvItem(int pnum, int cii) if (plr[pnum].InvList[c]._iMiscId == IMISC_MAPOFDOOM) return TRUE; if (plr[pnum].InvList[c]._iMiscId == IMISC_NOTE) { - InitQTextMsg(322); + InitQTextMsg(TEXT_BOOK9); invflag = FALSE; return TRUE; } diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 18f5e8ebe..45f67dfb7 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -694,7 +694,7 @@ static void LoadObject(LoadHelper *file, int i) pObject->_oVar4 = file->nextLE(); pObject->_oVar5 = file->nextLE(); pObject->_oVar6 = file->nextLE(); - pObject->_oVar7 = file->nextLE(); + pObject->_oVar7 = (_speech_id)file->nextLE(); pObject->_oVar8 = file->nextLE(); } @@ -723,9 +723,9 @@ static void LoadQuest(LoadHelper *file, int i) pQuest->_qidx = file->nextLE(); if (gbIsHellfireSaveGame) { file->skip(2); // Alignment - pQuest->_qmsg = file->nextLE(); + pQuest->_qmsg = file->nextLE(); } else { - pQuest->_qmsg = file->nextLE(); + pQuest->_qmsg = file->nextLE(); } pQuest->_qvar1 = file->nextLE(); pQuest->_qvar2 = file->nextLE(); @@ -1620,9 +1620,9 @@ static void SaveQuest(SaveHelper *file, int i) file->writeLE(pQuest->_qidx); if (gbIsHellfire) { file->skip(2); // Alignment - file->writeLE(pQuest->_qmsg); + file->writeLE(pQuest->_qmsg); } else { - file->writeLE(pQuest->_qmsg); + file->writeLE(pQuest->_qmsg); } file->writeLE(pQuest->_qvar1); file->writeLE(pQuest->_qvar2); diff --git a/Source/monster.cpp b/Source/monster.cpp index ff154ed21..c671d8ff6 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4348,12 +4348,22 @@ void MAI_Garbud(int i) _my = Monst->_my; md = M_GetDir(i); - if (Monst->mtalkmsg < TEXT_GARBUD4 - && Monst->mtalkmsg > TEXT_DOOM10 + if (Monst->mtalkmsg >= TEXT_GARBUD1 + && Monst->mtalkmsg <= TEXT_GARBUD3 && !(dFlags[_mx][_my] & BFLAG_VISIBLE) && Monst->_mgoal == MGOAL_TALKING) { Monst->_mgoal = MGOAL_INQUIRING; - Monst->mtalkmsg++; + switch (Monst->mtalkmsg) { + case TEXT_GARBUD1: + Monst->mtalkmsg = TEXT_GARBUD2; + break; + case TEXT_GARBUD2: + Monst->mtalkmsg = TEXT_GARBUD3; + break; + case TEXT_GARBUD3: + Monst->mtalkmsg = TEXT_GARBUD4; + break; + } } if (dFlags[_mx][_my] & BFLAG_VISIBLE) { diff --git a/Source/objects.cpp b/Source/objects.cpp index d20574873..9b17d3201 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -200,7 +200,7 @@ const char *const StoryBookName[] = { "A Spellbook", }; /** Specifies the speech IDs of each dungeon type narrator book, for each player class. */ -int StoryText[3][3] = { +_speech_id StoryText[3][3] = { { TEXT_BOOK11, TEXT_BOOK12, TEXT_BOOK13 }, { TEXT_BOOK21, TEXT_BOOK22, TEXT_BOOK23 }, { TEXT_BOOK31, TEXT_BOOK32, TEXT_BOOK33 } @@ -423,7 +423,7 @@ void AddCandles() AddObject(OBJ_STORYCANDLE, tx + 2, ty + 2); } -void AddBookLever(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2, int msg) +void AddBookLever(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2, _speech_id msg) { bool exit; int xp, yp, ob, cnt, m, n; @@ -965,7 +965,7 @@ void AddLazStand() void InitObjects() { - int sp_id; + _speech_id sp_id; BYTE *mem; ClrAllObjects(); @@ -1216,7 +1216,7 @@ void SetObjMapRange(int i, int x1, int y1, int x2, int y2, int v) object[i]._oVar8 = v; } -void SetBookMsg(int i, int msg) +void SetBookMsg(int i, _speech_id msg) { object[i]._oVar7 = msg; } @@ -1597,47 +1597,47 @@ void objects_44DA68(int i, int a2) switch (a2) { case 6: if (plr[myplr]._pClass == PC_WARRIOR) { - object[i]._oVar2 = 323; + object[i]._oVar2 = TEXT_BOOKA; } else if (plr[myplr]._pClass == PC_ROGUE) { - object[i]._oVar2 = 332; + object[i]._oVar2 = TEXT_RBOOKA; } else if (plr[myplr]._pClass == PC_SORCERER) { - object[i]._oVar2 = 329; + object[i]._oVar2 = TEXT_MBOOKA; } else if (plr[myplr]._pClass == PC_MONK) { - object[i]._oVar2 = 326; + object[i]._oVar2 = TEXT_OBOOKA; } else if (plr[myplr]._pClass == PC_BARD) { - object[i]._oVar2 = 335; + object[i]._oVar2 = TEXT_BBOOKA; } else if (plr[myplr]._pClass == PC_BARBARIAN) { - object[i]._oVar2 = 323; + object[i]._oVar2 = TEXT_BOOKA; } break; case 7: if (plr[myplr]._pClass == PC_WARRIOR) { - object[i]._oVar2 = 324; + object[i]._oVar2 = TEXT_BOOKB; } else if (plr[myplr]._pClass == PC_ROGUE) { - object[i]._oVar2 = 333; + object[i]._oVar2 = TEXT_RBOOKB; } else if (plr[myplr]._pClass == PC_SORCERER) { - object[i]._oVar2 = 330; + object[i]._oVar2 = TEXT_MBOOKB; } else if (plr[myplr]._pClass == PC_MONK) { - object[i]._oVar2 = 327; + object[i]._oVar2 = TEXT_OBOOKB; } else if (plr[myplr]._pClass == PC_BARD) { - object[i]._oVar2 = 336; + object[i]._oVar2 = TEXT_BBOOKB; } else if (plr[myplr]._pClass == PC_BARBARIAN) { - object[i]._oVar2 = 324; + object[i]._oVar2 = TEXT_BOOKB; } break; case 8: if (plr[myplr]._pClass == PC_WARRIOR) { - object[i]._oVar2 = 325; + object[i]._oVar2 = TEXT_BOOKC; } else if (plr[myplr]._pClass == PC_ROGUE) { - object[i]._oVar2 = 334; + object[i]._oVar2 = TEXT_RBOOKC; } else if (plr[myplr]._pClass == PC_SORCERER) { - object[i]._oVar2 = 331; + object[i]._oVar2 = TEXT_MBOOKC; } else if (plr[myplr]._pClass == PC_MONK) { - object[i]._oVar2 = 328; + object[i]._oVar2 = TEXT_OBOOKC; } else if (plr[myplr]._pClass == PC_BARD) { - object[i]._oVar2 = 337; + object[i]._oVar2 = TEXT_BBOOKC; } else if (plr[myplr]._pClass == PC_BARBARIAN) { - object[i]._oVar2 = 325; + object[i]._oVar2 = TEXT_BOOKC; } break; } @@ -1649,7 +1649,7 @@ void objects_44DA68(int i, int a2) } else { object[i]._oVar1 = 1; - object[i]._oVar2 = a2 + 316; + object[i]._oVar2 = a2 + TEXT_SKLJRN; object[i]._oVar3 = a2 + 9; v9 = 2 * object[i]._oVar1; object[i]._oAnimFrame = 5 - v9; diff --git a/Source/objects.h b/Source/objects.h index eaf4a93cc..566d44b0f 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -26,7 +26,7 @@ void AddL2Objs(int x1, int y1, int x2, int y2); void InitObjects(); void SetMapObjects(BYTE *pMap, int startx, int starty); void SetObjMapRange(int i, int x1, int y1, int x2, int y2, int v); -void SetBookMsg(int i, int msg); +void SetBookMsg(int i, _speech_id msg); void GetRndObjLoc(int randarea, int *xx, int *yy); void AddMushPatch(); void AddSlainHero(); diff --git a/Source/player.cpp b/Source/player.cpp index 95da99b7b..291487e89 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -3503,16 +3503,16 @@ void ProcessPlayers() if (sfxdelay == 0) { switch (sfxdnum) { case USFX_DEFILER1: - InitQTextMsg(286); + InitQTextMsg(TEXT_DEFILER1); break; case USFX_DEFILER2: - InitQTextMsg(287); + InitQTextMsg(TEXT_DEFILER2); break; case USFX_DEFILER3: - InitQTextMsg(288); + InitQTextMsg(TEXT_DEFILER3); break; case USFX_DEFILER4: - InitQTextMsg(289); + InitQTextMsg(TEXT_DEFILER4); break; default: PlaySFX(sfxdnum); @@ -4314,7 +4314,7 @@ void PlayDungMsgs() sfxdnum = USFX_DEFILER1; quests[Q_DEFILER]._qactive = 2; quests[Q_DEFILER]._qlog = 1; - quests[Q_DEFILER]._qmsg = 286; + quests[Q_DEFILER]._qmsg = TEXT_DEFILER1; plr[myplr].pDungMsgs2 |= 1; } else if (currlevel == 19 && !plr[myplr]._pLvlVisited[19] && !gbIsMultiplayer && !(plr[myplr].pDungMsgs2 & 4)) { sfxdelay = 10; diff --git a/Source/quests.cpp b/Source/quests.cpp index 651ccf811..9bc4a5d0e 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -772,10 +772,10 @@ void ResyncQuests() } else { if (quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE) { if (quests[Q_MUSHROOM]._qvar1 >= QS_MUSHGIVEN) { - Qtalklist[TOWN_WITCH]._qblkm = -1; - Qtalklist[TOWN_HEALER]._qblkm = TEXT_MUSH3; + Qtalklist[TOWN_WITCH][Q_MUSHROOM] = TEXT_NONE; + Qtalklist[TOWN_HEALER][Q_MUSHROOM] = TEXT_MUSH3; } else if (quests[Q_MUSHROOM]._qvar1 >= QS_BRAINGIVEN) { - Qtalklist[TOWN_HEALER]._qblkm = -1; + Qtalklist[TOWN_HEALER][Q_MUSHROOM] = TEXT_NONE; } } } diff --git a/Source/quests.h b/Source/quests.h index 07e38d74a..255079736 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -23,7 +23,7 @@ typedef struct QuestStruct { Sint32 _qty; Uint8 _qslvl; Uint8 _qidx; - Uint32 _qmsg; + Sint32 _qmsg; Uint8 _qvar1; Uint8 _qvar2; bool _qlog; diff --git a/Source/stores.cpp b/Source/stores.cpp index fe1fe08bf..0cc172d9a 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1426,7 +1426,7 @@ void S_StartTalk() sn = 0; for (i = 0; i < MAXQUESTS; i++) { - if (quests[i]._qactive == QUEST_ACTIVE && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) + if (quests[i]._qactive == QUEST_ACTIVE && Qtalklist[talker][i] != TEXT_NONE && quests[i]._qlog) sn++; } @@ -1441,7 +1441,7 @@ void S_StartTalk() sn2 = sn - 2; for (i = 0; i < MAXQUESTS; i++) { - if (quests[i]._qactive == QUEST_ACTIVE && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) { + if (quests[i]._qactive == QUEST_ACTIVE && Qtalklist[talker][i] != TEXT_NONE && quests[i]._qlog) { AddSText(0, sn, TRUE, questlist[i]._qlstr, COL_WHITE, TRUE); sn += la; } @@ -2649,7 +2649,7 @@ void S_TalkEnter() sn = 0; for (i = 0; i < MAXQUESTS; i++) { - if (quests[i]._qactive == QUEST_ACTIVE && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) + if (quests[i]._qactive == QUEST_ACTIVE && Qtalklist[talker][i] != TEXT_NONE && quests[i]._qlog) sn++; } if (sn > 6) { @@ -2668,9 +2668,9 @@ void S_TalkEnter() } for (i = 0; i < MAXQUESTS; i++) { - if (quests[i]._qactive == QUEST_ACTIVE && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) { + if (quests[i]._qactive == QUEST_ACTIVE && Qtalklist[talker][i] != TEXT_NONE && quests[i]._qlog) { if (sn == stextsel) { - InitQTextMsg(((DWORD *)&Qtalklist[talker])[i]); + InitQTextMsg(Qtalklist[talker][i]); } sn += la; } diff --git a/Source/towners.cpp b/Source/towners.cpp index a1731c36d..c3ddefe2a 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -113,23 +113,22 @@ int cowoffx[8] = { -1, 0, -1, -1, -1, 0, -1, -1 }; */ int cowoffy[8] = { -1, -1, -1, 0, -1, -1, -1, 0 }; /** Contains the data related to quest gossip for each towner ID. */ -QuestTalkData Qtalklist[] = { +_speech_id Qtalklist[NUM_TOWNER_TYPES][MAXQUESTS] = { // clang-format off - // _qinfra, _qblkm, _qgarb, _qzhar, _qveil, _qmod, _qbutch, _qbol, _qblind, _qblood, _qanvil, _qwarlrd, _qking, _qpw, _qbone, _qvb, _qgrv, _qfarm, _qgirl, _qtrade, _qdefiler, _qnakrul, _qjersy, _qhf8 - { TEXT_INFRA6, TEXT_MUSH6, -1, -1, TEXT_VEIL5, -1, TEXT_BUTCH5, TEXT_BANNER6, TEXT_BLIND5, TEXT_BLOOD5, TEXT_ANVIL6, TEXT_WARLRD5, TEXT_KING7, TEXT_POISON7, TEXT_BONE5, TEXT_VILE9, TEXT_GRAVE2, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA3, -1, -1, -1, TEXT_VEIL3, -1, TEXT_BUTCH3, TEXT_BANNER4, TEXT_BLIND3, TEXT_BLOOD3, TEXT_ANVIL3, TEXT_WARLRD3, TEXT_KING5, TEXT_POISON4, TEXT_BONE3, TEXT_VILE7, TEXT_GRAVE3, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA2, TEXT_MUSH2, -1, -1, TEXT_VEIL2, -1, TEXT_BUTCH2, -1, TEXT_BLIND2, TEXT_BLOOD2, TEXT_ANVIL2, TEXT_WARLRD2, TEXT_KING3, TEXT_POISON2, TEXT_BONE2, TEXT_VILE4, TEXT_GRAVE5, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA1, TEXT_MUSH1, -1, -1, TEXT_VEIL1, TEXT_VILE3, TEXT_BUTCH1, TEXT_BANNER1, TEXT_BLIND1, TEXT_BLOOD1, TEXT_ANVIL1, TEXT_WARLRD1, TEXT_KING1, TEXT_POISON1, TEXT_BONE1, TEXT_VILE2, TEXT_GRAVE6, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA8, TEXT_MUSH7, -1, -1, TEXT_VEIL6, -1, TEXT_BUTCH6, TEXT_BANNER7, TEXT_BLIND6, TEXT_BLOOD6, TEXT_ANVIL8, TEXT_WARLRD6, TEXT_KING8, TEXT_POISON8, TEXT_BONE6, TEXT_VILE10, TEXT_GRAVE7, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA9, TEXT_MUSH9, -1, -1, TEXT_VEIL7, -1, TEXT_BUTCH7, TEXT_BANNER8, TEXT_BLIND7, TEXT_BLOOD7, TEXT_ANVIL9, TEXT_WARLRD7, TEXT_KING9, TEXT_POISON9, TEXT_BONE7, TEXT_VILE11, TEXT_GRAVE1, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA4, TEXT_MUSH5, -1, -1, TEXT_VEIL4, -1, TEXT_BUTCH4, TEXT_BANNER5, TEXT_BLIND4, TEXT_BLOOD4, TEXT_ANVIL4, TEXT_WARLRD4, TEXT_KING6, TEXT_POISON6, TEXT_BONE4, TEXT_VILE8, TEXT_GRAVE8, -1, -1, -1, -1, -1, -1, -1 }, - { TEXT_INFRA10, TEXT_MUSH13, -1, -1, TEXT_VEIL8, -1, TEXT_BUTCH8, TEXT_BANNER9, TEXT_BLIND8, TEXT_BLOOD8, TEXT_ANVIL10,TEXT_WARLRD8, TEXT_KING10, TEXT_POISON10, TEXT_BONE8, TEXT_VILE12, TEXT_GRAVE9, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + // Q_ROCK, Q_MUSHROOM, Q_GARBUD, Q_ZHAR, Q_VEIL, Q_DIABLO, Q_BUTCHER, Q_LTBANNER, Q_BLIND, Q_BLOOD, Q_ANVIL, Q_WARLORD, Q_SKELKING, Q_PWATER, Q_SCHAMB, Q_BETRAYER, Q_GRAVE, Q_FARMER, Q_GIRL, Q_TRADER, Q_DEFILER, Q_NAKRUL, Q_CORNSTN, Q_JERSEY + { TEXT_INFRA6, TEXT_MUSH6, TEXT_NONE, TEXT_NONE, TEXT_VEIL5, TEXT_NONE, TEXT_BUTCH5, TEXT_BANNER6, TEXT_BLIND5, TEXT_BLOOD5, TEXT_ANVIL6, TEXT_WARLRD5, TEXT_KING7, TEXT_POISON7, TEXT_BONE5, TEXT_VILE9, TEXT_GRAVE2, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA3, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_VEIL3, TEXT_NONE, TEXT_BUTCH3, TEXT_BANNER4, TEXT_BLIND3, TEXT_BLOOD3, TEXT_ANVIL3, TEXT_WARLRD3, TEXT_KING5, TEXT_POISON4, TEXT_BONE3, TEXT_VILE7, TEXT_GRAVE3, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA2, TEXT_MUSH2, TEXT_NONE, TEXT_NONE, TEXT_VEIL2, TEXT_NONE, TEXT_BUTCH2, TEXT_NONE, TEXT_BLIND2, TEXT_BLOOD2, TEXT_ANVIL2, TEXT_WARLRD2, TEXT_KING3, TEXT_POISON2, TEXT_BONE2, TEXT_VILE4, TEXT_GRAVE5, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA1, TEXT_MUSH1, TEXT_NONE, TEXT_NONE, TEXT_VEIL1, TEXT_VILE3, TEXT_BUTCH1, TEXT_BANNER1, TEXT_BLIND1, TEXT_BLOOD1, TEXT_ANVIL1, TEXT_WARLRD1, TEXT_KING1, TEXT_POISON1, TEXT_BONE1, TEXT_VILE2, TEXT_GRAVE6, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA8, TEXT_MUSH7, TEXT_NONE, TEXT_NONE, TEXT_VEIL6, TEXT_NONE, TEXT_BUTCH6, TEXT_BANNER7, TEXT_BLIND6, TEXT_BLOOD6, TEXT_ANVIL8, TEXT_WARLRD6, TEXT_KING8, TEXT_POISON8, TEXT_BONE6, TEXT_VILE10, TEXT_GRAVE7, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA9, TEXT_MUSH9, TEXT_NONE, TEXT_NONE, TEXT_VEIL7, TEXT_NONE, TEXT_BUTCH7, TEXT_BANNER8, TEXT_BLIND7, TEXT_BLOOD7, TEXT_ANVIL9, TEXT_WARLRD7, TEXT_KING9, TEXT_POISON9, TEXT_BONE7, TEXT_VILE11, TEXT_GRAVE1, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA4, TEXT_MUSH5, TEXT_NONE, TEXT_NONE, TEXT_VEIL4, TEXT_NONE, TEXT_BUTCH4, TEXT_BANNER5, TEXT_BLIND4, TEXT_BLOOD4, TEXT_ANVIL4, TEXT_WARLRD4, TEXT_KING6, TEXT_POISON6, TEXT_BONE4, TEXT_VILE8, TEXT_GRAVE8, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_INFRA10, TEXT_MUSH13, TEXT_NONE, TEXT_NONE, TEXT_VEIL8, TEXT_NONE, TEXT_BUTCH8, TEXT_BANNER9, TEXT_BLIND8, TEXT_BLOOD8, TEXT_ANVIL10, TEXT_WARLRD8, TEXT_KING10, TEXT_POISON10, TEXT_BONE8, TEXT_VILE12, TEXT_GRAVE9, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, + { TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE, TEXT_NONE }, // clang-format on }; /** Specifies the active sound effect ID for interacting with cows. */ @@ -222,8 +221,8 @@ void InitQstSnds(int i) tl++; for (j = 0; j < MAXQUESTS; j++) { towner[i].qsts[j]._qsttype = quests[j]._qtype; - towner[i].qsts[j]._qstmsg = ((int *)(Qtalklist + tl))[j]; - if (((int *)(Qtalklist + tl))[j] != -1) + towner[i].qsts[j]._qstmsg = Qtalklist[tl][j]; + if (Qtalklist[tl][j] != TEXT_NONE) towner[i].qsts[j]._qstmsgact = TRUE; else towner[i].qsts[j]._qstmsgact = FALSE; @@ -933,8 +932,8 @@ void TalkToTowner(int p, int t) if (PlrHasItem(p, IDI_MUSHROOM, &i) != NULL) { RemoveInvItem(p, i); quests[Q_MUSHROOM]._qvar1 = 5; - Qtalklist[TOWN_HEALER]._qblkm = TEXT_MUSH3; - Qtalklist[TOWN_WITCH]._qblkm = -1; + Qtalklist[TOWN_HEALER][Q_MUSHROOM] = TEXT_MUSH3; + Qtalklist[TOWN_WITCH][Q_MUSHROOM] = TEXT_NONE; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; quests[Q_MUSHROOM]._qmsg = TEXT_MUSH10; @@ -1020,7 +1019,7 @@ void TalkToTowner(int p, int t) SpawnQuestItem(IDI_SPECELIX, towner[t]._tx, towner[t]._ty + 1, 0, 0); InitQTextMsg(TEXT_MUSH4); quests[Q_MUSHROOM]._qvar1 = QS_BRAINGIVEN; - Qtalklist[TOWN_HEALER]._qblkm = -1; + Qtalklist[TOWN_HEALER][Q_MUSHROOM] = TEXT_NONE; } } if (!qtextflag) { @@ -1086,7 +1085,7 @@ void TalkToTowner(int p, int t) CowSFX(p); } else if (towner[t]._ttype == TOWN_FARMER) { if (!qtextflag) { - qt = 277; + qt = TEXT_FARMER1; t2 = 1; switch (quests[Q_FARMER]._qactive) { case 0: @@ -1098,13 +1097,13 @@ void TalkToTowner(int p, int t) quests[Q_FARMER]._qmsg = TEXT_FARMER1; break; } else if (!plr[p]._pLvlVisited[9] && plr[p]._pLevel < 15) { - qt = 309; + qt = TEXT_FARMER8; if (plr[p]._pLvlVisited[2]) - qt = 281; + qt = TEXT_FARMER5; if (plr[p]._pLvlVisited[5]) - qt = 308; + qt = TEXT_FARMER7; if (plr[p]._pLvlVisited[7]) - qt = 310; + qt = TEXT_FARMER9; } else { qt = TEXT_FARMER1; quests[Q_FARMER]._qactive = 2; @@ -1157,14 +1156,14 @@ void TalkToTowner(int p, int t) t2 = 1; break; case 10: - qt = -1; + qt = TEXT_NONE; break; default: quests[Q_FARMER]._qactive = 0; qt = TEXT_FARMER4; break; } - if (qt != -1) { + if (qt != TEXT_NONE) { if (t2) InitQTextMsg(qt); else @@ -1176,7 +1175,7 @@ void TalkToTowner(int p, int t) } } else if (towner[t]._ttype == TOWN_COWFARM) { if (!qtextflag) { - qt = 297; + qt = TEXT_JERSEY1; t2 = 1; if (PlrHasItem(p, IDI_GREYSUIT, &i)) { qt = TEXT_JERSEY7; @@ -1260,7 +1259,7 @@ void TalkToTowner(int p, int t) } } else if (towner[t]._ttype == TOWN_GIRL) { if (!qtextflag) { - qt = 282; + qt = TEXT_GIRL1; t2 = 0; if (!PlrHasItem(p, IDI_THEODORE, &i) || quests[Q_GIRL]._qactive == 3) { switch (quests[Q_GIRL]._qactive) { @@ -1285,7 +1284,7 @@ void TalkToTowner(int p, int t) t2 = 1; break; case 3: - qt = -1; + qt = TEXT_NONE; break; default: quests[Q_GIRL]._qactive = 0; diff --git a/Source/towners.h b/Source/towners.h index 843389853..f56266f16 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -12,6 +12,23 @@ DEVILUTION_BEGIN_NAMESPACE extern "C" { #endif +typedef enum _talker_id { + TOWN_SMITH, + TOWN_HEALER, + TOWN_DEADGUY, + TOWN_TAVERN, + TOWN_STORY, + TOWN_DRUNK, + TOWN_WITCH, + TOWN_BMAID, + TOWN_PEGBOY, + TOWN_COW, + TOWN_FARMER, + TOWN_GIRL, + TOWN_COWFARM, + NUM_TOWNER_TYPES, +} _talker_id; + typedef struct TNQ { Uint8 _qsttype; Uint8 _qstmsg; @@ -54,33 +71,6 @@ typedef struct TownerStruct { Uint8 *_tNData; } TownerStruct; -typedef struct QuestTalkData { - int _qinfra; - int _qblkm; - int _qgarb; - int _qzhar; - int _qveil; - int _qmod; - int _qbutch; - int _qbol; - int _qblind; - int _qblood; - int _qanvil; - int _qwarlrd; - int _qking; - int _qpw; - int _qbone; - int _qvb; - int _qgrv; - int _qfarm; - int _qgirl; - int _qtrade; - int _qdefiler; - int _qnakrul; - int _qjersy; - int _qhf8; -} QuestTalkData; - extern TownerStruct towner[NUM_TOWNERS]; void InitTowners(); @@ -89,7 +79,7 @@ void ProcessTowners(); ItemStruct *PlrHasItem(int pnum, int item, int *i); void TalkToTowner(int p, int t); -extern QuestTalkData Qtalklist[]; +extern _speech_id Qtalklist[NUM_TOWNER_TYPES][MAXQUESTS]; #ifdef __cplusplus } diff --git a/enums.h b/enums.h index 59c2e5449..ed7fea9c7 100644 --- a/enums.h +++ b/enums.h @@ -1830,6 +1830,7 @@ typedef enum _speech_id { TEXT_BBOOKA = 0x14F, TEXT_BBOOKB = 0x150, TEXT_BBOOKC = 0x151, + TEXT_NONE = -1, } _speech_id; typedef enum object_graphic_id { @@ -2358,23 +2359,6 @@ typedef enum _cmd_id { NUM_CMDS, } _cmd_id; -typedef enum _talker_id { - TOWN_SMITH = 0x0, - TOWN_HEALER = 0x1, - TOWN_DEADGUY = 0x2, - TOWN_TAVERN = 0x3, - TOWN_STORY = 0x4, - TOWN_DRUNK = 0x5, - TOWN_WITCH = 0x6, - TOWN_BMAID = 0x7, - TOWN_PEGBOY = 0x8, - TOWN_COW = 0x9, - TOWN_FARMER = 0xA, - TOWN_GIRL = 0xB, - TOWN_COWFARM = 0xC, - TOWN_PRIEST, -} _talker_id; - typedef enum _music_id { TMUSIC_TOWN, TMUSIC_L1, diff --git a/structs.h b/structs.h index 9a7c7d434..b1ae9b504 100644 --- a/structs.h +++ b/structs.h @@ -240,7 +240,7 @@ typedef struct ObjectStruct { int _oVar4; int _oVar5; int _oVar6; - int _oVar7; + _speech_id _oVar7; int _oVar8; } ObjectStruct;