summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_item.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-1/+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!
* Move letter <-> index from stuff.cc to prompt.cc (wheals)Nicholas Feinberg2014-07-281-0/+1
|
* Refactor out a redundant list of jewellery namesNicholas Feinberg2014-07-221-87/+41
| | | | And de-indent l_item_do_subtype() slightly.
* Refactor weapon_skill()Nicholas Feinberg2014-07-131-3/+1
| | | | | | | | | | | | | | This function was misleadingly named (it only provided the skill used for melee weapons, not ranged weapons), and incomplete; code along the lines of "is_ranged_weapon(*it) ? range_skill(*it) : weapon_skill(*it)" was scattered in about half a dozen different functions. I've corrected both of those problems (renaming weapon_ skill() to melee_skill() and adding item_weapon_skill()), and also possibly fixed two bugs in the process - an l_you.cc function that claimed to provide the skill used for the starting weapon (but actually only gave the melee skill), and unrand creation code that checked if a potential unrand swap used the same (melee) skill as the weapon type being generated.
* Plus2: Attempt to cleanup trove/lua handling of weapon plusses.Chris Oelmueller2014-06-141-7/+2
| | | | | | [Committer's note: removed handling of plus2 in lm_trove. This will need to be reverted if anyone ever wants to make troves ask for rods.]
* Combine plus/plus2 for rings of slaying, and Acc+/Dam+ on artefactsChris Oelmueller2014-06-131-6/+1
| | | | | | | | | | Phase out ARTP_ACCURACY, rename ARTP_DAMAGE to ARTP_SLAYING which now combines both Acc+ and Dam+ bonuses. Bracers of archery are +4 now instead of +5,+3. [Committer's note: fixed a description and cleaned up various other small issues.]
* Remove jewelry and armour sources of conservationgammafunk2014-05-281-2/+2
| | | | | | The amulet of conservation and cloaks of preservation are no longer necessary without item destruction. Maxwell's patent armour now has the resistance ego and grants rF+ and rC+.
* Remove a few more references (|amethyst).Shmuale Mark2014-04-301-2/+2
|
* Mark potions that are preferred food as food for prefix & stash search (#8461)Eduardo Gonzalez2014-04-301-0/+11
| | | | | | | | This affects porridge for most races and blood for vampires, though since everything in the actual food class is usually irrelevant as "food" for vampires, they're probably better off searching for blood anyways. Expose is_preferred_food to lua for the stash annotation code.
* Indentation fixes.Adam Borowski2013-12-041-1/+1
|
* Annotate items with terse description of their egoPekka Lampila2013-12-021-0/+13
| | | | | Purpose of this is allow finding for example helmet of see invisible by searching for "SInv".
* Add some player-usable item lua: fully_identified, plus, plus2.elliptic2013-11-051-0/+55
|
* Pad some ternary operators with spaces on the leftChris Oelmueller2013-07-281-1/+1
| | | | | | While this is not explicitly mentioned as a rule in coding_conventions, all examples listed there apply it as well. The dungeon.cc chunk did overflow max. columns before already, but could still be looked at.
* Annotate god gifts for stash searchPekka Lampila2013-04-171-0/+11
|
* #ifdef out potions of gain abilityAdam Borowski2013-04-051-0/+2
|
* Unify menu_colour_item_prefix and filtering_item_prefix.Adam Borowski2012-12-271-1/+1
| | | | | The only reason for this madness was so searching for "ident" doesn't find identified items.
* Replace levitation with flight and remove controlled flight (elliott)Chris Campbell2012-11-071-2/+6
|
* Drop a lot of unnecessary braces.Adam Borowski2012-10-241-2/+0
| | | | | The perl one-liner I use for this had a bug where it didn't match "else" at the end of a line (ie, most of the time).
* Remove unnecessary includes from header files.Jay3.14152012-10-231-0/+1
| | | | | | | | | | For most header files, this only saves on having to recompile a small number of source files, but there are also a few headers where small changes would now take significantly less time. This is most obvious for the Tiles build for which the dependencies have been greatly reduced, so that the only additional includes when compared to console are strictly library or tile related.
* Use std namespace.Raphael Langella2012-08-261-14/+14
| | | | | | | | | | | | | 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.
* Remove potions of water.Adam Borowski2012-08-201-2/+0
| | | | Without Evaporate, they lost their last use.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Some more return deparenthesization.Adam Borowski2012-07-051-1/+1
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-96/+96
|
* Don't use two misleading schemes for reach ranges.Adam Borowski2012-06-261-1/+1
| | | | | | | Both were scalars compatible with int, and both used the name "reach_range" is some cases. Thus, let's use 2/5/8 everywhere. This probably makes the enum obsolete.
* Make a bunch of functions static or gone.Adam Borowski2012-06-231-2/+2
|
* Remove spaces between function identifiers and arguments lists.Adam Borowski2012-06-211-8/+8
|
* Use ARRAYSZ() instead of sizeof division, for readability.Adam Borowski2012-06-191-1/+1
| | | | Also, it's not vulnerable to changes to the underlying types.
* Check the count of rings and amulets in l_item.ccAdam Borowski2012-06-181-2/+4
| | | | | jewellery_type_name doesn't have an array to expose, would need to fix it later.
* Update the list of amulets in l_item.ccPolicarpo Caballero2012-06-171-2/+2
|
* Make staves and rods separate object classes.Adam Borowski2012-06-121-1/+1
| | | | | | | | | | | | They have about no overlap, more than both being usable as weapons. A vast majority of uses immediately checked item_is_rod()/item_is_staff(). I kept them shared for acquirement, for now. Also, eliminate rods of smiting -- hardly ever used, problematic theme-wise as they use "divine providence" without worship. Keeping rods of striking for now, could be used to fix artificer problems. Adding/removing rod enums is a mess due to tile handling, renaming ROD_SMITING to ROD_LIGHTNING for now.
* Move throwing code out of item_use.ccAdam Borowski2012-05-131-0/+1
| | | | | It really needs to be ripped out and rewritten, with a stress on making the formulas sane.
* Fix a lua info leak.Raphael Langella2012-05-111-4/+2
| | | | We shouldn't return enum values ever anyway.
* Merge branch 'master' into portal_branchesAdam Borowski2012-04-251-2/+56
|\
| * Return multiple items from items.get_items_at().Neil Moore2012-04-221-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Like full_describe_view(), we get the extra items from the stash tracker; on untracked levels we can get only the top. Difficulties arise because the stash tracker returns item_defs on the stack where they cannot safely be pointed to. To handle this properly, item_wrapper gains a new boolean member indicating whether the item_def is a temporary copy (as opposed to an element of mitm, for example); a new C function clua_push_item_temp() allocates a copy of an item_def and creates such a wrapper. If the temporary flag is true, the item_def will be freed when the wrapper is GCed.
| * Revert get_items_at -> get_item_at, fix it not working out of LOS, fix crashes.Adam Borowski2012-04-211-8/+24
| | | | | | | | | | | | | | It doesn't actually work for any items but the top yet, but at least the interface won't change. This reverts commit 198c943b116acfd9a1997c48073f29e520e7c0c4.
| * Avoid info leak, get_items_at -> get_item_at.Neil Moore2012-04-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | Returns an item or nil. This avoids leaking information about items at the bottom of an unvisited pile. For the same reason, do not return anything from an invisible pile (e.g. one at the bottom of deep water for non-swimmers). It would be nice to use the stash to return an entire visited pile, but there doesn't seem to be a way to get a semi-permanent pointer to an item_def in the stash.
| * New clua binding that returns an array of floor items.Policarpo Caballero2012-04-211-0/+15
| |
| * Drop pointless braces after else/else if as well.Adam Borowski2012-04-201-2/+0
|/
* Make another bunch of functions static or gone.Adam Borowski2012-04-051-4/+4
|
* Add item.is_melded to clua, check it in autofight.Neil Moore2011-12-081-0/+11
| | | | | | We shouldn't try to fire a melded bow, or reach with a melded polearm. Fixes #5026.
* expand lua script engine [item.is_useless, you.contaminated, you.feel_safe]Kek2011-11-201-0/+11
|
* Let autofight use the new reaching code; fix attempts to reach while berserk.Adam Borowski2011-09-091-0/+11
|
* Unrevert and fix index_to_letter() checks, make them stricter.Adam Borowski2011-09-031-1/+1
| | | | | | | | | The only place that can legitimately have a non-letter is the lua function, and it'll now return -1 in that case. Most of the others had isaalpha() already. It's possible I missed some case and the asserts will now crash, but if so, they'd re buggy anyway (accepting digits and interpunction as slots).
* Fix a std::string.c_str() going out of scope crash.Adam Borowski2011-08-101-1/+1
| | | | There's no point in using a std::string here at all.
* Several user-callable Lua functions. (#3967)Ryan Riegel2011-08-031-1/+52
| | | | | | | Added several Lua-callable functions for enhanced reasoning about items, monsters, and player state. Signed-off-by: Jude Brown <bookofjude@users.sourceforge.net>
* Fix lua bugs with unidentied armour.Raphael Langella2011-07-211-10/+10
| | | | Bug introduced by 294db2cc.
* Allow searching by equipment slot.Raphael Langella2011-07-211-0/+2
| | | | | The keywords are: cloak helmet gloves boots shield body
* Adjust some whitespace and formatting.Adam Borowski2011-07-081-1/+0
|
* Merge branch 'octopodes'Adam Borowski2011-06-091-1/+1
|\