Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c569a1110c | |||
| 56407505ea | |||
| 5e4a78530a | |||
| 7be4d2b9ca | |||
| eb4b0fba00 | |||
| 3f22b4511d | |||
| 6f777332a4 | |||
| 101ea0ffb5 | |||
| af11324fb7 | |||
| 6903774f97 | |||
| 1a9d2d0d9f | |||
| 359abd3ab4 | |||
| 1a3a493df4 | |||
| 0890efd1ec | |||
| 5b4278cf30 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "adventurers-guild",
|
"name": "adventurers-guild",
|
||||||
"version": "0.1.0",
|
"version": "0.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 406 KiB |
|
After Width: | Height: | Size: 470 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 474 KiB |
|
After Width: | Height: | Size: 130 KiB |
@@ -14,10 +14,10 @@ import {RouterLink, RouterView} from 'vue-router'</script>
|
|||||||
:guild="guild"
|
:guild="guild"
|
||||||
:adventurers="adventurers"
|
:adventurers="adventurers"
|
||||||
:quests="missives"
|
:quests="missives"
|
||||||
:lastRecruitTime="lastRecruitHandled"
|
:adventurerForHire="adventurerForHire"
|
||||||
@finalizeQuest="finalizeQuest($event)"
|
@finalizeQuest="finalizeQuest($event)"
|
||||||
@wipeSave="resetSave()"
|
@wipeSave="resetSave()"
|
||||||
@recruitActionTaken="lastRecruitHandled = Number(new Date())"
|
@recruitActionTaken="recruitAction($event)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -27,9 +27,10 @@ import {Adventurer} from "@/classes/Adventurer";
|
|||||||
import {getQuestWithRewards, Quest} from "@/classes/Quest";
|
import {getQuestWithRewards, Quest} from "@/classes/Quest";
|
||||||
import {Guild} from "@/classes/Guild";
|
import {Guild} from "@/classes/Guild";
|
||||||
import {getFromString, QuestRank} from "@/classes/QuestRank";
|
import {getFromString, QuestRank} from "@/classes/QuestRank";
|
||||||
import {GameData, loadAvailableQuests, loadGame, saveGame} from "@/GameData";
|
import {GameData, loadAdventurersForHire, loadAvailableQuests, loadGame, saveGame} from "@/GameData";
|
||||||
import type {GuildUpgrade} from "@/classes/GuildUpgrade";
|
import type {GuildUpgrade} from "@/classes/GuildUpgrade";
|
||||||
import {AdventurerCapacityUpgrade} from "@/classes/guildUpgrades/AdventurerCapacityUpgrade";
|
import {AdventurerCapacityUpgrade} from "@/classes/guildUpgrades/AdventurerCapacityUpgrade";
|
||||||
|
import {getNewAdventurerForHire} from "@/classes/Recruitment";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "GuildView",
|
name: "GuildView",
|
||||||
@@ -45,6 +46,8 @@ export default defineComponent({
|
|||||||
F: null as null|number,
|
F: null as null|number,
|
||||||
} as { [key: string]: null|number },
|
} as { [key: string]: null|number },
|
||||||
lastRecruitHandled: null as null|number,
|
lastRecruitHandled: null as null|number,
|
||||||
|
adventurerForHire: null as Adventurer|null,
|
||||||
|
adventurersDatabase: {} as Array<Adventurer>,
|
||||||
adventurers: {} as { [key: string]: Adventurer },
|
adventurers: {} as { [key: string]: Adventurer },
|
||||||
quests: {} as { [key: string]: { [key: string]: Quest } },
|
quests: {} as { [key: string]: { [key: string]: Quest } },
|
||||||
missives: {
|
missives: {
|
||||||
@@ -77,6 +80,28 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
async checkForNewRecruit(currentTimestamp: number) {
|
||||||
|
if (this.lastRecruitHandled === null) {
|
||||||
|
this.lastRecruitHandled = 0;
|
||||||
|
}
|
||||||
|
if (currentTimestamp - this.lastRecruitHandled >= 1000 * 60 * 30 && this.adventurerForHire === null) {
|
||||||
|
this.adventurerForHire = getNewAdventurerForHire(this.adventurersDatabase);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
recruitAction(adventurer: Adventurer|null): void {
|
||||||
|
this.lastRecruitHandled = Number(new Date());
|
||||||
|
this.adventurerForHire = null;
|
||||||
|
if (adventurer === null) return;
|
||||||
|
|
||||||
|
this.adventurers[adventurer.id] = adventurer;
|
||||||
|
for (const id in this.adventurersDatabase) {
|
||||||
|
const databaseAdventurer = this.adventurersDatabase[id];
|
||||||
|
if (databaseAdventurer.id === adventurer.id) {
|
||||||
|
this.adventurersDatabase.splice(Number(id), 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
finalizeQuest(missive: Quest) {
|
finalizeQuest(missive: Quest) {
|
||||||
missive.progressPoints = 0;
|
missive.progressPoints = 0;
|
||||||
this.guild.gold += missive.goldReward;
|
this.guild.gold += missive.goldReward;
|
||||||
@@ -134,6 +159,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
this.adventurers = adventurers;
|
this.adventurers = adventurers;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const missives = {} as { [key: string]: { [key: string]: Quest } };
|
const missives = {} as { [key: string]: { [key: string]: Quest } };
|
||||||
|
|
||||||
for (const id in saveData.missives) {
|
for (const id in saveData.missives) {
|
||||||
@@ -153,6 +180,21 @@ export default defineComponent({
|
|||||||
this.missives = missives;
|
this.missives = missives;
|
||||||
|
|
||||||
this.lastRecruitHandled = saveData.lastRecruitAction ?? 0;
|
this.lastRecruitHandled = saveData.lastRecruitAction ?? 0;
|
||||||
|
|
||||||
|
if (Object.keys(this.adventurers).length <= 0) {
|
||||||
|
this.adventurerForHire = this.adventurersDatabase[0];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveData.currentlyForHireId !== null) {
|
||||||
|
for (const id in this.adventurersDatabase) {
|
||||||
|
const adventurer = this.adventurersDatabase[id];
|
||||||
|
if (adventurer.id === saveData.currentlyForHireId) {
|
||||||
|
this.adventurerForHire = adventurer;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
resetSave() {
|
resetSave() {
|
||||||
if (!confirm("You are about to wipe your save file. Are you sure?")) return;
|
if (!confirm("You are about to wipe your save file. Are you sure?")) return;
|
||||||
@@ -163,6 +205,7 @@ export default defineComponent({
|
|||||||
async mounted() {
|
async mounted() {
|
||||||
this.loadGame();
|
this.loadGame();
|
||||||
this.quests = await loadAvailableQuests();
|
this.quests = await loadAvailableQuests();
|
||||||
|
this.adventurersDatabase = await loadAdventurersForHire(Object.keys(this.adventurers));
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
saveGame(new GameData(
|
saveGame(new GameData(
|
||||||
@@ -170,7 +213,8 @@ export default defineComponent({
|
|||||||
this.adventurers,
|
this.adventurers,
|
||||||
this.missives,
|
this.missives,
|
||||||
this.lastQuestGot,
|
this.lastQuestGot,
|
||||||
this.lastRecruitHandled
|
this.lastRecruitHandled,
|
||||||
|
this.adventurerForHire?.id ?? null
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}, 10*1000)
|
}, 10*1000)
|
||||||
@@ -180,6 +224,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
const now = Number(new Date());
|
const now = Number(new Date());
|
||||||
|
|
||||||
|
this.checkForNewRecruit(now);
|
||||||
|
|
||||||
for (const id in this.lastQuestGot) {
|
for (const id in this.lastQuestGot) {
|
||||||
const lastTime = this.lastQuestGot[getFromString(id as QuestRank)];
|
const lastTime = this.lastQuestGot[getFromString(id as QuestRank)];
|
||||||
if (lastTime === null) this.lastQuestGot[getFromString(id as QuestRank)] = 0;
|
if (lastTime === null) this.lastQuestGot[getFromString(id as QuestRank)] = 0;
|
||||||
|
|||||||
@@ -9,13 +9,21 @@ export class GameData {
|
|||||||
missives: { [key: string]: { [key: string]: Quest } };
|
missives: { [key: string]: { [key: string]: Quest } };
|
||||||
lastQuestGot: { [key: string]: null | number };
|
lastQuestGot: { [key: string]: null | number };
|
||||||
lastRecruitAction: null | number;
|
lastRecruitAction: null | number;
|
||||||
|
currentlyForHireId: string|null;
|
||||||
|
|
||||||
constructor(guild: Guild, adventurers: { [key: string]: Adventurer }, missives: { [key: string]: { [key: string]: Quest } }, lastQuestGot: { [key: string]: null | number }, lastRecruitAction: null | number) {
|
constructor(
|
||||||
|
guild: Guild, adventurers: { [key: string]: Adventurer },
|
||||||
|
missives: { [key: string]: { [key: string]: Quest } },
|
||||||
|
lastQuestGot: { [key: string]: null | number },
|
||||||
|
lastRecruitAction: null | number,
|
||||||
|
currentlyForHireId: string|null = null
|
||||||
|
) {
|
||||||
this.guild = guild;
|
this.guild = guild;
|
||||||
this.adventurers = adventurers;
|
this.adventurers = adventurers;
|
||||||
this.missives = missives;
|
this.missives = missives;
|
||||||
this.lastQuestGot = lastQuestGot;
|
this.lastQuestGot = lastQuestGot;
|
||||||
this.lastRecruitAction = lastRecruitAction;
|
this.lastRecruitAction = lastRecruitAction;
|
||||||
|
this.currentlyForHireId = currentlyForHireId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,6 +41,7 @@ export function saveGame(
|
|||||||
missives: data.missives,
|
missives: data.missives,
|
||||||
lastQuestGot: data.lastQuestGot,
|
lastQuestGot: data.lastQuestGot,
|
||||||
lastRecruitAction: data.lastRecruitAction,
|
lastRecruitAction: data.lastRecruitAction,
|
||||||
|
adventurerForHireId: data.currentlyForHireId,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
:root {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 0 10rem;
|
|
||||||
min-height: calc(100vh - 10rem);
|
|
||||||
font-family: 'EB Garamond', serif;
|
|
||||||
overflow-y: scroll;
|
|
||||||
user-select: none;
|
|
||||||
background-size: 30%;
|
|
||||||
background: rgba(87, 50, 20, 0.75) url("/img/background/panels/plaster.png") repeat;
|
|
||||||
background-blend-mode: darken;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
:root {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 0 10rem;
|
||||||
|
min-height: calc(100vh - 10rem);
|
||||||
|
font-family: 'EB Garamond', serif;
|
||||||
|
overflow-y: scroll;
|
||||||
|
user-select: none;
|
||||||
|
background-size: 25rem;
|
||||||
|
background-color: rgba(87, 50, 20, 0.45);
|
||||||
|
background-image: url("/img/background/wood/cut_wood_background.png");
|
||||||
|
background-blend-mode: darken;
|
||||||
|
background-repeat: repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
&.pinned-paper {
|
||||||
|
background-image: url("/img/quests/backgrounds/paper.png");
|
||||||
|
position: relative;
|
||||||
|
filter: drop-shadow(-0.15rem 0.2rem 0.1rem rgba(0, 0, 0, 0.25));
|
||||||
|
|
||||||
|
.nail {
|
||||||
|
position: absolute;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
filter: drop-shadow(-0.15rem 0.2rem 0.1rem rgba(0, 0, 0, 0.5));
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.top-left {
|
||||||
|
top: 1rem;
|
||||||
|
left: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.top-right {
|
||||||
|
top: 1rem;
|
||||||
|
right: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.note-paper {
|
||||||
|
background-image: url("/img/background/paper/small_tile_paper.png");
|
||||||
|
position: relative;
|
||||||
|
filter: drop-shadow(-0.15rem 0.2rem 0.1rem rgba(0, 0, 0, 0.25));
|
||||||
|
border-image: url("/img/borders/metal_corner.png") 30 round;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import type {GuildUpgrade} from "@/classes/GuildUpgrade";
|
import type {GuildUpgrade} from "@/classes/GuildUpgrade";
|
||||||
import {AdventurerCapacityUpgrade} from "@/classes/guildUpgrades/AdventurerCapacityUpgrade";
|
import {AdventurerCapacityUpgrade} from "@/classes/guildUpgrades/AdventurerCapacityUpgrade";
|
||||||
|
import formatGold from "@/classes/NumberMagic";
|
||||||
|
|
||||||
export class Guild {
|
export class Guild {
|
||||||
gold: number;
|
gold: number;
|
||||||
@@ -30,7 +31,7 @@ export class Guild {
|
|||||||
} else {
|
} else {
|
||||||
const newCost = this.getUpgradeCost();
|
const newCost = this.getUpgradeCost();
|
||||||
if (newCost === null) return;
|
if (newCost === null) return;
|
||||||
this.displayUpgradeCost = newCost;
|
this.displayUpgradeCost = formatGold(newCost);
|
||||||
this.upgradeCost = newCost;
|
this.upgradeCost = newCost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const formatter = new Intl.NumberFormat('en-US', {
|
||||||
|
maximumFractionDigits: 3,
|
||||||
|
// @ts-ignore - typescript doesn't know about this option for some godforsaken reason
|
||||||
|
notation: "compact",
|
||||||
|
useGrouping: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default function formatGold(number: number): string {
|
||||||
|
return formatter.format(number);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import type {Adventurer} from "@/classes/Adventurer";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a random adventurer from the pool
|
||||||
|
* @param adventurerPool
|
||||||
|
* @returns {Adventurer|null} null if the pool is empty
|
||||||
|
*/
|
||||||
|
export function getNewAdventurerForHire(adventurerPool: Array<Adventurer>): Adventurer|null {
|
||||||
|
if (adventurerPool.length <= 0) return null;
|
||||||
|
const randomId = adventurerPool.length * Math.random() << 0;
|
||||||
|
return adventurerPool[randomId];
|
||||||
|
}
|
||||||
@@ -18,14 +18,15 @@ export default defineComponent({
|
|||||||
name: "AdventurerList",
|
name: "AdventurerList",
|
||||||
components: {AdventurerMiniComponent},
|
components: {AdventurerMiniComponent},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
currentAdventurer: null as Adventurer|null
|
currentAdventurer: null as Adventurer | null
|
||||||
}),
|
}),
|
||||||
props: {
|
props: {
|
||||||
adventurers: {
|
adventurers: {
|
||||||
type: Object as PropType<{[key: string]: Adventurer}>,
|
type: Object as PropType<{ [key: string]: Adventurer }>,
|
||||||
default() {
|
default() {
|
||||||
return {} as {[key: string]: Adventurer};
|
return {} as { [key: string]: Adventurer };
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -39,12 +40,13 @@ export default defineComponent({
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.slot {
|
.slot {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 5rem;
|
width: 5rem;
|
||||||
height: 5rem;
|
height: 5rem;
|
||||||
border: 2px solid #000;
|
border: 2px solid #000;
|
||||||
background-color: rgba(0,0,0, 0.2);
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,12 +65,10 @@ export default defineComponent({
|
|||||||
default() {
|
default() {
|
||||||
return {} as {[key: string]: Adventurer};
|
return {} as {[key: string]: Adventurer};
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
print(a:string) {
|
|
||||||
console.log(a);
|
|
||||||
},
|
|
||||||
closeSelect() {
|
closeSelect() {
|
||||||
this.selection = false;
|
this.selection = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
:title="adventurer.name + (adventurer.busy ? ' (busy)' : '')"
|
:title="adventurer.name + (adventurer.busy ? ' (busy)' : '')"
|
||||||
>
|
>
|
||||||
<img :src="adventurer.portrait" :alt="adventurer.name" draggable="false">
|
<img :src="adventurer.portrait" :alt="adventurer.name" draggable="false">
|
||||||
<div class="level" :title="adventurer.isMaxLevel() ? 'Max level' : ''">{{adventurer.level}}<span v-if="adventurer.isMaxLevel()">⇪</span></div>
|
<div class="level" :title="adventurer.isMaxLevel() ? 'Max level' : ''">{{ adventurer.level }}<span
|
||||||
|
v-if="adventurer.isMaxLevel()">⇪</span></div>
|
||||||
<div class="exp"></div>
|
<div class="exp"></div>
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
||||||
import type {Adventurer} from "@/classes/Adventurer";
|
import type {Adventurer} from "@/classes/Adventurer";
|
||||||
import {defineComponent, type PropType } from "vue";
|
import {defineComponent, type PropType} from "vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "AdventurerTile",
|
name: "AdventurerTile",
|
||||||
@@ -22,6 +23,7 @@ export default defineComponent({
|
|||||||
default() {
|
default() {
|
||||||
return {} as Adventurer;
|
return {} as Adventurer;
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
@@ -49,19 +51,21 @@ export default defineComponent({
|
|||||||
overflow: clip;
|
overflow: clip;
|
||||||
font-size: 5rem;
|
font-size: 5rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
color: rgba(0,0,0, 0.75);
|
color: rgba(0, 0, 0, 0.75);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.level {
|
.level {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
min-width: 1rem;
|
min-width: 1rem;
|
||||||
background-color: rgba(0,0,0, 0.75);
|
background-color: rgba(0, 0, 0, 0.75);
|
||||||
border-bottom-right-radius: 0.2rem;
|
border-bottom-right-radius: 0.2rem;
|
||||||
padding: 0.1rem;
|
padding: 0.1rem;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exp {
|
.exp {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -71,6 +75,7 @@ export default defineComponent({
|
|||||||
background-color: rgba(203, 33, 213, 0.75);
|
background-color: rgba(203, 33, 213, 0.75);
|
||||||
transition: width 1s linear;
|
transition: width 1s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="changelog">
|
<div class="changelog panel pinned-paper">
|
||||||
|
<div class="nail top-left">
|
||||||
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
|
</div>
|
||||||
|
<div class="nail top-right">
|
||||||
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
|
</div>
|
||||||
<h1>Changelog</h1>
|
<h1>Changelog</h1>
|
||||||
<div class="changelog-entry" v-for="release in releases">
|
<div class="changelog-entry" v-for="release in releases">
|
||||||
|
<hr>
|
||||||
<h2>Version {{ release.name }}</h2>
|
<h2>Version {{ release.name }}</h2>
|
||||||
<pre>{{ release.body }}</pre>
|
<pre>{{ release.body }}</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,29 +54,42 @@ export default defineComponent({
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.changelog {
|
.changelog {
|
||||||
padding: 3rem;
|
padding-block: 3rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
max-width: 45rem;
|
max-width: 45rem;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 3rem;
|
font-size: 3rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.changelog-entry {
|
.changelog-entry {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding-inline: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
width: calc(100% - 2rem);
|
||||||
|
border-bottom: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
font-family: 'EB Garamond', serif;
|
font-family: 'EB Garamond', serif;
|
||||||
|
padding-inline: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<h3>Rewards</h3>
|
<h3>Rewards</h3>
|
||||||
<div class="rewards">
|
<div class="rewards">
|
||||||
<span>Gold: <b>{{missive.goldReward}}</b></span>
|
<span>Gold: <b>{{ missive.goldReward }}</b></span>
|
||||||
<span>Exp: <b>{{missive.expReward}}</b></span>
|
<span>Exp: <b>{{ missive.expReward }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
@@ -57,16 +57,18 @@ export default defineComponent({
|
|||||||
components: {AdventurerComponent},
|
components: {AdventurerComponent},
|
||||||
props: {
|
props: {
|
||||||
missive: {
|
missive: {
|
||||||
type: Object as PropType<Quest|any>,
|
type: Object as PropType<Quest | any>,
|
||||||
default() {
|
default() {
|
||||||
return {} as Quest;
|
return {} as Quest;
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
adventurers: {
|
adventurers: {
|
||||||
type: Object as PropType<{[key: string]: Adventurer}>,
|
type: Object as PropType<{ [key: string]: Adventurer }>,
|
||||||
default() {
|
default() {
|
||||||
return {} as {[key: string]: Adventurer};
|
return {} as { [key: string]: Adventurer };
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: () => {
|
data: () => {
|
||||||
@@ -126,6 +128,7 @@ export default defineComponent({
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: -5;
|
z-index: -5;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -137,6 +140,7 @@ export default defineComponent({
|
|||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -148,6 +152,7 @@ export default defineComponent({
|
|||||||
margin: 0.5rem auto;
|
margin: 0.5rem auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 1.25rem;
|
height: 1.25rem;
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -158,6 +163,7 @@ export default defineComponent({
|
|||||||
background-color: rgba(0, 128, 0, 0.65);
|
background-color: rgba(0, 128, 0, 0.65);
|
||||||
transition: width 250ms linear;
|
transition: width 250ms linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
.percentage {
|
.percentage {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -221,6 +227,7 @@ export default defineComponent({
|
|||||||
background-size: contain;
|
background-size: contain;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
z-index: -4;
|
z-index: -4;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -241,6 +248,7 @@ export default defineComponent({
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
height: 35%;
|
height: 35%;
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="upgrades">
|
<section class="upgrades">
|
||||||
<h2>Upgrades</h2>
|
<h2>Upgrades</h2>
|
||||||
<div class="upgrade">
|
<div class="upgrade">
|
||||||
<span>Adventurer capacity (level {{ guild.adventurerCapacity.level }})</span>
|
<span>Adventurer capacity (level {{ guild.adventurerCapacity.level }})</span>
|
||||||
<button
|
<button
|
||||||
v-if="guild.adventurerCapacity.nextLevelCost"
|
v-if="guild.adventurerCapacity.nextLevelCost"
|
||||||
:disabled="guild.gold < guild.adventurerCapacity.nextLevelCost"
|
:disabled="guild.gold < guild.adventurerCapacity.nextLevelCost"
|
||||||
@click="upgradeAdventurerCapacity()"
|
@click="upgradeAdventurerCapacity()"
|
||||||
>
|
>
|
||||||
Upgrade ({{guild.adventurerCapacity.nextLevelCost.toFixed(0)}} gold)
|
Upgrade ({{ formatGold(guild.adventurerCapacity.nextLevelCost) }} gold)
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Guild } from "@/classes/Guild";
|
import {Guild} from "@/classes/Guild";
|
||||||
import {defineComponent, type PropType} from "vue";
|
import {defineComponent, type PropType} from "vue";
|
||||||
|
import formatGold from "../classes/NumberMagic";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "UpgradesList",
|
name: "UpgradesList",
|
||||||
@@ -25,10 +26,12 @@ export default defineComponent({
|
|||||||
type: Object as PropType<Guild>,
|
type: Object as PropType<Guild>,
|
||||||
default() {
|
default() {
|
||||||
return new Guild(1, 0) as Guild;
|
return new Guild(1, 0) as Guild;
|
||||||
}
|
},
|
||||||
|
required: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatGold,
|
||||||
upgradeAdventurerCapacity(): void {
|
upgradeAdventurerCapacity(): void {
|
||||||
if (!this.guild.adventurerCapacity) return;
|
if (!this.guild.adventurerCapacity) return;
|
||||||
if (!this.guild.adventurerCapacity.nextLevelCost) return;
|
if (!this.guild.adventurerCapacity.nextLevelCost) return;
|
||||||
@@ -47,11 +50,13 @@ export default defineComponent({
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.75rem;
|
font-size: 1.75rem;
|
||||||
margin: 2rem 0 0;
|
margin: 2rem 0 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upgrade {
|
.upgrade {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { createApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
import './assets/main.css'
|
import './assets/main.scss'
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="adventurer-section">
|
<div class="adventurer-section">
|
||||||
<section class="recruit">
|
<section class="recruit panel pinned-paper">
|
||||||
<h1>Applying adventurers</h1>
|
<h1>Applying adventurers</h1>
|
||||||
<div class="adventurers">
|
<div class="adventurers">
|
||||||
<div v-if="currentlyForHire">
|
<div v-if="adventurerForHire">
|
||||||
<adventurer-tile class="hire-tile" :adventurer="currentlyForHire"/>
|
<adventurer-tile class="hire-tile" :adventurer="adventurerForHire"/>
|
||||||
<div class="decision">
|
<div class="decision">
|
||||||
<span
|
<span
|
||||||
title="Hire"
|
title="Hire"
|
||||||
@click="hireAdventurer(currentlyForHire)"
|
@click="hireAdventurer()"
|
||||||
:class="{disabled: Object.keys(adventurers).length >= guild.adventurerCapacity.getAdventurerCapacity()}"
|
:class="{disabled: Object.keys(adventurers).length >= guild.adventurerCapacity.getAdventurerCapacity()}"
|
||||||
>
|
>
|
||||||
✔
|
✔
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
:title="Object.keys(adventurers).length > 0 ? 'Dismiss' : ''"
|
:title="Object.keys(adventurers).length > 0 ? 'Dismiss' : ''"
|
||||||
:class="{disabled: Object.keys(adventurers).length <= 0}"
|
:class="{disabled: Object.keys(adventurers).length <= 0}"
|
||||||
@click="dismissAdventurer()"
|
@click="dismissAdventurer()"
|
||||||
>
|
>
|
||||||
✗
|
✗
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<span>Noone applied as of now. Check back later!</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="collection panel pinned-paper">
|
||||||
|
<h1>Recruited adventurers ({{ Object.keys(adventurers).length }} /
|
||||||
|
{{ guild.adventurerCapacity.getAdventurerCapacity() }})</h1>
|
||||||
|
<div class="adventurers">
|
||||||
|
<div class="adventurer-tile" v-for="adventurer in adventurers" :key="adventurer.id">
|
||||||
|
<AdventurerTile class="entry" :adventurer="adventurer"/>
|
||||||
|
<b>{{ adventurer.name }}</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
</section>
|
||||||
<span>Noone applied as of now. Check back later!</span>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="collection">
|
|
||||||
<h1>Recruited adventurers ({{ Object.keys(adventurers).length }} / {{ guild.adventurerCapacity.getAdventurerCapacity() }})</h1>
|
|
||||||
<div class="adventurers">
|
|
||||||
<div class="adventurer-tile" v-for="adventurer in adventurers" :key="adventurer.id">
|
|
||||||
<AdventurerTile class="entry" :adventurer="adventurer" />
|
|
||||||
<b>{{ adventurer.name }}</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -45,7 +46,7 @@ import type {PropType} from "vue";
|
|||||||
import {defineComponent} from "vue";
|
import {defineComponent} from "vue";
|
||||||
import AdventurerTile from "@/components/AdventurerTile.vue";
|
import AdventurerTile from "@/components/AdventurerTile.vue";
|
||||||
import type {Adventurer} from "@/classes/Adventurer";
|
import type {Adventurer} from "@/classes/Adventurer";
|
||||||
import { loadAdventurersForHire } from "@/GameData";
|
import {loadAdventurersForHire} from "@/GameData";
|
||||||
import type {Guild} from "@/classes/Guild";
|
import type {Guild} from "@/classes/Guild";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -53,7 +54,7 @@ export default defineComponent({
|
|||||||
components: {AdventurerTile},
|
components: {AdventurerTile},
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
currentlyForHire: null as Adventurer|null,
|
currentlyForHire: null as Adventurer | null,
|
||||||
adventurersForHire: [] as Array<Adventurer>,
|
adventurersForHire: [] as Array<Adventurer>,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -63,83 +64,34 @@ export default defineComponent({
|
|||||||
default() {
|
default() {
|
||||||
return {} as Guild
|
return {} as Guild
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
adventurers: {
|
adventurers: {
|
||||||
type: Object as PropType<{ [key: string]: Adventurer }>,
|
type: Object as PropType<{ [key: string]: Adventurer }>,
|
||||||
default() {
|
default() {
|
||||||
return {} as { [key: string]: Adventurer };
|
return {} as { [key: string]: Adventurer };
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
lastRecruitTime: {
|
adventurerForHire: {
|
||||||
type: Number as PropType<number>,
|
type: Object as PropType<Adventurer|null>,
|
||||||
default() {
|
default() {
|
||||||
return 0;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getRandomAdventurer(): Adventurer|null {
|
hireAdventurer(): void {
|
||||||
if (this.adventurersForHire.length <= 0) return null;
|
|
||||||
const randomId = this.adventurersForHire.length * Math.random() << 0;
|
|
||||||
return this.adventurersForHire[randomId];
|
|
||||||
},
|
|
||||||
getNewAdventurerForHire(): void {
|
|
||||||
const adventurer = this.getRandomAdventurer();
|
|
||||||
if (adventurer === null) {
|
|
||||||
this.currentlyForHire = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adventurers[adventurer.id] != null) {
|
|
||||||
this.currentlyForHire = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.currentlyForHire = adventurer;
|
|
||||||
window.localStorage.setItem("currentlyForHire", adventurer.id);
|
|
||||||
|
|
||||||
},
|
|
||||||
hireAdventurer(adventurer: Adventurer|any): void {
|
|
||||||
if (Object.keys(this.adventurers).length >= this.guild.adventurerCapacity.getAdventurerCapacity()) return;
|
if (Object.keys(this.adventurers).length >= this.guild.adventurerCapacity.getAdventurerCapacity()) return;
|
||||||
this.adventurers[adventurer.id] = adventurer;
|
this.$emit("recruitActionTaken", this.adventurerForHire);
|
||||||
this.currentlyForHire = null;
|
|
||||||
window.localStorage.removeItem("currentlyForHire");
|
|
||||||
this.$emit("recruitActionTaken", adventurer);
|
|
||||||
},
|
},
|
||||||
dismissAdventurer() {
|
dismissAdventurer() {
|
||||||
if (Object.keys(this.adventurers).length <= 0) return;
|
if (Object.keys(this.adventurers).length <= 0) return;
|
||||||
this.currentlyForHire = null;
|
|
||||||
this.$emit("recruitActionTaken", null);
|
this.$emit("recruitActionTaken", null);
|
||||||
window.localStorage.removeItem("currentlyForHire");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
|
||||||
this.adventurersForHire = await loadAdventurersForHire(Object.keys(this.adventurers));
|
|
||||||
|
|
||||||
if (Object.keys(this.adventurers).length <= 0) {
|
|
||||||
this.currentlyForHire = this.adventurersForHire[0];
|
|
||||||
window.localStorage.setItem("currentlyForHire", this.adventurersForHire[0].id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedCurrentForHire = window.localStorage.getItem("currentlyForHire");
|
|
||||||
if (savedCurrentForHire !== null) {
|
|
||||||
for (const id in this.adventurersForHire) {
|
|
||||||
const adventurer = this.adventurersForHire[id];
|
|
||||||
if (adventurer.id === savedCurrentForHire) {
|
|
||||||
this.currentlyForHire = adventurer;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const now = Number(new Date());
|
|
||||||
|
|
||||||
if (now - this.lastRecruitTime >= 1000 * 60 * 30 && this.currentlyForHire === null) {
|
|
||||||
this.getNewAdventurerForHire();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
emits: ["recruitActionTaken"]
|
emits: ["recruitActionTaken"]
|
||||||
|
|
||||||
@@ -148,22 +100,28 @@ export default defineComponent({
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.adventurer-section {
|
.adventurer-section {
|
||||||
|
padding-block: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
section {
|
section {
|
||||||
max-width: 1280px;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-block: 1rem;
|
padding: 1rem;
|
||||||
|
width: calc(100% - 2rem);
|
||||||
|
max-width: 45rem;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adventurers {
|
.adventurers {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -171,6 +129,7 @@ export default defineComponent({
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
.adventurer-tile {
|
.adventurer-tile {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -178,10 +137,12 @@ export default defineComponent({
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.25rem;
|
gap: 0.25rem;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
|
|
||||||
.entry {
|
.entry {
|
||||||
height: 7rem;
|
height: 7rem;
|
||||||
width: 7rem;
|
width: 7rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
b {
|
b {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -192,6 +153,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.decision {
|
.decision {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -199,17 +161,21 @@ export default defineComponent({
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
color: rgba(0,0,0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.hire-tile {
|
.hire-tile {
|
||||||
width: 8rem;
|
width: 8rem;
|
||||||
height: 8rem;
|
height: 8rem;
|
||||||
|
|||||||
@@ -1,26 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
<section class="title">
|
<section class="title panel note-paper">
|
||||||
<h1>Guild Master</h1>
|
<h1>Guild Master</h1>
|
||||||
<h3>Adventurer's guild management game</h3>
|
<h3>Adventurer's guild management game</h3>
|
||||||
<small>v{{version}}</small>
|
<small>v{{ version }}</small>
|
||||||
</section>
|
</section>
|
||||||
<section class="coffer">
|
<section class="upgrades panel pinned-paper">
|
||||||
<p>Coffer: {{guild.gold}} gold</p>
|
<div class="nail top-left">
|
||||||
</section>
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
<section class="upgrade">
|
</div>
|
||||||
<p>Guild level: {{ guild.level }}</p>
|
<div class="nail top-right">
|
||||||
<button :disabled="guild.upgradeCost ? guild.gold < guild.upgradeCost : true" @click="guild.upgrade()">
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
<span>Upgrade guild level</span><br>
|
</div>
|
||||||
<span>({{ guild.displayUpgradeCost }})</span>
|
<section class="coffer">
|
||||||
</button>
|
<p>Coffer: {{ formatGold(guild.gold) }} gold</p>
|
||||||
</section>
|
</section>
|
||||||
<section class="upgrade">
|
<section class="upgrade">
|
||||||
<UpgradesList :guild="guild" />
|
<p>Guild level: {{ guild.level }}</p>
|
||||||
</section>
|
<button :disabled="guild.upgradeCost ? guild.gold < guild.upgradeCost : true" @click="guild.upgrade()">
|
||||||
<section class="upgrade">
|
<span>Upgrade guild level</span><br>
|
||||||
<span class="wipe-save" @click="$emit('wipeSave')">Wipe your save data</span>
|
<span>({{ guild.displayUpgradeCost }})</span>
|
||||||
|
</button>
|
||||||
|
</section>
|
||||||
|
<section class="upgrade">
|
||||||
|
<UpgradesList :guild="guild"/>
|
||||||
|
</section>
|
||||||
|
<section class="upgrade">
|
||||||
|
<span class="wipe-save" @click="$emit('wipeSave')">Wipe your save data</span>
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -31,9 +40,11 @@ import {Guild} from "@/classes/Guild";
|
|||||||
|
|
||||||
import {version} from "../../package.json"
|
import {version} from "../../package.json"
|
||||||
import UpgradesList from "@/components/UpgradesList.vue";
|
import UpgradesList from "@/components/UpgradesList.vue";
|
||||||
|
import formatGold from "../classes/NumberMagic";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "GuildView",
|
name: "GuildView",
|
||||||
|
methods: {formatGold},
|
||||||
components: {UpgradesList},
|
components: {UpgradesList},
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
@@ -44,46 +55,69 @@ export default defineComponent({
|
|||||||
guild: {
|
guild: {
|
||||||
type: Object as PropType<Guild>,
|
type: Object as PropType<Guild>,
|
||||||
default: () => new Guild(1, 0) as Guild,
|
default: () => new Guild(1, 0) as Guild,
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding-block: 1rem;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
.upgrades {
|
||||||
|
max-width: 45rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 2.5rem;
|
padding-block: 2.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 45rem;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 4rem;
|
font-size: 4rem;
|
||||||
line-height: 0.75;
|
line-height: 0.75;
|
||||||
|
white-space: pre-wrap;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 0.9;
|
line-height: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 0.25;
|
line-height: 0.25;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.coffer {
|
.coffer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.upgrade {
|
.upgrade {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.wipe-save {
|
.wipe-save {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -91,6 +125,7 @@ export default defineComponent({
|
|||||||
color: #d52121;
|
color: #d52121;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|||||||
@@ -1,89 +1,90 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="guild" v-if="guild.level >= 7 && Object.keys(quests.S).length > 0">
|
<section>
|
||||||
<h1>Rank S Quests</h1>
|
<div class="guild" v-if="guild.level >= 7 && Object.keys(quests.S).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank S Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.S"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.S"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="guild.level >= 6 && Object.keys(quests.A).length > 0">
|
</div>
|
||||||
<h1>Rank A Quests</h1>
|
<div class="guild" v-if="guild.level >= 6 && Object.keys(quests.A).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank A Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.A"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.A"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="guild.level >= 5 && Object.keys(quests.B).length > 0">
|
</div>
|
||||||
<h1>Rank B Quests</h1>
|
<div class="guild" v-if="guild.level >= 5 && Object.keys(quests.B).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank B Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.B"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.B"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="guild.level >= 4 && Object.keys(quests.C).length > 0">
|
</div>
|
||||||
<h1>Rank C Quests</h1>
|
<div class="guild" v-if="guild.level >= 4 && Object.keys(quests.C).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank C Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.C"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.C"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="guild.level >= 3 && Object.keys(quests.D).length > 0">
|
</div>
|
||||||
<h1>Rank D Quests</h1>
|
<div class="guild" v-if="guild.level >= 3 && Object.keys(quests.D).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank D Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.D"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.D"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest((missive))"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest((missive))"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="guild.level >= 2 && Object.keys(quests.E).length > 0">
|
</div>
|
||||||
<h1>Rank E Quests</h1>
|
<div class="guild" v-if="guild.level >= 2 && Object.keys(quests.E).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank E Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.E"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.E"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
<div class="guild" v-if="Object.keys(quests.F).length > 0">
|
</div>
|
||||||
<h1>Rank F Quests</h1>
|
<div class="guild" v-if="Object.keys(quests.F).length > 0">
|
||||||
<section class="missives">
|
<h1>Rank F Quests</h1>
|
||||||
<QuestMissive
|
<section class="missives">
|
||||||
v-for="(missive, key, index) in quests.F"
|
<QuestMissive
|
||||||
:key="key"
|
v-for="(missive, key, index) in quests.F"
|
||||||
:adventurers="adventurers"
|
:key="key"
|
||||||
:missive="missive"
|
:adventurers="adventurers"
|
||||||
@click="finalizeQuest(missive)"
|
:missive="missive"
|
||||||
/>
|
@click="finalizeQuest(missive)"
|
||||||
</section>
|
/>
|
||||||
</div>
|
</section>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -103,18 +104,21 @@ export default defineComponent({
|
|||||||
default() {
|
default() {
|
||||||
return new Guild(1, 0);
|
return new Guild(1, 0);
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
adventurers: {
|
adventurers: {
|
||||||
type: Object as PropType<{ [key: string]: Adventurer }>,
|
type: Object as PropType<{ [key: string]: Adventurer }>,
|
||||||
default() {
|
default() {
|
||||||
return {} as { [key: string]: Adventurer };
|
return {} as { [key: string]: Adventurer };
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
quests: {
|
quests: {
|
||||||
type: Object as PropType<{ [key: string]: Quest }>,
|
type: Object as PropType<{ [key: string]: Quest }>,
|
||||||
default() {
|
default() {
|
||||||
return {} as { [key: string]: Quest };
|
return {} as { [key: string]: Quest };
|
||||||
},
|
},
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
lastRecruitTime: {
|
lastRecruitTime: {
|
||||||
type: Number as PropType<number>,
|
type: Number as PropType<number>,
|
||||||
@@ -123,10 +127,10 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: [ 'finalizeQuest', 'wipeSave', 'recruitActionTaken'],
|
emits: ['finalizeQuest', 'wipeSave', 'recruitActionTaken'],
|
||||||
methods: {
|
methods: {
|
||||||
// This is a workaround for vue not reporting Quest as Quest in v-for
|
// This is a workaround for vue not reporting Quest as Quest in v-for
|
||||||
finalizeQuest(quest: any|Quest): void {
|
finalizeQuest(quest: any | Quest): void {
|
||||||
if (quest.progressPoints < quest.maxProgress) return;
|
if (quest.progressPoints < quest.maxProgress) return;
|
||||||
this.$emit('finalizeQuest', quest)
|
this.$emit('finalizeQuest', quest)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="technical-view">
|
<section class="technical-view">
|
||||||
<h1>Socials</h1>
|
<div class="socials panel pinned-paper">
|
||||||
<div class="socials">
|
<div class="nail top-left small">
|
||||||
<a class="link" href="https://discord.gg/j8KK5dGBps"><img class="icon" src="/img/icons/discord.svg" alt="Discord" />Discord</a>
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
<a class="link" href="https://github.com/YouHaveTrouble/GuildMaster"><img class="icon" src="/img/icons/github.svg" alt="GitHub" />GitHub</a>
|
</div>
|
||||||
|
<div class="nail top-right small">
|
||||||
|
<img src="/img/quests/overlays/nail.png" alt="" draggable="false"/>
|
||||||
|
</div>
|
||||||
|
<h1>Socials</h1>
|
||||||
|
<div class="links">
|
||||||
|
<a class="link" href="https://discord.gg/j8KK5dGBps">
|
||||||
|
<img class="icon" src="/img/icons/discord.svg" alt="Discord"/>
|
||||||
|
Discord
|
||||||
|
</a>
|
||||||
|
<a class="link" href="https://github.com/YouHaveTrouble/GuildMaster">
|
||||||
|
<img class="icon" src="/img/icons/github.svg" alt="GitHub"/>
|
||||||
|
GitHub
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ChangelogComponent/>
|
||||||
|
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<ChangelogComponent/>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -31,30 +43,44 @@ export default defineComponent({
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding-block: 1rem;
|
padding-block: 1rem;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 3rem;
|
font-size: 3rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.socials {
|
.socials {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
|
||||||
|
.links {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
.link {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.05rem;
|
||||||
|
text-decoration: underline;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: #000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.link {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 0.05rem;
|
|
||||||
text-decoration: underline;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
color: #000;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
|||||||