|
|
|
@@ -0,0 +1,55 @@ |
|
|
|
<template> |
|
|
|
<div class="hello"> |
|
|
|
<h1>VORE TIME</h1> |
|
|
|
<h2>Oh shit it's a:</h2> |
|
|
|
|
|
|
|
<h3> {{enemy.name.capital.all}}</h3> |
|
|
|
<p> {{enemy.health}}</p> |
|
|
|
<br> |
|
|
|
<button v-for="action in player.validActions(enemy)" :key="'player-' + action.name" v-on:click="log(action.execute(player, enemy))">{{action.name}}</button> |
|
|
|
<button v-for="action in player.validActions(player)" :key="'palyer-' + action.name" v-on:click="log(action.execute(player, player))">{{action.name}}</button> |
|
|
|
<div id="log"></div> |
|
|
|
<button v-for="action in enemy.validActions(player)" :key="'enemy-' + action.name" v-on:click="log(action.execute(enemy, player))">{{action.name}}</button> |
|
|
|
<button v-for="action in enemy.validActions(enemy)" :key="'enemy-' + action.name" v-on:click="log(action.execute(enemy, enemy))">{{action.name}}</button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' |
|
|
|
import { Creature, POV } from '@/game/entity' |
|
|
|
import { log, LogEntry } from '@/game/interface' |
|
|
|
|
|
|
|
@Component |
|
|
|
export default class HelloWorld extends Vue { |
|
|
|
@Prop({ type: Creature, required: true }) |
|
|
|
player!: Creature |
|
|
|
|
|
|
|
@Prop({ type: Creature, required: true }) |
|
|
|
enemy!: Creature |
|
|
|
|
|
|
|
private log: (entry: LogEntry) => void; |
|
|
|
|
|
|
|
constructor () { |
|
|
|
super() |
|
|
|
this.log = log |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
|
|
|
<style scoped> |
|
|
|
h3 { |
|
|
|
margin: 40px 0 0; |
|
|
|
} |
|
|
|
ul { |
|
|
|
list-style-type: none; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
li { |
|
|
|
display: inline-block; |
|
|
|
margin: 0 10px; |
|
|
|
} |
|
|
|
a { |
|
|
|
color: #42b983; |
|
|
|
} |
|
|
|
</style> |