bernardosulzbach / dungeon

Text-based open-world RPG made with Java
https://www.bernardosulzbach.com/dungeon
BSD 3-Clause "New" or "Revised" License
144 stars 52 forks source link

Butcher command #80

Open bernardosulzbach opened 9 years ago

bernardosulzbach commented 9 years ago

Butcher command that allows the character - if he has a sharp item - to obtain meat from corpses.

Use case: Allow the player to butcher a corpse.

  1. The player issues the butcher command.
  2. The game finds an unambiguous selection.
  3. The game verifies that the player can butcher (has a tool with the SHARP tag).
  4. The game verifies that the corpse can be butchered.
  5. The game verifies that the corpse has not yet been butchered.
  6. Roll the date forward by the amount of time it takes to butcher a corpse.
  7. Check if the corpse is still there.
  8. All the items the body has are moved to the character's inventory.
  9. Remove the body from the Location.
  10. Write a message about the command completion.

2a. The game cannot perform an unambiguous selection, write a message and fail. 3a. The player does not have a proper tool, write a message and fail. 4a. The corpse can not be butchered, write a message and fail. 5a. The corpse has already been butchered, write a message and fail. 7a. The corpse disappeared due to decomposition, write a message warning the player that the corpse is no longer in the location. 8a.1 Not all items fit into the character's inventory. 8a.2 Drop all items that do not fit onto the ground.

Notes:

  1. Requires items with the SHARP tag.
  2. Creatures that have the tag CORPSE need to have a corpse member that lists what its corpse need to contain (this will be used for corpse generation). This member should also specify if the generated corpse can be butchered or not.
  3. Item will get an Inventory field. Initially null for all except for corpses.
  4. Requires the CorpseInventory class. When a corpse is destroyed, the inventory is erased and all it had is lost. When a corpse decomposes, everything the inventory contained is transferred to the location's inventory. Animals should have bones to test this. Note that items and - in the future - plants do not require a special type of inventory that prevents decomposition as fruits will be regenerated all the time and the meat of a corpse rots.
bernardosulzbach commented 9 years ago

TODO:

bernardosulzbach commented 9 years ago

Rabbits could also provide Rabbit's Foot, a miscellaneous item for now.