diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-12 20:30:12 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-12 20:30:12 -0500 |
commit | 8075717d132ff61257a8836ce7854f71f1eb05f8 (patch) | |
tree | 115643864aa9b4c5c8ace4cdd3864d9f31a80997 /crawl-ref/source/monstuff.cc | |
parent | 4cf89bf43fe0847385567b94f0a61a16003561fb (diff) | |
download | crawl-ref-8075717d132ff61257a8836ce7854f71f1eb05f8.tar.gz crawl-ref-8075717d132ff61257a8836ce7854f71f1eb05f8.zip |
Change ballistomycete spore mechanics again
New status: if a ballistomycete or giant spore dies any ballistos on
the level get +1 to a counter. Ballistos with a count higher than zero
get spore production on a short (~150 turn) timer. When a spore is
spawned (by a ballisto) the count of all ballistos on the level is
decreased by 1.
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index ae91249f6b..d94598974c 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -33,6 +33,7 @@ #include "kills.h" #include "message.h" #include "misc.h" +#include "mon-abil.h" #include "mon-behv.h" #include "monplace.h" #include "monspeak.h" @@ -1087,6 +1088,7 @@ static bool _spore_goes_pop(monsters *monster, killer_type killer, beam.thrower = crawl_state.arena ? KILL_MON : monster->attitude == ATT_FRIENDLY ? KILL_YOU : KILL_MON; beam.aux_source.clear(); + beam.attitude = monster->attitude; if (YOU_KILL(killer)) beam.aux_source = "set off by themselves"; @@ -1157,6 +1159,7 @@ static bool _spore_goes_pop(monsters *monster, killer_type killer, // FIXME: show_more == mons_near(monster) beam.explode(); + activate_ballistomycetes(monster); // Monster died in explosion, so don't re-attach it to the grid. return (true); } @@ -1432,45 +1435,6 @@ static int _destroy_tentacles(monsters *head) return tent; } -static void _activate_ballistomycetes( monsters * monster) -{ - if(!monster || monster->type != MONS_BALLISTOMYCETE) - return; - - bool activated_others = false; - int seen_others = 0; - for(int i=0; i < int(env.mons.size()); ++i) - { - if(i != monster->mindex() - && env.mons[i].alive() - && env.mons[i].type == MONS_BALLISTOMYCETE) - { - env.mons[i].number++; - // 0 -> 1 means the ballisto moves onto the faster spawn - // timer and changes color - if(env.mons[i].number == 1) - { - env.mons[i].colour = LIGHTRED; - // Reset the spore production timer. - env.mons[i].del_ench(ENCH_SPORE_PRODUCTION, false); - env.mons[i].add_ench(ENCH_SPORE_PRODUCTION); - activated_others = true; - if(you.can_see(&env.mons[i])) - seen_others++; - } - } - } - - // How to do messaging? Message on kill no matter what, only if you see - // other ballistos get angry, only if other ballistos get angry - // (seen or not). Also need a message if a ballisto suddenly becomes - // angry - if(mons_near(monster) && activated_others) - mprf("You feel ballistomycets on the level are angry now?"); - else if (seen_others > 0) - mprf("The ballistomycete appears angry..."); -} - // Returns the slot of a possibly generated corpse or -1. int monster_die(monsters *monster, killer_type killer, int killer_index, bool silent, bool wizard) @@ -1494,7 +1458,8 @@ int monster_die(monsters *monster, killer_type killer, you.remove_beholder(monster); - _activate_ballistomycetes(monster); + if(monster->type == MONS_BALLISTOMYCETE) + activate_ballistomycetes(monster); // Clear auto exclusion now the monster is killed -- if we know about it. if (mons_near(monster) || wizard) |