diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 22:29:06 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 22:29:06 +0000 |
commit | 527fdaf6347eeec4683c418593c1977ab77c5007 (patch) | |
tree | 515624e198b43b2a86d702eebbf3fc5c44817cc9 | |
parent | 407e5c7135b9a0031c1c3438581ee9eb6e160180 (diff) | |
download | crawl-ref-527fdaf6347eeec4683c418593c1977ab77c5007.tar.gz crawl-ref-527fdaf6347eeec4683c418593c1977ab77c5007.zip |
Make a note about how much you paid to enter a ziggurat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7624 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/clua.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/lm_toll.lua | 11 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/ziggurat.lua | 1 |
3 files changed, 34 insertions, 1 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 09ab691cec..2204d17cf1 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -35,6 +35,7 @@ #include "monstuff.h" #include "mon-util.h" #include "newgame.h" +#include "notes.h" #include "output.h" #include "player.h" #include "randart.h" @@ -2025,6 +2026,13 @@ static int crawl_msgch_name(lua_State *ls) return (1); } +static int crawl_take_note(lua_State *ls) +{ + const char* msg = luaL_checkstring(ls, 1); + take_note(Note(NOTE_MESSAGE, 0, 0, msg)); + return (0); +} + #define REGEX_METATABLE "crawl.regex" #define MESSF_METATABLE "crawl.messf" @@ -2153,6 +2161,19 @@ static int crawl_split(lua_State *ls) return (1); } +static int crawl_article_a(lua_State *ls) +{ + const char *s = luaL_checkstring(ls, 1); + + bool lowercase = true; + if (lua_isboolean(ls, 2)) + lowercase = lua_toboolean(ls, 2); + + lua_pushstring(ls, article_a(s, lowercase).c_str()); + + return (1); +} + LUARET1(crawl_game_started, boolean, crawl_state.need_save) LUARET1(crawl_random2, number, random2( luaL_checkint(ls, 1) )) LUARET1(crawl_one_chance_in, boolean, one_chance_in( luaL_checkint(ls, 1) )) @@ -2281,11 +2302,13 @@ static const struct luaL_reg crawl_lib[] = { "read_options", crawl_read_options }, { "msgch_num", crawl_msgch_num }, { "msgch_name", crawl_msgch_name }, + { "take_note", crawl_take_note }, { "regex", crawl_regex }, { "message_filter", crawl_message_filter }, { "trim", crawl_trim }, { "split", crawl_split }, + { "article_a", crawl_article_a }, { "game_started", crawl_game_started }, { "err_trace", crawl_err_trace }, diff --git a/crawl-ref/source/dat/clua/lm_toll.lua b/crawl-ref/source/dat/clua/lm_toll.lua index e48f555cc9..4f5ed4bed0 100644 --- a/crawl-ref/source/dat/clua/lm_toll.lua +++ b/crawl-ref/source/dat/clua/lm_toll.lua @@ -42,6 +42,15 @@ function TollStair:check_veto(marker, pname) elseif pname == "veto_level_change" then -- Gold gold gold! Forget that gold! you.gold(you.gold() - needed) + + local toll_desc + if self.props.toll_desc then + toll_desc = self.props.toll_desc + else + toll_desc = "at " .. crawl.article_a(self.props.desc) + end + crawl.take_note("You paid a toll of " .. needed .. " gold " .. + toll_desc .. ".") return end end @@ -62,4 +71,4 @@ end function toll_stair(pars) return TollStair:new(pars) -end
\ No newline at end of file +end diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua index 312886351a..0d2b50a818 100644 --- a/crawl-ref/source/dat/clua/ziggurat.lua +++ b/crawl-ref/source/dat/clua/ziggurat.lua @@ -80,6 +80,7 @@ function ziggurat_portal(e) local function stair() return toll_stair { amount = entry_fee, + toll_desc = "to enter a ziggurat", desc = "gateway to a ziggurat", dst = "ziggurat", dstovermap = "Ziggurat", |