diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/dat/database/godspeak.txt | 28 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/monspeak.txt | 70 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/randart.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 202 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 3 |
7 files changed, 181 insertions, 149 deletions
diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt index e2c07c531d..5467472be2 100644 --- a/crawl-ref/source/dat/database/godspeak.txt +++ b/crawl-ref/source/dat/database/godspeak.txt @@ -337,4 +337,32 @@ Xom's power brushes against you for a moment. You hear Xom's avuncular chuckle. %%%% +############################################ +# Beogh rants on destroying an orcish idol # +############################################ +# Beogh's messiah has destroyed an idol +Beogh idol follower + +Beogh fumes, "This is no small sin, orc. Repent!" + +Beogh whispers, "You will pay for this transgression.", + +Beogh rages, "An eye for an eye..." + +%%%% +# an unbelieving hill orc has destroyed an idol +Beogh idol hill orc + +Beogh's voice booms out: "Heretic, die!" + +You hear Beogh's thundering voice: "Suffer, infidel!" + +%%%% +# a character of another species has destroyed an idol +Beogh idol other + +Beogh is not amused about the destruction of his idols. + +Beogh seems highly displeased. +%%%% diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt index e2168ef8c5..50e206b30f 100644 --- a/crawl-ref/source/dat/database/monspeak.txt +++ b/crawl-ref/source/dat/database/monspeak.txt @@ -1894,6 +1894,23 @@ w:4 @holy_being@ %%%% +good_god_neutral_holy_being_reaction + +@The_monster@ is calmed by your holy aura. + +@The_monster@ relaxes its fighting stance. + +@The_monster@ salutes you. + +%%%% +good_god_neutral_holy_being_speech + +@The_monster@ shouts, "Continue thy quest, mortal!" + +@The_monster@ says, "Forge ahead, servant of @player_god@!" + +@The_monster@ says, "Carry on, mortal." +%%%% ############################################################# # evil monsters may also have some choicy things to say... ############################################################# @@ -2229,4 +2246,57 @@ w:2 w:1 @related beogh orc@ %%%% +############################### +# orc conversion speech +############################### +# on sight +beogh_converted_orc_reaction_sight + +@The_monster@ stares at you in amazement and kneels. + +@The_monster@ relaxes @pronoun@ fighting stance and smiles at you. + +@The_monster@ falls on @pronoun@ knees before you. + +%%%% +beogh_converted_orc_speech_sight + +@Pronoun@ shouts, "I'll follow thee gladly!" + +@Pronoun@ shouts, "Surely Beogh must have sent you!" + +@Pronoun@ asks, "Are you our saviour?" + +@Pronoun@ says, "I'm so glad you are here now." + +%%%% +# through battle +beogh_converted_orc_reaction_battle + +@The_monster@ surrenders. + +@The_monster@ falls to @pronoun@ knees. + +@The_monster@ raises @pronoun@ hands in surrender. + +%%%% +beogh_converted_orc_speech_battle + +@Pronoun@ shouts, "I'll follow you, let me live!" + +@Pronoun@ says, "You must be the Messiah, I see it now!" + +@Pronoun@ yells, "Beogh is my god, I swear it!" +%%%% +######################################################## +# Maybe use different speech if converted by a follower. +######################################################## +beogh_converted_orc_reaction_battle_follower + +@beogh_converted_orc_reaction_battle@ +%%%% +beogh_converted_orc_reaction_speech_follower + +@beogh_converted_orc_reaction_speech@ +%%%% diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 08defe609e..a589e79f45 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -328,8 +328,8 @@ enum branch_type // you.where_are_you BRANCH_CRYPT, BRANCH_TOMB, BRANCH_VESTIBULE_OF_HELL, - BRANCH_DIS, - BRANCH_FIRST_HELL = BRANCH_DIS, + BRANCH_FIRST_HELL, + BRANCH_DIS = BRANCH_FIRST_HELL, BRANCH_GEHENNA, BRANCH_COCYTUS, BRANCH_TARTARUS, diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 450e82d0bb..2ea6e4d33c 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -505,7 +505,7 @@ static bool monster_avoided_death(monsters *monster, killer_type killer, int i) // Bias beaten-up-conversion towards the stronger orcs. && random2(monster->hit_dice) > 2) { - beogh_convert_orc(monster, true); + beogh_convert_orc(monster, true, MON_KILL(killer)); return (true); } } @@ -6269,13 +6269,13 @@ bool message_current_target() } return (false); -} // end message_current_target() +} // aaah, the simple joys of pointer arithmetic! {dlb}: unsigned int monster_index(const monsters *monster) { return (monster - menv.buffer()); -} // end monster_index() +} int hurt_monster(monsters * victim, int damage_dealt) { diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index a687e6ffa1..71c9f96a11 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -130,9 +130,10 @@ static std::string replace_name_parts(const std::string name_in, god_gift = static_cast<god_type>(help); } - // Don't allow "player's Doom" type names for god gifts (except Xom!) - if (name.find("@player_name@'s", 0) != std::string::npos - && god_gift != GOD_NO_GOD && god_gift != GOD_XOM) + // Don't allow "player's Death" type names for god gifts (except Xom!) + if (god_gift != GOD_NO_GOD && god_gift != GOD_XOM + && name.find("@player_name@'s", 0) != std::string::npos + && name.find("Death", 0) != std::string::npos) { // simply overwrite the name with one of type "god's Favour" name = "of "; @@ -153,7 +154,7 @@ static std::string replace_name_parts(const std::string name_in, std::string place; if (one_chance_in(5)) { - switch(random2(6)) + switch(random2(8)) { case 0: case 1: @@ -165,9 +166,13 @@ static std::string replace_name_parts(const std::string name_in, place = "Pandemonium"; break; case 4: + case 5: + place = "the Realm of Zot"; + break; + case 6: place = "the Labyrinth"; break; - case 5: + case 7: place = "the Portal Chambers"; break; } @@ -175,7 +180,7 @@ static std::string replace_name_parts(const std::string name_in, else { const branch_type branch = - static_cast<branch_type>(random2(BRANCH_INFERNO)); + static_cast<branch_type>(random2(BRANCH_TARTARUS)); place = place_name( get_packed_place(branch, 1, LEVEL_DUNGEON), true, false ); } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index c8d32a021b..1011c773e9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -38,6 +38,7 @@ #include "beam.h" #include "chardump.h" #include "cloud.h" +#include "database.h" #include "debug.h" #include "decks.h" #include "describe.h" @@ -1005,7 +1006,7 @@ std::string god_prayer_reaction() (you.piety > 40) ? "most pleased with you" : (you.piety > 20) ? "pleased with you" : (you.piety > 5) ? "noncommittal" - : "displeased"; + : "displeased"; result += "."; return result; @@ -1432,8 +1433,6 @@ bool did_god_conduct( conduct_type thing_done, int level, bool known, if (you.religion == GOD_TROG && !god_hates_attacking_friend(you.religion, victim)) { - // hooking this up, but is it too good? - // enjoy it while you can -- bwr simple_god_message(" appreciates your killing of a magic user."); ret = true; if (random2(level + 10) > 5) @@ -3157,6 +3156,17 @@ static bool beogh_followers_abandon_you() return false; } +// currently only used when orcish idols have been destroyed +static const char* _get_beogh_speech(const std::string key) +{ + std::string result = getSpeakString("Beogh " + key); + + if (!result.empty()) + return (result.c_str()); + + return ("Beogh is angry!"); +} + // Destroying orcish idols (a.k.a. idols of Beogh) may anger Beogh. void beogh_idol_revenge() { @@ -3170,33 +3180,11 @@ void beogh_idol_revenge() const char *revenge; if (you.religion == GOD_BEOGH) - { - const char *messages[3] = { - "Beogh fumes, \"This is no small sin, orc. Repent!\"", - "Beogh whispers, \"You will pay for this transgression.\"", - "Beogh rages, \"An eye for an eye...\"" - }; - - revenge = RANDOM_ELEMENT(messages); - } + revenge = _get_beogh_speech("idol follower"); else if (you.species == SP_HILL_ORC) - { - const char *messages[2] = { - "Beogh's voice booms out: \"Heretic, die!\"", - "You hear Beogh's thundering voice: \"Suffer, infidel!\"" - }; - - revenge = RANDOM_ELEMENT(messages); - } + revenge = _get_beogh_speech("idol hill orc"); else - { - const char *messages[2] = { - "Beogh is not amused about the destruction of his idols.", - "Beogh seems highly displeased." - }; - - revenge = RANDOM_ELEMENT(messages); - } + revenge = _get_beogh_speech("idol other"); god_smites_you(GOD_BEOGH, KILLED_BY_BEOGH_SMITING, revenge); @@ -3214,113 +3202,20 @@ void beogh_idol_revenge() } } -static void good_god_holy_being_attitude_change_speech( - std::ostream &chan, - const monsters *holy) +static void _print_good_god_neutral_holy_being_speech(const std::string key, + monsters *mon, + msg_channel_type channel) { - switch (random2(3)) - { - case 0: - chan << " is calmed by your holy aura."; - break; - case 1: - chan << " relaxes its fighting stance."; - break; - case 2: - chan << " salutes you."; - break; - } - chan << std::endl; - - if (!one_chance_in(3)) - { - std::ostream& tchan = msg::streams(MSGCH_TALK); - tchan << holy->pronoun(PRONOUN_CAP) << " "; - switch (random2(3)) - { - case 0: - tchan << "shouts, \"Continue thy quest, mortal!\""; - break; - case 1: - tchan << "says, \"Forge ahead, servant of " - << god_name(you.religion) << "!\""; - break; - case 2: - tchan << "says, \"Carry on, mortal.\""; - break; - } - tchan << std::endl; - } -} + std::string msg = getSpeakString("good_god_neutral_holy_being_" + key); -static void beogh_orc_emergency_conversion_speech( - std::ostream &chan, - const monsters *orc) -{ - switch (random2(3)) + if (!msg.empty()) { - case 0: chan << " surrenders. "; break; - case 1: chan << " falls to " << orc->pronoun(PRONOUN_NOCAP_POSSESSIVE) - << " knees. "; break; - case 2: chan << " raises " << orc->pronoun(PRONOUN_NOCAP_POSSESSIVE) - << " hands in surrender. "; break; + msg = do_mon_str_replacements(msg, mon); + mpr(msg.c_str(), channel); } - chan << std::endl; - - static const char *mercy_message[] = - { - " shouts, \"I'll follow you, let me live!\"", - " says, \"You must be the Messiah, I see it now!\"", - " yells, \"Beogh is my god, I swear it!\"" - }; - msg::streams(MSGCH_TALK) << orc->pronoun(PRONOUN_CAP) - << RANDOM_ELEMENT(mercy_message) - << std::endl; } -static void beogh_orc_spontaneous_conversion_speech( - std::ostream &chan, - const monsters *orc) -{ - switch (random2(3)) - { - case 0: - chan << " stares at you in amazement and kneels."; - break; - case 1: - chan << " relaxes " << orc->pronoun(PRONOUN_NOCAP_POSSESSIVE) - << " fighting stance and smiles at you."; - break; - case 2: - chan << " falls on " << orc->pronoun(PRONOUN_NOCAP_POSSESSIVE) - << " knees before you."; - break; - } - chan << std::endl; - if (!one_chance_in(3)) - { - std::ostream& tchan = msg::streams(MSGCH_TALK); - tchan << orc->pronoun(PRONOUN_CAP) << " "; - switch (random2(4)) - { - case 0: - tchan << "shouts, \"I'll follow thee gladly!\""; - break; - case 1: - tchan << "shouts, \"Surely Beogh must have " - "sent you!\""; - break; - case 2: - tchan << "asks, \"Are you our saviour?\""; - break; - case 3: - tchan << "says, \"I'm so glad you are here now.\""; - break; - } - tchan << std::endl; - } -} void good_god_holy_attitude_change(monsters *holy) { @@ -3328,10 +3223,12 @@ void good_god_holy_attitude_change(monsters *holy) if (player_monster_visible(holy)) // show reaction { - std::ostream& chan = msg::streams(MSGCH_MONSTER_ENCHANT); - chan << holy->name(DESC_CAP_THE); + _print_good_god_neutral_holy_being_speech("reaction", holy, + MSGCH_MONSTER_ENCHANT); - good_god_holy_being_attitude_change_speech(chan, holy); + if (!one_chance_in(3)) + _print_good_god_neutral_holy_being_speech("speech", holy, + MSGCH_TALK); } holy->attitude = ATT_NEUTRAL; @@ -3344,19 +3241,50 @@ void good_god_holy_attitude_change(monsters *holy) behaviour_event(holy, ME_ALERT, MHITNOT); } -void beogh_convert_orc(monsters *orc, bool emergency) +static void _print_converted_orc_speech(const std::string key, + monsters *mon, + msg_channel_type channel) +{ + std::string msg = getSpeakString("beogh_converted_orc_" + key); + + if (!msg.empty()) + { + msg = do_mon_str_replacements(msg, mon); + mpr(msg.c_str(), channel); + } +} + +void beogh_convert_orc(monsters *orc, bool emergency, + bool converted_by_follower) { ASSERT(mons_species(orc->type) == MONS_ORC); if (player_monster_visible(orc)) // show reaction { - std::ostream& chan = msg::streams(MSGCH_MONSTER_ENCHANT); - chan << orc->name(DESC_CAP_THE); - if (emergency || orc->hit_points <= 0) - beogh_orc_emergency_conversion_speech(chan, orc); + { + if (converted_by_follower) + { + _print_converted_orc_speech("reaction_battle_follower", orc, + MSGCH_MONSTER_ENCHANT); + _print_converted_orc_speech("speech_battle_follower", orc, + MSGCH_TALK); + } + else + { + _print_converted_orc_speech("reaction_battle", orc, + MSGCH_MONSTER_ENCHANT); + _print_converted_orc_speech("speech_battle", orc, MSGCH_TALK); + } + } else - beogh_orc_spontaneous_conversion_speech(chan, orc); + { + _print_converted_orc_speech("reaction_sight", orc, + MSGCH_MONSTER_ENCHANT); + + if (!one_chance_in(3)) + _print_converted_orc_speech("speech_sight", orc, MSGCH_TALK); + } } orc->attitude = ATT_FRIENDLY; diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index eec54c139d..f4416658be 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -64,7 +64,8 @@ void divine_retribution(god_type god); bool beogh_water_walk(); void beogh_idol_revenge(); void good_god_holy_attitude_change(monsters *holy); -void beogh_convert_orc(monsters *orc, bool emergency); +void beogh_convert_orc(monsters *orc, bool emergency, + bool converted_by_follower = false); bool is_evil_item(const item_def& item); bool ely_destroy_weapons(); bool trog_burn_books(); |