Adventure-Bot / adventure-bot

Slay a monster! Stab your friend! Adventure Bot!
https://www.adventurebot.io/
6 stars 6 forks source link

Potions, scrolls, consumables #28

Closed brian-gates closed 2 years ago

brian-gates commented 2 years ago

Examples

/inventory will display a "Use" button if usable items are present.

const isUsable = (item: Item) => item.usable && item.useCharges === false || item.useCharges > 0

Clicking the "Use" button will prompt to select which item to use.

The list will show each item's name, a description of its effect, and number of remaining charges, if applicable.

Selecting an item will invoke it's effect.

Items with the consumeOnUse flag will be destroyed after use.

type Usable = Item & {
  usable: true;
  useCharges: false | number;
  consumeOnUse: boolean;
}

Future Scope

Targeting. Self targeting will be assumed, initially. Later, the ability to choose a target will be added.

brian-gates commented 2 years ago

29