Bläddra i källkod

Add an equip() method to creatures

master
Fen Dweller 5 år sedan
förälder
incheckning
899a428090
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. +8
    -0
      src/game/creature.ts

+ 8
- 0
src/game/creature.ts Visa fil

@@ -74,6 +74,14 @@ export class Creature extends Vore implements Combatant {
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> {
const results: Array<VisibleStatus> = []



Laddar…
Avbryt
Spara