hook in data sources for adventurers and quests,

programatically generate quest rewards,
change damage math,
This commit is contained in:
2023-03-25 14:42:17 +01:00
parent 9ac13c4cae
commit c71eeda11f
13 changed files with 163 additions and 32 deletions
+6 -8
View File
@@ -44,6 +44,7 @@ import type {PropType} from "vue";
import {defineComponent} from "vue";
import AdventurerTile from "@/components/AdventurerTile.vue";
import {Adventurer} from "@/classes/Adventurer";
import { loadAdventurersForHire } from "@/GameData";
export default defineComponent({
name: "RecruitView",
@@ -51,13 +52,7 @@ export default defineComponent({
data: () => {
return {
currentlyForHire: null as Adventurer|null,
adventurersForHire: [
new Adventurer("rincewind-diskworld", "Rincewind", "/img/adventurers/rincewind.png", 2),
new Adventurer("fran-sword-isekai", "Fran", "/img/adventurers/fran.png", 3),
new Adventurer("kazuma-konosuba", "Kazuma", "/img/adventurers/kazuma.png", 2),
new Adventurer("rein-beast-tamer", "Rein", "/img/adventurers/rein.png", 2),
new Adventurer("momon-overlord", "Momon", "/img/adventurers/momon.png", 2),
] as Array<Adventurer>,
adventurersForHire: [] as Array<Adventurer>,
}
},
props: {
@@ -109,7 +104,10 @@ export default defineComponent({
window.localStorage.removeItem("currentlyForHire");
}
},
mounted() {
async mounted() {
this.adventurersForHire = await loadAdventurersForHire();
if (Object.keys(this.adventurers).length <= 0) {
this.currentlyForHire = this.adventurersForHire[0];
window.localStorage.setItem("currentlyForHire", this.adventurersForHire[0].id);