ソースを参照

Clear the log when traveling

master
Fen Dweller 5年前
コミット
969f031e0b
3個のファイルの変更12行の追加4行の削除
  1. +9
    -1
      src/components/Explore.vue
  2. +1
    -1
      src/game/combat/tests.ts
  3. +2
    -2
      src/game/maps/town.ts

+ 9
- 1
src/components/Explore.vue ファイルの表示

@@ -23,7 +23,7 @@
<p class="location-desc">{{ location.desc }}</p>
</div>
<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 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" />
@@ -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) {


+ 1
- 1
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)}`
)
)
}


+ 2
- 2
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"
)



読み込み中…
キャンセル
保存