|
|
|
@@ -22,7 +22,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<EquipmentView class="character-equipment" :subject="subject" /> |
|
|
|
<EquipmentView class="character-equipment" :world="world" :subject="subject" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@@ -44,20 +44,25 @@ import { Item, ItemKind, Equipment } from '@/game/items' |
|
|
|
}) |
|
|
|
|
|
|
|
export default class Profile extends Vue { |
|
|
|
@Prop() |
|
|
|
world!: World |
|
|
|
|
|
|
|
@Prop() |
|
|
|
subject!: Creature |
|
|
|
|
|
|
|
useItem (item: Item): void { |
|
|
|
switch (item.kind) { |
|
|
|
case ItemKind.Key: |
|
|
|
break |
|
|
|
case ItemKind.Consumable: |
|
|
|
item.actions[0].execute(this.subject, this.subject) |
|
|
|
break |
|
|
|
case ItemKind.Equipment: |
|
|
|
this.subject.equip(item as Equipment, (item as Equipment).slot) |
|
|
|
this.subject.items = this.subject.items.filter(i => item !== i) |
|
|
|
break |
|
|
|
if (this.subject.side === this.world.player.side) { |
|
|
|
switch (item.kind) { |
|
|
|
case ItemKind.Key: |
|
|
|
break |
|
|
|
case ItemKind.Consumable: |
|
|
|
item.actions[0].execute(this.subject, this.subject) |
|
|
|
break |
|
|
|
case ItemKind.Equipment: |
|
|
|
this.subject.equip(item as Equipment, (item as Equipment).slot) |
|
|
|
this.subject.items = this.subject.items.filter(i => item !== i) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|