summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [1800206] Ghoul food cleanup (dolorous).dshaligram2007-10-211-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2504 c06c8d41-db1a-0410-9941-cceddc491573
* Moved position information Lua functions to luadgn.cc.dshaligram2007-10-201-7/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2496 c06c8d41-db1a-0410-9941-cceddc491573
* Lua accessors for you.x_pos, you.y_pos and you.poszelgadis2007-10-181-1/+9
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2488 c06c8d41-db1a-0410-9941-cceddc491573
* [1810484] Fixed Lua userdata leak - shouldn't use luaL_checkudata from __gc ↵dshaligram2007-10-101-4/+4
| | | | | | metamethod. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2406 c06c8d41-db1a-0410-9941-cceddc491573
* Moved all of the bazaar specific logic/code to dat/bazaar (or turned thezelgadis2007-10-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code into Lua utility functions which can be reused by things other than bazaars). Related changes: * Portal vault entrances now work if they have destinations ("dst" property) besides "bazaar" (though it still causes an assert if no matchng maps for the destination can be found). * The floor and rock colour for a level are generated once and then stored in the save file, rather than being constantly regenerated (which means that bazaar floor colours are now truly random, rather than being tied to the depth of the bazaar entrance). * The floor and rock colour for a portal vault (or for any level containing any vault) can be set with ROCKCOL and FLOORCOL (which currently only accepts a single colour, unlike COLOUR); there are also Lua functions for querying and setting the colours. * Each portal vault level_type_name can have an associated Lua callback which is called when level generation is complete; it can be used for things like stair fixup. I also moved the Halls of Zot rock/floor colour special casing to the dat/zot.des file, since it was easy once ROCKCOL and FLOORCOL had been implemented. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2314 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed bad species name (eg: deep elves with the bows title) in dump because ↵dshaligram2007-10-011-1/+2
| | | | | | of reuse of static buffers (Iaido). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2288 c06c8d41-db1a-0410-9941-cceddc491573
* This change moves the logic for when a level or branch prohibitszelgadis2007-09-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | teleport control from the C++ code into the vault .des files. This is done with the additions of two things: * Changeable, persistent per-level and per-branch flags which affect game play. * Dungeon events for the killing of monsters, picking up of objects and changing of features. The current level and branch flags are for teleport control prevention, making a level unmappable (like the Abyss or a Labyrinth), and preventing magic mapping from working (like the Abyss or a Labyrinth). Some related changes: * The new .des header KMASK allows for dungeon grid masks like no_monster_gen to be applied to specific symbols rather than the entire vault. * If the wizard mapping command (&{) is used in a place which is unmappable, it will ask if you wish to force the area to be mappable (so you can see what an entire Labyrinth or Abyss level looks like without having to hack the source). * A new wizard-mode level-map command, 'T', will teleport the player to wherever the cursor is pointing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2146 c06c8d41-db1a-0410-9941-cceddc491573
* Introduces three new wall types, translucent versions of the normalzelgadis2007-09-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rock wall, stone wall and permanent rock wall. These are for use in vaults, and are never randomly generated. Magically translucent versions of the normal wall types are used, rather than glass, so we don't have to figure out how glass would react to things like digging and Shatter, but can re-use the code for the normal wall types. I've tried to fix all the places where the old code assumes that any square which is visible to the player has no walls between it and the player, but I've probably missed lots; this will require a lot of play testing before its ready for non-developers. viewwindow() now has two calls to losight(), the second one determining what squares would be visible if all translucent walls were made transparent, so that there's a quick way to see if there's any translucent walls between the player and a square. This second call to losight() doesn't cause any noticeable slowdown for me, but it might on an older system. Other than viewwindow() making a second call to losight(), there shouldn't be any changes to game-play or game-logic if there aren't any translucent walls around. The wizard blinking command (&b) has been changed so that it ignores all normal restrictions except for needing to see the target square and not landing on monsters; if the player lands on a wall square it's changed to floor. Wizard blinking also doesn't increase magical contamination. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2145 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+3
| | | | | | | | | | | | | crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
* Applying patches by dolorous:j-p-e-g2007-09-151-4/+2
| | | | | | | | | | 1795373: level-2 carnivorous mutation gets another description to differentiate the levels 1795116: more levitation cleanups (using you.flies()) 1794858: cleanup for vampires and fangs mutation git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2092 c06c8d41-db1a-0410-9941-cceddc491573
* Another change to how bazaars look.j-p-e-g2007-09-121-0/+5
| | | | | | | | | | All floor squares around shops (in bazaars) get coloured yellow. (David likened this to light flooding the street.) Lava on red floor get converted to water, and deep water on blue floor is substituted by lava or shallow water. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2074 c06c8d41-db1a-0410-9941-cceddc491573
* Reintroducing Throwing.j-p-e-g2007-09-111-1/+1
| | | | | | | | | | | | | | s/SK_RANGED_COMBAT/SK_THROWING Only thrown weapons, darts and slings train Throwing and benefit from this skill. Added Slings/Throwing and Darts/Throwing to the cross training pairs in skill2.cc. For most cases ranged combat could be simply replaced with throwing. For some, such as effSkill in item_use.cc or starting skills I tried to choose reasonable replacements. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2070 c06c8d41-db1a-0410-9941-cceddc491573
* Finally fixed pickup.lua to work as intended (I hope).j-p-e-g2007-08-241-8/+18
| | | | | | | | | | Other small changes: - default yesno for renouncing religion to 'n' - plants and fungi aren't "interesting", even when OOD - added WIZ designator to listed saved characters git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2031 c06c8d41-db1a-0410-9941-cceddc491573
* Type-safety on mpr() and friends channel argument.haranp2007-08-041-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1970 c06c8d41-db1a-0410-9941-cceddc491573
* Replaced timed markers with Lua markers. Breaks save compatibility.dshaligram2007-07-261-47/+49
| | | | | | KFEAT: feature names are now as in the dungeon_feature_type enum. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1930 c06c8d41-db1a-0410-9941-cceddc491573
* Tweaked bazaar portal timeout. Bazaars may now replace normal shops.dshaligram2007-07-241-0/+1
| | | | | | | | Fixed broken dungeon connectivity checks. Include math lib in Lua interpreters. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1924 c06c8d41-db1a-0410-9941-cceddc491573
* Added potions of resistance, which give fire, electricity and cold resist forharanp2007-07-231-0/+1
| | | | | | | | | | | 10 + random2(40) turns. Rareness roughly equivalent to levitation. This is FR 1756363. The potion does *not* give MR. Rewrote some vampire potion handling, including some changes: e.g. vampires can now be paralysed by potions of paralysis (I don't see why they shouldn't be.) For now there is no status message for fire/cold resist; will change soon. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1918 c06c8d41-db1a-0410-9941-cceddc491573
* pickup lua again, this time with Vampires includedj-p-e-g2007-07-161-1/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1882 c06c8d41-db1a-0410-9941-cceddc491573
* Added a pickup lua that controls what will be picked upj-p-e-g2007-07-161-0/+65
| | | | | | | | | | | | in some more detail (a LOT more detail for potions). Where to add this for crawlrc? Also, while I appreciate being listed as author of trapwalk.lua, I'd rather not have my email address shown. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1881 c06c8d41-db1a-0410-9941-cceddc491573
* Vampires, yay! Credit mostly goes to Jarmo, thoughj-p-e-g2007-07-141-0/+2
| | | | | | | | | | | | | | | | there are a few traces of things I've changed (that I've included and then commented out). There's still lots of stuff to be added, but they should be playable right now. I notice that their vampiric bite attack needs to be made more probable. Feel free to comment on anything that looks weird, is plain wrong, or goes against the spirit of Crawl/Stonesoup. Positive feedback will be appreciated as well. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1870 c06c8d41-db1a-0410-9941-cceddc491573
* [1752315] Made zombie orc entry to D:11-only and reduced the frequency ofdshaligram2007-07-121-0/+7
| | | | | | wraiths and orc sorcerers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1845 c06c8d41-db1a-0410-9941-cceddc491573
* [1737348] Allow stash.lua to annotate item names for autopickup so autopickupdshaligram2007-07-111-3/+2
| | | | | | can use matches like <Short Blades. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1832 c06c8d41-db1a-0410-9941-cceddc491573
* Adjust dragon armour properties back towards 4.0 (they were using 4.1.2 propsdshaligram2007-06-291-1/+1
| | | | | | due to an accidental import circa 0.1). I've left hides closer to the 4.1.2 AC. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1689 c06c8d41-db1a-0410-9941-cceddc491573
* Updated level-design.txt with a basic overview of the Lua possibilities.dshaligram2007-06-281-8/+19
| | | | | | | Fixed some inconsistencies in the handling of Lua errors. Tweaked the lexer to allow spaces before Lua chunk prefixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1676 c06c8d41-db1a-0410-9941-cceddc491573
* Added glyphs_connected and friends for maps to test connectedness of pointsdshaligram2007-06-271-8/+9
| | | | | | | | after map transforms are applied. Fixed conflicts in bison grammar. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1669 c06c8d41-db1a-0410-9941-cceddc491573
* The dungeon builder now caches compiled Lua chunks instead of Lua source in thedshaligram2007-06-271-2/+11
| | | | | | .dsc to save on compile time (at the expense of larger .dsc files). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1663 c06c8d41-db1a-0410-9941-cceddc491573
* .des files can use a global Lua prelude (before maps are defined) that runsdshaligram2007-06-251-9/+13
| | | | | | | at start of game, before any maps are loaded, and does not run in the context of any specific map. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1654 c06c8d41-db1a-0410-9941-cceddc491573
* Croak if necessary Lua files are missing, instead of failing subtly later.dshaligram2007-06-251-6/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1651 c06c8d41-db1a-0410-9941-cceddc491573
* Hackily rewrite Lua chunk errors to reflect line numbers from the originaldshaligram2007-06-241-0/+38
| | | | | | | .des file so that level-designers can find the lines that are causing the problem. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1641 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented .des file caching (speeds startup a fair bit): .des files aredshaligram2007-06-241-0/+3
| | | | | | | | | | parsed only once (unless they're modified again). Crawl also keeps only map stubs in memory (name, place, orient, tags) and loads the map body only when it is actually selected by the dungeon builder. This probably breaks the Windows build, will be fixed soonish. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1637 c06c8d41-db1a-0410-9941-cceddc491573
* Step 1 of .des file Lua-isation. The dungeon compiler converts .des files todshaligram2007-06-231-69/+54
| | | | | | | | | | Lua (Lua code can be embedded with {{ <lua code here> }} constructs) that is run to produce the final map. Some maps may be broken, this is untested, lots more work needs to be done. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1629 c06c8d41-db1a-0410-9941-cceddc491573
* Moved lua/base.lua -> dat/clua/userbase.lua, source it automatically.dshaligram2007-06-221-0/+2
| | | | | | Removed references to base.lua from init.txt, and the other lua files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1623 c06c8d41-db1a-0410-9941-cceddc491573
* Pull c_macro out of the code and into clua/macro.lua.dshaligram2007-06-221-31/+9
| | | | | | | | User-script dofile and loadfile check for "clua" anywhere in the file name and refuse to load the file in that case; only core Crawl code can load Lua files from clua/*. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1622 c06c8d41-db1a-0410-9941-cceddc491573
* Override loadfile and dofile in the Lua user-script interpreter so they have todshaligram2007-06-211-37/+75
| | | | | | | | use datafile_path, and cannot use shell metacharacters (not that it matters) and ../ paths. Multiple loading is not prevented; we could probably add another function that does that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1614 c06c8d41-db1a-0410-9941-cceddc491573
* Added support for limiting memory used by the Lua interpreter.dshaligram2007-06-211-14/+57
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1613 c06c8d41-db1a-0410-9941-cceddc491573
* Experimental mouse support for ncurses (enable with mouse_input=yes indshaligram2007-06-201-0/+1
| | | | | | .crawlrc). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1610 c06c8d41-db1a-0410-9941-cceddc491573
* Correct "artifact" to "artefact".dshaligram2007-06-201-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1607 c06c8d41-db1a-0410-9941-cceddc491573
* Set debug hooks in the Lua VM and interrupt scripts that are running too long.dshaligram2007-06-191-2/+144
| | | | | | (Necessary to make Lua usable on public servers.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1605 c06c8d41-db1a-0410-9941-cceddc491573
* [1603676] Stairs override items on the same square for display purposes ifdshaligram2007-06-011-0/+1
| | | | | | | | stair_item_brand is set (defaults to reverse). Fixed compile error in clua.cc (oops). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1499 c06c8d41-db1a-0410-9941-cceddc491573
* Added you.god() to Lua bindings.dshaligram2007-06-011-0/+2
| | | | | | [1595846] Fixed turnloss for evoking an item that's not evokable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1498 c06c8d41-db1a-0410-9941-cceddc491573
* monam(), moname() and ptr_monam() are gone.haranp2007-05-191-3/+1
| | | | | | | | | | The replacement is str_monam() and mons_type_name(). str_monam() should probably be folded into actor::name. I think. Deaths from zombies, skeletons and simulacra will not handle the name correctly; needs a further hack. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1484 c06c8d41-db1a-0410-9941-cceddc491573
* Minor cleanups.haranp2007-05-151-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1477 c06c8d41-db1a-0410-9941-cceddc491573
* Removed dud verbose_dump and detailed_stat_dump options, and dead code indshaligram2007-04-291-2/+0
| | | | | | shopping.cc (Haran). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1395 c06c8d41-db1a-0410-9941-cceddc491573
* Made item_def::base_type into object_class_type, instead of unsigned char.haranp2007-04-261-0/+2
| | | | | | | | | | | Flushed out a few bugs as a result, specifically: 1. Some monsters (e.g., orcs) can now get blowguns as they were intended to (look at the makeitem.cc change); 2. Acquirement will no longer attempt to give you the books of minor magic if you've found them (look at the effects.cc change.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1374 c06c8d41-db1a-0410-9941-cceddc491573
* Eliminated it_name(), in_name(), item_name(). The function to use isharanp2007-04-211-6/+3
| | | | | | | | now item_def::name(). Cleaned up a lot of code in the process. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1341 c06c8d41-db1a-0410-9941-cceddc491573
* Tweaked to allow building without CLUA_BINDINGS, but allowingdshaligram2007-04-161-4/+0
| | | | | | Lua-conditionalised search patterns. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1320 c06c8d41-db1a-0410-9941-cceddc491573
* Fixes for compiling without Lua. (Darshan, I hope I didn't break anything...)haranp2007-04-161-0/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1319 c06c8d41-db1a-0410-9941-cceddc491573
* Tweaked CLUA_BINDINGS so that the only thing it controls is running userdshaligram2007-04-141-4/+0
| | | | | | scripts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1309 c06c8d41-db1a-0410-9941-cceddc491573
* Added ice statues.dshaligram2007-04-091-1/+1
| | | | | | | | | | Monster spells now use spell_type instead of the old mon_spell_type. Fixed buggy behaviour when banished from Labyrinth. DGL_WHEREIS was not including current time, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1275 c06c8d41-db1a-0410-9941-cceddc491573
* Added classic_item_colours option to go back to 0.1.x item colours. The optiondshaligram2007-03-201-0/+6
| | | | | | | is not retroactive, it only affects items that are created after the option is set. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1072 c06c8d41-db1a-0410-9941-cceddc491573