Add Best Effort, a soft mode, and quiet notifications
A fourth Normal preset, gentler than Change Freeze: calm chaos (so no DDoS and no chaos monkey), quick builds and no market, plus four new rules that only it softens: sea cuts mend on their own clock without cable ships, no conference season, a five-year Ministry of Tubes rescue loan instead of game over, and customers who sour half as fast. The new rules are written into S.rules only when they differ from the classic game, so older networks' rules stay byte for byte what they were. Quiet notifications is a new setting for every mode, on by default in Best Effort: toasts the day itself raises pop up only for trouble and milestones, the rest goes to the NOC log; what a click says still shows. Best Effort badges count as Freeze-dried. The preset picker is four wide, two by two on a phone in portrait.
This commit is contained in:
parent
de4a750cdd
commit
09f205e458
21 changed files with 228 additions and 28 deletions
|
|
@ -85,7 +85,8 @@ const BVAR={freeze:{k:'freeze',lv:1,i:'🧊',n:N_('badges.variant_freeze_dried')
|
|||
const BVAR_IDS=['freeze','oncall','bgp'],bvar=k=>own(BVAR,k)?BVAR[k]:BVAR.oncall;
|
||||
// The preset this save plays under ('oncall' for every save from before rulesets), and the variant it earns (null: none).
|
||||
const rulePre=()=>(typeof rulePreset==='function'?rulePreset():(S&&S.rules&&S.rules.preset))||'oncall';
|
||||
function badgeVar(){if(!S||S.mode==='sandbox')return null;const p=rulePre();return p==='sandbox'||p==='puzzle'?null:own(BVAR,p)?p:'oncall';}
|
||||
// Best Effort earns the gentlest variant, Freeze-dried.
|
||||
function badgeVar(){if(!S||S.mode==='sandbox')return null;const p=rulePre();return p==='sandbox'||p==='puzzle'?null:p==='soft'?'freeze':own(BVAR,p)?p:'oncall';}
|
||||
// The hall of fame is this device's localStorage, so it is checked like a save: unknown variants count as standard.
|
||||
function hof(){let h;try{h=JSON.parse(localStorage.getItem('sot-badges')||'{}');}catch(e){h=null;}if(!h||typeof h!=='object'||Array.isArray(h))return {};
|
||||
for(const k of Object.keys(h)){const x=h[k];if(!x||typeof x!=='object'){delete h[k];continue;}const vs=x.vs&&typeof x.vs==='object'&&!Array.isArray(x.vs)?x.vs:{};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue