mirror of
https://github.com/YouHaveTrouble/GuildMaster.git
synced 2026-05-11 22:16:59 +00:00
move quests to a single file
This commit is contained in:
@@ -0,0 +1,106 @@
|
|||||||
|
{
|
||||||
|
"ranks": {
|
||||||
|
"A": [
|
||||||
|
{
|
||||||
|
"title": "Ogre king",
|
||||||
|
"text": "Ogres have chosen a new king through democratic vote. They all voted for the strongest ogre."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Devilish dungeon",
|
||||||
|
"text": "New dungeon was discovered. It needs to be mapped and explored so lower rank adventurers can enter."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Eater of Worlds",
|
||||||
|
"text": "A giant worm emerged from the ground and appears to be consuming the ground itself."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"B": [
|
||||||
|
{
|
||||||
|
"title": "Undead horde",
|
||||||
|
"text": "Due to the spillage of necromancy potion at nearby graveyard we now have an undead army on our doorstep."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Runaway prisoner",
|
||||||
|
"text": "During the last prison guard strike a prisoner managed to escape. Bring them back to their cell."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "The aristocrats",
|
||||||
|
"text": "Royalty wants an escort for one of their carriages."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"C": [
|
||||||
|
{
|
||||||
|
"title": "Scratchy, the butcher",
|
||||||
|
"text": "Scratchy turned evil and is terrorizing its victims. Put a stop to it!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Hobgnoblin subjugation",
|
||||||
|
"text": "Gnoblins evolved and are back for vengeance."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Holy",
|
||||||
|
"text": "Gnoblins summoned their machine god and it started going haywire on everything around it. Destroy it!"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"D": [
|
||||||
|
{
|
||||||
|
"title": "Caravan escort",
|
||||||
|
"text": "Escort a merchant caravan."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Rare ore",
|
||||||
|
"text": "Obtain laudanium ore for town's blacksmith."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Demonic pests!",
|
||||||
|
"text": "Clear the fields from cabbage imps."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"E": [
|
||||||
|
{
|
||||||
|
"title": "Gnoblin subjugation",
|
||||||
|
"text": "Kill 3 gnoblins."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Phantom menace",
|
||||||
|
"text": "Exorcise ghosts out of someone's apartment."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Scratchy in peril",
|
||||||
|
"text": "Get Scratchy the cat from the tree safe onto the ground."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"F": [
|
||||||
|
{
|
||||||
|
"title": "Frog Frenzy",
|
||||||
|
"text": "Kill 10 demon frogs."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Rats!",
|
||||||
|
"text": "Get rid of the rats from someone's basement."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Herb gathering",
|
||||||
|
"text": "Collect medicinal herbs."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Big pile of rubble",
|
||||||
|
"text": "Tavern collapsed. Again. Help clean up the debris."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"S": [
|
||||||
|
{
|
||||||
|
"title": "The Demon King",
|
||||||
|
"text": "Demon King has awoken and is a threat to whole existence. Heroes needed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Scratchy, Destruction Incarnate",
|
||||||
|
"text": "Scratchy was reborn as a machine of pure destruction and needs to be stopped."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Jiggly Jungle",
|
||||||
|
"text": "A jungle south began rapidly expanding and experts think arson is our only option."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Ogre king",
|
|
||||||
"text": "Ogres have chosen a new king through democratic vote. They all voted for the strongest ogre."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Devilish dungeon",
|
|
||||||
"text": "New dungeon was discovered. It needs to be mapped and explored so lower rank adventurers can enter."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Eater of Worlds",
|
|
||||||
"text": "A giant worm emerged from the ground and appears to be consuming the ground itself."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Undead horde",
|
|
||||||
"text": "Due to the spillage of necromancy potion at nearby graveyard we now have an undead army on our doorstep."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Runaway prisoner",
|
|
||||||
"text": "During the last prison guard strike a prisoner managed to escape. Bring them back to their cell."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "The aristocrats",
|
|
||||||
"text": "Royalty wants an escort for one of their carriages."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Scratchy, the butcher",
|
|
||||||
"text": "Scratchy turned evil and is terrorizing its victims. Put a stop to it!"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Hobgnoblin subjegation",
|
|
||||||
"text": "Gnoblins evolved and are back for vengeance."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Holy",
|
|
||||||
"text": "Gnoblins summoned their machine god and it started going haywire on everything around it. Destroy it!"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Caravan escort",
|
|
||||||
"text": "Escort a merchant caravan."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Rare ore",
|
|
||||||
"text": "Obtain laudanium ore for town's blacksmith."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Demonic pests!",
|
|
||||||
"text": "Clear the fields from cabbage imps."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Gnoblin subjegation",
|
|
||||||
"text": "Kill 3 gnoblins."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Phantom menace",
|
|
||||||
"text": "Exorcise ghosts out of someone's apartment."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Scratchy in peril",
|
|
||||||
"text": "Get Scratchy the cat from the tree safe onto the ground."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "Frog Frenzy",
|
|
||||||
"text": "Kill 10 demon frogs."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Rats!",
|
|
||||||
"text": "Get rid of the rats from someone's basement."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Herb gathering",
|
|
||||||
"text": "Collect medicinal herbs."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Big pile of rubble",
|
|
||||||
"text": "Tavern collapsed. Again. Help clean up the debris."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"title": "The Demon King",
|
|
||||||
"text": "Demon King has awoken and is a threat to whole existence. Heroes needed."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Scratchy, Destruction Incarnate",
|
|
||||||
"text": "Scratchy was reborn as a machine of pure destruction and needs to be stopped."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Jiggly Jungle",
|
|
||||||
"text": "A jungle south began rapidly expanding and experts think arson is our only option."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
+18
-13
@@ -68,26 +68,31 @@ export async function loadAvailableQuests(): Promise<{ [key: string]: { [key: st
|
|||||||
F: {} as { [key: string]: Quest },
|
F: {} as { [key: string]: Quest },
|
||||||
} as { [key: string]: { [key: string]: Quest } };
|
} as { [key: string]: { [key: string]: Quest } };
|
||||||
|
|
||||||
for (const rank in quests) {
|
const questsResponse = await fetch(`data/quests.json`);
|
||||||
const response = await fetch(`data/quests/Rank${rank}.json`);
|
|
||||||
if (response.status !== 200) {
|
if (questsResponse.status !== 200) {
|
||||||
console.error("Failed to load quests");
|
console.error("Failed to load quests");
|
||||||
alert("Failed to load quests. Please try refreshing the page.");
|
alert("Failed to load quests. Please try refreshing the page.");
|
||||||
return quests;
|
return quests;
|
||||||
}
|
}
|
||||||
const questData = await response.json();
|
|
||||||
|
|
||||||
let id = 0;
|
const questsData = await questsResponse.json();
|
||||||
for (const quest of questData) {
|
|
||||||
id++;
|
for (const rank of Object.keys(questsData.ranks)) {
|
||||||
quests[rank.toString()][id] = new Quest(
|
const questRank = getFromString(rank as keyof typeof QuestRank);
|
||||||
id.toString(),
|
if (!questRank) {
|
||||||
getFromString(rank as QuestRank),
|
console.error(`Invalid quest rank: ${rank}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const questRankData = questsData.ranks[questRank];
|
||||||
|
|
||||||
|
for (const quest of questRankData) {
|
||||||
|
const id = quest.id;
|
||||||
|
quests[questRank][id] = new Quest(
|
||||||
|
id,
|
||||||
|
questRank,
|
||||||
quest.title,
|
quest.title,
|
||||||
quest.text,
|
quest.text,
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ export class Quest {
|
|||||||
rank: QuestRank,
|
rank: QuestRank,
|
||||||
title: string,
|
title: string,
|
||||||
text: string,
|
text: string,
|
||||||
maxProgress: number,
|
maxProgress: number = 1,
|
||||||
expReward: number,
|
expReward: number = 0,
|
||||||
goldReward: number,
|
goldReward: number = 0,
|
||||||
maxAdventurers: number = 1
|
maxAdventurers: number = 1
|
||||||
) {
|
) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|||||||
Reference in New Issue
Block a user