summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-23 10:12:03 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-23 10:12:03 +1000
commit7b22a3c233602f96171f5fc0555102c8608d4d8e (patch)
tree641eb5682566462cdf9bf465129bde1b97af80bf
parent2fc79a6d0d709878025fa1f06cf2a5344098f333 (diff)
downloadcrawl-ref-7b22a3c233602f96171f5fc0555102c8608d4d8e.tar.gz
crawl-ref-7b22a3c233602f96171f5fc0555102c8608d4d8e.zip
Counterpart fprop for NO_RTELE_INTO: NO_CTELE_INTO.
NO_CTELE_INTO causes grid-cells marked as such to reject controlled teleport into them, with the message: "A strong magical force throws you back!". NO_TELE_INTO combines both of these flags (NO_RTELE_INTO and NO_CTELE_INTO) to prevent both controlled and random teleports into a specific cell. Also document both of these.
-rw-r--r--crawl-ref/docs/develop/levels/syntax.txt9
-rw-r--r--crawl-ref/source/fprop.h4
-rw-r--r--crawl-ref/source/initfile.cc4
-rw-r--r--crawl-ref/source/spells3.cc6
4 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/docs/develop/levels/syntax.txt b/crawl-ref/docs/develop/levels/syntax.txt
index 0f67c13616..132d1cbee1 100644
--- a/crawl-ref/docs/develop/levels/syntax.txt
+++ b/crawl-ref/docs/develop/levels/syntax.txt
@@ -921,8 +921,8 @@ KPROP: x = bloody
KFEAT: and KMONS:, it can be combined with these for the same place-
holder.
- Available properties are:
-
+ Available properties are:
+
* "bloody": Causes features to appear as though splattered with
blood. This should be used very, very sparingly!
* "force_exclude": Forces a single grid square or feature to be an
@@ -933,6 +933,11 @@ KPROP: x = bloody
entering from nearby squares.
* "no_rtele_into": Prevents random teleport from chosing to use this
square. Should be used sparingly.
+ * "no_ctele_into": Prevents controlled teleportation into this square.
+ Will instead generate the message "A strong magical force throws
+ you back!". Should be used sparingly.
+ * "no_tele_into": Combines the above no_rtele_into and no_ctele_into
+ in one flag, and disallows both random and controlled teleports.
KITEM: ? = potion of healing / potion of restore abilities
KITEM: places the specified item at all occurrences of the
diff --git a/crawl-ref/source/fprop.h b/crawl-ref/source/fprop.h
index cd8abcf51e..e6fe37e9a9 100644
--- a/crawl-ref/source/fprop.h
+++ b/crawl-ref/source/fprop.h
@@ -17,7 +17,9 @@ enum feature_property_type
// NOTE: Bloody floor and sanctuary are exclusive.
FPROP_FORCE_EXCLUDE = (1 << 6),
FPROP_NO_CLOUD_GEN = (1 << 7),
- FPROP_NO_RTELE_INTO = (1 << 8)
+ FPROP_NO_RTELE_INTO = (1 << 8),
+ FPROP_NO_CTELE_INTO = (1 << 9),
+ FPROP_NO_TELE_INTO = FPROP_NO_RTELE_INTO | FPROP_NO_CTELE_INTO
};
#endif
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index bc31bfdc33..da5ecad62b 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -228,6 +228,10 @@ int str_to_fprop ( const std::string &str)
return (FPROP_NO_CLOUD_GEN);
if (str == "no_rtele_into")
return (FPROP_NO_RTELE_INTO);
+ if (str == "no_ctele_into")
+ return (FPROP_NO_CTELE_INTO);
+ if (str == "no_tele_into")
+ return (FPROP_NO_TELE_INTO);
return (FPROP_NONE);
}
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 08e6243fb3..4969da954f 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1532,6 +1532,12 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
is_controlled = false;
large_change = false;
}
+ else if (testbits(env.pgrid(pos), FPROP_NO_CTELE_INTO))
+ {
+ is_controlled = false;
+ large_change = false;
+ mpr("A strong magical force throws you back!", MSGCH_WARN);
+ }
else
{
// Leave a purple cloud.