diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-08 06:11:34 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-08 06:11:34 +0000 |
commit | 0a035731a014657ed31f567eb854033a1a62f0e4 (patch) | |
tree | a11451152c40e2f48966b6b1d3ea1114b2773321 /crawl-ref/source/spells1.cc | |
parent | 5dc8d3bb786e86a7c4460f29277ef50468e3c9f8 (diff) | |
download | crawl-ref-0a035731a014657ed31f567eb854033a1a62f0e4.tar.gz crawl-ref-0a035731a014657ed31f567eb854033a1a62f0e4.zip |
Added BEAM_CHAOS and changed chaos launchers/ammo to use that. Currently only
chooses a different, random beam flavour (which undoudtedly needs to have their
relative weights changed after playtesting) for each square it passes through,
but in the future it might do things like bounce off walls at weird angles or
animate weapons left laying on the ground.
Added CLOUD_CHAOS, though it doesn't do anything yet.
Monsters which are marked summoned or otherwise given ENCH_ABJ can also be
marked with the type of summoning that happened, which is stored in the
until-now-unused ENCH_SUMMON. This is useful for figuring out if a monster has
ENCH_ABJ but isn't really summoned (like fire vortices created by Fire Storm or
dancing weapons created by Tukima's Dance) so that they won't be affected by
abjuration. It's also currently used to do a different "dissapears in a puff
of smoke" messages for summoned monsters based on the summoning type, so that
monsters summoned by Shadow Creature "dissolve into shadows" and don't leave
behind any clouds, and temporary god gift monsters from good gods "dissolve
into sparkling lights". In the future it might be used to do temporarily
animated corpses, which turn back into a corpse when killed or when the
animation runs out.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7778 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index dd1e0b7497..7353430c9a 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -1086,36 +1086,40 @@ void abjuration(int pow) if (mons_wont_attack(monster)) continue; - mon_enchant abj = monster->get_ench(ENCH_ABJ); - if (abj.ench != ENCH_NONE) + int duration; + if (monster->is_summoned(&duration)) { int sockage = std::max(fuzz_value(abjdur, 60, 30), 40); #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "%s abj: dur: %d, abj: %d", - monster->name(DESC_PLAIN).c_str(), abj.duration, sockage); + monster->name(DESC_PLAIN).c_str(), duration, sockage); #endif + bool shielded = false; // TSO and Trog's abjuration protection. if (mons_is_god_gift(monster, GOD_SHINING_ONE)) { sockage = sockage * (30 - monster->hit_dice) / 45; - if (sockage < abj.duration) + if (sockage < duration) { simple_god_message(" protects a fellow warrior from your evil magic!", GOD_SHINING_ONE); + shielded = true; } } else if (mons_is_god_gift(monster, GOD_TROG)) { sockage = sockage * 8 / 15; - if (sockage < abj.duration) + if (sockage < duration) { simple_god_message(" shields an ally from your puny magic!", GOD_TROG); + shielded = true; } } - if (!monster->lose_ench_duration(abj, sockage)) + mon_enchant abj = monster->get_ench(ENCH_ABJ); + if (!monster->lose_ench_duration(abj, sockage) && !shielded) simple_monster_message(monster, " shudders."); } } |