From fca02d5a9d188648a0f97dc5b717c21a8adfb092 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Fri, 16 Oct 2009 04:01:53 -0700 Subject: 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 --- crawl-ref/source/spells4.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crawl-ref/source/spells4.cc') 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? -- cgit v1.2.3-54-g00ecf