From 4dd53d952662125a877527566e76c73754385369 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 6 Nov 2009 15:24:34 +0100 Subject: Collect attitude changing code. --- crawl-ref/source/godabil.cc | 128 -------------------------------------------- 1 file changed, 128 deletions(-) (limited to 'crawl-ref/source/godabil.cc') diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index 3aec727fec..496a4c5a9c 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -308,95 +308,6 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile, } } -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); - } -} - -// Orcs may turn friendly when encountering followers of Beogh, and be -// made gifts of Beogh. -void beogh_convert_orc(monsters *orc, bool emergency, - bool converted_by_follower) -{ - ASSERT(mons_species(orc->type) == MONS_ORC); - - if (you.can_see(orc)) // show reaction - { - if (emergency || !orc->alive()) - { - if (converted_by_follower) - { - _print_converted_orc_speech("reaction_battle_follower", orc, - MSGCH_FRIEND_ENCHANT); - _print_converted_orc_speech("speech_battle_follower", orc, - MSGCH_TALK); - } - else - { - _print_converted_orc_speech("reaction_battle", orc, - MSGCH_FRIEND_ENCHANT); - _print_converted_orc_speech("speech_battle", orc, MSGCH_TALK); - } - } - else - { - _print_converted_orc_speech("reaction_sight", orc, - MSGCH_FRIEND_ENCHANT); - - if (!one_chance_in(3)) - _print_converted_orc_speech("speech_sight", orc, MSGCH_TALK); - } - } - - orc->attitude = ATT_FRIENDLY; - - // The monster is not really *created* friendly, but should it - // become hostile later on, it won't count as a good kill. - orc->flags |= MF_CREATED_FRIENDLY; - - // Prevent assertion if the orc was previously worshipping a - // different god, rather than already worshipping Beogh or being an - // atheist. - orc->god = GOD_NO_GOD; - - mons_make_god_gift(orc, GOD_BEOGH); - - if (orc->is_patrolling()) - { - // Make orcs stop patrolling and forget their patrol point, - // they're supposed to follow you now. - orc->patrol_point = coord_def(0, 0); - } - - if (!orc->alive()) - orc->hit_points = std::min(random_range(1, 4), orc->max_hit_points); - - // Avoid immobile "followers". - behaviour_event(orc, ME_ALERT, MHITNOT); -} - -void feawn_neutralise_plant(monsters *plant) -{ - if (!plant - || !feawn_neutralises(plant) - || plant->attitude != ATT_HOSTILE - || testbits(plant->flags, MF_ATT_CHANGE_ATTEMPT)) - { - return; - } - - plant->attitude = ATT_GOOD_NEUTRAL; - plant->flags |= MF_WAS_NEUTRAL; -} - // Feawn allows worshipers to walk on top of stationary plants and // fungi. bool feawn_passthrough(const monsters * target) @@ -408,45 +319,6 @@ bool feawn_passthrough(const monsters * target) || target->attitude != ATT_HOSTILE)); } -void jiyva_convert_slime(monsters* slime) -{ - ASSERT(mons_is_slime(slime)); - - if (you.can_see(slime)) - { - if (mons_genus(slime->type) == MONS_GIANT_EYEBALL) - { - mprf(MSGCH_GOD, "%s stares at you suspiciously for a moment, " - "then relaxes.", - - slime->name(DESC_CAP_THE).c_str()); - } - else - { - mprf(MSGCH_GOD, "%s trembles before you.", - slime->name(DESC_CAP_THE).c_str()); - } - } - - slime->attitude = ATT_STRICT_NEUTRAL; - slime->flags |= MF_WAS_NEUTRAL; - - if (!mons_eats_items(slime)) - { - slime->add_ench(ENCH_EAT_ITEMS); - - mprf(MSGCH_MONSTER_ENCHANT, "%s looks hungrier.", - slime->name(DESC_CAP_THE).c_str()); - } - - // Prevent assertion if the slime was previously worshipping a - // different god, rather than already worshipping Jiyva or being an - // atheist. - slime->god = GOD_NO_GOD; - - mons_make_god_gift(slime, GOD_JIYVA); -} - bool ponderousify_armour() { int item_slot = -1; -- cgit v1.2.3-54-g00ecf