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 MinigameCategory = "core" | "cardtable";
|
||||||
export type MinigameStatus = "active" | "retired" | "upcoming";
|
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 = [
|
export const CORE_MINIGAME_KEYS = [
|
||||||
"flappy",
|
"flappy",
|
||||||
"eod",
|
"eod",
|
||||||
"radio",
|
"radio",
|
||||||
"qualification",
|
"qualification",
|
||||||
"opord",
|
"opord",
|
||||||
|
"callForFire",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const CARDTABLE_MINIGAME_KEYS = ["poker", "blackjack"] as const;
|
export const CARDTABLE_MINIGAME_KEYS = ["poker", "blackjack"] as const;
|
||||||
|
|
@ -107,6 +108,18 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
||||||
countsForPeriods: true,
|
countsForPeriods: true,
|
||||||
scoreLabel: "Score",
|
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",
|
key: "poker",
|
||||||
label: "Poker",
|
label: "Poker",
|
||||||
|
|
@ -115,7 +128,7 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
||||||
icon: "Spade",
|
icon: "Spade",
|
||||||
category: "cardtable",
|
category: "cardtable",
|
||||||
status: "active",
|
status: "active",
|
||||||
order: 6,
|
order: 7,
|
||||||
countsForPeriods: false,
|
countsForPeriods: false,
|
||||||
scoreLabel: "Chips",
|
scoreLabel: "Chips",
|
||||||
},
|
},
|
||||||
|
|
@ -127,7 +140,7 @@ export const BUILTIN_MINIGAMES: BuiltinMinigame[] = [
|
||||||
icon: "Club",
|
icon: "Club",
|
||||||
category: "cardtable",
|
category: "cardtable",
|
||||||
status: "active",
|
status: "active",
|
||||||
order: 7,
|
order: 8,
|
||||||
countsForPeriods: false,
|
countsForPeriods: false,
|
||||||
scoreLabel: "Chips",
|
scoreLabel: "Chips",
|
||||||
},
|
},
|
||||||
|
|
@ -181,6 +194,7 @@ export const MINIGAME_PROFILE_GAME_KEYS: Record<string, string> = {
|
||||||
radio: "radioTraffic",
|
radio: "radioTraffic",
|
||||||
qualification: "aimTrainer",
|
qualification: "aimTrainer",
|
||||||
opord: "opordRecall",
|
opord: "opordRecall",
|
||||||
|
callForFire: "callForFire",
|
||||||
poker: "poker",
|
poker: "poker",
|
||||||
blackjack: "blackjack",
|
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_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_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_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 = [
|
export const migrations = [
|
||||||
{
|
{
|
||||||
|
|
@ -744,4 +745,9 @@ export const migrations = [
|
||||||
down: migration_20261011_201531_add_minigame_entry_occurred_at.down,
|
down: migration_20261011_201531_add_minigame_entry_occurred_at.down,
|
||||||
name: '20261011_201531_add_minigame_entry_occurred_at'
|
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",
|
"mission:role-promoted",
|
||||||
"contribution:xp-granted",
|
"contribution:xp-granted",
|
||||||
"contribution:xp-revoked",
|
"contribution:xp-revoked",
|
||||||
|
"minigame:achievement",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
export const enum_users_preferences_discord_muted_types = pgEnum(
|
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",
|
"mission:role-promoted",
|
||||||
"contribution:xp-granted",
|
"contribution:xp-granted",
|
||||||
"contribution:xp-revoked",
|
"contribution:xp-revoked",
|
||||||
|
"minigame:achievement",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
export const enum_users_preferences_display_lead_or_actual = pgEnum(
|
export const enum_users_preferences_display_lead_or_actual = pgEnum(
|
||||||
|
|
@ -3023,6 +3025,37 @@ export const profiles = pgTable(
|
||||||
"progression_minigames_opord_recall_xp_earned",
|
"progression_minigames_opord_recall_xp_earned",
|
||||||
{ mode: "number" },
|
{ mode: "number" },
|
||||||
).default(0),
|
).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", {
|
progression_minigames_poker_gamesPlayed: numeric("progression_minigames_poker_games_played", {
|
||||||
mode: "number",
|
mode: "number",
|
||||||
}).default(0),
|
}).default(0),
|
||||||
|
|
@ -7300,6 +7333,7 @@ export const minigame_entries = pgTable(
|
||||||
game: varchar("game").notNull(),
|
game: varchar("game").notNull(),
|
||||||
mode: varchar("mode"),
|
mode: varchar("mode"),
|
||||||
score: numeric("score", { mode: "number" }).notNull(),
|
score: numeric("score", { mode: "number" }).notNull(),
|
||||||
|
occurredAt: timestamp("occurred_at", { mode: "string", withTimezone: true, precision: 3 }),
|
||||||
accuracy: numeric("accuracy", { mode: "number" }),
|
accuracy: numeric("accuracy", { mode: "number" }),
|
||||||
durationMs: numeric("duration_ms", { mode: "number" }).notNull(),
|
durationMs: numeric("duration_ms", { mode: "number" }).notNull(),
|
||||||
period: integer("period_id").references(() => minigame_periods.id, {
|
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_user_idx").on(columns.user),
|
||||||
index("minigame_entries_game_idx").on(columns.game),
|
index("minigame_entries_game_idx").on(columns.game),
|
||||||
index("minigame_entries_score_idx").on(columns.score),
|
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_period_idx").on(columns.period),
|
||||||
index("minigame_entries_updated_at_idx").on(columns.updatedAt),
|
index("minigame_entries_updated_at_idx").on(columns.updatedAt),
|
||||||
index("minigame_entries_created_at_idx").on(columns.createdAt),
|
index("minigame_entries_created_at_idx").on(columns.createdAt),
|
||||||
|
|
|
||||||
|
|
@ -3307,6 +3307,16 @@ export interface Profile {
|
||||||
eliteBestTimeMs?: number | null;
|
eliteBestTimeMs?: number | null;
|
||||||
xpEarned?: 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?: {
|
poker?: {
|
||||||
gamesPlayed?: number | null;
|
gamesPlayed?: number | null;
|
||||||
wins?: number | null;
|
wins?: number | null;
|
||||||
|
|
@ -8961,6 +8971,18 @@ export interface ProfilesSelect<T extends boolean = true> {
|
||||||
eliteBestTimeMs?: T;
|
eliteBestTimeMs?: T;
|
||||||
xpEarned?: T;
|
xpEarned?: T;
|
||||||
};
|
};
|
||||||
|
callForFire?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
gamesPlayed?: T;
|
||||||
|
wins?: T;
|
||||||
|
losses?: T;
|
||||||
|
bestScore?: T;
|
||||||
|
xpEarned?: T;
|
||||||
|
bestPatrolMissions?: T;
|
||||||
|
bestCheckpointMissions?: T;
|
||||||
|
bestCompoundMissions?: T;
|
||||||
|
};
|
||||||
poker?:
|
poker?:
|
||||||
| T
|
| T
|
||||||
| {
|
| {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue