Browse Source

💬 Rename HeroSpeech members to improve discoverability

pull/2047/head
Juliano Leal Goncalves 5 years ago committed by Anders Jenbo
parent
commit
15c46b9eb0
  1. 2
      Source/controls/plrctrls.cpp
  2. 206
      Source/effects.h
  3. 28
      Source/inv.cpp
  4. 2
      Source/miniwin/misc_msg.cpp
  5. 10
      Source/missiles.cpp
  6. 8
      Source/objects.cpp
  7. 20
      Source/player.cpp
  8. 14
      Source/quests.cpp
  9. 4
      Source/towners.cpp
  10. 2
      Source/trigs.cpp

2
Source/controls/plrctrls.cpp

@ -1491,7 +1491,7 @@ void PerformSpellAction()
int spl = plr[myplr]._pRSpell;
if ((pcursplr == -1 && (spl == SPL_RESURRECT || spl == SPL_HEALOTHER))
|| (pcursobj == -1 && spl == SPL_DISARM)) {
plr[myplr].Say(HeroSpeech::N27);
plr[myplr].Say(HeroSpeech::ICantCastThatHere);
return;
}

206
Source/effects.h

@ -13,109 +13,109 @@
namespace devilution {
enum class HeroSpeech {
N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8,
N9,
N10,
N11,
N12,
N13,
N14,
N15,
N16,
N17,
N18,
N19,
N20,
N21,
N22,
N23,
N24,
N25,
N26,
N27,
N28,
N29,
N30,
N31,
N32,
N33,
N34,
N35,
N36,
N37,
N38,
N39,
N40,
N41,
N42,
N43,
N44,
N45,
N46,
N47,
N48,
N49,
N50,
N51,
N52,
N53,
N54,
N55,
N56,
N57,
N58,
N59,
N60,
N61,
N62,
N63,
N64,
N65,
N66,
N67,
N68,
N69,
N70,
N71,
N72,
N73,
N74,
N75,
N76,
N77,
N78,
N79,
N80,
N81,
N82,
N83,
N84,
N85,
N86,
N87,
N88,
N89,
N90,
N91,
N92,
N93,
N94,
N95,
N96,
N97,
N98,
N99,
N100,
N101,
N102,
LAST = N102
ChamberOfBoneLore,
HorazonsSanctumLore,
GolemSpellLore,
HorazonsCreatureOfFlameLore,
MortaVespaGaieaInnuminoEvegeenJatanLuaGraton,
GrimspikeLieutenantOfBelialLore,
HorazonsJournal,
YourDeathWillBeAvenged,
RestInPeaceMyFriend,
ValorLore,
HallsOfTheBlindLore,
WarlordOfBloodLore,
ICantUseThisYet,
ICantCarryAnymore,
IHaveNoRoom,
WhereWouldIPutThis,
NoWay,
NotAChance,
IdNeverUseThis,
IdHaveToEquipThat,
ICantMoveThis,
ICantMoveThisYet,
ICantOpenThis,
ICantOpenThisYet,
ICantLiftThis,
ICantLiftThisYet,
ICantCastThatHere,
ICantCastThatYet,
ThatDidntDoAnything,
ICanAlreadyDoThat,
IDontNeedThat,
IDontNeedToDoThat,
IDontWantThat,
IDontHaveASpellReady,
NotEnoughMana,
ThatWouldKillMe,
ICantDoThat,
No,
Yes,
ThatWontWork,
ThatWontWorkHere,
ThatWontWorkYet,
ICantGetThereFromHere,
ItsTooHeavy,
ItsTooBig,
JustWhatIWasLookingFor,
IveGotABadFeelingAboutThis,
GotMilk,
ImNotThirsty,
ImNoMilkmade,
ICouldBlowUpTheWholeVillage,
YepThatsACowAlright,
TooUghHeavy,
InSpirituSanctum,
PraedictumOtium,
EfficioObitusUtInimicus,
TheEnchantmentIsGone,
OhTooEasy,
BackToTheGrave,
TimeToDie,
ImNotImpressed,
ImSorryDidIBreakYourConcentration,
VengeanceIsMine,
Die,
Yeah,
Ah,
Phew,
Argh,
ArghClang,
Aaaaargh,
OofAh,
HeavyBreathing,
Oh,
Wow,
ThankTheLight,
WhatWasThat,
MmHmm,
Hmm,
UhHuh,
TheSpiritsOfTheDeadAreNowAvenged,
TheTownIsSafeFromTheseFoulSpawn,
RestWellLeoricIllFindYourSon,
YourMadnessEndsHereBetrayer,
YouLureNoMoreMenToTheirDeaths,
ReturnToHeavenWarriorOfLight,
ICanSeeWhyTheyFearThisWeapon,
ThisMustBeWhatGriswoldWanted,
INeedToGetThisToLachdanan,
INeedToGetThisToGriswold,
IveNeverBeenHereBefore,
MayTheSpiritOfArkaineProtectMe,
ThisIsAPlaceOfGreatPower,
ThisBladeMustBeDestroyed,
YourReignOfPainHasEnded,
NowThatsOneBigMushroom,
TheSmellOfDeathSurroundsMe,
TheSanctityOfThisPlaceHasBeenFouled,
ItsHotDownHere,
IMustBeGettingClose,
MaybeItsLockedFromTheInside,
LooksLikeItsRustedShut,
MaybeThereIsAnotherWay,
LAST = MaybeThereIsAnotherWay
};
enum _sfx_id : int16_t {

28
Source/inv.cpp

@ -963,7 +963,7 @@ void CheckInvPaste(int pnum, int mx, int my)
if (il != ILOC_UNEQUIPABLE && il != ILOC_BELT && !plr[pnum].HoldItem._iStatFlag) {
done = false;
plr[pnum].Say(HeroSpeech::N13);
plr[pnum].Say(HeroSpeech::ICantUseThisYet);
}
if (!done)
@ -1448,9 +1448,9 @@ void CheckInvCut(int pnum, int mx, int my, bool automaticMove)
if (automaticMove) {
if (!automaticallyMoved) {
if (CanBePlacedOnBelt(holdItem) || automaticallyUnequip) {
player.SaySpecific(HeroSpeech::N15);
player.SaySpecific(HeroSpeech::IHaveNoRoom);
} else {
player.SaySpecific(HeroSpeech::N37);
player.SaySpecific(HeroSpeech::ICantDoThat);
}
}
@ -1540,7 +1540,7 @@ void CheckQuestItem(int pnum)
if (plr[pnum].HoldItem.IDidx == IDI_OPTAMULET && quests[Q_BLIND]._qactive == QUEST_ACTIVE)
quests[Q_BLIND]._qactive = QUEST_DONE;
if (plr[pnum].HoldItem.IDidx == IDI_MUSHROOM && quests[Q_MUSHROOM]._qactive == QUEST_ACTIVE && quests[Q_MUSHROOM]._qvar1 == QS_MUSHSPAWNED) {
plr[pnum].Say(HeroSpeech::N95, 10); // BUGFIX: Voice for this quest might be wrong in MP
plr[pnum].Say(HeroSpeech::NowThatsOneBigMushroom, 10); // BUGFIX: Voice for this quest might be wrong in MP
quests[Q_MUSHROOM]._qvar1 = QS_MUSHPICKED;
}
if (plr[pnum].HoldItem.IDidx == IDI_ANVIL && quests[Q_ANVIL]._qactive != QUEST_NOTAVAIL) {
@ -1548,29 +1548,29 @@ void CheckQuestItem(int pnum)
quests[Q_ANVIL]._qactive = QUEST_ACTIVE;
}
if (quests[Q_ANVIL]._qlog) {
plr[myplr].Say(HeroSpeech::N89, 10);
plr[myplr].Say(HeroSpeech::INeedToGetThisToGriswold, 10);
}
}
if (plr[pnum].HoldItem.IDidx == IDI_GLDNELIX && quests[Q_VEIL]._qactive != QUEST_NOTAVAIL) {
plr[myplr].Say(HeroSpeech::N88, 30);
plr[myplr].Say(HeroSpeech::INeedToGetThisToLachdanan, 30);
}
if (plr[pnum].HoldItem.IDidx == IDI_ROCK && quests[Q_ROCK]._qactive != QUEST_NOTAVAIL) {
if (quests[Q_ROCK]._qactive == QUEST_INIT) {
quests[Q_ROCK]._qactive = QUEST_ACTIVE;
}
if (quests[Q_ROCK]._qlog) {
plr[myplr].Say(HeroSpeech::N87, 10);
plr[myplr].Say(HeroSpeech::ThisMustBeWhatGriswoldWanted, 10);
}
}
if (plr[pnum].HoldItem.IDidx == IDI_ARMOFVAL && quests[Q_BLOOD]._qactive == QUEST_ACTIVE) {
quests[Q_BLOOD]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N91, 20);
plr[myplr].Say(HeroSpeech::MayTheSpiritOfArkaineProtectMe, 20);
}
if (plr[pnum].HoldItem.IDidx == IDI_MAPOFDOOM) {
quests[Q_GRAVE]._qlog = false;
quests[Q_GRAVE]._qactive = QUEST_ACTIVE;
quests[Q_GRAVE]._qvar1 = 1;
plr[myplr].Say(HeroSpeech::N79, 10);
plr[myplr].Say(HeroSpeech::UhHuh, 10);
}
if (plr[pnum].HoldItem.IDidx == IDI_NOTE1 || plr[pnum].HoldItem.IDidx == IDI_NOTE2 || plr[pnum].HoldItem.IDidx == IDI_NOTE3) {
int mask, idx, item_num;
@ -1585,7 +1585,7 @@ void CheckQuestItem(int pnum)
mask |= 4;
if (mask == 7) {
int n1, n2, n3;
plr[myplr].Say(HeroSpeech::N46, 10);
plr[myplr].Say(HeroSpeech::JustWhatIWasLookingFor, 10);
switch (idx) {
case IDI_NOTE1:
plr[pnum].HasItem(IDI_NOTE2, &n2);
@ -1713,7 +1713,7 @@ void AutoGetItem(int pnum, ItemStruct *item, int ii)
}
if (pnum == myplr) {
plr[pnum].Say(HeroSpeech::N14);
plr[pnum].Say(HeroSpeech::ICantCarryAnymore);
}
plr[pnum].HoldItem = *item;
RespawnItem(item, true);
@ -2189,11 +2189,11 @@ bool UseInvItem(int pnum, int cii)
switch (Item->IDidx) {
case IDI_MUSHROOM:
plr[pnum].Say(HeroSpeech::N95, 10);
plr[pnum].Say(HeroSpeech::NowThatsOneBigMushroom, 10);
return true;
case IDI_FUNGALTM:
PlaySFX(IS_IBOOK);
plr[pnum].Say(HeroSpeech::N29, 10);
plr[pnum].Say(HeroSpeech::ThatDidntDoAnything, 10);
return true;
}
@ -2201,7 +2201,7 @@ bool UseInvItem(int pnum, int cii)
return false;
if (!Item->_iStatFlag) {
plr[pnum].Say(HeroSpeech::N13);
plr[pnum].Say(HeroSpeech::ICantUseThisYet);
return true;
}

2
Source/miniwin/misc_msg.cpp

@ -281,7 +281,7 @@ bool BlurInventory()
{
if (pcurs >= CURSOR_FIRSTITEM) {
if (!TryDropItem()) {
plr[myplr].Say(HeroSpeech::N16); // "Where would I put this?"
plr[myplr].Say(HeroSpeech::WhereWouldIPutThis);
return false;
}
}

10
Source/missiles.cpp

@ -810,7 +810,7 @@ bool PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, bool s
}
if (plr[pnum]._pHitPoints >> 6 > 0) {
plr[pnum].Say(HeroSpeech::N69);
plr[pnum].Say(HeroSpeech::ArghClang);
}
return true;
}
@ -920,7 +920,7 @@ bool Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, b
dam -= (dam * resper) / 100;
if (pnum == myplr)
NetSendCmdDamage(true, p, dam);
plr[pnum].Say(HeroSpeech::N69);
plr[pnum].Say(HeroSpeech::ArghClang);
return true;
}
if (blkper < blk) {
@ -2919,7 +2919,7 @@ void AddBlodboil(int mi, int sx, int sy, int dx, int dy, int midir, int8_t miene
missile[mi]._mirange = lvl + 10 * missile[mi]._mispllvl + 245;
CalcPlrItemVals(id, true);
force_redraw = 255;
plr[id].Say(HeroSpeech::N70);
plr[id].Say(HeroSpeech::Aaaaargh);
}
}
@ -4848,7 +4848,7 @@ void MI_Blodboil(int i)
CalcPlrItemVals(id, true);
ApplyPlrDamage(id, 0, 1, hpdif);
force_redraw = 255;
plr[id].Say(HeroSpeech::N72);
plr[id].Say(HeroSpeech::HeavyBreathing);
} else {
missile[i]._miDelFlag = true;
plr[id]._pSpellFlags &= ~0x4;
@ -4856,7 +4856,7 @@ void MI_Blodboil(int i)
CalcPlrItemVals(id, true);
ApplyPlrDamage(id, 0, 1, hpdif + missile[i]._miVar2);
force_redraw = 255;
plr[id].Say(HeroSpeech::N72);
plr[id].Say(HeroSpeech::HeavyBreathing);
}
}
}

