| @@ -23,7 +23,7 @@ | |||||
| <p class="location-desc">{{ location.desc }}</p> | <p class="location-desc">{{ location.desc }}</p> | ||||
| </div> | </div> | ||||
| <div class="explore-nav"> | <div class="explore-nav"> | ||||
| <NavButton @click.native="writeLog(location.connections[direction].travel(world, world.player))" v-for="direction in Object.keys(directions).filter(dir => Object.keys(location.connections).includes(dir))" :key="direction" :style="navBtnCss(direction)" :location="location" :direction="direction" /> | |||||
| <NavButton @click.native="clearLog(); writeLog(location.connections[direction].travel(world, world.player))" v-for="direction in Object.keys(directions).filter(dir => Object.keys(location.connections).includes(dir))" :key="direction" :style="navBtnCss(direction)" :location="location" :direction="direction" /> | |||||
| </div> | </div> | ||||
| <div class="explore-choices"> | <div class="explore-choices"> | ||||
| <ChoiceButton @click.native="writeLog(choice.execute(world, world.player))" v-for="(choice, index) in location.choices.filter(choice => choice.visible(world))" :key="'choice' + index" :choice="choice" :world="world" /> | <ChoiceButton @click.native="writeLog(choice.execute(world, world.player))" v-for="(choice, index) in location.choices.filter(choice => choice.visible(world))" :key="'choice' + index" :choice="choice" :world="world" /> | ||||
| @@ -71,6 +71,14 @@ export default class Explore extends Vue { | |||||
| } | } | ||||
| } | } | ||||
| clearLog () { | |||||
| const log = this.$el.querySelector(".explore-log") | |||||
| if (log !== null) { | |||||
| log.innerHTML = "" | |||||
| } | |||||
| } | |||||
| writeLog (entry: LogEntry) { | writeLog (entry: LogEntry) { | ||||
| const log = this.$el.querySelector(".explore-log") | const log = this.$el.querySelector(".explore-log") | ||||
| if (log !== null) { | if (log !== null) { | ||||
| @@ -49,7 +49,7 @@ export class OpposedStatScorer implements Scorer { | |||||
| }) | }) | ||||
| ), | ), | ||||
| new LogLine( | new LogLine( | ||||
| `Score delta: ${this.computeScore(user, this.userStats) - this.computeScore(target, this.targetStats)}` | |||||
| `Score delta: ${(this.computeScore(user, this.userStats) - this.computeScore(target, this.targetStats)).toFixed(1)}` | |||||
| ) | ) | ||||
| ) | ) | ||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| import { Place, Choice, Direction, World } from '../world' | import { Place, Choice, Direction, World } from '../world' | ||||
| import { ProperNoun, ImproperNoun, MalePronouns, FemalePronouns, TheyPronouns } from '../language' | |||||
| import { ProperNoun, ImproperNoun, MalePronouns, FemalePronouns, TheyPronouns, LiveText } from '../language' | |||||
| import { Encounter, Stat, Damage, DamageType, Vigor, Side } from '../combat' | import { Encounter, Stat, Damage, DamageType, Vigor, Side } from '../combat' | ||||
| import * as Creatures from '../creatures' | import * as Creatures from '../creatures' | ||||
| import * as Items from '../items' | import * as Items from '../items' | ||||
| @@ -66,7 +66,7 @@ function makeParty (): Creature[] { | |||||
| export const Town = (): Place => { | export const Town = (): Place => { | ||||
| const home = new Place( | const home = new Place( | ||||
| new ProperNoun('Your home'), | |||||
| new ProperNoun("Home"), | |||||
| "A very home-y place" | "A very home-y place" | ||||
| ) | ) | ||||