Rework the daily team screens, share its team block and give the race its admin tab
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m2s
Validate and deploy Sokko G / deploy (push) Successful in 16s

The daily team page now opens on a welcome screen with the three steps,
and the recruitment keeps the same look: golden steps, the choice in a
golden panel with the hidden stars, a team summary of colored mini cards
and its strengths, and a reroll badge. One "Your team" block is shared by
the Guild, the recruitment and the ready team. The header shows the extra
golden stars and the balms; the tips button is gone. On the Guild, team
quests carry a "En groupe" sign until the team is ready and the streak
badge stays readable. The race gets its own admin tab: its own opening,
the day's circuit and results, rewards by place and the watchers' skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-28 09:50:35 +01:00
parent 327337075b
commit 52b35880f2
23 changed files with 570 additions and 253 deletions

View file

@ -481,6 +481,35 @@ test("a race needs a team, runs once a day and is paid once by the server", (t)
assert.equal(db.prepare("SELECT COUNT(*) AS count FROM team_races").get().count, 1);
});
test("the race opens and closes on its own, with its watchers' skill and a daily summary for the administration", (t) => {
const context = game(t);
const { team, player, admin } = context;
const { companions } = readyTeam(context);
const settings = team.settings;
assert.deepEqual([settings.raceEnabled, settings.watcherSkill], [true, { strong: 90, medium: 60, weak: 30 }]);
refuses("TEAM_SETTINGS_INVALID", () => team.updateSettings(admin.id, { ...settings, raceEnabled: "oui" }));
refuses("TEAM_SETTINGS_INVALID", () => team.updateSettings(admin.id, { ...settings, watcherSkill: { ...settings.watcherSkill, weak: 101 } }));
// Des réglages enregistrés avant la Course gardent leurs valeurs et prennent celles de la Course par défaut.
assert.deepEqual(readDailyTeamSettings({ enabled: true, raceRewards: [9, 8, 7, 6] }).watcherSkill, { strong: 90, medium: 60, weak: 30 });
team.updateSettings(admin.id, { ...settings, raceEnabled: false });
assert.deepEqual([team.summary(player.id).raceEnabled, team.view(player.id).raceEnabled, team.summary(player.id).enabled], [false, false, true]);
refuses("RACE_CLOSED", () => team.startRace(player.id, { day: DAY, cardId: companions[0].cardId }));
assert.equal(team.adminSettings().race.started, 0);
team.updateSettings(admin.id, { ...settings, raceEnabled: true, watcherSkill: { strong: 100, medium: 100, weak: 100 } });
const { race } = team.startRace(player.id, { day: DAY, cardId: companions[0].cardId }).team;
const finished = team.finishRace(player.id, { boosts: [] }).team.race;
const summary = team.adminSettings().race;
assert.deepEqual(summary.zones, race.zones);
assert.deepEqual([summary.started, summary.finished, summary.stardust], [1, 1, finished.reward]);
assert.equal(summary.places[finished.place - 1], 1);
assert.deepEqual(summary.opponents, { players: 0, watchers: 3 });
// L'Équipe du jour fermée ferme aussi la Course aux joueurs.
team.updateSettings(admin.id, { ...team.settings, enabled: false });
assert.equal(team.summary(player.id).raceEnabled, false);
});
test("boosts already given cannot change, and an abandoned race ends with them", (t) => {
const context = game(t);
const { team, player, clock } = context;
@ -618,6 +647,7 @@ test("a balm brings a weakened companion back to its starting power, once and at
assert.equal(team.view(player.id).recruitment.current.power, 30);
service.expeditions.addItemsInTx(player.id, ["balm", "balm"]);
assert.equal(team.view(player.id).recruitment.balms, 2);
assert.equal(team.view(player.id).balms, 2);
const healed = team.healCompanion(player.id, { cardId }).team.recruitment;
assert.deepEqual([healed.current.power, healed.current.healed, healed.balms], [50, true, 1]);
assert.equal(team.healCompanion(player.id, { cardId }).team.recruitment.balms, 1);