8
Source/objects.cpp

@ -2144,7 +2144,7 @@ void Obj_BCrossDamage(int i)
ApplyPlrDamage(myplr, 0, 0, damage[leveltype - 1]);
if (plr[myplr]._pHitPoints >> 6 > 0) {
plr[myplr].Say(HeroSpeech::N68);
plr[myplr].Say(HeroSpeech::Argh);
}
}
@ -3139,7 +3139,7 @@ void OperateMushPatch(int pnum, int i)
if (quests[Q_MUSHROOM]._qactive != QUEST_ACTIVE) {
if (!deltaload && pnum == myplr) {
plr[myplr].Say(HeroSpeech::N13);
plr[myplr].Say(HeroSpeech::ICantUseThisYet);
}
return;
}
@ -3165,7 +3165,7 @@ void OperateInnSignChest(int pnum, int i)
if (quests[Q_LTBANNER]._qvar1 != 2) {
if (!deltaload && pnum == myplr) {
plr[myplr].Say(HeroSpeech::N24);
plr[myplr].Say(HeroSpeech::ICantOpenThisYet);
}
} else {
if (object[i]._oSelFlag != 0) {
@ -3199,7 +3199,7 @@ void OperateSlainHero(int pnum, int i)
} else if (plr[pnum]._pClass == HeroClass::Barbarian) {
CreateMagicWeapon(object[i].position, ITYPE_AXE, ICURS_BATTLE_AXE, false, true);
}
plr[myplr].Say(HeroSpeech::N9);
plr[myplr].Say(HeroSpeech::RestInPeaceMyFriend);
if (pnum == myplr)
NetSendCmdParam1(false, CMD_OPERATEOBJ, i);
}

