From 969f031e0beae20010751ec63c328e7b4ebb2c43 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 15 Oct 2020 14:18:05 -0400 Subject: [PATCH] Clear the log when traveling --- src/components/Explore.vue | 10 +++++++++- src/game/combat/tests.ts | 2 +- src/game/maps/town.ts | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/Explore.vue b/src/components/Explore.vue index 68c421c..a31382c 100644 --- a/src/components/Explore.vue +++ b/src/components/Explore.vue @@ -23,7 +23,7 @@

{{ location.desc }}

- +
@@ -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) { const log = this.$el.querySelector(".explore-log") if (log !== null) { diff --git a/src/game/combat/tests.ts b/src/game/combat/tests.ts index 895f7f9..3bf9e7e 100644 --- a/src/game/combat/tests.ts +++ b/src/game/combat/tests.ts @@ -49,7 +49,7 @@ export class OpposedStatScorer implements Scorer { }) ), 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)}` ) ) } diff --git a/src/game/maps/town.ts b/src/game/maps/town.ts index 331868b..7bc74d9 100644 --- a/src/game/maps/town.ts +++ b/src/game/maps/town.ts @@ -1,5 +1,5 @@ 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 * as Creatures from '../creatures' import * as Items from '../items' @@ -66,7 +66,7 @@ function makeParty (): Creature[] { export const Town = (): Place => { const home = new Place( - new ProperNoun('Your home'), + new ProperNoun("Home"), "A very home-y place" )