From 0cebeb433d68aea197f5ee1d2c38809b71c2e3dd Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sat, 19 Dec 2009 22:51:57 +0100 Subject: Iskenderun's Orb of Destruction --- crawl-ref/source/mon-act.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crawl-ref/source/mon-act.cc') diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 16c025e217..a3a46955ce 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -33,6 +33,7 @@ #include "mon-cast.h" #include "mon-iter.h" #include "mon-place.h" +#include "mon-project.h" #include "mgen_data.h" #include "coord.h" #include "mon-stuff.h" @@ -1708,6 +1709,14 @@ static void _handle_monster_move(monsters *monster) } old_energy = monster->speed_increment; + if (mons_is_projectile(monster->type)) + { + if (iood_act(*monster)) + return; + monster->lose_energy(EUT_MOVE); + continue; + } + monster->shield_blocks = 0; cloud_type cl_type; @@ -3416,6 +3425,13 @@ static bool _monster_move(monsters *monster) 2 + random2(3), monster->kill_alignment(), KILL_MON_MISSILE ); } + + if (monster->type == MONS_ORB_OF_DESTRUCTION) + { + place_cloud( CLOUD_TLOC_ENERGY, monster->pos(), + 2 + random2(3), monster->kill_alignment(), + KILL_MON_MISSILE ); + } } else { -- cgit v1.2.3-54-g00ecf From 75cf943abb6e77df046924a0f6946c21c5798862 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sat, 19 Dec 2009 22:52:31 +0100 Subject: Tloc smoke trail. Doesn't look good IMO, I'd replace it with normal transparent smoke. --- crawl-ref/source/mon-act.cc | 7 ------- crawl-ref/source/mon-project.cc | 12 ++++++++++-- crawl-ref/source/mon-project.h | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/mon-act.cc') diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index a3a46955ce..62df9c963b 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -3425,13 +3425,6 @@ static bool _monster_move(monsters *monster) 2 + random2(3), monster->kill_alignment(), KILL_MON_MISSILE ); } - - if (monster->type == MONS_ORB_OF_DESTRUCTION) - { - place_cloud( CLOUD_TLOC_ENERGY, monster->pos(), - 2 + random2(3), monster->kill_alignment(), - KILL_MON_MISSILE ); - } } else { diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc index cb37776c61..4fd4583fe3 100644 --- a/crawl-ref/source/mon-project.cc +++ b/crawl-ref/source/mon-project.cc @@ -15,6 +15,7 @@ #include "externs.h" +#include "cloud.h" #include "coord.h" #include "env.h" #include "mgen_data.h" @@ -61,7 +62,7 @@ bool cast_iood(actor *caster, int pow, bolt *beam) mon.flags &= ~MF_JUST_SUMMONED; // Move away from the caster's square. - iood_act(mon); + iood_act(mon, true); mon.lose_energy(EUT_MOVE); return (true); } @@ -105,7 +106,7 @@ bool _iood_hit(monsters &mon, const coord_def &pos) } // returns true if the orb is gone -bool iood_act(monsters &mon) +bool iood_act(monsters &mon, bool no_trail) { ASSERT(mons_is_projectile(mon.type)); @@ -168,6 +169,13 @@ bool iood_act(monsters &mon) } } + if (!no_trail) + { + place_cloud(CLOUD_TLOC_ENERGY, mon.pos(), + 2 + random2(3), mon.kill_alignment(), + KILL_MON_MISSILE); + } + if (!mon.move_to_pos(pos)) { _iood_dissipate(mon); diff --git a/crawl-ref/source/mon-project.h b/crawl-ref/source/mon-project.h index 3f17a9c755..a57afbbd80 100644 --- a/crawl-ref/source/mon-project.h +++ b/crawl-ref/source/mon-project.h @@ -12,6 +12,6 @@ bool mons_is_projectile(monster_type mt); bool cast_iood(actor *caster, int pow, bolt *beam); -bool iood_act(monsters &mon); +bool iood_act(monsters &mon, bool no_trail = false); #endif -- cgit v1.2.3-54-g00ecf