20
Source/player.cpp

@ -1725,7 +1725,7 @@ void StartPlrHit(int pnum, int dam, bool forcehit)
return;
}
player.Say(HeroSpeech::N69);
player.Say(HeroSpeech::ArghClang);
drawhpflag = true;
if (player._pClass == HeroClass::Barbarian) {
@ -1839,7 +1839,7 @@ StartPlayerKill(int pnum, int earflag)
diablolevel = gbIsMultiplayer && player.plrlevel == 16;
player.Say(HeroSpeech::N71);
player.Say(HeroSpeech::OofAh);
if (player._pgfxnum) {
player._pgfxnum = 0;
@ -3813,12 +3813,12 @@ void CheckPlrSpell()
spell_id rspell = myPlayer._pRSpell;
if (rspell == SPL_INVALID) {
myPlayer.Say(HeroSpeech::N34);
myPlayer.Say(HeroSpeech::IDontHaveASpellReady);
return;
}
if (leveltype == DTYPE_TOWN && !spelldata[rspell].sTownSpell) {
myPlayer.Say(HeroSpeech::N27);
myPlayer.Say(HeroSpeech::ICantCastThatHere);
return;
}
@ -3876,7 +3876,7 @@ void CheckPlrSpell()
}
if (myPlayer._pRSplType == RSPLTYPE_SPELL) {
myPlayer.Say(HeroSpeech::N35);
myPlayer.Say(HeroSpeech::NotEnoughMana);
}
}
@ -4280,16 +4280,16 @@ void PlayDungMsgs()
auto &myPlayer = plr[myplr];
if (currlevel == 1 && !myPlayer._pLvlVisited[1] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & DMSG_CATHEDRAL)) {
myPlayer.Say(HeroSpeech::N97, 40);
myPlayer.Say(HeroSpeech::TheSanctityOfThisPlaceHasBeenFouled, 40);
myPlayer.pDungMsgs = myPlayer.pDungMsgs | DMSG_CATHEDRAL;
} else if (currlevel == 5 && !myPlayer._pLvlVisited[5] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & DMSG_CATACOMBS)) {
myPlayer.Say(HeroSpeech::N96, 40);
myPlayer.Say(HeroSpeech::TheSmellOfDeathSurroundsMe, 40);
myPlayer.pDungMsgs |= DMSG_CATACOMBS;
} else if (currlevel == 9 && !myPlayer._pLvlVisited[9] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & DMSG_CAVES)) {
myPlayer.Say(HeroSpeech::N98, 40);
myPlayer.Say(HeroSpeech::ItsHotDownHere, 40);
myPlayer.pDungMsgs |= DMSG_CAVES;
} else if (currlevel == 13 && !myPlayer._pLvlVisited[13] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & DMSG_HELL)) {
myPlayer.Say(HeroSpeech::N99, 40);
myPlayer.Say(HeroSpeech::IMustBeGettingClose, 40);
myPlayer.pDungMsgs |= DMSG_HELL;
} else if (currlevel == 16 && !myPlayer._pLvlVisited[15] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & DMSG_DIABLO)) { // BUGFIX: _pLvlVisited should check 16 or this message will never play
sfxdelay = 40;
@ -4307,7 +4307,7 @@ void PlayDungMsgs()
sfxdnum = USFX_DEFILER3;
myPlayer.pDungMsgs2 |= 4;
} else if (currlevel == 21 && !myPlayer._pLvlVisited[21] && !gbIsMultiplayer && !(myPlayer.pDungMsgs & 32)) {
myPlayer.Say(HeroSpeech::N92, 30);
myPlayer.Say(HeroSpeech::ThisIsAPlaceOfGreatPower, 30);
myPlayer.pDungMsgs |= 32;
} else {
sfxdelay = 0;

14
Source/quests.cpp

@ -315,21 +315,21 @@ void CheckQuestKill(int m, bool sendmsg)
if (monster[m].MType->mtype == MT_SKING) {
quests[Q_SKELKING]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N82, 30);
plr[myplr].Say(HeroSpeech::RestWellLeoricIllFindYourSon, 30);
if (sendmsg)
NetSendCmdQuest(true, Q_SKELKING);
} else if (monster[m].MType->mtype == MT_CLEAVER) {
quests[Q_BUTCHER]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N80, 30);
plr[myplr].Say(HeroSpeech::TheSpiritsOfTheDeadAreNowAvenged, 30);
if (sendmsg)
NetSendCmdQuest(true, Q_BUTCHER);
} else if (monster[m]._uniqtype - 1 == UMT_GARBUD) { //"Gharbad the Weak"
quests[Q_GARBUD]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N61, 30);
plr[myplr].Say(HeroSpeech::ImNotImpressed, 30);
} else if (monster[m]._uniqtype - 1 == UMT_ZHAR) { //"Zhar the Mad"
quests[Q_ZHAR]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N62, 30);
plr[myplr].Say(HeroSpeech::ImSorryDidIBreakYourConcentration, 30);
} else if (monster[m]._uniqtype - 1 == UMT_LAZURUS && gbIsMultiplayer) { //"Arch-Bishop Lazarus"
quests[Q_BETRAYER]._qactive = QUEST_DONE;
quests[Q_BETRAYER]._qvar1 = 7;
@ -344,7 +344,7 @@ void CheckQuestKill(int m, bool sendmsg)
}
}
}
plr[myplr].Say(HeroSpeech::N83, 30);
plr[myplr].Say(HeroSpeech::YourMadnessEndsHereBetrayer, 30);
if (sendmsg) {
NetSendCmdQuest(true, Q_BETRAYER);
NetSendCmdQuest(true, Q_DIABLO);
@ -356,10 +356,10 @@ void CheckQuestKill(int m, bool sendmsg)
quests[Q_BETRAYER]._qvar2 = 4;
quests[Q_DIABLO]._qactive = QUEST_ACTIVE;
AddMissile(35, 32, 35, 32, 0, MIS_RPORTAL, TARGET_MONSTERS, myplr, 0, 0);
plr[myplr].Say(HeroSpeech::N83, 30);
plr[myplr].Say(HeroSpeech::YourMadnessEndsHereBetrayer, 30);
} else if (monster[m]._uniqtype - 1 == UMT_WARLORD) { //"Warlord of Blood"
quests[Q_WARLORD]._qactive = QUEST_DONE;
plr[myplr].Say(HeroSpeech::N94, 30);
plr[myplr].Say(HeroSpeech::YourReignOfPainHasEnded, 30);
}
}

