4. Missions: one strategy per mission
-
[E] A mission is a file with
canSend(fleet, target)(pure, insrc/core, used by server and browser) andonArrive(ctx, fleet)(server only). A registry replaces theifchain insrc/server/game/arrival.ts. -
[E] Decided for #116 (owner, 2026-11-14):
- Form: each
src/features/missions/<m>/rules.tsexportscanSendand typed data: the order, the target kind (own, foreign, any, free), cargo yes or no, return yes or no, ships visible to the defender yes or no, silent return yes or no. Data, no free hooks. [V] #169 adds one more typed field,alertsGuild(whether the launch writes an event into the chat of the defender’s guild; the attack only), so the server asks the rules, not the mission’s name. - Send check:
canSendreturns an error code or nothing. The server determines the noob protection and turns the codes into today’s German messages, in today’s order. Slots, cargo and fuel stay generic. The fleet form keeps offering every mission (replaces the [V] of #116 that the fleet view offers only whatcanSendallows). - Arrival: the dispatcher in the server’s arrival code checks generically through the target kind whether the target still fits, else „Flotte kehrt um“. Colonize gets the raw target, the others the settled target, in today’s order and with the same random draws.
- Order: an
orderfield in eachrules.ts, in steps of 10; order and preselection of the fleet form stay (attack, transport, spy, colonize, deploy; the first preselected). - Server registry:
gen-featuresalso writessrc/features/index.server.gen.ts(MISSION_SERVERS), not checked in; every mission needs anarrive.server.ts; onlysrc/serverimports that index (dependency-cruiser). - Type
Mission: a type-only derivation from the generated index, if the ruleno-circularallows it (else the question comes back). - Texts: see section 2.
- Form: each
-
[E] Built with #116: five folders
attack,transport,spy,colonize,deploy, each withrules.ts,texts.de.ts,arrive.server.tsand a test of its owncanSendandonArrive(seeded random, fixed clock). The data: attack 10, foreign, cargo, return, visible; transport 20, any, cargo, return; spy 30, foreign, no cargo, return, silent (it comes home without a report of its own unless recalled); colonize 40, free, cargo, return; deploy 50, own, cargo, no return. OnlycanSendof spy (only Spähschädel,probesOnly) and of colonize (a Kolonistenarche,noColonyShip) check anything; the others return nothing.src/core/missions.tsholds the types (TargetKind,SendError,SendFleet,SendTarget,MissionRules),missionRules(m)from the index,MISSION,suits(kind, owner, planet)andsendError(rules, fleet, target): first the target kind (occupied; no planet, same planet, not own, own target, noob protection), then the mission’scanSend. The server passes the noob protection asprotects(owner), asked only for a foreign target after the other checks, so the points are computed as rarely as before;fleet-actions.tsmaps each code to its message.src/server/game/arrival.tsreadsonArrivefromMISSION_SERVERS; the target fits bysuitsand, for a free target, by a position inside the universe (the check colonize had); a free target gets no arrival (null, nothing is there), the others{ t, att, def }with the settled planet. The coming home readssilent, the view of a foreign fleetvisible, the cargo of a sendcargo, the fleet formorder,target(„Freie Position“) andreturns(no return time).MissionServer,Arrival,turnBack,landandresearchAtare insrc/server/game/missions.ts;arrival.tsstill exportsspyScore,rebuildandplunder, which moved to the spy and attack folders. A fleet of an unknown mission throws andtickremoves it; the database allows only the five missions. Nof.mission ===is left outside the mission folders. -
[E] Built with #55, within the decisions of #116: the seventh folder
hold(Wache stellen, 70) with the new target kindally, a foreign planet whose owner must be an ally:suitstreats it asforeign, the noob protection keeps it as a foreign target, the own planet getsnotAlly, and the mission’scanSendasks the server’sallyandholdingofSendTarget(both optional, asked only by it). Every rules.ts exports the new typed fieldholds; the fleet stateholdsits betweenoutandback, and the server’s clock ends it (dueAtofsrc/core/holding.ts). -
[V] Changed with #228 (owner, 2026-11-16, D2: the thresholds of the Auspex-Lehre apply to every foreign fleet): the field
visibleis gone fromMissionRulesand everyrules.ts; the view of a foreign fleet asksseenShips()ofsrc/core/fleet-recognition.tsinstead (see Espionage defense). -
[E] Built with #45, within the decisions of #116: the sixth folder
harvest(Bergung, 60) with the target kinddebrisbeside own, foreign, any and free.SendTargetcarriesdebris(a Trümmerfeld lies at the position);sendErrorchecks only that for the kinddebris(noDebris), whatever planet is there, thencanSend(noRecycler).suitstakes the field as a fourth argument. A fleet of the kinddebrisflies to the placed<g>_<s>_<p>; at the arrival the dispatcher turns it back when the field is gone, with the text of #45, and else hands it no arrival (null), like a free target, because a field is no planet. Migration 16 allowsharvestin the database (see Trümmerfelder). -
[E] Built with #95, within the decisions of #116: the seventh folder
moonbreak(Mondbruch, 70) with the target kindforeignMoon, a foreign moon and nothing else, so the kind alone says what the mission fits (as #253 needs for its filter, „the moon’s target kind decides“).sendErroranswersnotMoonwhen the fleet does not fly to a moon, then checks it as a foreign target (no moon, same place, own target, noob protection), thencanSend(noWorldbreaker).suitsreads the kind of the place, so at the arrival a target that has become a planet does not fit and the fleet turns back with „Flotte kehrt um“. Its arrival reuses the steps of the attack, moved fromattack/arrive.server.tsintosrc/server/game/fight.ts, because a feature folder never imports another (dependency-cruiser):fight,battleReportswith what a mission adds to each side’s report,flyHome, andrebuildandplunder, which the attack folder re-exports; the attack runs them in the same order and with the same draws as before. Migration20261119T0810-moonbreakallowsmoonbreakin the database (see Moons). -
[V] Built with #237, #253 and #292, within the decisions of #116:
sendErrorisfitError(the target kind, which asks nothing of the ships; the fleet form lists only the missions for which it finds nothing,missionsForofsrc/core/mission-fit.ts) and then the mission’scanSend. Two optional typed fields ofMissionRulesmark missions without naming them:colonizes(the Landnahme, counted against the planet limit) andremembered(the attack and the spy, kept as last targets). The send check of the Landnahme gets the planet limit throughSendFleet.colonies(). -
[V] Built with #54, within the decisions of #116: the folder
missile(Raketenangriff, 90) with the optional typed fieldlaunch('fleet'unless a mission says'missiles', read throughlaunchOf): the fleet form listsFLEET_MISSIONS,sendrefuses the others, andisFleetkeeps them out of the fleet slots and the recall. Missiles whose target is gone are lost instead of turning back. The launch is its own action with its own pure check,launchErrorofsrc/core/missiles.ts(Missiles).