|
|
|
@@ -3,7 +3,7 @@ |
|
|
|
<Header /> |
|
|
|
<div id="main-area"> |
|
|
|
<transition name="component-fade" mode='out-in'> |
|
|
|
<component @leaveCombat="mode = 'Explore'" v-bind:is="mode" :world="world" :encounter="encounter" /> |
|
|
|
<component @leaveCombat="world.encounter = null" v-bind:is="mode" :world="world" :encounter="world.encounter" /> |
|
|
|
</transition> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@@ -23,6 +23,7 @@ import { Encounter, Side } from './game/combat' |
|
|
|
import { LogLine, nilLog } from './game/interface' |
|
|
|
import { InstantKillEffect } from './game/combat/effects' |
|
|
|
import moment from 'moment' |
|
|
|
import { Town } from './game/maps/town' |
|
|
|
|
|
|
|
@Component({ |
|
|
|
components: { |
|
|
|
@@ -30,9 +31,7 @@ import moment from 'moment' |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
encounter: null, |
|
|
|
world: null, |
|
|
|
mode: 'explore', |
|
|
|
props: { |
|
|
|
Explore: { |
|
|
|
world: this |
|
|
|
@@ -41,15 +40,19 @@ import moment from 'moment' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
export default class App extends Vue { |
|
|
|
constructor () { |
|
|
|
super() |
|
|
|
} |
|
|
|
|
|
|
|
get mode () { |
|
|
|
return this.$data.world.encounter === null ? "Explore" : "Combat" |
|
|
|
} |
|
|
|
|
|
|
|
@Emit('startFight') |
|
|
|
startFight (encounter: Encounter) { |
|
|
|
this.$data.encounter = encounter |
|
|
|
this.$data.mode = 'Combat' |
|
|
|
this.$data.world.encounter = encounter |
|
|
|
} |
|
|
|
|
|
|
|
created () { |
|
|
|
@@ -57,34 +60,9 @@ export default class App extends Vue { |
|
|
|
player.perspective = POV.Second |
|
|
|
player.side = Side.Heroes |
|
|
|
|
|
|
|
const bonusBosses = [] |
|
|
|
bonusBosses.push(new Encounter({ name: 'Boss Fight' }, this.makeParty().concat([new Creatures.Withers(), new Creatures.Kenzie()]))) |
|
|
|
bonusBosses.push(new Encounter({ name: 'Cafat' }, this.makeParty().concat([new Creatures.Cafat()]))) |
|
|
|
bonusBosses.push(new Encounter({ name: 'Large Wah' }, this.makeParty().concat([new Creatures.Shingo()]))) |
|
|
|
bonusBosses.push(new Encounter({ name: 'Goldeneye' }, this.makeParty().concat([new Creatures.Goldeneye()]))) |
|
|
|
|
|
|
|
const home = new Place(new ProperNoun('your home'), 'This is not not home') |
|
|
|
|
|
|
|
const street = new Place(new ImproperNoun('street'), 'The street') |
|
|
|
const bosses = new Place(new ProperNoun('The Boss Zone'), 'Death time lmao') |
|
|
|
home.biconnect(Direction.North, street) |
|
|
|
street.biconnect(Direction.West, bosses) |
|
|
|
|
|
|
|
bonusBosses.forEach((encounter: Encounter) => bosses.choices.push(new Choice( |
|
|
|
encounter.desc.name, |
|
|
|
'Fight time!', |
|
|
|
(world, executor) => { |
|
|
|
this.startFight( |
|
|
|
encounter |
|
|
|
) |
|
|
|
return nilLog |
|
|
|
} |
|
|
|
))) |
|
|
|
|
|
|
|
const bar = new Place(new ProperNoun('Dave\'s Bar'), 'This is the bar') |
|
|
|
street.biconnect(Direction.East, bar) |
|
|
|
player.location = home |
|
|
|
this.$data.world = new World(player) |
|
|
|
|
|
|
|
player.location = Town() |
|
|
|
} |
|
|
|
|
|
|
|
makeParty (): Creature[] { |
|
|
|
|