summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-11-15 00:49:34 -0800
committerStefan O'Rear <stefanor@cox.net>2009-11-15 00:49:34 -0800
commit9454f08a3d4e98c0b6c2c64b495e20e1316ecc58 (patch)
treea7877de5b712191efdff02dc588f252d228fde93 /crawl-ref
parent05010f1d267b268e68821223680f34545c443f5c (diff)
parentb3db32a1027c60c2ceea9e44697b833e660cb295 (diff)
downloadcrawl-ref-9454f08a3d4e98c0b6c2c64b495e20e1316ecc58.tar.gz
crawl-ref-9454f08a3d4e98c0b6c2c64b495e20e1316ecc58.zip
Merge branch 'master' of git://crawl-ref.git.sourceforge.net/gitroot/crawl-ref/crawl-ref
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/dat/volcano.des26
-rw-r--r--crawl-ref/source/describe.cc31
-rw-r--r--crawl-ref/source/describe.h3
-rw-r--r--crawl-ref/source/l_dgngrd.cc17
4 files changed, 63 insertions, 14 deletions
diff --git a/crawl-ref/source/dat/volcano.des b/crawl-ref/source/dat/volcano.des
index ded2ddfe8f..4fd83eddd3 100644
--- a/crawl-ref/source/dat/volcano.des
+++ b/crawl-ref/source/dat/volcano.des
@@ -198,14 +198,6 @@ function place_tiny_volcano(e)
delay = 800, size = 80, spread_rate = 10,
listener = large_warning})
end
-
-function place_medium_flame_cloud (e, glyph, nolava)
- if not nolava then
- e.kfeat(glyph .. " = l")
- end
- e.lua_marker(glyph, fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80,
- start_clouds = 1, cloud_type = "flame"})
-end
-- #
-- ###
@@ -666,7 +658,9 @@ SHUFFLE: <<<
NSUBST: < = 4:.
: volcano_setup(_G)
: place_tiny_volcano(_G)
-: place_medium_flame_cloud(_G, 'J')
+KFEAT: J = l
+MARKER: J = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
+ start_clouds = 1, cloud_type = "flame"}
MAP
xxx
xxyxx
@@ -728,8 +722,11 @@ MONS: mummy
SHUFFLE: 12K
: volcano_setup(_G)
: place_large_volcano(_G)
-: place_medium_flame_cloud(_G, "J")
-: place_medium_flame_cloud(_G, "K")
+KFEAT: JK = l
+MARKER: J = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
+ start_clouds = 1, cloud_type = "flame"}
+MARKER: K = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
+ start_clouds = 1, cloud_type = "flame"}
MAP
xxxx
xxxxxxyyxxxxx
@@ -777,8 +774,11 @@ COLOUR: m = blue
TAGS: volcano no_item_gen no_monster_gen
: volcano_setup(_G)
: place_small_volcano(_G)
-: place_medium_flame_cloud(_G, "J", true)
-: place_medium_flame_cloud(_G, "K")
+MARKER: J = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
+ start_clouds = 1, cloud_type = "flame"}
+KFEAT: K = l
+MARKER: K = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
+ start_clouds = 1, cloud_type = "flame"}
# Sides: Lindwurm # Vortex/elemental
MAP
xxxxxxxxx
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index e75423ded2..e87434318a 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -54,6 +54,7 @@
#include "xom.h"
#define LONG_DESC_KEY "long_desc_key"
+#define QUOTE_KEY "quote_key"
// ========================================================================
// Internal Functions
@@ -2087,6 +2088,15 @@ void get_feature_desc(const coord_def &pos, describe_info &inf)
inf.body << _get_feature_description_wide(grd(pos));
inf.quote = getQuoteString(db_name);
+
+ // Quotes don't care about custom descriptions.
+ if (props.exists(QUOTE_KEY))
+ {
+ const CrawlHashTable &quote_table = props[QUOTE_KEY].get_table();
+
+ if (quote_table.exists(db_name))
+ inf.quote = quote_table[db_name].get_string();
+ }
}
void describe_feature_wide(const coord_def& pos)
@@ -2122,6 +2132,25 @@ void set_feature_desc_long(const std::string &raw_name,
desc_table[raw_name] = desc;
}
+void set_feature_quote(const std::string &raw_name,
+ const std::string &quote)
+{
+ ASSERT(!raw_name.empty());
+
+ CrawlHashTable &props = env.properties;
+
+ if (!props.exists(QUOTE_KEY))
+ props[QUOTE_KEY].new_table();
+
+ CrawlHashTable &quote_table = props[QUOTE_KEY].get_table();
+
+ if (quote.empty())
+ quote_table.erase(raw_name);
+ else
+ quote_table[raw_name] = quote;
+}
+
+
void get_item_desc(const item_def &item, describe_info &inf, bool terse)
{
// Don't use verbose descriptions if terse and the item contains spells,
@@ -2776,7 +2805,7 @@ void get_monster_db_desc(const monsters& mons, describe_info &inf,
// descriptions in Lua vaults by using MonPropsMarker. This is also the
// method used by set_feature_desc_long, etc. {due}
if (mons.props.exists("description"))
- inf.body << std::string(mons.props["description"]);
+ inf.body << mons.props["description"].get_string();
// Don't get description for player ghosts.
else if (mons.type != MONS_PLAYER_GHOST)
inf.body << getLongDescription(db_name);
diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h
index ab07f30fa6..3b68325015 100644
--- a/crawl-ref/source/describe.h
+++ b/crawl-ref/source/describe.h
@@ -52,6 +52,9 @@ void get_feature_desc(const coord_def &gc, describe_info &inf);
void set_feature_desc_long(const std::string &raw_name,
const std::string &desc);
+void set_feature_quote(const std::string &raw_name,
+ const std::string &quote);
+
void describe_item(item_def &item, bool allow_inscribe = false,
bool shopping = false);
void get_item_desc(const item_def &item, describe_info &inf,
diff --git a/crawl-ref/source/l_dgngrd.cc b/crawl-ref/source/l_dgngrd.cc
index 84d2d00cfc..d72dab589c 100644
--- a/crawl-ref/source/l_dgngrd.cc
+++ b/crawl-ref/source/l_dgngrd.cc
@@ -115,6 +115,22 @@ static int dgn_set_feature_desc_long(lua_State *ls)
return (0);
}
+static int dgn_set_feature_quote(lua_State *ls)
+{
+ const std::string raw_name = luaL_checkstring(ls, 1);
+ const std::string quote = luaL_checkstring(ls, 2);
+
+ if (raw_name.empty())
+ {
+ luaL_argerror(ls, 1, "Raw name can't be empty");
+ return (0);
+ }
+
+ set_feature_quote(raw_name, quote);
+
+ return (0);
+}
+
static int dgn_max_bounds(lua_State *ls)
{
lua_pushnumber(ls, GXM);
@@ -180,6 +196,7 @@ const struct luaL_reg dgn_grid_dlib[] =
{ "feature_desc_at", dgn_feature_desc_at },
{ "set_feature_desc_short", dgn_set_feature_desc_short },
{ "set_feature_desc_long", dgn_set_feature_desc_long },
+{ "set_feature_quote", dgn_set_feature_quote },
{ "seen_replace_feat", dgn_seen_replace_feat },
{ "grid", dgn_grid },