summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
Commit message (Collapse)AuthorAgeFilesLines
* Apply trunk r10435 to 0.5.dolorous2009-07-271-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10436 c06c8d41-db1a-0410-9941-cceddc491573
* Backport my previous commit (Zot remaining open once entered) to 0.5.j-p-e-g2009-07-191-20/+1
| | | | | | | Also replace the (unused) branch entry tile with the new Zot entry tile. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10304 c06c8d41-db1a-0410-9941-cceddc491573
* Fix dropping worn items not checking for !T.j-p-e-g2009-06-071-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9909 c06c8d41-db1a-0410-9941-cceddc491573
* Use wield_weapon(-) instead of unwield_item() when dropping/throwing aj-p-e-g2009-05-121-1/+1
| | | | | | | wielded weapon, so inscriptions are respected. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9760 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2009-04-281-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9700 c06c8d41-db1a-0410-9941-cceddc491573
* Change Options.autopickup_on from boolean to 3-state: 1 (autopick up), 0j-p-e-g2009-04-241-1/+1
| | | | | | | | (autopickup off), -1 (autopickup turned off automatically). Only in the latter case does killing an invisible monster turn autopickup (back) on. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9691 c06c8d41-db1a-0410-9941-cceddc491573
* * Tweak Xom's ideas about what makes a funny or boring death.j-p-e-g2009-04-221-23/+23
| | | | | | | | | * 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
* * Fix Xom's piety wrapping around from 0 -> 255.j-p-e-g2009-04-181-3/+6
| | | | | | | | | | | | | | | | * Fix Xom piety 100 (initial state) favouring bad effects. * Limit tension bonus for good effects to 199. * Add penalty for tension 0, so bad effects become more likely without tension. * Revert order of Xom's amusement to actually match the amusement gain. (Was getting "roars with laughter" for gain of 2, etc.) * Add damage shaving to Deep Dwarf ghosts. * Add 'o' to pickup list commands -> stop prompting, start autoexplore. * Default menu_colour_item_class to true in initfile.cc. * Allow autopickup of chunks in Lich form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9634 c06c8d41-db1a-0410-9941-cceddc491573
* [2758242] Fixing segfault during debug_mons_scan due to an mprf not matching ↵ennewalker2009-04-181-2/+25
| | | | | | its format string with its var args. Also, fixing clone function from chaos brand that was causing this where cloned items in monster inventories weren't setting their link to be part of the new monster's inventory. Refactoring monster holding functions into item_def, where they probably should be. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9618 c06c8d41-db1a-0410-9941-cceddc491573
* * Use menu colours (rather than message colours) for item announcementsj-p-e-g2009-03-251-10/+8
| | | | | | | | | | | | and the like. * Fix 'V' if there are more than 52 monsters/items in the list. * Make Xom act more often, with the probability depending strongly on tension. Also tweak a few action probabilities according to tension, so that e.g. summons are more likely for high tension. * Fix monsters being created with large quantities of curare needles. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9546 c06c8d41-db1a-0410-9941-cceddc491573
* * Allow viewing of card descriptions from Triple Draw and Stack Deck.j-p-e-g2009-03-231-7/+11
| | | | | | | | | | * Sort items in 'V' screen according to pickup menu sort order. * Name Xom's randart book gifts more randomly. * Colour items seen by 'x' with message colour tags and same for pickup messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9541 c06c8d41-db1a-0410-9941-cceddc491573
* Tiles:j-p-e-g2009-03-081-1/+7
| | | | | | | | | | | | * (Re?)allow mouseclicks in menus (Tiles, only): L-click = scroll down, R-click = Esc * Clear last_clicked_grid if you move your mouse. * When entering a new level, draw the map before handling monster shouts. Enne, please review the changes. Thanks! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9386 c06c8d41-db1a-0410-9941-cceddc491573
* * Fix wizmode targetting commands not flushing messages correctly.j-p-e-g2009-03-071-1/+2
| | | | | | | | | | | | | * Fix Sif Muna's randart book gifts never containing the Vehumet/Kiku special spells, as was originally intended. (Books found elsewhere will never contain the spells.) * In the highly unlikely case the player already has seen all spells don't crash when attempting to gift a book. Instead, simply make the acquirement fail, but be quiet about "the demon of the infinite void" if it was instigated by Sif Muna. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9368 c06c8d41-db1a-0410-9941-cceddc491573
* Tiles again:j-p-e-g2009-03-061-6/+3
| | | | | | | | | | | * Store index of last cell clicked on in inventory and suppress item description if you just clicked on it, so you can see the messages describing whatever you just did (should fix 2660578). * Allow right-click as a synonym for '!' when toggling ^, A, m. * Let shift left-click on avatar standing on altar = prayer. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9343 c06c8d41-db1a-0410-9941-cceddc491573
* Fix [2644366]: place a space between prefixes and the item name.haranp2009-02-281-1/+1
| | | | | | | | Also, fix the documentation which used to say that the prefixes are comma-separated (they're not.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9294 c06c8d41-db1a-0410-9941-cceddc491573
* Call flush_prev_message() before getch(), cancelable_get_line() andj-p-e-g2009-02-281-3/+3
| | | | | | | mpr_formatted_output(). Fixes 2647846. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9275 c06c8d41-db1a-0410-9941-cceddc491573
* Remove all traces of TRAN_AIR and TRAN_SERPENT_OF_HELL, the latterj-p-e-g2009-02-271-20/+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
* Clean up acquirement subtype determination code. (Another goto bites the dust.)haranp2009-02-041-1/+1
| | | | | | | Be a bit more generous regarding books for Evoc and Invoc types. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8890 c06c8d41-db1a-0410-9941-cceddc491573
* Implement [2383585]: picking up part of a stack (e.g. 3 of 6 breadharanp2009-01-251-0/+8
| | | | | | | | rations) marks the rest of the stack as dropped, so that greedy autoexplore and autopickup won't try to take it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8751 c06c8d41-db1a-0410-9941-cceddc491573
* Following dolorous's comments on 2488905, use random_in_bounds() insteadharanp2009-01-251-1/+1
| | | | | | | | | of manual randomization. Also fixes the bug where this was biased towards the bottom-right section of the map. Unfortunately, it doesn't fix 2488905. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8750 c06c8d41-db1a-0410-9941-cceddc491573
* Attempting to move or copy and item to a out-of-bounds position on the gridzelgadis2009-01-201-0/+4
| | | | | | | will now assert. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8627 c06c8d41-db1a-0410-9941-cceddc491573
* Fix assertion when buying items from shops.zelgadis2009-01-201-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8622 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
* Fix bug #2510110: blood potions coagulating while in a monster's inventoryzelgadis2009-01-161-8/+15
| | | | | | | | | | | | | | was causing crashes. Get rid of drop_blood_potions_stack() and pick_up_blood_potions_stack(), replace with the more general merge_blood_potion_stacks() and merge_item_stacks(). When creating blood potions via debug command you can now specify how many turns away from coagulating/rotting it should be. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8471 c06c8d41-db1a-0410-9941-cceddc491573
* * Add speech for Dissolution, courtesy of David.j-p-e-g2009-01-121-3/+1
| | | | | | | * Change Nessos stats to that of centaur warrior. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8431 c06c8d41-db1a-0410-9941-cceddc491573
* * Fix non-tile compilation as suggested by Enne.j-p-e-g2009-01-121-2/+2
| | | | | | | * Don't give half xp when pacifying summoned monsters (BR 2501795). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8429 c06c8d41-db1a-0410-9941-cceddc491573
* [2499489] Allowing mouse clicks for picking up items and for --more-- prompts.ennewalker2009-01-121-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8421 c06c8d41-db1a-0410-9941-cceddc491573
* Code cleanup for ignite_poison(), inspired by [2204223].haranp2009-01-081-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8325 c06c8d41-db1a-0410-9941-cceddc491573
* Make the position of monster held items (-2, -2) rather than (0, 0), so thatzelgadis2009-01-081-26/+36
| | | | | | | | | | | | | | | any valid item in mitm[] which is still at (0, 0) by the time debug_item_scan() is called must be buggy. Also set the link fields of monster held items to NON_ITEM + 1 + monster_index, so that it's easy to tell which monster is holding any given item; this is used in debug_mons_scan() and monsters::pickup() to do some sanity checking of monster inventory. I've tried to thoroughly test this, but there might still be some bugs left. Breaks savefile compatibility (or, rather, will lead to endless error messages if you use an old save file). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8322 c06c8d41-db1a-0410-9941-cceddc491573
* Yet another fix to the arena win/loss/tie logic.zelgadis2009-01-071-1/+15
| | | | | | | | | | | | | | | | | | | | | | | During arena mode don't reserve any of mitm[] when creating new items, and when mitm[] fills up call arena_cull_items() instead of _cull_items(), since in arena mode we can cull via how boring/interesting the items are rather than having to consider game balance and fairness to the player. Allow the arena to veto monster placement, rather than culling them immediately after they're placed. New arena tags: * "no_bands" prevents band members from being placed. * "move_spawners" teleports test spawners every turn to spread their summons randomly over the arena. * "ban_glyphs:" lists a set of text glyphs of types of monsters which shouldn't be allowed in the arena. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8300 c06c8d41-db1a-0410-9941-cceddc491573
* Greatly improve eating interface, as suggested in FRs 1923273 and 2018733.j-p-e-g2009-01-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8217 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed 2481704: Travel stopping for spellcasting monsters without LOSj-p-e-g2009-01-021-0/+3
| | | | | | | | spells behind glass. Fixed 2174517: V giving information about unknown items in stashes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8128 c06c8d41-db1a-0410-9941-cceddc491573
* * Dump spells contained in randart spellbooks, marking memorised spellsj-p-e-g2008-12-291-6/+6
| | | | | | | | | | with an asterisk. * Sif Muna no longer gifts the books specific to Kiku and Vehumet (Necronomicon, Annihilations, Demonology) though the spells contained there-in may crop up in randart books. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8011 c06c8d41-db1a-0410-9941-cceddc491573
* Add whitespace fixes.dolorous2008-12-221-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7904 c06c8d41-db1a-0410-9941-cceddc491573
* autopickup_no_burden no longer influences manual pickup.haranp2008-12-131-42/+1
| | | | | | | | Fixes 2375482. This might have unintended consequences; jpeg, can you review? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7824 c06c8d41-db1a-0410-9941-cceddc491573
* Fix spurious encumberance messages when combining ammo in inventory.haranp2008-12-131-5/+7
| | | | | | | Fixes 2354891. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7823 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 2414178: applied Brendan MacDonell's patch (2414671) to make the book orderzelgadis2008-12-111-2/+2
| | | | | | | in spl-book.cc match enum.h git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7810 c06c8d41-db1a-0410-9941-cceddc491573
* Generalize swapping two pieces of terrain in function swap_terrain().zelgadis2008-12-111-2/+3
| | | | | | | | | | | | Encapsulate filling out a corpse object for a particular monster in fill_out_corpse(). Started work on "swap chaos weapon with weapon of victim" chaos effect, but am putting that off until there's some actor class virtual methods for changing inventory and equipment. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7807 c06c8d41-db1a-0410-9941-cceddc491573
* Fix bug 2398346: don't record note on identify-by-wearing of mundane armour.zelgadis2008-12-071-0/+19
| | | | | | | Fix some god gift autoinscription problems. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7762 c06c8d41-db1a-0410-9941-cceddc491573
* Savefile compatibility breakage from keeping track of which spells have beenzelgadis2008-12-041-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | seen. Implemented fixed-level randart spell books, which is all randart spellbooks as of now. All my attempts at sorting the spell list so that spells with the same schools group together have utterly failed. Got rid of the hackish "non-monster origin is stored in item.orig_monnum as (-origin - 2)" logic, replaced with the slightly less hackish "-origin". Added the two enumerations IT_SRC_START and IT_SRC_SHOP to do it. Also, origin_is_god_gift() and origin_is_acquirement() can retrieve the god/source of the item so that you don't have to do the negation and typecasting yourself. Added some new spell flags: * SPFLAG_BATTLE for non-conjuration spells which are still combat/battle related (branding spells and single school attack spells like "Pain"), * SPFLAG_CARD for spells which are card-type effects which don't show up in ordinary spellbooks (Tomb of Doroklohe and (I assume) Disintigrate) * SPFLAG_TESTING for spells which are only used for testing (Debugging Ray) * SPFLAG_DEVEL for spells that are still under development (Crush, Disrupt, and Detect Magic). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7742 c06c8d41-db1a-0410-9941-cceddc491573
* Changed player attribute type from unsigned char to unsigned long. Breakszelgadis2008-11-291-0/+1
| | | | | | | | | | | | | 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
* Oops, was forgetting to set the portal vault origin string from withinzelgadis2008-11-251-0/+1
| | | | | | | origin_set(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7613 c06c8d41-db1a-0410-9941-cceddc491573
* For items that originate in a portal vault, store the string describingzelgadis2008-11-241-0/+20
| | | | | | | | | | | | | | | | | their origin place in "portal_vault_origin" in the item's prop hash table, so that (for example) an item bought in a bazaar will display its origin as "in a bazaar" after exiting the bazaar, instead of "in a Portal Vault". The string can be made different than the default with the "dstorigin" property of the entrance portal marker, or via the lua function dgn.set_level_type_origin(). Ziggurat items now say "on level X of a ziggurat", and sewer items "in the sewers", with other portal vaults using the default. Breaks savefile compatibilty. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7577 c06c8d41-db1a-0410-9941-cceddc491573
* Allow .des files to place manuals with names as "manual of Fighting" or ↵dshaligram2008-11-231-1/+20
| | | | | | "random manual" (dpeg). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7549 c06c8d41-db1a-0410-9941-cceddc491573
* Oops, used tabs instead of spaces for indentation in items.cc and mon-util.cc.zelgadis2008-11-221-2/+2
| | | | | | | Fixed the same problem in initfile.cc and directn.cc while I was at it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7533 c06c8d41-db1a-0410-9941-cceddc491573
* Fix bug 2298697: for dealing with weapons of returning which fail to return,zelgadis2008-11-221-0/+18
| | | | | | | | | | mons_throw() should have been using the mslot of the weapon, not weapon's mitm index. Introduces the new functions get_mon_equip_slot() and item_to_mslot(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7530 c06c8d41-db1a-0410-9941-cceddc491573
* Add miscellaneous minor fixes.dolorous2008-11-181-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7476 c06c8d41-db1a-0410-9941-cceddc491573
* * Tweak a number of starting choice restrictions. (FR 2106062)j-p-e-g2008-11-061-25/+82
| | | | | | | | | * FR 2088441: Add an aptitudes hotkey for the book/weapon choice submenus. * FR 2196437: Check entire stack of (selected) items, even if your pack is full, in case some of them can merge. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7393 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2162827: tag length calculation was incorrect.haranp2008-10-131-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7230 c06c8d41-db1a-0410-9941-cceddc491573