add quest exp modifier upgrade

This commit is contained in:
2023-04-23 15:22:40 +02:00
parent 3b47ed1bed
commit 40d5a876b8
6 changed files with 67 additions and 11 deletions
+26 -3
View File
@@ -3,6 +3,7 @@
<h2>Upgrades</h2>
<div class="upgrade">
<span>Adventurer capacity (level {{ guild.adventurerCapacity.level }})</span>
<small>Increases the maximum amount of recruited adventurers</small>
<button
class="button metal"
v-if="guild.adventurerCapacity.nextLevelCost"
@@ -12,6 +13,18 @@
Upgrade ({{ formatGold(guild.adventurerCapacity.nextLevelCost) }} gold)
</button>
</div>
<div class="upgrade" v-if="guild.level >= guild.expModifier.guildLevelRequirement">
<span>Quest exp modifier (level {{ guild.expModifier.level }})</span>
<small>Increases exp from newly offered quests by 10% per level</small>
<button
class="button metal"
v-if="guild.expModifier.nextLevelCost"
:disabled="guild.gold < guild.expModifier.nextLevelCost"
@click="upgradeQuestExpModifier()"
>
Upgrade ({{ formatGold(guild.expModifier.nextLevelCost) }} gold)
</button>
</div>
</section>
</template>
@@ -39,7 +52,14 @@ export default defineComponent({
if (this.guild.gold < this.guild.adventurerCapacity.nextLevelCost) return;
this.guild.gold -= this.guild.adventurerCapacity.nextLevelCost;
this.guild.adventurerCapacity.upgrade();
}
},
upgradeQuestExpModifier(): void {
if (!this.guild.expModifier) return;
if (!this.guild.expModifier.nextLevelCost) return;
if (this.guild.gold < this.guild.expModifier.nextLevelCost) return;
this.guild.gold -= this.guild.expModifier.nextLevelCost;
this.guild.expModifier.upgrade();
},
}
});
</script>
@@ -63,12 +83,15 @@ export default defineComponent({
font-size: 1.25rem;
font-weight: bold;
display: flex;
flex-direction: row;
flex-wrap: wrap;
flex-direction: column;
width: min(25rem, 100%);
justify-content: center;
align-items: center;
gap: 0.2rem;
small {
font-weight: normal;
line-height: 1;
}
}
}
</style>