generated from nhcarrigan/template
feat: v0.6.0 balance pass, quest-gated bosses, and achievement fixes
This commit is contained in:
@@ -107,6 +107,17 @@ const milestoneVerbs: Record<MilestoneType, string> = {
|
||||
transcendence: "transcended",
|
||||
};
|
||||
|
||||
type MilestoneSuffixBuilder = (counts: MilestoneCounts)=> string;
|
||||
|
||||
const milestoneSuffixes: Partial<
|
||||
Record<MilestoneType, MilestoneSuffixBuilder>
|
||||
> = {
|
||||
transcendence: (counts) => {
|
||||
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- counts.prestige is a number, intentionally stringified */
|
||||
return ` at ${counts.prestige} prestige`;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Posts a milestone announcement to the configured Discord webhook.
|
||||
* Fails silently so webhook errors do not affect the game action.
|
||||
@@ -126,8 +137,9 @@ const postMilestoneWebhook = async(
|
||||
}
|
||||
|
||||
const verb = milestoneVerbs[milestone];
|
||||
const suffix = milestoneSuffixes[milestone]?.(counts) ?? "";
|
||||
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- counts fields are numbers, intentionally stringified */
|
||||
const content = `<@${discordId}> has ${verb}~! They are now on Prestige ${counts.prestige}, Transcendence ${counts.transcendence}, Apotheosis ${counts.apotheosis}!`;
|
||||
const content = `<@${discordId}> has ${verb}${suffix}~! They are now on Prestige ${counts.prestige}, Transcendence ${counts.transcendence}, Apotheosis ${counts.apotheosis}!`;
|
||||
|
||||
try {
|
||||
await fetch(webhookUrl, {
|
||||
|
||||
Reference in New Issue
Block a user