diff --git a/src/App.vue b/src/App.vue
index 06a7008..0491f56 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,8 +1,8 @@
-
-
-
+
+
+
@@ -15,8 +15,10 @@ import * as Creatures from '@/game/creatures'
import * as Items from '@/game/items'
import { Creature } from '@/game/creature'
import { ProperNoun, TheyPronouns, FemalePronouns, MalePronouns, ImproperNoun, POV } from '@/game/language'
-import { Place, Direction, World } from '@/game/world'
-import { Encounter } from './game/combat'
+import { Place, Direction, World, Choice } from '@/game/world'
+import { Encounter, Side } from './game/combat'
+import { LogLine, nilLog } from './game/interface'
+import { InstantKillEffect } from './game/combat/effects'
@Component({
components: {
@@ -26,7 +28,8 @@ import { Encounter } from './game/combat'
return {
encounter: null,
encounters: null,
- world: null
+ world: null,
+ mode: 'explore'
}
}
})
@@ -35,9 +38,10 @@ export default class App extends Vue {
super()
}
- @Emit('selectEncounter')
- selectEncounter (encounter: Encounter) {
+ @Emit('startFight')
+ startFight (encounter: Encounter) {
this.$data.encounter = encounter
+ this.$data.mode = 'combat'
}
created () {
@@ -51,16 +55,29 @@ export default class App extends Vue {
this.$data.encounter = this.$data.encounters[0]
- const foo = new Place('Foo', 'A very foo-y place')
- const other = new Place('Bar', 'The bar')
- foo.biconnect(Direction.North, other)
+ const home = new Place('Home', 'This is not not home')
- const something = new Place('Baz', 'Despacito 3')
- foo.biconnect(Direction.East, something)
+ const street = new Place('Street', 'The street')
+ home.biconnect(Direction.North, street)
+
+ this.$data.encounters.forEach((encounter: Encounter) => home.choices.push(new Choice(
+ encounter.desc.name,
+ 'Fight time!',
+ (world, executor) => {
+ this.startFight(
+ encounter
+ )
+ return nilLog
+ }
+ )))
+
+ const bar = new Place('Bar', 'This is the bar')
+ street.biconnect(Direction.East, bar)
const player = new Creatures.Wolf()
player.perspective = POV.Second
- player.location = foo
+ player.side = Side.Heroes
+ player.location = home
this.$data.world = new World(player)
}
diff --git a/src/components/ChoiceButton.vue b/src/components/ChoiceButton.vue
new file mode 100644
index 0000000..d34024f
--- /dev/null
+++ b/src/components/ChoiceButton.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
diff --git a/src/components/Explore.vue b/src/components/Explore.vue
index 69c8a93..fe65ad9 100644
--- a/src/components/Explore.vue
+++ b/src/components/Explore.vue
@@ -4,18 +4,20 @@
-
{{ world.time.format("MMMM Do YYYY") }}
-
{{ world.time.format("h:mm:ss A")}}
+
{{ world.time.format("MMMM Do yyy") }}
+
{{ world.time.format("h:mm A")}}
+
{{ location.name }}
{{ location.desc }}
-
@@ -25,10 +27,18 @@
import { Component, Prop, Vue } from 'vue-property-decorator'
import { Direction, World, Place } from '@/game/world'
import NavButton from './NavButton.vue'
+import ChoiceButton from './ChoiceButton.vue'
+import Statblock from './Statblock.vue'
+import { LogEntry } from '@/game/interface'
@Component({
components: {
- NavButton
+ NavButton, ChoiceButton, Statblock
+ },
+ data () {
+ return {
+ directions: Direction
+ }
}
})
@@ -49,6 +59,27 @@ export default class Explore extends Vue {
'--nav-direction': dir
}
}
+
+ writeLog (entry: LogEntry) {
+ const log = this.$el.querySelector(".explore-log")
+ if (log !== null) {
+ const before = log.querySelector("div.log-entry")
+ const holder = document.createElement("div")
+ holder.classList.add("log-entry")
+
+ entry.render().forEach(element => {
+ holder.appendChild(element)
+ })
+
+ holder.classList.add("left-move")
+ const hline = document.createElement("div")
+ hline.classList.add("log-separator")
+ log.insertBefore(hline, before)
+ log.insertBefore(holder, hline)
+
+ log.scrollTo({ top: 0, left: 0 })
+ }
+ }
}
@@ -56,21 +87,25 @@ export default class Explore extends Vue {
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 795aff3..1cc6700 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -7,9 +7,6 @@
-
-
-
diff --git a/src/components/NavButton.vue b/src/components/NavButton.vue
index bd1d180..bf5a3fc 100644
--- a/src/components/NavButton.vue
+++ b/src/components/NavButton.vue
@@ -1,6 +1,6 @@