From 27dfaeb9dc344b1d0e4e9efa85484be2ba61d114 Mon Sep 17 00:00:00 2001 From: staphen Date: Sun, 5 Mar 2023 15:58:15 -0500 Subject: [PATCH] Use herosounds for class-specific quest speech IDs --- Source/minitext.cpp | 30 ++++++++++++++++++++++-- Source/textdat.cpp | 56 ++++++++++++++++++++++----------------------- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/Source/minitext.cpp b/Source/minitext.cpp index 868b3afb0..be4a52474 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -14,6 +14,7 @@ #include "engine/load_cel.hpp" #include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" +#include "playerdat.hpp" #include "textdat.h" #include "utils/language.h" #include "utils/stdcompat/optional.hpp" @@ -131,14 +132,39 @@ void InitQuestText() void InitQTextMsg(_speech_id m) { + _sfx_id sfxnr = Speeches[m].sfxnr; + const _sfx_id *classSounds = herosounds[static_cast(MyPlayer->_pClass)]; + switch (sfxnr) { + case PS_WARR1: + sfxnr = classSounds[static_cast(HeroSpeech::ChamberOfBoneLore)]; + break; + case PS_WARR10: + sfxnr = classSounds[static_cast(HeroSpeech::ValorLore)]; + break; + case PS_WARR11: + sfxnr = classSounds[static_cast(HeroSpeech::HallsOfTheBlindLore)]; + break; + case PS_WARR12: + sfxnr = classSounds[static_cast(HeroSpeech::WarlordOfBloodLore)]; + break; + case PS_WARR54: + sfxnr = classSounds[static_cast(HeroSpeech::InSpirituSanctum)]; + break; + case PS_WARR55: + sfxnr = classSounds[static_cast(HeroSpeech::PraedictumOtium)]; + break; + case PS_WARR56: + sfxnr = classSounds[static_cast(HeroSpeech::EfficioObitusUtInimicus)]; + break; + } if (Speeches[m].scrlltxt) { QuestLogIsOpen = false; LoadText(_(Speeches[m].txtstr)); qtextflag = true; - qtextSpd = CalculateTextSpeed(Speeches[m].sfxnr); + qtextSpd = CalculateTextSpeed(sfxnr); ScrollStart = SDL_GetTicks(); } - PlaySFX(Speeches[m].sfxnr); + PlaySFX(sfxnr); } void DrawQTextBack(const Surface &out) diff --git a/Source/textdat.cpp b/Source/textdat.cpp index e7c56b9d7..fcfca9228 100644 --- a/Source/textdat.cpp +++ b/Source/textdat.cpp @@ -477,21 +477,21 @@ const Speech Speeches[] = { { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and men alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood."), true, PS_WARR12 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written."), - true, PS_MAGE1 }, + true, PS_WARR1 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken..."), - true, PS_MAGE10 }, + true, PS_WARR10 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind."), - true, PS_MAGE11 }, + true, PS_WARR11 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and men alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood."), - true, PS_MAGE12 }, + true, PS_WARR12 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written."), - true, PS_ROGUE1 }, + true, PS_WARR1 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken..."), - true, PS_ROGUE10 }, + true, PS_WARR10 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind."), - true, PS_ROGUE11 }, + true, PS_WARR11 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and men alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood."), - true, PS_ROGUE12 }, + true, PS_WARR12 }, { "", false, TSFX_COW1 }, { "", false, TSFX_COW2 }, /* @@ -523,21 +523,21 @@ const Speech Speeches[] = { { N_(/* TRANSLATORS: Neutral Text spoken by Ogden */ "Thank goodness you've returned!\nMuch has changed since you lived here, my friend. All was peaceful until the dark riders came and destroyed our village. Many were cut down where they stood, and those who took up arms were slain or dragged away to become slaves - or worse. The church at the edge of town has been desecrated and is being used for dark rituals. The screams that echo in the night are inhuman, but some of our townsfolk may yet survive. Follow the path that lies between my tavern and the blacksmith shop to find the church and save who you can. \n \nPerhaps I can tell you more if we speak again. Good luck."), true, TSFX_TAVERN0 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written."), - true, PS_MONK1 }, + true, PS_WARR1 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken..."), - true, PS_MONK10 }, + true, PS_WARR10 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind."), - true, PS_MONK11 }, + true, PS_WARR11 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and man alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood."), - true, PS_MONK12 }, + true, PS_WARR12 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "Beyond the Hall of Heroes lies the Chamber of Bone. Eternal death awaits any who would seek to steal the treasures secured within this room. So speaks the Lord of Terror, and so it is written."), - true, PS_ROGUE1 }, + true, PS_WARR1 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "...and so, locked beyond the Gateway of Blood and past the Hall of Fire, Valor awaits for the Hero of Light to awaken..."), - true, PS_ROGUE10 }, + true, PS_WARR10 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "I can see what you see not.\nVision milky then eyes rot.\nWhen you turn they will be gone,\nWhispering their hidden song.\nThen you see what cannot be,\nShadows move where light should be.\nOut of darkness, out of mind,\nCast down into the Halls of the Blind."), - true, PS_ROGUE11 }, + true, PS_WARR11 }, { N_(/* TRANSLATORS: Quest text spoken aloud from a book by player */ "The armories of Hell are home to the Warlord of Blood. In his wake lay the mutilated bodies of thousands. Angels and man alike have been cut down to fulfill his endless sacrifices to the Dark ones who scream for one thing - blood."), - true, PS_ROGUE12 }, + true, PS_WARR12 }, { N_(/* TRANSLATORS: Quest text spoken by Adria */ "Maintain your quest. Finding a treasure that is lost is not easy. Finding a treasure that is hidden less so. I will leave you with this. Do not let the sands of time confuse your search."), true, TSFX_WITCH19 }, { N_(/* TRANSLATORS: Quest text spoken by Griswold */ "A what?! This is foolishness. There's no treasure buried here in Tristram. Let me see that!! Ah, Look these drawings are inaccurate. They don't match our town at all. I'd keep my mind on what lies below the cathedral and not what lies below our topsoil."), @@ -642,18 +642,18 @@ const Speech Speeches[] = { { N_(/* TRANSLATORS: Quest text read aloud from book by player */ "In Spiritu Sanctum."), true, PS_WARR54 }, { N_(/* TRANSLATORS: Quest text read aloud from book by player */ "Praedictum Otium."), true, PS_WARR55 }, { N_(/* TRANSLATORS: Quest text read aloud from book by player */ "Efficio Obitus Ut Inimicus."), true, PS_WARR56 }, - { N_("In Spiritu Sanctum."), true, PS_MONK54 }, - { N_("Praedictum Otium."), true, PS_MONK55 }, - { N_("Efficio Obitus Ut Inimicus."), true, PS_MONK56 }, - { N_("In Spiritu Sanctum."), true, PS_MAGE54 }, - { N_("Praedictum Otium."), true, PS_MAGE55 }, - { N_("Efficio Obitus Ut Inimicus."), true, PS_MAGE56 }, - { N_("In Spiritu Sanctum."), true, PS_ROGUE54 }, - { N_("Praedictum Otium."), true, PS_ROGUE55 }, - { N_("Efficio Obitus Ut Inimicus."), true, PS_ROGUE56 }, - { N_("In Spiritu Sanctum."), true, PS_ROGUE54 }, - { N_("Praedictum Otium."), true, PS_ROGUE55 }, - { N_("Efficio Obitus Ut Inimicus."), true, PS_ROGUE56 }, + { N_("In Spiritu Sanctum."), true, PS_WARR54 }, + { N_("Praedictum Otium."), true, PS_WARR55 }, + { N_("Efficio Obitus Ut Inimicus."), true, PS_WARR56 }, + { N_("In Spiritu Sanctum."), true, PS_WARR54 }, + { N_("Praedictum Otium."), true, PS_WARR55 }, + { N_("Efficio Obitus Ut Inimicus."), true, PS_WARR56 }, + { N_("In Spiritu Sanctum."), true, PS_WARR54 }, + { N_("Praedictum Otium."), true, PS_WARR55 }, + { N_("Efficio Obitus Ut Inimicus."), true, PS_WARR56 }, + { N_("In Spiritu Sanctum."), true, PS_WARR54 }, + { N_("Praedictum Otium."), true, PS_WARR55 }, + { N_("Efficio Obitus Ut Inimicus."), true, PS_WARR56 }, /** { N_("Please help....! I barely escaped from....... The Butcher...! He killed.... My wife... My children! I beg of you...... In the name of God......... Avenge them........."), true, TSFX_DEADGUY }, { N_("*retching* Listen, listen. I don't even like worms. Don't tell me about yer worms! I don't want yer worms! Nope, no thanks! *slight hiccup/gag* No worms for me."), true, TSFX_DRUNK5 },