4
Source/towners.cpp

@ -376,7 +376,7 @@ void TalkToDeadguy(PlayerStruct &player, TownerStruct & /*deadguy*/)
return;
if (quests[Q_BUTCHER]._qvar1 == 1) {
player.SaySpecific(HeroSpeech::N8);
player.SaySpecific(HeroSpeech::YourDeathWillBeAvenged);
return;
}
@ -597,7 +597,7 @@ void TalkToCow(PlayerStruct &player, TownerStruct &cow)
} else if (CowClicks >= 8 && !gbIsSpawn) {
CowClicks = 4;
static const HeroSpeech snSfx[3] = { HeroSpeech::N52, HeroSpeech::N49, HeroSpeech::N50 };
static const HeroSpeech snSfx[3] = { HeroSpeech::YepThatsACowAlright, HeroSpeech::ImNotThirsty, HeroSpeech::ImNoMilkmade };
player.SaySpecific(snSfx[CowMsg]);
CowMsg++;
if (CowMsg >= 3)

2
Source/trigs.cpp

@ -865,7 +865,7 @@ void CheckTriggers()
}
if (abort) {
plr[myplr].Say(HeroSpeech::N43);
plr[myplr].Say(HeroSpeech::ICantGetThereFromHere);
InitDiabloMsg(abortflag);
NetSendCmdLoc(myplr, true, CMD_WALKXY, position);

Loading…
Cancel
Save