From f3f0b988e33da726da2ca89b9620d7352b9951a4 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 27 Jan 2009 23:43:07 +0000 Subject: Add speech for when the player fails to neutralize holy beings. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8830 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dat/database/monspeak.txt | 16 +++++++++++++ crawl-ref/source/religion.cc | 38 +++++++++++++++++++++++------- crawl-ref/source/religion.h | 1 + crawl-ref/source/view.cc | 3 +++ 4 files changed, 50 insertions(+), 8 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt index d3df47f04d..4e452203fd 100644 --- a/crawl-ref/source/dat/database/monspeak.txt +++ b/crawl-ref/source/dat/database/monspeak.txt @@ -2883,6 +2883,22 @@ good_god_neutral_holy_being_speech @The_monster@ says @to_foe@, "Carry on, mortal." %%%% +good_god_nonneutral_holy_being_reaction + +@The_monster@ ignores your imperfect holy aura. + +@The_monster@ frowns, and retains its fighting stance. + +@The_monster@ refuses to salute you. +%%%% +good_god_nonneutral_holy_being_speech + +@The_monster@ shouts @at_foe@, "Seek the light more diligently, mortal!" + +@The_monster@ says @to_foe@, "Thou art not yet worthy, servant of @player_god@." + +@The_monster@ says @to_foe@, "I sense wickedness within thee, mortal!" +%%%% ############################################################# # evil monsters may also have some choicy things to say... ############################################################# diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index e8574dcb6a..f3d0bc3b82 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5488,11 +5488,18 @@ static bool _beogh_idol_revenge() return (false); } -static void _print_good_god_neutral_holy_being_speech(const std::string key, - monsters *mon, - msg_channel_type channel) +static void _print_good_god_holy_being_speech(bool neutral, + const std::string key, + monsters *mon, + msg_channel_type channel) { - std::string msg = getSpeakString("good_god_neutral_holy_being_" + key); + std::string full_key = "good_god_"; + if (!neutral) + full_key += "non"; + full_key += "neutral_holy_being_"; + full_key += key; + + std::string msg = getSpeakString(full_key); if (!msg.empty()) { @@ -5509,12 +5516,12 @@ void good_god_holy_attitude_change(monsters *holy) if (player_monster_visible(holy)) // show reaction { - _print_good_god_neutral_holy_being_speech("reaction", holy, - MSGCH_FRIEND_ENCHANT); + _print_good_god_holy_being_speech(true, "reaction", holy, + MSGCH_FRIEND_ENCHANT); if (!one_chance_in(3)) - _print_good_god_neutral_holy_being_speech("speech", holy, - MSGCH_TALK); + _print_good_god_holy_being_speech(true, "speech", holy, + MSGCH_TALK); } holy->attitude = ATT_GOOD_NEUTRAL; @@ -5527,6 +5534,21 @@ void good_god_holy_attitude_change(monsters *holy) behaviour_event(holy, ME_ALERT, MHITNOT); } +void good_god_holy_fail_attitude_change(monsters *holy) +{ + ASSERT(mons_is_holy(holy)); + + if (player_monster_visible(holy)) // show reaction + { + _print_good_god_holy_being_speech(false, "reaction", holy, + MSGCH_FRIEND_ENCHANT); + + if (!one_chance_in(3)) + _print_good_god_holy_being_speech(false, "speech", holy, + MSGCH_TALK); + } +} + static void _tso_blasts_cleansing_flame(const char *message) { // TSO won't protect you from his own cleansing flame, and Xom is too diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index e29785b1e0..dbefc0aa0b 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -100,6 +100,7 @@ bool zin_sustenance(bool actual = true); bool yred_injury_mirror(bool actual = true); bool beogh_water_walk(); void good_god_holy_attitude_change(monsters *holy); +void good_god_holy_fail_attitude_change(monsters *holy); void yred_make_enslaved_soul(monsters *mon, bool force_hostile = false, bool quiet = false, bool unlimited = false); void beogh_convert_orc(monsters *orc, bool emergency, diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 1db517a556..365fd5eaed 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -905,11 +905,14 @@ static void _good_god_follower_attitude_change(monsters *monster) msg::stream << monster->name(DESC_CAP_THE) << " glares at your weapon." << std::endl; + good_god_holy_fail_attitude_change(monster); return; } good_god_holy_attitude_change(monster); stop_running(); } + else + good_god_holy_fail_attitude_change(monster); } } -- cgit v1.2.3-54-g00ecf