summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
Commit message (Collapse)AuthorAgeFilesLines
* Replace static snprintf() with make_sprintf() where the result is ↵Adam Borowski2009-12-171-3/+1
| | | | | | immediately cast to std::string.
* Fix another callmbooleanfn bug.Robert Vollmert2009-11-241-1/+1
|
* Fix compile with newer gcc.Robert Vollmert2009-11-241-3/+3
|
* Add "maybe_bool CLua::callmbooleanfn".Robert Vollmert2009-11-241-8/+22
| | | | This allows Lua hooks to say they don't have an opinion.
* dat/clua/iter.lua: iterators for Lua.Jude Brown2009-11-191-0/+1
| | | | | | | | | | | | | | | | | | Currently only includes: rectangle_iterator: iterates points between two corners. los_iterator: iterates over currently visible points in LOS. adjacent_iterator: iterates over adjacent points to the center. Most iterators accept a "filter" parameter that is a function which should either return true if the point is acceptable for the iteration, or false if it is not. los_iterator is currently restricted to player LOS rather than actor or monster LOS, but could be expanded at a later date. All of the iterators seem to work as intended: hopefully I haven't made too many mistakes with them.
* set_exclude/del_exclude lua bindings.Robert Vollmert2009-11-121-0/+1
|
* lmark.synchronized_markers(): apply one marker's effects to multiple points ↵Darshan Shaligram2009-10-311-5/+45
| | | | | | | | | | | | | | | simultaneously. synchronized_markers() takes a marker, and a list of method names to override, and returns a set of markers that fire simultaneously, to allow, say, fog machines that fire at random intervals, but always fire in unison. lm_mslav.lua has details. volcano.des has an example volcano entry vault that uses this. Allow fetching a list of Lua markers/marker positions by property value. Renamed dgn.find_marker_prop -> dgn.find_marker_position_by_prop. s/helper/listener/ for fog machine listeners.
* Add whitespace fixes.David Lawrence Ramsey2009-10-311-1/+1
|
* Initialize __echo in lua interpreter.Robert Vollmert2009-10-301-0/+1
|
* Add lua binding for inspecting env.show.Robert Vollmert2009-10-271-0/+1
|
* Actually load new moninf library.Robert Vollmert2009-10-271-0/+1
| | | | | | | | | | | | | | | | | | As a first test that this works, add the following to your .crawlrc: < function test_mon() local m = monster.get_monster_at(1, 0) if m then crawl.mpr("damage: " .. m:damage_desc()) else crawl.mpr("no monster") end end > Bind the macro "===test_mon" to some key, stand to the left of a creature, and invoke the macro.
* Move Lua monster bindings into the dungeon lua.Robert Vollmert2009-10-271-1/+0
| | | | | | They appear to be used only for ziggurat monster placement, and I'm finding it hard to see a safe use of these for the user. Correct me if I'm wrong.
* clua.cc: needed algorithm header fileMatthew Cline2009-10-211-0/+2
| | | | Needed "#include <algorithm>" for std::find()
* Move print_?lua_stack into CLua.Robert Vollmert2009-10-211-25/+26
|
* Move clua_register_metatable to cluautil.Robert Vollmert2009-10-211-25/+0
|
* Move utility functions from clua.cc to cluautil.cc.Robert Vollmert2009-10-211-97/+3
| | | | | | | | cluautil.cc should eventually contain all of the functions for passing objects from and to lua, at least the shared ones. Also cut down on clua.cc include list.
* Comments and renaming for consistency.Robert Vollmert2009-10-201-5/+1
|
* Move remaining libraries from clua.cc.Robert Vollmert2009-10-201-231/+3
| | | | That's l_file.cc, l_food.cc, l_global.cc.
* Move library "item" from clua.cc to l_item.cc.Robert Vollmert2009-10-201-670/+1
|
* Move library "options" from clua.cc to l_option.cc.Robert Vollmert2009-10-201-136/+1
|
* Move monster libraries from clua.cc to l_mons.cc.Robert Vollmert2009-10-201-236/+2
|
* Move grd_lib out of clua.cc into l_mapgrd.cc.Robert Vollmert2009-10-201-105/+0
| | | | | | | | | | | | | | Rest of commit comment only as accurate as my understanding... Renaming from grd to mapgrd to avoid confusion with grd == env.grid: This grd is the maplines-section of a vault definition. Also move mapgrd_lib from clua to dlua since it's only used for dungeon building. clua and dlua need more descriptive names.
* Move clua you_lib to l_you.cc.Robert Vollmert2009-10-201-226/+1
| | | | | Also remove you.pos() from clua since grid coordinates aren't supposed to be known to the user.
* Move clua crawl_lib from clua to l_crawl.cc.Robert Vollmert2009-10-201-569/+2
| | | | To avoid name clashes, rename dlua libs from *_lib to *_dlib.
* Lua map improvements.Enne Walker2009-10-181-0/+105
| | | | | | | | | | | | | | | | | | | | The previous dungeon layout.des functions all apply directly to the grid and so are unsuitable for use in vaults. This aims to correct that by providing lua functions that can manipulate maps (of glyphs). grd[x][y] in a .des file can now be used to get and set glyphs in the current map. This should allow for less cumbersome map variations than what you can do with just SUBST and SHUFFLE. To support that, map_def no longer batches up transforms--it applies them all immediately. This resulted in a good bit of refactoring. FTILE/RTILE map commands now support setting the tile for multiple features at once. There are also a small number of new lua functions that apply to maps (map_octa_room, map_smear, and map_extend). Ideally, these will eventually replace the existing builder funcs that work on grd.
* versioning: remove SVN-specific revision data, add Git versioningSteven Noonan2009-10-181-1/+0
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* you.uniques() should not be user-accessible, as sorear pointed out.Jude Brown2009-10-151-2/+14
| | | | Signed-off-by: Eino Keskitalo <evktalo@users.sourceforge.net>
* Allow access to you.unique_creates in Lua, via you.uniques("Michael"), etc.Jude Brown2009-10-141-0/+2
|
* Make gods that take corpse offerings do so without the butchery step,David Lawrence Ramsey2009-10-111-6/+32
| | | | | | i.e., allow merely praying over said corpses. Now, the only gods that pay attention to butchery are Kikubaaqudgha and Elyvilon. Also, add several miscellaneous fixes.
* Remove a lot of unneccessary includes.Robert Vollmert2009-10-091-1/+0
| | | | | | | The console version still compiles on Linux; both console and tiles version compile in OS X. I haven't been able to test the DOS and Windows compiles -- please fix or tell me about any errors that show up.
* Remove unnecessary includes of view.h.Robert Vollmert2009-10-091-1/+0
| | | | | Compilation of console crawl on Linux succeeds; please complain if other platforms break.
* Wrap more() for lua (crawl.more()).Robert Vollmert2009-10-071-0/+2
|
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* Fix projects referencing 'Kills.cc' to reference 'kills.cc'Steven Noonan2009-09-291-1/+1
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Set up a basic testing framework for LOS. ./crawl -test with a full debug ↵Darshan Shaligram2009-09-241-6/+0
| | | | build will run the test.
* Add spelling fixes.David Lawrence Ramsey2009-09-231-1/+1
|
* Fix assert triggered when ziggurat levels are generated (syllogism).dshaligram2009-09-161-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10687 c06c8d41-db1a-0410-9941-cceddc491573
* Apply patch by Adam Borowski, introducing new unique enchantress Kirke.j-p-e-g2009-06-271-0/+2
| | | | | | | | | | | This includes a new transformation TRAN_PIG that the player can not end at will but rather will have to time out. Pigs (or rather hogs) are fast but cannot use any equipment except amulets, or cast spells. If the transformation would cause death by stat loss (due to equipment loss) the player is paralysed instead. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10061 c06c8d41-db1a-0410-9941-cceddc491573
* First part of the merger of fixed artefacts into unrandom artefactszelgadis2009-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (further changes will be much smaller). Breaks savefile compatibility, and bumps the major savefile version up to 6. Some changes made to some tiles files, but it hasn't been tested with a tiles build. Overview of changes: * Unrand artefacts are now defined in art-data.txt and is turned into C code via util/art-data.pl. This has the dual advantage of being more readable by humans, and that if the unrand data structure changes then you can just change util/art-data.pl and regenerate the C code rather than having to change some 70 different C structs by hand. * util/art-data.pl automatically updates NO_UNRANDARTS, and also automatically generates an enumeration of all the unrands which are equal to their item.special field. * randart.cc and randart.h have been renamed to artefact.cc and artefact.h, since the files covers all types of artefacts, and the differences between randarts, unrandarts and (former) fixed arts have been minimized since the terms were introduced. Also renamed unrand.h to art-data.h * The brands and resistances of former fixed arts are now handled via artefact properties, but the rest of their special behaviours are still hardcoded. * Unrandarts are now distinguished between normal and "special", with the special ones currently just being identical to the list of the formed fixed arts. Special unrandarts are randomly generated less often than normal unrandarts, can be generated in the Abyss if they've been lost, can't be picked up by monsters, and can't be affected by Tukima's Dance. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10035 c06c8d41-db1a-0410-9941-cceddc491573
* Fix for compile failure on 32-bit g++dshaligram2009-05-031-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9722 c06c8d41-db1a-0410-9941-cceddc491573
* Allow ziggurat levels to generate all monsters awakedshaligram2009-05-021-1/+66
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9720 c06c8d41-db1a-0410-9941-cceddc491573
* * Tweak Xom's ideas about what makes a funny or boring death.j-p-e-g2009-04-221-1/+1
| | | | | | | | | * Add another option (*sigh*) covering whether W=T and P=R. (Defaults to false.) * Various spacing and comment fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9675 c06c8d41-db1a-0410-9941-cceddc491573
* Remove all traces of TRAN_AIR and TRAN_SERPENT_OF_HELL, the latterj-p-e-g2009-02-271-4/+0
| | | | | | | together with the corresponding unused ability. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9244 c06c8d41-db1a-0410-9941-cceddc491573
* * Move eating logic from lua to C again, so as to handle more than j-p-e-g2009-01-251-2/+2
| | | | | | | | boolean responses (eat, skip, cancel). * Remove the now deprecated eat.lua. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8746 c06c8d41-db1a-0410-9941-cceddc491573
* Include the Lua stack trace and currently acting monsters in the crash report.zelgadis2009-01-221-5/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8694 c06c8d41-db1a-0410-9941-cceddc491573
* Remove now-unused redraw_gold flag.dolorous2009-01-201-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8618 c06c8d41-db1a-0410-9941-cceddc491573
* Greatly improve eating interface, as suggested in FRs 1923273 and 2018733.j-p-e-g2009-01-061-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you now press 'e' the following takes place: 1) If you can eat chunks, the game builds a list out of all chunks on the floor and in your inventory, sorted by age [1], and prompts you to eat them [2]. 2) If none are found, or you decline all of them you get prompted for non-chunk food items on the floor. 3) Prompt for non-chunk food in your inventory. 4) Open up the food menu of your inventory. Because of the way lua works, there's currently a problem that in the early stages (1-3) "q" (now also accepts Escape) will cause to skip ahead to the next stage rather than leaving the process entirely, which is of course less than optimal. I also added two new options [1] prefer_safe_chunks (defaults to true) which will offer clean chunks before contaminated ones, even if the latter happens to be older [2] easy_eat_chunks (defaults to false) which causes the prompting to be skipped for safe (i.e. clean) chunks, so you will automatically eat the oldest chunk that applies. This is ignored for undead characters. I also got rid of the outdated safechnk.lua and chnkdata.lua seeing how chunk effects are no longer spoily information. Added a new wizmode command: Ctrl-H, which allows you to set your character's hunger state. (Hopefully this will make Vampire testing easier.) Also fix 2488374: "Controlled Flight being named upon levitation even if its type is already known. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8282 c06c8d41-db1a-0410-9941-cceddc491573
* Adding REVISION() macro to all source files.ennewalker2009-01-041-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8217 c06c8d41-db1a-0410-9941-cceddc491573
* Fix .des timer messaging to be easier to customise, applied timer to sewer ↵dshaligram2008-12-011-0/+11
| | | | | | | | | | portals. Fix typo in monspeak.txt (slinkies). Fixed hippogriff plural. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7709 c06c8d41-db1a-0410-9941-cceddc491573
* Changed player attribute type from unsigned char to unsigned long. Breakszelgadis2008-11-291-0/+5
| | | | | | | | | | | | | savefile compatibility. Keep track of how much gold the player has collected, spent at shops, donated, and otherwise used (like at ziggurats) and include that info in the misc section of the character dump file. Place-holder for chaos spawn monster. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7683 c06c8d41-db1a-0410-9941-cceddc491573