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R3O4KWQBDSRNPT36AYOQYAC X7MFMKQTNZ2IWBFVGS6WQV7NRNKJ3DWQAW2X7IQMFQQXW24AHPZQC HNXKX6ZDQJV33E7UKZOLBYWJMRZ4QLEMXVXJZNRCTOIG2KVRTIEAC W52PCSHX72WAMWKG6L4BPUBVMO6E72KYYBNKAA7554KNOTY6V7WQC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC GOX2FK35IXLRJJJYT6QHL2GTFUWN6IJ6P7GIWKSP2LDOGTWA7XEQC GCDBSJXJCPEK4NCX5CVGDBK3432PFCU5OCO2F3DA32332ALI2ZYQC QIDA6PWWBPR6IJOXFCSPCGWV45PVRZ4TPWSL2TDATNVTYLDMVESQC PRG7UT7G56GT4W3FQ3KG5JRPGMKKJBFDLVHDLYFQK6IZW25JQLBQC NKONHW4JNY6HP2M63MNPM3H64ZWSUNUT5FX2STW4KTS4AMXJXXVQC std::string prompt = make_stringf("%s%s ", str ? str : "Buggy prompt?",_list_allowed_keys(alt_yes, alt_yes2,safe, allow_all).c_str());
std::string prompt =make_stringf("%s%s ", str ? str : "Buggy prompt?",_list_allowed_keys(alt_yes, alt_yes2,safe, allow_all).c_str());
}bool dgn_event_dispatcher::fire_vetoable_position_event(dgn_event_type et, const coord_def &pos){const dgn_event event(et, pos);return fire_vetoable_position_event(event, pos);}bool dgn_event_dispatcher::fire_vetoable_position_event(const dgn_event &et, const coord_def &pos){dgn_square_alarm *alarm = grid_triggers[pos.x][pos.y].get();if (alarm && (alarm->eventmask & et.type)){dgn_square_alarm alcopy(*alarm);for (std::list<dgn_event_listener*>::iteratori = alcopy.listeners.begin();i != alcopy.listeners.end(); ++i){if (!(*i)->notify_dgn_event(et))return (false);}}return (true);
-------------------------------------------------------------------------------- lm_toll.lua:-- One-way toll-stair marker.------------------------------------------------------------------------------require("clua/lm_1way.lua")TollStair = util.subclass(OneWayStair)function TollStair:new(props)local toll = self.super.new(self, props)if not props.amount or props.amount < 1 thenerror("Bad toll amount: " .. props.amount)endreturn tollendfunction TollStair:activate(marker)self.super.activate(self, marker)dgn.register_listener(dgn.dgn_event_type("v_leave_level"),marker, marker:pos())endfunction TollStair:event(marker, ev)if self.super.event(self, marker, ev) thenreturn trueendif ev:type() == dgn.dgn_event_type('v_leave_level') then-- Have we enough gold?local gold = you.gold()local needed = self.props.amountif gold < needed thencrawl.mpr("This portal charges " .. needed .. " gold for entry; " .."you have only " .. gold .. " gold.")return falseend-- Ok, ask if the player wants to spend the $$$.if not crawl.yesno("This portal charges " .. needed .." gold for entry. Pay?", true, "n") thenreturn falseend-- Gold gold gold! Forget that gold!you.gold(you.gold() - needed)return trueendendfunction TollStair:read(marker, th)TollStair.super.read(self, marker, th)setmetatable(self, TollStair)return selfendfunction toll_stair(pars)return TollStair:new(pars)end
static char _lua_char(lua_State *ls, int ndx, char defval = 0){return (lua_isnone(ls, ndx) || !lua_isstring(ls, ndx)? defval: lua_tostring(ls, ndx)[0]);}static int crawl_yesno(lua_State *ls){const char *prompt = luaL_checkstring(ls, 1);const bool safe = lua_toboolean(ls, 2);const int safeanswer = _lua_char(ls, 3);const bool clear_after =lua_isnone(ls, 4) ? true : lua_toboolean(ls, 4);const bool interrupt_delays =lua_isnone(ls, 5) ? true : lua_toboolean(ls, 5);const bool noprompt =lua_isnone(ls, 6) ? false : lua_toboolean(ls, 6);cursor_control con(true);lua_pushboolean(ls, yesno(prompt, safe, safeanswer, clear_after,interrupt_delays, noprompt));return (1);}static int crawl_yesnoquit(lua_State *ls){const char *prompt = luaL_checkstring(ls, 1);const bool safe = lua_toboolean(ls, 2);const int safeanswer = _lua_char(ls, 3);const bool allow_all =lua_isnone(ls, 4) ? false : lua_toboolean(ls, 4);const bool clear_after =lua_isnone(ls, 5) ? true : lua_toboolean(ls, 5);// Skipping the other params until somebody needs them.cursor_control con(true);lua_pushnumber(ls, yesnoquit(prompt, safe, safeanswer, allow_all,clear_after));return (1);}