From 7b22a3c233602f96171f5fc0555102c8608d4d8e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Mon, 23 Nov 2009 10:12:03 +1000 Subject: 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. --- crawl-ref/docs/develop/levels/syntax.txt | 9 +++++++-- crawl-ref/source/fprop.h | 4 +++- crawl-ref/source/initfile.cc | 4 ++++ crawl-ref/source/spells3.cc | 6 ++++++ 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. -- cgit v1.2.3-54-g00ecf