Browse Source

Add an equip() method to creatures

master
Fen Dweller 5 years ago
parent
commit
899a428090
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/game/creature.ts

+ 8
- 0
src/game/creature.ts View File

@@ -74,6 +74,14 @@ export class Creature extends Vore implements Combatant {
return effect.onRemove(this) return effect.onRemove(this)
} }


equip (item: Equipment, slot: EquipmentSlot) {
const equipped = this.equipment.get(slot)
if (equipped !== undefined) {
this.items.push(equipped)
}
this.equipment.set(slot, item)
}

get status (): Array<VisibleStatus> { get status (): Array<VisibleStatus> {
const results: Array<VisibleStatus> = [] const results: Array<VisibleStatus> = []




Loading…
Cancel
Save