summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_moninf.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-0/+1
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Simplify, optimise, and improve formattingNeil Moore2014-07-011-8/+5
|
* Add getting monster spells to clua m:spells() (#8737)Aj Adamson2014-07-011-0/+38
| | | | | | | | | | | | [Committer's note: squashed two commits. The second commit's message was: changed clua moninfo:spells() to return book sets/string tables like describe.cc monster_info has_spells based on mostly on spellbooks. describe and clua moninfo:spells's shared code moves to mon-book.h/mon-util.cc -neil]
* A clua hook for MB_RANGED_ATTACK (gw).Steve Melenchuk2014-04-231-0/+2
|
* Remove fake Mara/Rakshasa monsters and associated code, refactor to use ↵DracoOmega2014-03-111-5/+1
| | | | | | | | | | | | | | | | | | | Phantom Mirror There was quite a bit of special case code for the 'fake' monsters which Mara and other rakshasa would create that can be subsumed beneath the general Phantom Mirror effect (which can properly create fake dummies of any type of monster in a unified way). The main practical gameplay difference that will result (aside from bugs introduced by this, of course) is that the true Mara will actually be disguised when he splits, instead of the player knowing for sure which one he is (until two of them blink in the same turn, anyway). This is a Mara buff, but it seems to me that an illusion spell of this nature shouldn't have been so easy to see through in the first place and that this is an overall better state of affairs. (Also, the clones do have less hp than before, if you end up killing the wrong one first).
* Let moninf_get_is_caught() also check webbed status.elliptic2014-03-061-1/+1
|
* A lua function telling when a monster is netted or webbed.elliptic2014-02-241-0/+8
|
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-1/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Correct other missing #includesSamuel Bronson2013-04-061-0/+1
|
* Use std namespace.Raphael Langella2012-08-261-16/+13
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Lua: don't claim that 0-damage constriction (ie, "hold") is not constriction.Adam Borowski2012-08-191-8/+7
| | | | | | It differs only for some advanced tactics, and for a majority of uses they're similar enough: they block movement, make the monster constricting you a priority to kill, have the same blink restriction, etc.
* Fix lua for detecting constriction status.elliptic2012-07-311-3/+10
| | | | It was broken by the introduction of "holding" in addition to "constricting".
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-17/+17
|
* Use mid rather than mindex for constriction.Neil Moore2012-07-041-15/+8
| | | | | | | | | | | | actor::constricting is now a pointer to a map from mids to durations; if the actor is not constricting anything, we use a NULL pointer rather than an empty map to save memory. Save compatibility: Because constrictees might be loaded after constrictors (and vice versa), we cannot convert the old constriction arrays (which use mindex) until all the monsters have been loaded. Instead, save the constriction data temporarily, and create the maps at the end of tag_read_level_monsters().
* A clua function monster:reach_range()Adam Borowski2012-06-261-0/+9
|
* A clua function moninf:can_be_constricted()Adam Borowski2012-05-261-0/+24
|
* Allow clua to query m:is("flag") by name rather than enum.Adam Borowski2012-05-221-1/+30
|
* Give lua access to monster names.elliptic2012-05-121-0/+9
| | | | Rather than having to parse the full m:desc() string each time.
* Add monster.is_constricting_you() to lua.Adam Borowski2012-04-041-0/+19
| | | | | | If there are two hostile nagas, one constricting you and another a summon of yours, it was impossible to tell which one is which. And sadly, lua has currently no way to pass "you".
* Remove monster.is_very_stabbable().Adam Borowski2012-04-041-9/+0
| | | | stabbability() provides strictly more information.
* Add monster.stabbability to lua.Adam Borowski2012-04-041-0/+35
| | | | Return a float 0..1 representing the stab bonus.
* Add {you,monster}.is_constrict{ed,ing} to clua.Adam Borowski2012-04-041-0/+23
|
* Fix a crash on demand in mon-info:is()Adam Borowski2012-01-031-0/+5
| | | | This really should be indexed by enum names rather than numbers.
* Coding style fixes: braces to their own line.Neil Moore2011-12-141-1/+2
| | | | The exceptions are extern "C", multi-line macros, and json.{cc,h}.
* Improve autofight handling of "safe" monsters by checking for firewood instead.elliptic2011-12-101-0/+2
| | | | | | | Previously some monsters were still not being attacked because they were treated as safe. Checking mons_is_firewood() is better for determining which monsters to ignore, though ballistomycetes and butterflies still need to be special-cased.
* Another player lua function, for checking whether a monster is sleeping or ↵elliptic2011-12-031-0/+9
| | | | paralysed.
* Make monster threat level accessible from lua.Raphael Langella2011-08-241-0/+2
| | | | Should help with bots.
* Several user-callable Lua functions. (#3967)Ryan Riegel2011-08-031-0/+16
| | | | | | | Added several Lua-callable functions for enhanced reasoning about items, monsters, and player state. Signed-off-by: Jude Brown <bookofjude@users.sourceforge.net>
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-4/+4
| | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* Rename class "monsters" to "monster".Robert Vollmert2010-09-051-1/+1
|
* Make monster_info store all the player's knowledge on a monster (v3)Luca Barbieri2010-07-281-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in v3 (rob): - update for master (bleeding, deflect missiles, ...) - fix misled not ending - fix all monsters getting extreme fire resistance Changes in v2: - add operator = monster_info is changed from the monster list's structure to a general purpose structure storing player-known information about a monster. The plan is to make all the user interface code read data from moster_info, so that: 1. There is no risk of accidental leaks, since all the sensitive code is in one place 2. Complicated things like misled and fake monsters are correctly handled, and the code exists once 3. The structure can be serialized for client/server play, and the deserialized structure can be passed to the UI code (this is still theoretical) This will be done in a successive patch. Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
* Adapt mi_get_monster_at to lua_push_moninf-change.Robert Vollmert2010-03-231-2/+2
|
* Properly fix ch_mon_is_safe memory leak (greensnark).Robert Vollmert2010-03-231-1/+1
| | | | | Apparently, mons_is_safe was only leaking memory in case ch_mon_is_safe was undefined.
* Revert "Use mons_is_safe check for autofight.lua."Robert Vollmert2010-02-281-5/+2
| | | | | | | This reverts commit a4138c893d44489c23d6528122a8b956cd9d7390. It was a good change, but I'm moving the mons_is_safe check into monster_info for greater flexibility on the Lua side.
* Export monster_info::is_safe to Lua.Robert Vollmert2010-02-281-0/+2
|
* Use mons_is_safe check for autofight.lua.Johanna Ploog2010-02-271-2/+5
| | | | | | When using the autofight macro, we're probably not interested in moving towards allies or bashing plants. Using mons_is_safe for this might be overly restrictive, but it's a definite improvement.
* Allow lua code to access monster_info description.Robert Vollmert2010-02-051-0/+15
| | | | | | This is not really safe since it accesses the underlying monsters*; it would be preferable to generate the necessary info on construction of the monster_info instance and not storing the monsters* pointer.
* Update includes after the mon-util.h split.Robert Vollmert2010-01-221-0/+1
|
* Remove libutil.h from AppHdr.h and include explicitly.Robert Vollmert2010-01-201-0/+1
| | | | | | | Also extract unwind_var template to unwind.h. The latter is now included from AppHdr.h, though it needn't really be. This means it's now possible to use coord_def in libutil.h.
* Move player2grid and grid2player to coord.Robert Vollmert2009-11-241-10/+1
|
* Add whitespace fixes.David Lawrence Ramsey2009-10-311-1/+1
|
* Add lua binding for inspecting env.show.Robert Vollmert2009-10-271-6/+3
|
* Add function to return monster info for a given coordinate.Robert Vollmert2009-10-271-0/+45
|
* Start of monster_info lua binding.Robert Vollmert2009-10-271-0/+57