diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-13 16:04:24 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-13 16:04:24 +0000 |
commit | 280d409759be7af8b54366f07ccba17348ea24f9 (patch) | |
tree | 99b931599c7a6544a9c9b3f4aeb7d9c99752b5d9 /crawl-ref/source/religion.cc | |
parent | 8b4a043aa12cf1492ff94b0ef071afce5997dff2 (diff) | |
download | crawl-ref-280d409759be7af8b54366f07ccba17348ea24f9.tar.gz crawl-ref-280d409759be7af8b54366f07ccba17348ea24f9.zip |
Commit several patches:
* patch 2849505 by weyrava: make submerged monsters use the correct colour
* patch 2857771 by caotto: another Feawn update
* patch 2838771 by camedo: add potions of brilliance/agility
* BR 2841651 by bookofjude: allow Merfolk to control-tele into deep water
Now we need tiles for the new potions!
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10669 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 66 |
1 files changed, 52 insertions, 14 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index e526621b0f..caab8d5daf 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2364,6 +2364,7 @@ static bool _god_accepts_prayer(god_type god) case GOD_BEOGH: case GOD_NEMELEX_XOBEH: + case GOD_FEAWN: return (true); default: @@ -2464,6 +2465,13 @@ void pray() you.duration[DUR_PRAYER] *= 2; } + if (you.religion == GOD_FEAWN) + { + if (you.duration[DUR_SLOW] < you.duration[DUR_PRAYER]) + slow_player(you.duration[DUR_PRAYER]); + mprf(MSGCH_GOD, "You feel in touch with plants."); + } + if (you.religion == GOD_ZIN || you.religion == GOD_BEOGH || you.religion == GOD_NEMELEX_XOBEH || you.religion == GOD_JIYVA) { @@ -2875,10 +2883,9 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, break; // fall through - case GOD_FEAWN: - // plant god only cares about plants + case GOD_FEAWN: // double-check god because of fall-throughs from other gods - if (you.religion == GOD_FEAWN && !mons_is_plant(victim)) + if (you.religion == GOD_FEAWN && !feawn_protects(victim)) break; // fall through @@ -6017,8 +6024,7 @@ static bool _feawn_plants_on_level_hostile() { monsters *monster = &menv[i]; if (monster->alive() - && (mons_is_plant(monster) - || monster->mons_species() == MONS_GIANT_SPORE)) + && mons_is_plant(monster)) { #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "Plant hostility: %s on level %d, branch %d", @@ -6475,22 +6481,54 @@ void beogh_convert_orc(monsters *orc, bool emergency, void feawn_neutralise_plant(monsters *plant) { - if (!mons_is_plant(plant) + if (!plant + || !feawn_neutralises(plant) + || plant->attitude != ATT_HOSTILE || testbits(plant->flags, MF_ATT_CHANGE_ATTEMPT)) { return; } - if (you.can_see(plant)) - { - mprf(MSGCH_GOD, "%s ignores you.", - plant->name(DESC_CAP_THE).c_str()); - } - plant->attitude = ATT_GOOD_NEUTRAL; plant->flags |= MF_WAS_NEUTRAL; } +// During prayer feawn allows worshipers to walk on top of stationary plants +// and fungi. +bool feawn_passthrough(const monsters * target) +{ + return (target && you.religion == GOD_FEAWN + && you.duration[DUR_PRAYER] + && mons_is_plant(target) + && mons_is_stationary(target)); +} + +// Feawn worshipers are on the hook for most plants and fungi, but not +// toadstools and giant spores because they die too easily. +// +// If feawn worshipers kill a protected monster they lose piety, +// if they attack a friendly one they get penance, +// if a friendly one dies they lose piety. +bool feawn_protects_species(int mc) +{ + return (mons_class_is_plant(mc) + && mc != MONS_TOADSTOOL + && mc != MONS_GIANT_SPORE); +} + +bool feawn_protects(const monsters * target) +{ + return target && feawn_protects_species(target->mons_species()); +} + +// Feawn neutralizes most plants and fungi but skips toadstools to prevent +// message spam (and killing them doesn't even cause piety loss). +bool feawn_neutralises(const monsters * target) +{ + return (target && mons_is_plant(target) + && target->mons_species() != MONS_TOADSTOOL); +} + void jiyva_convert_slime(monsters* slime) { ASSERT(mons_is_slime(slime)); @@ -6946,7 +6984,7 @@ bool god_hates_attacking_friend(god_type god, int species) case GOD_JIYVA: return (mons_class_is_slime(species)); case GOD_FEAWN: - return (mons_class_is_plant(species)); + return feawn_protects_species(species); default: return (false); } @@ -7535,7 +7573,7 @@ bool god_hates_killing(god_type god, const monsters* mon) } if (god == GOD_FEAWN) - retval = (mons_is_plant(mon)); + retval = (feawn_protects(mon)); return (retval); } |