feat(saves)!: add offline crew editing
Add per-country crew slot controls and skill level previews to the launcher. Keep archived crews and their stable IDs in the save, update affected lineups, and back up the save before closing a slot. Verified with both type checks, the launcher build, 2.61.0.64 patch checks, and temporary save read and write checks. BREAKING CHANGE: The launcher automatically upgrades existing saves to format 4. Keep a pre-upgrade backup to use a save with an older launcher.
This commit is contained in:
1 parent
264c5c59b8
commit
d58ba9fb9b
31 files changed
+1021
-139
No files matched your search
@@ -3,11 +3,10 @@
|
||||
*
|
||||
* The price of a country's next slot is config/rank.blk crew_slots slot<N>, N being the
|
||||
* number of crews the country has, as the client shows it (get_crew_slot_cost, aces.exe
|
||||
* 2.61.0.37 0x90eaa0). Without a slot<N> there is nothing more to buy. The new crew is empty
|
||||
* and numbered after every existing crew.
|
||||
* 2.61.0.37 0x90eaa0). Without a slot<N> there is nothing more to buy. The purchased slot is empty.
|
||||
*/
|
||||
import type { BlkBlock } from '@wto/blk';
|
||||
import { addCrew, crewCountOf } from '../profile/profile-crews.ts';
|
||||
import { crewCountOf, openNextCrew } from '../profile/profile-crews.ts';
|
||||
import { canAfford, pay } from '../profile/profile-currency.ts';
|
||||
import type { ResearchRules } from './research-rules.ts';
|
||||
import { ACCEPTED, refused, type RuleOutcome } from './rule-outcome.ts';
|
||||
@@ -18,6 +17,6 @@ export function buyCrewSlot(profile: BlkBlock, rules: ResearchRules, country: st
|
||||
if (!price) return refused('NOT_AVAILABLE');
|
||||
if (!canAfford(profile, price)) return refused('NOT_ENOUGH_MONEY');
|
||||
pay(profile, price);
|
||||
addCrew(profile, country);
|
||||
openNextCrew(profile, country);
|
||||
return ACCEPTED;
|
||||
}
|
||||
Reference in new issue
Block a user