Penance cycle

This commit is contained in:
2025-02-08 23:51:15 -08:00
parent 8c917df618
commit 2361b880eb
9 changed files with 433 additions and 52 deletions

View File

@ -19,9 +19,11 @@ class SkillsTable {
return this.#skills[skill.id]
}
getAllAvailableSkills(): Skill[] {
getAvailableSkills(includeDegrading: boolean): Skill[] {
let skills = [];
for (let i = 0; i < this.#skills.length; i++) {
let isDegrading = this.#skills[i].isDegrading ?? false;
if (isDegrading && !includeDegrading) { continue; }
skills.push({id: i});
}
return skills;
@ -35,6 +37,10 @@ class SkillsTable {
governingStatValue += getPlayerProgress().getStat(stat) / data.governing.stats.length;
}
if (data.governing.flipped) {
governingStatValue = - governingStatValue + 10;
}
let mult = getCostMultiplier(getPlayerProgress().getWish(), skill);
let [underTarget, target] = [data.governing.underTarget, data.governing.target];
underTarget = mult * underTarget;
@ -62,14 +68,14 @@ function geomInterpolate(
return lowOut * Math.pow(highOut / lowOut, proportion)
}
type Difficulty = 0 | 1 | 2 | 3
type Difficulty = 0 | 1 | 1.25 | 2 | 3
type GoverningTemplate = {
stats: Stat[],
note: string
scoring: SkillScoring,
}
type Track = "bat" | "stealth" | "charm" | "stare" | "party" | "lore"
type Track = "bat" | "stealth" | "charm" | "stare" | "party" | "lore" | "penance"
let templates: Record<Track, GoverningTemplate> = {
bat: {
stats: ["AGI", "AGI", "PSI"],
@ -101,9 +107,14 @@ let templates: Record<Track, GoverningTemplate> = {
note: "Cheaper with INT and CHA.",
scoring: {lore: 1},
},
penance: {
stats: ["AGI", "INT", "CHA", "PSI"],
note: "Lower your stats for this.",
scoring: {},
}
}
function governing(track: Track, difficulty: Difficulty): SkillGoverning {
function governing(track: Track, difficulty: Difficulty, flipped?: boolean): SkillGoverning {
let template = templates[track];
let underTarget: number
let target: number
@ -112,9 +123,15 @@ function governing(track: Track, difficulty: Difficulty): SkillGoverning {
switch(difficulty) {
case 0: underTarget = 5; target = 15; cost = 50; mortalServantValue = 1; break;
case 1: underTarget = 15; target = 40; cost = 100; mortalServantValue = 2; break;
case 1.25: underTarget = 17; target = 42; cost = 100; mortalServantValue = 2; break;
case 2: underTarget = 30; target = 70; cost = 125; mortalServantValue = 3; break;
case 3: underTarget = 50; target = 100; cost = 150; mortalServantValue = 10; break;
}
if (flipped) {
mortalServantValue = -mortalServantValue;
}
return {
stats: template.stats,
underTarget: underTarget,
@ -122,13 +139,15 @@ function governing(track: Track, difficulty: Difficulty): SkillGoverning {
cost: cost,
note: template.note,
scoring: template.scoring,
mortalServantValue: mortalServantValue
mortalServantValue: mortalServantValue,
flipped: flipped ?? false,
}
}
let table = new SkillsTable();
export let bat0 = table.add({
isDegrading: false,
governing: governing("bat", 0),
profile: {
name: "Screech",
@ -323,6 +342,37 @@ export let lore3 = table.add({
prereqs: [lore2]
});
export let sorry0 = table.add({
isDegrading: true,
governing: governing("penance", 0, true),
profile: {
name: "I'm Sorry",
description: "You really hurt your Master, you know? Shame on you."
},
prereqs: [],
})
export let sorry1 = table.add({
isDegrading: true,
governing: governing("penance", 1, true),
profile: {
name: "I'm So Sorry",
description: "You should have known better! You should have done what you were told."
},
prereqs: [],
})
export let sorry2 = table.add({
isDegrading: true,
// difficulty 2 is genuinely brutal
governing: governing("penance", 1.25, true),
profile: {
name: "Forgive Me",
description: "Nothing you say will ever be enough to make up for your indiscretion.",
},
prereqs: [],
})
export function getSkills(): SkillsTable {
return table;
}