|  |  | @@ -1,12 +1,12 @@ | 
		
	
		
			
			|  |  |  | <template> | 
		
	
		
			
			|  |  |  | <div id="app"> | 
		
	
		
			
			|  |  |  | <Header version="pre-alpha" /> | 
		
	
		
			
			|  |  |  | <Combat :encounter="encounter" /> | 
		
	
		
			
			|  |  |  | <Header version="pre-alpha" @selectEncounter="selectEncounter" :encounters="encounters" /> | 
		
	
		
			
			|  |  |  | <Combat v-show="$data.encounter === encounter" v-for="(encounter, index) in encounters" :key="'encounter-' + index" :encounter="encounter" /> | 
		
	
		
			
			|  |  |  | </div> | 
		
	
		
			
			|  |  |  | </template> | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | <script lang="ts"> | 
		
	
		
			
			|  |  |  | import { Component, Vue, Prop } from 'vue-property-decorator' | 
		
	
		
			
			|  |  |  | import { Component, Vue, Prop, Emit } from 'vue-property-decorator' | 
		
	
		
			
			|  |  |  | import Combat from './components/Combat.vue' | 
		
	
		
			
			|  |  |  | import Header from './components/Header.vue' | 
		
	
		
			
			|  |  |  | import * as Creatures from '@/game/creatures' | 
		
	
	
		
			
				|  |  | @@ -18,14 +18,35 @@ import { Encounter } from './game/combat' | 
		
	
		
			
			|  |  |  | @Component({ | 
		
	
		
			
			|  |  |  | components: { | 
		
	
		
			
			|  |  |  | Combat, Header | 
		
	
		
			
			|  |  |  | }, | 
		
	
		
			
			|  |  |  | data () { | 
		
	
		
			
			|  |  |  | return { | 
		
	
		
			
			|  |  |  | encounter: null, | 
		
	
		
			
			|  |  |  | encounters: null | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | }) | 
		
	
		
			
			|  |  |  | export default class App extends Vue { | 
		
	
		
			
			|  |  |  | encounter: Encounter | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | constructor () { | 
		
	
		
			
			|  |  |  | super() | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | @Emit('selectEncounter') | 
		
	
		
			
			|  |  |  | selectEncounter (encounter: Encounter) { | 
		
	
		
			
			|  |  |  | this.$data.encounter = encounter | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | created () { | 
		
	
		
			
			|  |  |  | this.$data.encounters = [] | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | this.$data.encounters.push(new Encounter({ name: 'Boss Fight' }, this.makeParty().concat([new Creatures.Withers(), new Creatures.Kenzie()]))) | 
		
	
		
			
			|  |  |  | this.$data.encounters.push(new Encounter({ name: 'Cafat' }, this.makeParty().concat([new Creatures.Cafat(), new Creatures.Wolf()]))) | 
		
	
		
			
			|  |  |  | this.$data.encounters.push(new Encounter({ name: 'Dragon' }, this.makeParty().concat([new Creatures.Dragon()]))) | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | this.$data.encounter = this.$data.encounters[0] | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | makeParty (): Creature[] { | 
		
	
		
			
			|  |  |  | const fighter = new Creatures.Human(new ProperNoun("Redgar"), MalePronouns, { | 
		
	
		
			
			|  |  |  | stats: { | 
		
	
		
			
			|  |  |  | Toughness: 20, | 
		
	
	
		
			
				|  |  | @@ -71,14 +92,7 @@ export default class App extends Vue { | 
		
	
		
			
			|  |  |  | cleric.title = "Lv. 5 Cleric" | 
		
	
		
			
			|  |  |  | cleric.items.push(Items.Mace) | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | const withers = new Creatures.Withers() | 
		
	
		
			
			|  |  |  | const kenzie = new Creatures.Kenzie() | 
		
	
		
			
			|  |  |  | const cafat = new Creatures.Cafat() | 
		
	
		
			
			|  |  |  | const wolf = new Creatures.Wolf() | 
		
	
		
			
			|  |  |  | const dragon = new Creatures.Dragon() | 
		
	
		
			
			|  |  |  | const combatants = [fighter, wizard, rogue, cleric, withers, kenzie, cafat, wolf, dragon] | 
		
	
		
			
			|  |  |  | this.encounter = new Encounter(combatants) | 
		
	
		
			
			|  |  |  | console.log(this.encounter) | 
		
	
		
			
			|  |  |  | return [fighter, cleric, rogue, wizard] | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | </script> | 
		
	
	
		
			
				|  |  | 
 |