feat(minigames): register Call for Fire in the minigame registry
Adds the callForFire row to BUILTIN_MINIGAMES (core, period-scored, order 6; poker/blackjack shift to 7/8), adds it to CORE_MINIGAME_KEYS period-scoring fallback, and maps the key to the callForFire profile group. Regenerates payload-types and the generated db schema, and registers the add_call_for_fire_minigame migration.
This commit is contained in:
parent
6d6a5fb0ce
commit
ce7fb97e0e
4 changed files with 80 additions and 3 deletions
|
|
@ -14,13 +14,14 @@
|
|||
export type MinigameCategory = "core" | "cardtable";
|
||||
export type MinigameStatus = "active" | "retired" | "upcoming";
|
||||
|
||||
/** The five period-scoring games. Poker and Blackjack stay out of periods. */
|
||||
/** The six period-scoring games. Poker and Blackjack stay out of periods. */
|
||||
export const CORE_MINIGAME_KEYS = [
|
||||
"flappy",
|
||||
"eod",
|
||||
"radio",
|
||||
"qualification",
|
||||
"opord",
|
||||
"callForFire",
|
||||
] as const;
|
||||
|
||||
export const CARDTABLE_MINIGAME_KEYS = ["poker", "blackjack"] as const;
|
||||
|
|
@ -107,6 +108,18 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
|||
countsForPeriods: true,
|
||||
scoreLabel: "Score",
|
||||
},
|
||||
{
|
||||
key: "callForFire",
|
||||
label: "Call for Fire",
|
||||
description: "Bracket artillery onto a hidden target: fewer fire missions score higher.",
|
||||
route: "/minigames/call-for-fire",
|
||||
icon: "Target",
|
||||
category: "core",
|
||||
status: "active",
|
||||
order: 6,
|
||||
countsForPeriods: true,
|
||||
scoreLabel: "Score",
|
||||
},
|
||||
{
|
||||
key: "poker",
|
||||
label: "Poker",
|
||||
|
|
@ -115,7 +128,7 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
|||
icon: "Spade",
|
||||
category: "cardtable",
|
||||
status: "active",
|
||||
order: 6,
|
||||
order: 7,
|
||||
countsForPeriods: false,
|
||||
scoreLabel: "Chips",
|
||||
},
|
||||
|
|
@ -127,7 +140,7 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
|||
icon: "Club",
|
||||
category: "cardtable",
|
||||
status: "active",
|
||||
order: 7,
|
||||
order: 8,
|
||||
countsForPeriods: false,
|
||||
scoreLabel: "Chips",
|
||||
},
|
||||
|
|
@ -181,6 +194,7 @@ export const MINIGAME_PROFILE_GAME_KEYS: Record<string, string> = {
|
|||
radio: "radioTraffic",
|
||||
qualification: "aimTrainer",
|
||||
opord: "opordRecall",
|
||||
callForFire: "callForFire",
|
||||
poker: "poker",
|
||||
blackjack: "blackjack",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ import * as migration_20261009_201920_add_contribution_entries from './20261009_
|
|||
import * as migration_20261010_050644_add_mission_threat_assessment from './20261010_050644_add_mission_threat_assessment';
|
||||
import * as migration_20261011_195306_add_minigame_periods from './20261011_195306_add_minigame_periods';
|
||||
import * as migration_20261011_201531_add_minigame_entry_occurred_at from './20261011_201531_add_minigame_entry_occurred_at';
|
||||
import * as migration_20261011_221111_add_call_for_fire_minigame from './20261011_221111_add_call_for_fire_minigame';
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
|
|
@ -744,4 +745,9 @@ export const migrations = [
|
|||
down: migration_20261011_201531_add_minigame_entry_occurred_at.down,
|
||||
name: '20261011_201531_add_minigame_entry_occurred_at'
|
||||
},
|
||||
{
|
||||
up: migration_20261011_221111_add_call_for_fire_minigame.up,
|
||||
down: migration_20261011_221111_add_call_for_fire_minigame.down,
|
||||
name: '20261011_221111_add_call_for_fire_minigame'
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -563,6 +563,7 @@ export const enum_users_preferences_notifications_muted_types = pgEnum(
|
|||
"mission:role-promoted",
|
||||
"contribution:xp-granted",
|
||||
"contribution:xp-revoked",
|
||||
"minigame:achievement",
|
||||
],
|
||||
);
|
||||
export const enum_users_preferences_discord_muted_types = pgEnum(
|
||||
|
|
@ -593,6 +594,7 @@ export const enum_users_preferences_discord_muted_types = pgEnum(
|
|||
"mission:role-promoted",
|
||||
"contribution:xp-granted",
|
||||
"contribution:xp-revoked",
|
||||
"minigame:achievement",
|
||||
],
|
||||
);
|
||||
export const enum_users_preferences_display_lead_or_actual = pgEnum(
|
||||
|
|
@ -3023,6 +3025,37 @@ export const profiles = pgTable(
|
|||
"progression_minigames_opord_recall_xp_earned",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_gamesPlayed: numeric(
|
||||
"progression_minigames_call_for_fire_games_played",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_wins: numeric("progression_minigames_call_for_fire_wins", {
|
||||
mode: "number",
|
||||
}).default(0),
|
||||
progression_minigames_callForFire_losses: numeric(
|
||||
"progression_minigames_call_for_fire_losses",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_bestScore: numeric(
|
||||
"progression_minigames_call_for_fire_best_score",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_xpEarned: numeric(
|
||||
"progression_minigames_call_for_fire_xp_earned",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_bestPatrolMissions: numeric(
|
||||
"progression_minigames_call_for_fire_best_patrol_missions",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_bestCheckpointMissions: numeric(
|
||||
"progression_minigames_call_for_fire_best_checkpoint_missions",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_callForFire_bestCompoundMissions: numeric(
|
||||
"progression_minigames_call_for_fire_best_compound_missions",
|
||||
{ mode: "number" },
|
||||
).default(0),
|
||||
progression_minigames_poker_gamesPlayed: numeric("progression_minigames_poker_games_played", {
|
||||
mode: "number",
|
||||
}).default(0),
|
||||
|
|
@ -7300,6 +7333,7 @@ export const minigame_entries = pgTable(
|
|||
game: varchar("game").notNull(),
|
||||
mode: varchar("mode"),
|
||||
score: numeric("score", { mode: "number" }).notNull(),
|
||||
occurredAt: timestamp("occurred_at", { mode: "string", withTimezone: true, precision: 3 }),
|
||||
accuracy: numeric("accuracy", { mode: "number" }),
|
||||
durationMs: numeric("duration_ms", { mode: "number" }).notNull(),
|
||||
period: integer("period_id").references(() => minigame_periods.id, {
|
||||
|
|
@ -7317,6 +7351,7 @@ export const minigame_entries = pgTable(
|
|||
index("minigame_entries_user_idx").on(columns.user),
|
||||
index("minigame_entries_game_idx").on(columns.game),
|
||||
index("minigame_entries_score_idx").on(columns.score),
|
||||
index("minigame_entries_occurred_at_idx").on(columns.occurredAt),
|
||||
index("minigame_entries_period_idx").on(columns.period),
|
||||
index("minigame_entries_updated_at_idx").on(columns.updatedAt),
|
||||
index("minigame_entries_created_at_idx").on(columns.createdAt),
|
||||
|
|
|
|||
|
|
@ -3307,6 +3307,16 @@ export interface Profile {
|
|||
eliteBestTimeMs?: number | null;
|
||||
xpEarned?: number | null;
|
||||
};
|
||||
callForFire?: {
|
||||
gamesPlayed?: number | null;
|
||||
wins?: number | null;
|
||||
losses?: number | null;
|
||||
bestScore?: number | null;
|
||||
xpEarned?: number | null;
|
||||
bestPatrolMissions?: number | null;
|
||||
bestCheckpointMissions?: number | null;
|
||||
bestCompoundMissions?: number | null;
|
||||
};
|
||||
poker?: {
|
||||
gamesPlayed?: number | null;
|
||||
wins?: number | null;
|
||||
|
|
@ -8961,6 +8971,18 @@ export interface ProfilesSelect<T extends boolean = true> {
|
|||
eliteBestTimeMs?: T;
|
||||
xpEarned?: T;
|
||||
};
|
||||
callForFire?:
|
||||
| T
|
||||
| {
|
||||
gamesPlayed?: T;
|
||||
wins?: T;
|
||||
losses?: T;
|
||||
bestScore?: T;
|
||||
xpEarned?: T;
|
||||
bestPatrolMissions?: T;
|
||||
bestCheckpointMissions?: T;
|
||||
bestCompoundMissions?: T;
|
||||
};
|
||||
poker?:
|
||||
| T
|
||||
| {
|
||||
|
|
|
|||
Loading…
Reference in a new issue