git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1469 c06c8d41-db1a-0410-9941-cceddc491573
XNSW5BCK756UAQFY6EC52DXE4TZBF7Y4TNBAHLAQLRVSCRGAAXPQC #ifdef ALLOW_DESTROY_ITEM_COMMAND// Started with code from AX-crawl, although its modified to fix some// serious problems. -- bwr//// Issues to watch for here:// - no destroying things from the ground since that includes corpses// which might be animated by monsters (butchering takes a few turns).// This code provides a quicker way to get rid of a corpse, but// the player has to be able to lift it first... something that was// a valid preventative method before (although this allow the player// to get rid of the mass on the next action).//// - artefacts can be destroyed//// - equipment cannot be destroyed... not only is this the more accurate// than testing for curse status (to prevent easy removal of cursed items),// but the original code would leave all the equiped items properties// (including weight) which would cause a bit of a mess to state.//// - no item does anything for just carrying it... if that changes then// this code will have to deal with that.//// - Do we want the player to be able to remove items from the game?// This would make things considerably easier to keep weapons (esp// those of distortion) from falling into the hands of monsters.// Right now the player has to carry them to a safe area, or otherwise// ingeniously dispose of them... do we care about this gameplay aspect?//// - Prompt for number to destroy?//void cmd_destroy_item( void ){int i;// ask the item to destroyint item = prompt_invent_item( "Destroy which item? ", -1, true, false );if (item == PROMPT_ABORT)return;// Used to check for cursed... but that's not the real problem -- bwrfor (i = 0; i < NUM_EQUIP; i++){if (you.equip[i] == item){mesclr( true );mpr( "You cannot destroy equipped items!" );return;}}// ask confirmationsnprintf( info, INFO_SIZE, "Destroy %s? ",you.inv[item].name(DESC_NOCAP_THE).c_str() );if (yesno( info, true )){//destroy it!!mprf( "You destroy %s.",you.inv[item].name(DESC_NOCAP_THE).c_str() );dec_inv_item_quantity( item, you.inv[item].quantity );burden_change();}}#endif
// bwr: allow player to destroy items in inventory (but not equipped items)// See comment at items.cc::cmd_destroy_item() for details/issues.// #define ALLOW_DESTROY_ITEM_COMMAND