|
|
@@ -3,7 +3,7 @@ |
|
|
<Header /> |
|
|
<Header /> |
|
|
<div id="main-area"> |
|
|
<div id="main-area"> |
|
|
<transition name="component-fade" mode='out-in'> |
|
|
<transition name="component-fade" mode='out-in'> |
|
|
<component @leaveCombat="world.encounter = null" v-bind:is="mode" :world="world" :encounter="world.encounter" /> |
|
|
|
|
|
|
|
|
<component @profile="profileOn = true" @exit="profileOn = false" @leaveCombat="world.encounter = null" v-bind:is="mode" :world="world" :encounter="world.encounter" /> |
|
|
</transition> |
|
|
</transition> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@@ -11,9 +11,10 @@ |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { Component, Vue, Prop, Emit } 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 Header from './components/Header.vue' |
|
|
|
|
|
import Combat from './components/Combat.vue' |
|
|
import Explore from './components/Explore.vue' |
|
|
import Explore from './components/Explore.vue' |
|
|
|
|
|
import Profile from './components/Profile.vue' |
|
|
import * as Creatures from '@/game/creatures' |
|
|
import * as Creatures from '@/game/creatures' |
|
|
import * as Items from '@/game/items' |
|
|
import * as Items from '@/game/items' |
|
|
import { Creature } from '@/game/creature' |
|
|
import { Creature } from '@/game/creature' |
|
|
@@ -27,11 +28,12 @@ import { Town } from './game/maps/town' |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
components: { |
|
|
components: { |
|
|
Combat, Header, Explore |
|
|
|
|
|
|
|
|
Combat, Header, Explore, Profile |
|
|
}, |
|
|
}, |
|
|
data () { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
world: null, |
|
|
world: null, |
|
|
|
|
|
profileOn: false, |
|
|
props: { |
|
|
props: { |
|
|
Explore: { |
|
|
Explore: { |
|
|
world: this |
|
|
world: this |
|
|
@@ -47,7 +49,13 @@ export default class App extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
get mode () { |
|
|
get mode () { |
|
|
return this.$data.world.encounter === null ? "Explore" : "Combat" |
|
|
|
|
|
|
|
|
if (this.$data.world.encounter !== null) { |
|
|
|
|
|
return "Combat" |
|
|
|
|
|
} else if (this.$data.profileOn) { |
|
|
|
|
|
return "Profile" |
|
|
|
|
|
} else { |
|
|
|
|
|
return "Explore" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Emit('startFight') |
|
|
@Emit('startFight') |
|
|
|