diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-11 16:10:31 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-11 16:10:31 +0000 |
commit | 4661402a536708e9c1f97415b9298bff2cd59719 (patch) | |
tree | bc47fdbfe2aab7d5ab5067bcf06d541283820677 /crawl-ref/source/monplace.cc | |
parent | 04ef4ac34d7bbc5358a3adbf542071599e71c515 (diff) | |
download | crawl-ref-4661402a536708e9c1f97415b9298bff2cd59719.tar.gz crawl-ref-4661402a536708e9c1f97415b9298bff2cd59719.zip |
[1678085] Fixed efreet message sequence (Erik).
Fixed off-by-one-column beam animations.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1017 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r-- | crawl-ref/source/monplace.cc | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index e743667e80..9c70d802a2 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -1295,9 +1295,33 @@ coord_def find_newmons_square(int mons_class, int x, int y) return (pos); } +bool player_angers_monster(monsters *creation) +{ + // get the drawbacks, not the benefits... + // (to prevent demon-scumming) + if ( (you.religion == GOD_ZIN || + you.religion == GOD_SHINING_ONE || + you.religion == GOD_ELYVILON) && + mons_is_unholy(creation) ) + { + if ( creation->attitude != ATT_HOSTILE ) + { + creation->attitude = ATT_HOSTILE; + if ( see_grid(creation->x, creation->y) + && player_monster_visible(creation) ) + { + mprf("%s is enraged by your holy aura!", + ptr_monam(creation, DESC_CAP_THE)); + } + } + return (true); + } + return (false); +} + int create_monster( int cls, int dur, int beha, int cr_x, int cr_y, int hitting, int zsec, bool permit_bands, - bool force_place ) + bool force_place, bool force_behaviour ) { int summd = -1; coord_def pos = find_newmons_square(cls, cr_x, cr_y); @@ -1338,24 +1362,10 @@ int create_monster( int cls, int dur, int beha, int cr_x, int cr_y, if (beha == BEH_GOD_GIFT) creation->flags |= MF_GOD_GIFT; - - // get the drawbacks, not the benefits... - // (to prevent demon-scumming) - if ( (you.religion == GOD_ZIN || - you.religion == GOD_SHINING_ONE || - you.religion == GOD_ELYVILON) && - mons_is_unholy(creation) ) - { - if ( creation->attitude != ATT_HOSTILE ) - { - creation->attitude = ATT_HOSTILE; - if ( see_grid(cr_x, cr_y) ) - mpr("The monster is enraged by your holy aura!"); - } - creation->behaviour = BEH_HOSTILE; - beha = BEH_HOSTILE; - } + if (!force_behaviour && player_angers_monster(creation)) + beha = BEH_HOSTILE; + if (beha == BEH_CHARMED) { creation->attitude = ATT_HOSTILE; |