Some falukant fixes, added undeground ui - no save right now, changed menu (and verification)

This commit is contained in:
Torsten Schulz
2025-07-17 14:28:52 +02:00
parent fceea5b7fb
commit 89cf12a7a8
33 changed files with 1010 additions and 423 deletions

View File

@@ -14,6 +14,7 @@ import BanquetteType from "../../models/falukant/type/banquette.js";
import LearnRecipient from "../../models/falukant/type/learn_recipient.js";
import PoliticalOfficeType from "../../models/falukant/type/political_office_type.js";
import PoliticalOfficePrerequisite from "../../models/falukant/predefine/political_office_prerequisite.js";
import UndergroundType from "../../models/falukant/type/underground.js";
export const initializeFalukantTypes = async () => {
await initializeFalukantTypeRegions();
@@ -29,6 +30,7 @@ export const initializeFalukantTypes = async () => {
await initializeLearnerTypes();
await initializePoliticalOfficeTypes();
await initializePoliticalOfficePrerequisites();
await initializeUndergroundTypes();
};
const regionTypes = [];
@@ -48,10 +50,10 @@ const regions = [
{ labelTr: "Siebenbachen", regionType: "shire", parentTr: "Groß-Benbach" },
{ labelTr: "Bad Homburg", regionType: "county", parentTr: "Siebenbachen" },
{ labelTr: "Maintal", regionType: "county", parentTr: "Siebenbachen" },
{ labelTr: "Frankfurt", regionType: "city", parentTr: "Bad Homburg", map: {x: 187, y: 117, w: 10, h:11} },
{ labelTr: "Oberursel", regionType: "city", parentTr: "Bad Homburg", map: {x: 168, y: 121, w: 10, h:11} },
{ labelTr: "Offenbach", regionType: "city", parentTr: "Bad Homburg", map: {x: 171, y: 142, w: 10, h:11} },
{ labelTr: "Königstein", regionType: "city", parentTr: "Maintal", map: {x: 207, y: 124, w: 24, h:18} },
{ labelTr: "Frankfurt", regionType: "city", parentTr: "Bad Homburg", map: { x: 187, y: 117, w: 10, h: 11 } },
{ labelTr: "Oberursel", regionType: "city", parentTr: "Bad Homburg", map: { x: 168, y: 121, w: 10, h: 11 } },
{ labelTr: "Offenbach", regionType: "city", parentTr: "Bad Homburg", map: { x: 171, y: 142, w: 10, h: 11 } },
{ labelTr: "Königstein", regionType: "city", parentTr: "Maintal", map: { x: 207, y: 124, w: 24, h: 18 } },
];
const relationships = [
@@ -537,6 +539,29 @@ const politicalOfficePrerequisites = [
}
];
const undergroundTypes = [
{
"tr": "spyin",
"cost": 3000
},
{
"tr": "assassin",
"cost": 5000
},
{
"tr": "sabotage",
"cost": 10000
},
{
"tr": "corrupt_politician",
"cost": 15000
},
{
"tr": "rob",
"cost": 500
},
];
{
const giftNames = promotionalGifts.map(g => g.name);
const traitNames = characterTraits.map(t => t.name);
@@ -777,20 +802,29 @@ export const initializePoliticalOfficeTypes = async () => {
export const initializePoliticalOfficePrerequisites = async () => {
for (const prereq of politicalOfficePrerequisites) {
// zunächst den OfficeType anhand seines Namens (tr) ermitteln
const office = await PoliticalOfficeType.findOne({
where: { name: prereq.officeTr }
});
if (!office) continue;
// Nun findOrCreate mit dem neuen Spaltennamen:
await PoliticalOfficePrerequisite.findOrCreate({
where: { office_type_id: office.id },
defaults: {
office_type_id: office.id,
prerequisite: prereq.prerequisite
}
});
const office = await PoliticalOfficeType.findOne({
where: { name: prereq.officeTr }
});
if (!office) continue;
await PoliticalOfficePrerequisite.findOrCreate({
where: { office_type_id: office.id },
defaults: {
office_type_id: office.id,
prerequisite: prereq.prerequisite
}
});
}
};
};
export const initializeUndergroundTypes = async () => {
for (const underground of undergroundTypes) {
await UndergroundType.findOrCreate({
where: { tr: underground.tr },
defaults: {
tr: underground.tr,
cost: underground.cost
}
});
}
};