summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-monench.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2013-05-28 19:21:06 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2013-05-28 19:21:06 -0600
commit8e67a1927623eb2ca88e8088248ce0874d7d227f (patch)
tree9f1c1a75cb180bec0cd7c2f464fdc95197d37a27 /crawl-ref/source/spl-monench.cc
parentdc5062ff1de130b4c94ae98e30af9096ec19cfd8 (diff)
downloadcrawl-ref-8e67a1927623eb2ca88e8088248ce0874d7d227f.tar.gz
crawl-ref-8e67a1927623eb2ca88e8088248ce0874d7d227f.zip
More variety for Forest monster spell sets.
Fauns, tengu conjurers, and tengu reavers now have multiple spell sets - the former focusing on various low-level hexes and the latter two getting various schools of conjuration magic. All of the above have had empty spell slots assigned duplicate copies of spells so that more spells are cast. Pan can now also cast Metabolic Englaciation; thus, he can confuse and slow entire bands of enemies! (Leave your orc horde at home, Beoghites!)
Diffstat (limited to 'crawl-ref/source/spl-monench.cc')
-rw-r--r--crawl-ref/source/spl-monench.cc34
1 files changed, 24 insertions, 10 deletions
diff --git a/crawl-ref/source/spl-monench.cc b/crawl-ref/source/spl-monench.cc
index e0ae9471ef..ef809fc11f 100644
--- a/crawl-ref/source/spl-monench.cc
+++ b/crawl-ref/source/spl-monench.cc
@@ -21,40 +21,54 @@
#include "terrain.h"
#include "viewmap.h"
-static int _englaciate_monsters(coord_def where, int pow, int, actor *actor)
+int englaciate(coord_def where, int pow, int, actor *agent)
{
- monster* mons = monster_at(where);
+ actor *victim = actor_at(where);
- if (!mons)
+ if (!victim || victim == agent)
return 0;
- if (mons->res_cold() > 0 || mons_is_stationary(mons))
+ monster* mons = victim->as_monster();
+
+ if (victim->res_cold() > 0
+ || (mons && mons_is_stationary(mons))
+ || (!mons && you.form == TRAN_TREE))
{
- if (!mons_is_firewood(mons))
+ if (!mons)
+ canned_msg(MSG_YOU_UNAFFECTED);
+ else if (mons && !mons_is_firewood(mons))
simple_monster_message(mons, " is unaffected.");
return 0;
}
- int duration = (roll_dice(3, pow) / 6 - random2(mons->get_experience_level()))
+ int duration = (roll_dice(3, pow) / 6
+ - random2(victim->get_experience_level()))
* BASELINE_DELAY;
if (duration <= 0)
{
- simple_monster_message(mons, " resists.");
+ if (!mons)
+ canned_msg(MSG_YOU_RESIST);
+ else
+ simple_monster_message(mons, " resists.");
return 0;
}
- if (mons_class_flag(mons->type, M_COLD_BLOOD))
+ if ((!mons && player_genus(GENPC_DRACONIAN)) // res_cold() checked above
+ || (mons && mons_class_flag(mons->type, M_COLD_BLOOD)))
duration *= 2;
- return do_slow_monster(mons, actor, duration);
+ if (!mons)
+ return slow_player(duration);
+
+ return do_slow_monster(mons, agent, duration);
}
spret_type cast_englaciation(int pow, bool fail)
{
fail_check();
mpr("You radiate an aura of cold.");
- apply_area_visible(_englaciate_monsters, pow, &you);
+ apply_area_visible(englaciate, pow, &you);
return SPRET_SUCCESS;
}