M3: the day's rule checks now live in its two halves, dayPre() and dayPost()

This commit is contained in:
Frederic Jung 2026-11-01 16:39:35 +01:00
parent 18db953818
commit fde4279633
No known key found for this signature in database

View file

@ -230,9 +230,9 @@ test('M2: presets are ordered: Change Freeze never harsher than On-call, BGP at
test('M3: every subsystem that can annoy the player reads a rule', () => {
// [function, what it must read]
const reads = [['dayTick', 'chaosMul()'], ['fireEvent', "rule('market')"], ['ddosTick', 'ddosOff()'],
const reads = [['dayPost', 'chaosMul()'], ['fireEvent', "rule('market')"], ['ddosTick', 'ddosOff()'],
['soldOut', "rule('market')"], ['hwMul', "rule('market')"], ['leadDays', "rule('lead')"], ['pniLead', 'leadDays'],
['dfBuildDays', 'leadDays'], ['dayTick', "rule('clock')"], ['snub', "rule('market')"]];
['dfBuildDays', 'leadDays'], ['dayPre', "rule('clock')"], ['snub', "rule('market')"]];
fail('M3', reads.filter(([f, r]) => !ev(`typeof ${f}==='function'&&${f}.toString().includes(${JSON.stringify(r)})`)).map(([f, r]) => `${f}() does not read ${r}`), 'gate it on the ruleset (src/game/40-progress/30-rules.js)');
// and in play: no chaos and no market means a quiet year
const g = load();