| @@ -19,6 +19,7 @@ import { Place, Direction, World, Choice } from '@/game/world' | |||||
| import { Encounter, Side } from './game/combat' | import { Encounter, Side } from './game/combat' | ||||
| import { LogLine, nilLog } from './game/interface' | import { LogLine, nilLog } from './game/interface' | ||||
| import { InstantKillEffect } from './game/combat/effects' | import { InstantKillEffect } from './game/combat/effects' | ||||
| import moment from 'moment' | |||||
| @Component({ | @Component({ | ||||
| components: { | components: { | ||||
| @@ -199,7 +199,6 @@ export default class Combat extends Vue { | |||||
| const pos = (element.offsetLeft - element.parentElement.offsetLeft) | const pos = (element.offsetLeft - element.parentElement.offsetLeft) | ||||
| const width = element.getBoundingClientRect().width / 2 | const width = element.getBoundingClientRect().width / 2 | ||||
| const offset = element.parentElement.getBoundingClientRect().width / 2 | const offset = element.parentElement.getBoundingClientRect().width / 2 | ||||
| console.log(pos, offset) | |||||
| element.parentElement.scrollTo({ left: pos + width - offset, behavior: "smooth" }) | element.parentElement.scrollTo({ left: pos + width - offset, behavior: "smooth" }) | ||||
| } | } | ||||
| @@ -4,8 +4,8 @@ | |||||
| </div> | </div> | ||||
| <div class="explore-worldinfo"> | <div class="explore-worldinfo"> | ||||
| <p class="worldinfo-date">{{ world.time.format("MMMM Do yyy") }}</p> | |||||
| <p class="worldinfo-time">{{ world.time.format("h:mm A")}}</p> | |||||
| <p class="worldinfo-date">{{ world.time.format("MMMM Do Y") }}</p> | |||||
| <p class="worldinfo-date">{{ world.time.format("hh:mm:ss a") }}</p> | |||||
| </div> | </div> | ||||
| <Statblock :subject="world.player" :initiative="0" /> | <Statblock :subject="world.player" :initiative="0" /> | ||||
| <div class="explore-info"> | <div class="explore-info"> | ||||
| @@ -13,8 +13,8 @@ | |||||
| <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="location.connections[direction].travel(world.player, world)" v-for="direction in Object.keys(location.connections)" :key="direction" :style="navBtnCss(direction)" :location="location" :direction="direction" /> | |||||
| <div class="nav-filler" :Style="navBtnCss(direction)" v-for="direction in Object.keys(directions)" :key="direction"></div> | |||||
| <NavButton @click.native="location.connections[direction].travel(world, world.player)" v-for="direction in Object.keys(location.connections)" :key="direction" :style="navBtnCss(direction)" :location="location" :direction="direction" /> | |||||
| <div class="nav-filler" :Style="navBtnCss(direction)" v-for="direction in Object.keys(directions)" :key="direction + '-filler'"></div> | |||||
| </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" /> | ||||
| @@ -147,6 +147,8 @@ export default class Explore extends Vue { | |||||
| "Southwest South Southeast"; | "Southwest South Southeast"; | ||||
| grid-template-rows: 1fr 1fr 1fr; | grid-template-rows: 1fr 1fr 1fr; | ||||
| grid-template-columns: 1fr 1fr 1fr; | grid-template-columns: 1fr 1fr 1fr; | ||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | } | ||||
| .nav-filler { | .nav-filler { | ||||
| @@ -128,7 +128,6 @@ export default class Statblock extends Vue { | |||||
| icons.map(elem => { | icons.map(elem => { | ||||
| const tooltip = elem.querySelector(".tooltip-template") as HTMLElement | const tooltip = elem.querySelector(".tooltip-template") as HTMLElement | ||||
| console.log(elem, tooltip) | |||||
| return tippy(elem, { | return tippy(elem, { | ||||
| content: tooltip | content: tooltip | ||||
| @@ -22,7 +22,6 @@ class StompAttack extends AttackAction { | |||||
| const targetResult = target.takeDamage(damage) | const targetResult = target.takeDamage(damage) | ||||
| const ownResult = this.successLine(user, target, { damage: damage }) | const ownResult = this.successLine(user, target, { damage: damage }) | ||||
| const effResult = target.applyEffect(new StunEffect(3)) | const effResult = target.applyEffect(new StunEffect(3)) | ||||
| console.log(target.effects) | |||||
| return new LogLines(ownResult, targetResult, effResult) | return new LogLines(ownResult, targetResult, effResult) | ||||
| } else { | } else { | ||||
| return this.failLine(user, target) | return this.failLine(user, target) | ||||
| @@ -47,7 +47,7 @@ export class Connection { | |||||
| } | } | ||||
| travel (traveler: Creature, world: World) { | |||||
| travel (world: World, traveler: Creature) { | |||||
| world.advance(moment.duration(5, "minutes")) | world.advance(moment.duration(5, "minutes")) | ||||
| traveler.location = this.dst | traveler.location = this.dst | ||||
| } | } | ||||