summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-28 03:39:01 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-28 03:39:01 +0000
commit72c1249ae7f4841dc8b335cb3a0a5ce81cb45887 (patch)
tree6b65ec871edba333b3ea18274025f52e4b384a24 /crawl-ref/source/monstuff.cc
parent102ecc248252562f59d7b7baf445cd5cdb2e3162 (diff)
downloadcrawl-ref-72c1249ae7f4841dc8b335cb3a0a5ce81cb45887.tar.gz
crawl-ref-72c1249ae7f4841dc8b335cb3a0a5ce81cb45887.zip
Apply caotto's patch in [2827204] to finish the plant god, with some
cleanups added by me. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10442 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 446c4f119b..01a8d55272 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1456,6 +1456,12 @@ int monster_die(monsters *monster, killer_type killer,
true, monster);
}
+ if (mons_is_plant(monster))
+ {
+ did_god_conduct(DID_KILL_PLANT, monster->hit_dice,
+ true, monster);
+ }
+
if (mons_is_slime(monster))
{
did_god_conduct(DID_KILL_SLIME, monster->hit_dice,
@@ -1553,13 +1559,18 @@ int monster_die(monsters *monster, killer_type killer,
// No piety loss if god gifts killed by other monsters.
// Also, dancing weapons aren't really friendlies.
if (mons_friendly(monster)
- && !mons_is_god_gift(monster)
&& monster->type != MONS_DANCING_WEAPON)
{
did_god_conduct(DID_FRIEND_DIED, 1 + (monster->hit_dice / 2),
true, monster);
}
+ if (pet_kill && mons_is_plant(monster))
+ {
+ did_god_conduct(DID_ALLY_KILLED_PLANT, 1 + (monster->hit_dice / 2),
+ true, monster);
+ }
+
// Trying to prevent summoning abuse here, so we're trying to
// prevent summoned creatures from being done_good kills. Only
// affects creatures which were friendly when summoned.
@@ -2846,9 +2857,19 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
&& !mons_is_fleeing(mon) && !mons_is_panicking(mon)))
{
// Monster types that you can't gain experience from cannot
- // fight back.
- if (mons_class_flag(mon->type, M_NO_EXP_GAIN))
+ // fight back, so don't bother having them do so. If you
+ // worship Feawn, create a ring of friendly plants, and try
+ // to break out of the ring by killing a plant, you'll get
+ // a warning prompt and penance only once. Without the
+ // hostility check, the plant will remain friendly until it
+ // dies, and you'll get a warning prompt and penance once
+ // *per hit*. This may not be the best way to address the
+ // issue, though. -cao
+ if (mons_class_flag(mon->type, M_NO_EXP_GAIN)
+ && mon->attitude != ATT_FRIENDLY)
+ {
return;
+ }
mon->foe = src;