remove unnecessary logs, update upgrade cost after upgrading

This commit is contained in:
2023-03-19 16:10:10 +01:00
parent 6323b530ca
commit 76fb24a948
3 changed files with 9 additions and 4 deletions
+3 -3
View File
@@ -97,7 +97,6 @@ export default defineComponent({
adventurer.busy = false; adventurer.busy = false;
} }
missive.adventurers = []; missive.adventurers = [];
console.log(missive.rank, missive.rank.toString(), missive.id)
delete this.missives[missive.rank.toString() as QuestRank][missive.id]; delete this.missives[missive.rank.toString() as QuestRank][missive.id];
}, },
getRandomQuest(rank: QuestRank): Quest | null { getRandomQuest(rank: QuestRank): Quest | null {
@@ -115,7 +114,7 @@ export default defineComponent({
this.missives[rank][newId] = quest; this.missives[rank][newId] = quest;
}, },
saveGame() { saveGame() {
console.debug("Saving game...") console.debug("Saving game...");
window.localStorage.setItem("savedGame", JSON.stringify({ window.localStorage.setItem("savedGame", JSON.stringify({
guild: this.guild, guild: this.guild,
adventurers: this.adventurers, adventurers: this.adventurers,
@@ -126,7 +125,8 @@ export default defineComponent({
const rawData = window.localStorage.getItem("savedGame"); const rawData = window.localStorage.getItem("savedGame");
if (!rawData) return; if (!rawData) return;
const saveData = JSON.parse(rawData); const saveData = JSON.parse(rawData);
this.guild = saveData.guild;
this.guild = new Guild(saveData.guild.level, saveData.guild.gold);
const adventurers = {} as { [key: string]: Adventurer }; const adventurers = {} as { [key: string]: Adventurer };
+4
View File
@@ -17,6 +17,10 @@ export class Guild {
this.level += 1; this.level += 1;
if (this.level > 7) { if (this.level > 7) {
this.displayUpgradeCost = "Max level"; this.displayUpgradeCost = "Max level";
} else {
const newCost = this.getUpgradeCost();
if (newCost === null) return;
this.displayUpgradeCost = newCost;
} }
} }
+2 -1
View File
@@ -52,7 +52,7 @@ export default defineComponent({
}, },
allAdventurers: { allAdventurers: {
type: Object as PropType<{[key: string]: Adventurer}>, type: Object as PropType<{[key: string]: Adventurer}>,
} },
}, },
methods: { methods: {
print(a:string) { print(a:string) {
@@ -77,6 +77,7 @@ export default defineComponent({
gap: 0.5rem; gap: 0.5rem;
padding: 0.5rem; padding: 0.5rem;
background-color: rgba(0,0,0, 0.2); background-color: rgba(0,0,0, 0.2);
z-index: 2;
.slot { .slot {
width: 5rem; width: 5rem;
height: 5rem; height: 5rem;