diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 35 |
4 files changed, 41 insertions, 26 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 8418c691ce..758879ac85 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -584,10 +584,7 @@ bool mons_is_native_in_branch(const monsters *monster, bool mons_is_chaotic(const monsters *mon) { - if (mons_is_shapeshifter(mon)) - return (true); - - if (mon->has_spell(SPELL_POLYMORPH_OTHER)) + if (mons_is_shapeshifter(mon) || mon->has_spell(SPELL_POLYMORPH_OTHER)) return (true); const int attk_flavour = mons_attack_spec(mon, 0).flavour; @@ -3939,12 +3936,16 @@ bool monsters::could_wield(const item_def &item, bool ignore_brand, // Holy monsters and monsters that are gifts of good gods won't // use evil weapons. - if ((mons_is_holy(this) || is_good_god(god)) && is_evil_item(item)) + if ((mons_is_holy(this) || is_good_god(god)) + && is_evil_item(item)) + { return (false); + } - // Holy monsters that aren't gifts of Xom and monsters that are - // gifts of good gods won't use chaotic weapons. - if (((mons_is_holy(this) && this->god != GOD_XOM) || is_good_god(god)) + // Holy monsters that aren't gifts of chaotic gods and monsters + // that are gifts of good gods won't use chaotic weapons. + if (((mons_is_holy(this) && !is_chaotic_god(this->god)) + || is_good_god(god)) && is_chaotic_item(item)) { return (false); @@ -5834,12 +5835,12 @@ int monsters::res_sticky_flame() const int monsters::res_holy_energy(const actor *attacker) const { - if (mons_is_unholy(this)) - return (-2); - if (mons_is_evil(this)) return (-1); + if (mons_is_unholy(this)) + return (-2); + if (is_good_god(god) || mons_is_holy(this) || mons_neutral(this) diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index b987a9d0c2..b18e171d3a 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1240,7 +1240,7 @@ int monster_die(monsters *monster, killer_type killer, && (killer_index == ANON_FRIENDLY_MONSTER || !invalid_monster_index(killer_index))); - if ( passive ) + if (passive) { mprf(MSGCH_MONSTER_DAMAGE, MDAM_DEAD, "%s is %s!", monster->name(DESC_CAP_THE).c_str(), @@ -1292,6 +1292,7 @@ int monster_die(monsters *monster, killer_type killer, monster->hit_dice, true, monster); } + // Zin hates chaotic beings. if (mons_is_chaotic(monster)) { did_god_conduct(DID_KILL_CHAOTIC, diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 6ab73f7780..0e0c362709 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6836,12 +6836,12 @@ int player::res_sticky_flame() const int player::res_holy_energy(const actor *attacker) const { - if (player_is_unholy()) - return (-2); - if (is_evil_god(you.religion)) return (-1); + if (player_is_unholy()) + return (-2); + if (is_good_god(you.religion)) return (1); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 56dacdeec5..80e65f6188 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -829,7 +829,8 @@ void dec_penance(god_type god, int val) you.redraw_armour_class = true; // When you've worked through all your penance, you get - // another chance to make hostile holy beings good neutral. + // another chance to make hostile holy beings that worship a + // good god good neutral. if (is_good_god(you.religion)) _holy_beings_attitude_change(); } @@ -3350,7 +3351,8 @@ void gain_piety(int pgn) } // When you gain a piety level, you get another chance to - // make hostile holy beings good neutral. + // make hostile holy beings that worship a good god good + // neutral. if (is_good_god(you.religion)) _holy_beings_attitude_change(); } @@ -3358,7 +3360,7 @@ void gain_piety(int pgn) if (you.religion == GOD_BEOGH) { - // every piety level change also affects AC from orcish gear + // Every piety level change also affects AC from orcish gear. you.redraw_armour_class = true; } @@ -3371,7 +3373,8 @@ void gain_piety(int pgn) } // When you gain piety of more than 160, you get another chance - // to make hostile holy beings good neutral. + // to make hostile holy beings that worship a good god good + // neutral. if (is_good_god(you.religion)) _holy_beings_attitude_change(); } @@ -4944,7 +4947,8 @@ static bool _holy_beings_on_level_attitude_change() { monsters *monster = &menv[i]; if (monster->alive() - && mons_is_holy(monster)) + && mons_is_holy(monster) + && is_good_god(monster->god)) { #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "Holy attitude changing: %s on level %d, branch %d", @@ -4954,7 +4958,8 @@ static bool _holy_beings_on_level_attitude_change() #endif // If you worship a good god, you get another chance to make - // neutral and hostile holy beings good neutral. + // neutral and hostile holy beings that worship a good god + // good neutral. if (is_good_god(you.religion) && !mons_wont_attack(monster)) { if (testbits(monster->flags, MF_ATT_CHANGE_ATTEMPT)) @@ -4965,7 +4970,8 @@ static bool _holy_beings_on_level_attitude_change() } } // If you don't worship a good god, you make all friendly - // and good neutral holy beings hostile. + // and good neutral holy beings that worship a good god + // hostile. else if (!is_good_god(you.religion) && mons_wont_attack(monster)) { monster->attitude = ATT_HOSTILE; @@ -5558,7 +5564,7 @@ static void _print_good_god_holy_being_speech(bool neutral, } // Holy monsters may turn good neutral when encountering followers of -// the good gods. +// the good gods, and be made worshippers of TSO if necessary. void good_god_holy_attitude_change(monsters *holy) { ASSERT(mons_is_holy(holy)); @@ -5579,6 +5585,10 @@ void good_god_holy_attitude_change(monsters *holy) // hostile later on, it won't count as a good kill. holy->flags |= MF_WAS_NEUTRAL; + // If the holy being was previously worshipping a different god, + // make it worship TSO. + holy->god = GOD_SHINING_ONE; + // Avoid immobile "followers". behaviour_event(holy, ME_ALERT, MHITNOT); } @@ -5746,6 +5756,8 @@ static void _print_converted_orc_speech(const std::string key, } } +// 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) { @@ -5785,8 +5797,9 @@ void beogh_convert_orc(monsters *orc, bool emergency, // 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 worhsipping Beogh or being an athiest. + // 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); @@ -5975,7 +5988,7 @@ void excommunication(god_type new_god) } // When you start worshipping a non-good god, or no god, you make - // all non-hostile holy beings hostile. + // all non-hostile holy beings that worship a good god hostile. if (!is_good_god(new_god) && _holy_beings_attitude_change()) mpr("The divine host forsakes you.", MSGCH_MONSTER_ENCHANT); |