summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua
Commit message (Collapse)AuthorAgeFilesLines
* Some new Lua wrappers for dungeon building and ranges.Jude Brown2010-01-121-1/+9
| | | | | | | | | | | Introduces util.range(start, stop), returning an array consisting of the numeric values between start and stop inclusive. Also introduces "is_valid_coord" Lua wrapper, which does the same work as _valid_coord but does not generate an error message for invalid coordinates, "find_in_area" (a straight translation of the function in dungeon.cc), and "is_passable_coord" which checks the glyph at that location against traversable_glyphs.
* Add -script option to Crawl to run a Lua script. Scripts are similar to ↵Darshan Shaligram2010-01-092-2/+57
| | | | | | tests, but can be parameterised. Add a script to generate 150 level at a named place and report on all the monsters generated there.
* Crawl now checks for the availability of branch ending vaults before ↵Darshan Shaligram2010-01-071-0/+17
| | | | starting up.
* Add test case to generate branch ends and verify that runes and orb exist.Darshan Shaligram2010-01-072-2/+13
|
* Fix Shoal:$ generation bugs: stairs could be surrounded by deep water, hut ↵Darshan Shaligram2010-01-053-5/+68
| | | | | | entrances could be blocked by rock. shoal-hut.lua test generates 1k Shoal:$ levels and verifies that the levels pass sanity tests.
* Inventory and stash iterators for lua.Jude Brown2009-12-281-0/+72
|
* Customisable clouds!Jude Brown2009-12-281-3/+18
| | | | | | | | | | | | | | | | | | | | | cloud_struct now has members for colour, name, and tile; colour will be used instead of the default colour of the cloud type, and will be used to recolour the tile of the cloud (if it exists). Name will be used to rebrand the cloud's description, and also alter the message generate while standing in a cloud. Finally, tile can be used to completely customise the tile used for the cloud. The value is stored as a string in order to maintain save compatibility across ASCII and tiles. A random tile (found using tile_main_count) from that set will also be used, however, no duration effects will be applied. Recoloured cloud tiles using just the colour code should be possible, though aren't yet fully tested. This commit bumps TAG_MAJOR_VERSION: changing marshalling of the FogMachine Lua code causes nasty crashes on reloading saved games. Otherwise, I don't think I broke anything else. :-)
* Fix util.append (due).Darshan Shaligram2009-12-251-11/+5
|
* Let message_at_spot accept props; function_at_spot.Jude Brown2009-12-041-2/+12
|
* Monster-flavour LOS, adjacent, rectangle and circle iterators.Jude Brown2009-11-291-22/+102
|
* New Lua iterators: point_iterator, slave_iterator, tweaks.Jude Brown2009-11-291-8/+79
| | | | | | | | | | | | | | The first (point_iterator) accepts a table of points (such as the ones return by dgn.find_marker_positions_by_prop, or any other function which returns points) and is filterable and stateful. The second is a quick wrapper over dgn.find_marker_positions_by_prop. Tweaked rectangle_iterator to supply an "rvi" (return value instead) which will store the value of the filter instead of expecting the filter to return a true or false value. Setting this to false will behave as before; setting it to true allows us to have the filter alter the point (mons_at, items_at, marker_at_pos, etc).
* Subvaults.Enne Walker2009-11-281-0/+36
| | | | | | | | Vaults can now include other vaults as a part of their definition. These subvaults are currently included by tag only and replace glyphs in their parent vault. See documentation for more details. Vault:8 has been modified to use subvaults.
* Fix include center being broken.Jude Brown2009-11-271-3/+3
| | | | | Typo in the variable name ("y" instead of "_y") meant that the center was always being included, even if it was specifically excluded.
* New Lua library: feat.Jude Brown2009-11-271-1/+1
| | | | | | | | | | | | | | | | | | | Provides wrappers for all of the feat_is_XXX functions from terrain.cc, as well as a few other functions. Also provides a macro which can wrap a function to take: * a set of co-ordinates (parsed with grd(coord_def(x, y))) * a string (parsed with dungeon_feature_by_name) * an integer (cast into dungeon_feature_type, can be fetched from dgn.grid(x, y)) All of the feat library functions can be used in this manner. For example: * feat.is_wall(x, y) * feat.is_wall(dgn.grid(x, y)) * feat.is_wall(7) * feat.is_wall("rock_wall")
* Fix wiz-mode Ziggurats not being properly initialised [BR2903984]Jude Brown2009-11-261-3/+8
| | | | | | | | | | The code references the "portal" object (created in ziggurat_portal, which is also passed to the onclimb initialiser) which is not actually used for Wizard Mode portals. Fixed this by a) checking whether or not there was a portal included in the zig() "check to see if we're using &P", and also adding a parameter to to ziggurat_portal which just returns the actual portal.
* Debugging functions to call from &^TMatthew Cline2009-11-241-0/+29
| | | | | | Currently only holds "debug_wrath()". After pressing "&^T", etner "debug_wrath()" to repeatedly throw divine wrath the player, without the player dying; stops when any key is pressed.
* Fix crawl.process_keys(), add crawl.redraw_stats()Matthew Cline2009-11-241-12/+0
|
* Allow reactivation of lua marker.Robert Vollmert2009-11-241-1/+2
| | | | | | | | | Failed reactivation was causing error messages on travel to off-level stashes, for example. _loadlev_populate_stair_distances reactivates all markers, so markers should probably handle reactivatiion gracefully. Not sure this is the correct way to handle things, however.
* Iteration-related functions: stack_search and stack_destroy.Jude Brown2009-11-221-0/+63
| | | | | | The first will return the first item whose name matches the search term in the relevant stack, while the second will destroy each item in the stack. Hopefully the precautions in stack_destroy will be enough.
* Some clean up of Lua iterator code.Jude Brown2009-11-211-31/+22
|
* New Lua iterator: circle_iterator. Fix LOS/adjactent iterator.Jude Brown2009-11-211-6/+61
| | | | | | LOS and adjacent iterators were only working if include_center was set to true; setting it to false (or nil) results in no points being returned.
* Add "wall_hit" to possible DgnTriggerer types.Jude Brown2009-11-201-1/+9
|
* dat/clua/iter.lua: iterators for Lua.Jude Brown2009-11-191-0/+176
| | | | | | | | | | | | | | | | | | 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.
* Fixing ziggurats missing fill_area function.Enne Walker2009-11-171-5/+5
| | | | | fill_grd_area now fills an area on the dungeon grd. Only Ziggurats use this function.
* A few typos.Adam Borowski2009-11-161-1/+1
|
* Don't remove marker while it's being activatedMatthew Cline2009-11-131-1/+13
| | | | | | Removing a marker while it's being activated leads to memory weirdness, so instead while activating all markers see if each marker has the "post_activate_remove" set, and afterwards remove those that do.
* dungeon.lua: dgn_set_persistent_var()Matthew Cline2009-11-131-0/+4
| | | | A function to for setting lua persistent data from C/C++
* MonPropsMarker: set hash properties on monstersMatthew Cline2009-11-132-0/+51
| | | | | | A marker class which will take the monster on top of it, set any number entries in that monster's props CrawslHashTable member, and then disappear.
* lm_trig.lua: monster_dies can look for "any"Matthew Cline2009-11-131-3/+3
|
* lm_trig.lua: monster_dies fix, slaved marker fixMatthew Cline2009-11-111-2/+2
| | | | | | | monster_dies now uses the full name of the monster, rather than the name of the monster's type. Fixed error with using slave markers.
* lm_trig.lua: "listen_to_slaves" not for globalsMatthew Cline2009-11-081-3/+13
| | | | | "listen_to_slaves" shouldn't apply to global events, only position-dependent events.
* item_pickup_change_flags: "auto" item nameMatthew Cline2009-11-082-7/+25
| | | | | | item_pickup_change_flags (and the underlying DgnTriggerable) can take the item name "auto", in which case it automatically picks the item placed on top of the marker.
* lm_trig.lua: Forgot to remove master listenerMatthew Cline2009-11-081-1/+4
|
* lm_trig.lua: Master markers can listen to slavesMatthew Cline2009-11-081-6/+50
| | | | | | Master markers can now listen to events happening at slave markers by setting the property "listen_to_slaves", and can only trigger at the slave marker which had the event by also setting "only_at_slave".
* Remove lm_func.lua and FunctionMachines.Jude Brown2009-11-072-178/+0
| | | | | These have been replaced TriggerableFunctions, which provide much more flexibility.
* "Tloc energy" -> "Translocational energy".Jude Brown2009-11-071-1/+1
| | | | Must be referred to by its full name.
* Make TriggerableFunction's data parameter always a table.Jude Brown2009-11-071-4/+4
| | | | And make it use lmark.marshall_table and lmark.unmarshall_table instead.
* Add check to stop tw_machine from firing constantly.Jude Brown2009-11-071-1/+1
|
* lm_fog.lua: now a Triggerable subclassMatthew Cline2009-11-071-110/+101
|
* lm_trig.lua: turn and enter event, listenersMatthew Cline2009-11-071-9/+194
| | | | | | | | Triggerable now handles listeners, and DgnTriggerer now handles turn and entered_level events. For turn events, DgnTriggerer also handles randomized, repeating countdowns. Also added a TriggerableFunction class.
* Rename purple smoke to clouds of translocational energyStefan O'Rear2009-11-061-1/+1
|
* lm_trig.lua: do_trigger(): simplifyMatthew Cline2009-11-041-20/+4
|
* Slave/master handling in the Triggerable classMatthew Cline2009-11-043-18/+121
| | | | | The Triggerable class can now handle master/slave marker logic. See dis_mu in hells.des for an example.
* Chained FogMachine convenience function, documentation, minor corrections.Bookofjude2009-11-033-3/+14
| | | | chained_fog_machine now performs relevant lmark.synchronized_markers modification to fog machines. Provided documentation for this. Cleaned up volcano.des, removed some unused functions and fixed some line lengths, other minor corrections.
* Ziggurats can now be added to the shopping list.Matthew Cline2009-11-021-0/+64
|
* Use lm_trig.lua instead of lm_func. lua for msgsMatthew Cline2009-11-012-10/+66
| | | | | Start of triggerable/function_machine merger: use triggerable class TriggerableMessage for messages instead of message_machine.
* lm_trig.lua: Handle player_move, player_losMatthew Cline2009-11-011-0/+17
| | | | DgnTriggerer now handles the dungeon event player_move and player_los.
* lm_trig.lua: event() uses method dispatchMatthew Cline2009-11-011-39/+50
| | | | | Use a method-dispatch type mechanism to deal with the different types of dungeon events, rather than a long series of "elseif"s.
* Lua distance bindings, Volcano tweaks, FogMachine message tweaks.Jude Brown2009-11-012-11/+33
| | | | | | | | | | New binding for coord.cc's distance functions (dgn.distance(x1, y1, x2, y2)), lua function "point_in_radius", accepts two dgn.point functions and a radius and returns true if point1 is in radius around point2. Extensive tweaks to FogMachine warning messages: most now accept a "see function" as the final parameter, which should take two parameters: an x and a y. The function should return true if the player can "see" this point. Finally, tweaks to Volcanoes: utilise see_function and dgn.point_in_radius to provide better warning for lake. Utilise greensnark's new slave/master system for chaining FogMachines together in Bunker and Village. Signed-off-by: Darshan Shaligram <dshaligram@users.sourceforge.net>
* loadmaps.lua auto-loads .des files in dat.Darshan Shaligram2009-11-011-23/+2
|