diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-16 04:01:53 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-16 04:01:53 -0700 |
commit | fca02d5a9d188648a0f97dc5b717c21a8adfb092 (patch) | |
tree | 95e3111b5ac1db5c89168b78227a9c8504f35d6a /crawl-ref/source/spells4.cc | |
parent | bf5490b041d4dd0089ffea4a60ef4e754e852a7d (diff) | |
download | crawl-ref-fca02d5a9d188648a0f97dc5b717c21a8adfb092.tar.gz crawl-ref-fca02d5a9d188648a0f97dc5b717c21a8adfb092.zip |
Protect features from damage with marker props
A marker can protect the feature it's on from damage by:
* Setting property "veto_fragmentation" to "veto" to protect it from
fragmentation (Lee's Rapid Deconstruction spell).
* Setting property "veto_shattering" to "veto" to protect it from
shattering (Shattering spell).
* Setting property "veto_disintegration" to "veto" to protect it from
disintegration and nuking.
TODO: Document this. I'm not sure where to put info on this in
docs/develop/level_design.txt
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r-- | crawl-ref/source/spells4.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index b3f96e5ca3..43966336b2 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -213,6 +213,9 @@ static int _shatter_walls(coord_def where, int pow, int, actor *) if (!in_bounds(where)) return 0; + if (env.markers.property_at(where, MAT_ANY, "veto_shatter") == "veto") + return 0; + const dungeon_feature_type grid = grd(where); switch (grid) @@ -1540,6 +1543,15 @@ bool cast_fragmentation(int pow, const dist& spd) goto all_done; } + if (env.markers.property_at(spd.target, MAT_ANY, + "veto_fragmentation") == "veto") + { + mprf("%s seems to be unnaturally hard.", + feature_description(spd.target, false, DESC_CAP_THE, false).c_str()); + canned_msg(MSG_SPELL_FIZZLES); + return (true); + } + do_terrain: // FIXME: do nothing in Abyss & Pandemonium? |