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
|
|
@ -3,29 +3,35 @@
|
|||
these rules, not separate code: Normal comes as Change Freeze, On-call (the classic game) and BGP at 3 a.m.;
|
||||
Sandbox and Puzzles are presets too. Saves without rules load as On-call, so nothing changes for them.
|
||||
Scenarios and the weekly challenge run on On-call plus their own S.scn.rules (scnRule()). */
|
||||
const RULE_DEF={clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder',mods:[]};
|
||||
const RULE_OK={clock:[true,false],chaos:['none','calm','normal','spicy'],lead:['real','quick'],market:[true,false],money:['normal','infinite'],gates:['ladder','open']};
|
||||
// sea: cable ships sail out to subsea cuts, or (timer) a cut mends on its own clock. confs: conference season.
|
||||
// broke: deep in the red ends the game, or (rescue) a state loan keeps it going. moods: patient customers sour half as fast.
|
||||
const RULE_DEF={clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder',sea:'ships',confs:true,broke:'lose',moods:'normal',mods:[]};
|
||||
const RULE_LATE=['sea','confs','broke','moods'];
|
||||
const RULE_OK={clock:[true,false],chaos:['none','calm','normal','spicy'],lead:['real','quick'],market:[true,false],money:['normal','infinite'],gates:['ladder','open'],sea:['ships','timer'],confs:[true,false],broke:['lose','rescue'],moods:['normal','patient']};
|
||||
// i: icon, n: name, d: the one-line joke, x: what is different, in small print.
|
||||
const PRESETS={
|
||||
soft:{i:'☕',n:tr('rules.best_effort'),d:tr('rules.no_sla_no_pager_no_promises'),x:tr('rules.rare_outages_no_ddos_no_conferences'),clock:true,chaos:'calm',lead:'quick',market:false,money:'normal',gates:'ladder',sea:'timer',confs:false,broke:'rescue',moods:'patient'},
|
||||
freeze:{i:'🧊',n:tr('rules.change_freeze'),d:tr('rules.nobody_touches_prod_even_the_backhoes'),x:tr('rules.a_third_of_the_outages_no_ddos_pnis'),clock:true,chaos:'calm',lead:'quick',market:false,money:'normal',gates:'ladder'},
|
||||
oncall:{i:'📟',n:tr('rules.on_call'),d:tr('rules.the_real_thing_your_pager_has'),x:tr('rules.real_lead_times_real_outages_a_real'),clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder'},
|
||||
bgp:{i:'🔥',n:tr('rules.bgp_at_3_a_m'),d:tr('rules.everything_is_on_fire_and_it'),x:tr('rules.more_and_longer_outages_more_ddos'),clock:true,chaos:'spicy',lead:'real',market:true,money:'normal',gates:'ladder'},
|
||||
sandbox:{i:'🏖️',n:tr('common.sandbox'),d:tr('rules.a_billion_dollars_every_unlock_your'),x:tr('rules.infinite_money_everything_unlocked_quick'),clock:true,chaos:'none',lead:'quick',market:true,money:'infinite',gates:'open'},
|
||||
puzzle:{i:'🧩',n:tr('rules.puzzle'),d:tr('rules.one_small_network_one_tricky_goal'),x:tr('rules.no_clock_no_bills_nothing_breaks'),clock:false,chaos:'none',lead:'quick',market:false,money:'normal',gates:'open'},
|
||||
};
|
||||
const NORMAL_PRESETS=['freeze','oncall','bgp'];
|
||||
const NORMAL_PRESETS=['soft','freeze','oncall','bgp'];
|
||||
// How often things break, against the classic game. Spicy outages also last half as long again.
|
||||
const CHAOS={none:{i:'😴',n:tr('rules.chaos_none'),d:tr('rules.nothing_ever_breaks'),m:0},calm:{i:'🧊',n:tr('rules.chaos_calm'),d:tr('rules.a_cut_now_and_then'),m:0.35},normal:{i:'📟',n:tr('rules.chaos_normal'),d:tr('rules.like_the_real_game'),m:1},spicy:{i:'🔥',n:tr('rules.chaos_spicy'),d:tr('rules.your_pager_never_sleeps'),m:1.8}};
|
||||
const SPICY_LONG=1.5,LEAD_QUICK=10;
|
||||
function rule(k){const r=S&&S.rules;return r&&r[k]!==undefined?r[k]:RULE_DEF[k];}
|
||||
function rulePreset(){const p=S&&S.rules&&S.rules.preset;return p&&Object.prototype.hasOwnProperty.call(PRESETS,p)?p:'oncall';}
|
||||
const shipsOn=()=>rule('sea')!=='timer',confsOn=()=>rule('confs')!==false;
|
||||
function gatesOpen(){return rule('gates')==='open';}
|
||||
function chaosMul(){const c=CHAOS[rule('chaos')];return c?c.m:1;}
|
||||
// Days until something ordered arrives: as quoted, or a tenth of it (at least a day) with quick lead times.
|
||||
function leadDays(n){return rule('lead')==='quick'?Math.max(1,Math.round(n/LEAD_QUICK)):n;}
|
||||
// A fresh, valid rules object: the preset's values, with any valid overrides on top.
|
||||
function makeRules(preset,o){const p=Object.prototype.hasOwnProperty.call(PRESETS,preset)?preset:'oncall',P=PRESETS[p],r={preset:p};o=o&&typeof o==='object'?o:{};
|
||||
for(const k of Object.keys(RULE_OK)){const d=P[k]!==undefined?P[k]:RULE_DEF[k];r[k]=RULE_OK[k].includes(o[k])?o[k]:d;}
|
||||
// The later rules are written only where they differ from the classic game, so older networks' rules stay as they were.
|
||||
for(const k of Object.keys(RULE_OK)){const d=P[k]!==undefined?P[k]:RULE_DEF[k],v=RULE_OK[k].includes(o[k])?o[k]:d;if(!RULE_LATE.includes(k)||v!==RULE_DEF[k])r[k]=v;}
|
||||
r.mods=Array.isArray(o.mods)?[...new Set(o.mods.filter(m=>typeof m==='string'&&/^[a-z0-9_-]{1,24}$/.test(m)))].slice(0,16):[];
|
||||
return r;}
|
||||
// What the HUD and the share card say about the rules. On-call says nothing: it is the game.
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@ function spawnLoanOffer(emergency){
|
|||
S.loanOffers.push(o);
|
||||
toast(tr('banks.bank_would_like_to_lend_you',{bank:esc(B.name),amount:fmt$(amount)})+'<br>'+(emergency?tr('banks.they_heard_you_might_be_in'):tr('banks.terms_apply_several_terms')),emergency?'bad':'goal',[{l:tr('common.open_bank'),act:'bank',args:{}}]);
|
||||
}
|
||||
// Best Effort has no game over: deep in the red, the Ministry of Tubes lends what it takes to be back in the black,
|
||||
// cheap, over five years, no conditions. The repayments are still yours.
|
||||
const RESCUE_APR=0.02,RESCUE_TERM=60;
|
||||
function rescueLoan(){const amount=niceAmt(Math.max(250000,-S.cash+Math.max(150000,(R.costMo||0)*2)));
|
||||
S.cash+=amount;S.stats.rescues=(S.stats.rescues||0)+1;S.neg=0;
|
||||
S.loans.push({id:uid(),bank:'gov',start:S.day,amount,got:amount,bal:amount,apr:RESCUE_APR,apr0:RESCUE_APR,pay:Math.round(annuity(amount,RESCUE_APR,RESCUE_TERM)),left:RESCUE_TERM,term:RESCUE_TERM,share:0,covs:[],base:{sub:S.links.filter(x=>x.sub).length}});
|
||||
track('rescue');toast(`<b>${tr('banks.bank_stepped_in',{bank:esc(BANKS.gov.name)})}</b><br>${tr('banks.a_rescue_loan_of_amount_keeps',{amount:fmt$(amount),pay:fmt$(Math.round(annuity(amount,RESCUE_APR,RESCUE_TERM)))})}`,'bad',[{l:tr('common.open_bank'),act:'bank',args:{}}]);sfx('coin');}
|
||||
function loanTick(d){
|
||||
// conditions: 15-day grace, then a penalty every 30 days while broken
|
||||
for(const l of S.loans){const B=BANKS[l.bank];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ const confSp=cf=>!cf.cap&&[...cf.key].reduce((a,ch)=>(a*31+ch.charCodeAt(0))>>>0
|
|||
const confCost=cf=>cf.cap?CAP_COST:CONF_COST;
|
||||
const confDay=(cf,y)=>dayOf(y+1,cf.m,10);
|
||||
function confKey(cf,y){return cf.n+'@'+cf.c+'@'+y;}
|
||||
function upcomingConfs(within){const y0=cal(S.day).y-1,out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
// No conference season in Best Effort: nothing to register for, nothing in the panel, no invitations.
|
||||
function upcomingConfs(within){if(!confsOn())return [];const y0=cal(S.day).y-1,out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
function confBoost(id){const cb=S.conf;if(!cb||!(cb.until>S.day))return 1;const n=NET[id];return n&&n.pops.some(c=>CITY[c]&&CITY[c].reg===cb.reg)?0.5:1;}
|
||||
function confTick(d){S.confReg=S.confReg||{};
|
||||
for(const cf of upcomingConfs(30)){if(cf.day-d===30&&!S.confReg[cf.key])toast(tr('conferences.conf_comes_to_city_in_30',{conf:esc(cf.n),city:esc(CITY[cf.c].name)}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ function fireFailure(only){
|
|||
const en=l.sub&&(CITY[l.a].au||CITY[l.b].au)&&!(l.cable&&CAB[l.cable].fragile)&&Math.random()<0.35?pick([N_('failures.box_jellyfish_season_at_the_a'),N_('failures.a_great_white_took_an_interest')]):l.cable&&CAB[l.cable].fragile&&Math.random()<0.8?pick([N_('failures.your_a_b_cable_is_cut'),N_('failures.a_b_is_down_same_cable')]):!l.sub&&CITY[l.a].land==='nzs'&&CITY[l.b].land==='nzs'&&Math.random()<0.75?pick([N_('failures.a_kea_pulled_the_rubber_seals'),N_('failures.the_sandflies_drove_your_splicing'),N_('failures.a_farmer_s_post_hole_digger')]):l.cable==='cook'&&Math.random()<0.6?N_('failures.a_ferry_dropped_anchor_in_cook'):!l.sub&&au&&Math.random()<0.75?pick([N_('failures.a_sulphur_crested_cockatoo_chewed'),N_('failures.a_kangaroo_hit_the_fiber_hut'),N_('failures.thieves_dug_up_your_a_b'),N_('failures.a_kilometre_of_copper_went_missing'),N_('failures.a_backhoe_putting_in_a_new'),N_('failures.the_emus_won_again_a_mob'),N_('failures.a_kangaroo_boxed_your_field_tech'),N_('failures.a_drop_bear_fell_on_the'),N_('failures.an_eastern_brown_snake_moved_into'),...((S.day%365)/30.42>=8&&(S.day%365)/30.42<11?[N_('failures.magpie_swooping_season_the_field')]:[]),...(auSummer?[N_('failures.bushfire_season_the_fiber_along_a')]:[]),...(nullPair(l.a,l.b)?[N_('failures.your_a_b_fiber_broke_somewhere')]:[])]):l.sub&&(l.a==='bda'||l.b==='bda')&&Math.random()<0.7?pick([N_('failures.your_a_b_cable_went_quiet'),N_('failures.the_repair_ship_s_compass_spun')]):l.sub&&(l.a==='tbu'||l.b==='tbu')&&Math.random()<0.7?pick([N_('failures.an_undersea_volcano_erupted_next_to'),N_('failures.the_seabed_off_tonga_slid_down')]):vn(l)&&Math.random()<0.8?pick([N_('failures.another_of_vietnam_s_subsea_cables'),N_('failures.your_a_b_cable_broke_in')]):!l.sub&&(l.a==='drw'||l.b==='drw')&&Math.random()<0.7?pick([N_('failures.a_crocodile_took_a_bite_out'),N_('failures.termites_ate_the_duct_on_a')]):tw(l)&&Math.random()<0.8?pick([N_('failures.a_cargo_ship_forgot_to_raise'),N_('failures.another_anchor_another_cut_your_a'),N_('failures.a_fishing_boat_with_an_unusually')]):l.sub&&(l.a==='oos'||l.b==='oos')&&Math.random()<0.8?pick([N_('failures.a_trawler_off_ostend_dragged_its'),N_('failures.a_wind_farm_service_vessel_dropped')]):!l.sub&&(CITY[l.a].ca||CITY[l.b].ca)&&Math.random()<0.4?pick([N_('failures.a_beaver_chewed_through_your_a'),N_('failures.your_a_b_fiber_is_down'),N_('failures.frost_heave_cracked_the_duct_on')]):!l.sub&&andesPair(l.a,l.b)?pick([N_('failures.a_landslide_in_the_andes_buried'),N_('failures.snow_closed_the_mountain_pass_and'),N_('failures.an_earthquake_shook_your_a_b'),N_('failures.a_llama_herd_trampled_the_fiber')]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([N_('failures.road_widening_near_a_cut_your'),N_('failures.the_monsoon_flooded_a_manhole_on'),N_('failures.a_digger_found_your_a_b')]):l.sub?pick([N_('failures.a_curious_shark_bit_your_subsea'),N_('failures.a_ship_dragged_its_anchor_across'),N_('failures.an_undersea_landslide_snapped_a_b')]):pick([N_('failures.a_backhoe_found_your_fiber_between'),N_('failures.squirrels_chewed_through_a_b_they'),N_('failures.road_works_cut_a_b_nobody')]);
|
||||
addInc({type,ref:trc,until:S.day+dur,msg:tr(en,{a:A,b:B})+(hit.length>1?' '+tr('failures.all_n_links_in_that_trench',{n:hit.length}):''),cost:Math.max(4000,Math.round(hit.reduce((a,x)=>a+x.mo,0)*0.5))},en);
|
||||
// At sea a cable ship sails out to it (50-cable-ships.js): it sets how long the cut lasts and what a charter costs.
|
||||
if(l.sub&&!pzOn())shipCut(S.inc[S.inc.length-1],l);
|
||||
// Without ships (Best Effort) a sea cut mends on the same clock as one on land.
|
||||
if(l.sub&&!pzOn()&&shipsOn())shipCut(S.inc[S.inc.length-1],l);
|
||||
}else if(type==='crash'||type==='power'){
|
||||
const c=pick(Object.keys(S.pops).flatMap(x=>type==='power'&&(CITY[x].za||CITY[x].blackout)?[x,x,x]:type==='crash'&&RG[S.pops[x].rgen||0].flaky?[x,x,x]:[x])),pp=S.pops[c],slow=slowBoot(c),dur=(type==='crash'?2+Math.floor(Math.random()*2):3+Math.floor(Math.random()*3))*(type==='crash'&&S.ev.sanction>S.day?2:1)+(slow?2+Math.floor(Math.random()*3):0);
|
||||
if(type==='crash'&&(pp.routers||1)>=2){pp.rdown=S.day+dur;S.stats.incidents++;S.stats.survived++;toast(tr('failures.router_crash_in_city_one_router',{city:CITY[c].name,slow:slow?' '+tr('failures.the_crashed_one_what',{what:esc(pick(SLOW_BOOT))}):'',d:dur}),'good');sfx('alert');return;}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* ---------- daily tick ---------- */
|
||||
/* A day is two halves around its routing: dayPre() (the world moves on), compute(), dayPost() (bills, moods, offers).
|
||||
In play the routing can run in a worker in between (28-route-worker.js); tests and the fallback run it in one go. */
|
||||
function dayTick(){const d=dayPre();if(d===false)return;compute();dayPost(d);}
|
||||
// UI.tick: what the day itself announces, which quiet notifications may keep to the NOC log.
|
||||
function dayTick(){UI.tick=true;try{const d=dayPre();if(d===false)return;compute();dayPost(d);}finally{UI.tick=false;}}
|
||||
function dayPre(){
|
||||
if(!S||S.lost||!rule('clock'))return false; // no clock (puzzles): no days, no bills, nothing fires
|
||||
S.day++;
|
||||
|
|
@ -47,7 +48,7 @@ function dayPost(d){
|
|||
(a.sla||(a.sla=[])).push(b.id);b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1;
|
||||
toast(tr('day_tick.sla_breach_name_the_attack_on',{name:esc(b.name),city:CITY[a.city].name,pen:fmt$(SLA_PEN)}),'bad');sfx('err');}}
|
||||
// businesses mood
|
||||
const ids=linkIds(),frr=coreFrr()&&S.links.some(l=>l.cut)?.5:1;const bhT=new Set(ddosAll().filter(a=>a.bh).map(a=>a.tgt));for(const b of S.biz.slice()){if(eventTick(b,d)||capPendTick(b,d))continue;b.pm=b.mood;if(bhT.has(b.id))continue;const sf=bizSf(b,ids),reachOk=BIZ_T[b.type].l2||BIZ_T[b.type].fiber||R.reach>0.99||scnRule('local'),scrubOk=b.type!=='scrub'||(hasScrub()&&!scrubFar(b.city)),divOk=reqOk(b);
|
||||
const ids=linkIds(),frr=(coreFrr()&&S.links.some(l=>l.cut)?.5:1)*(rule('moods')==='patient'?.5:1);const bhT=new Set(ddosAll().filter(a=>a.bh).map(a=>a.tgt));for(const b of S.biz.slice()){if(eventTick(b,d)||capPendTick(b,d))continue;b.pm=b.mood;if(bhT.has(b.id))continue;const sf=bizSf(b,ids),reachOk=BIZ_T[b.type].l2||BIZ_T[b.type].fiber||R.reach>0.99||scnRule('local'),scrubOk=b.type!=='scrub'||(hasScrub()&&!scrubFar(b.city)),divOk=reqOk(b);
|
||||
if(sf>=0.95&&reachOk&&scrubOk&&divOk)b.mood=Math.min(100,b.mood+2);
|
||||
else if(S.day-(b.since||0)<15){}
|
||||
else{b.mood-=frr*(Math.max(0,0.95-sf)*45+(!reachOk?3:0)+(!scrubOk?4:0)+(!divOk?3:0));
|
||||
|
|
@ -87,7 +88,7 @@ function dayPost(d){
|
|||
// money trouble
|
||||
if(S.cash<0){S.neg++;if(S.neg===1)toast(tr('day_tick.you_are_in_the_red_cancel'),'bad');}
|
||||
else S.neg=0;
|
||||
if(S.cash<-100000){S.lost=true;track('bankrupt');showLose();return;}
|
||||
if(S.cash<-100000){if(rule('broke')==='rescue')rescueLoan();else{S.lost=true;track('bankrupt');showLose();return;}}
|
||||
{const c=cal(d);if(c.m===0&&c.d===1&&[2,3,5].includes(c.y))track('game_year_'+c.y,true);}
|
||||
if(d%10===0)save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:{};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
/* ---------- toasts & modals ---------- */
|
||||
function toast(html,kind='',actions=[],open=null){
|
||||
if(S)logNote(html,kind,actions,open);
|
||||
// Quiet notifications: what the day announces pops up only for trouble and milestones; the rest stays in the NOC log.
|
||||
if(UI.tick&&kind!=='bad'&&kind!=='goal'&&quietOn())return;
|
||||
const el=document.createElement('div');el.className='toast '+kind;el.dataset.born=performance.now();
|
||||
el.innerHTML=`<div class="tx">${html}</div>${actions.map(a=>btn(a.l,a.act,a.args,'sm')).join('')}`;
|
||||
const box=$('toasts');box.prepend(el);const max=innerWidth<760?2:3;while(box.children.length>max)box.lastChild.remove();
|
||||
|
|
|
|||
|
|
@ -9,20 +9,23 @@ const langPick=id=>`<select class="pick" id="${id}" data-chg="langSet" aria-labe
|
|||
function segBtns(act,cur,opts){return opts.map(([v,l])=>btn(l,act,{v},cur===v?'pink sm':'ghost sm')).join('');}
|
||||
/* Animation setting: auto follows the system's reduced-motion preference, or force it on or off. */
|
||||
/* Settings are per device (localStorage), not part of the save: they are about how you like to play. */
|
||||
const PREF_DEF={pauseFurious:true,warnUnhappy:true,pauseIncident:false};
|
||||
const PREF_DEF={pauseFurious:true,warnUnhappy:true,pauseIncident:false,quiet:false};
|
||||
let PREFS=(()=>{try{const j=JSON.parse(localStorage.getItem('sot-prefs')||'{}');return j&&typeof j==='object'?j:{};}catch(e){return {};}})();
|
||||
const pref=k=>typeof PREFS[k]==='boolean'?PREFS[k]:PREF_DEF[k];
|
||||
// Quiet notifications: the player's choice once made, until then on in Best Effort only.
|
||||
const quietOn=()=>typeof PREFS.quiet==='boolean'?PREFS.quiet:rulePreset()==='soft';
|
||||
function setPref(k,v){if(!own(PREF_DEF,k))return;PREFS[k]=!!v;try{localStorage.setItem('sot-prefs',JSON.stringify(PREFS));}catch(e){}}
|
||||
// Stop the clock for something the player must see. Nothing happens if the game is already paused.
|
||||
function autoPause(){if(!S||!UI.speed)return false;UI.resumeSpeed=UI.speed;UI.speed=0;renderHUD();return true;}
|
||||
const resumeAct=()=>({l:tr('common.resume'),act:'speed',args:{v:UI.resumeSpeed||1}});
|
||||
function settingsHtml(){const seg=(lab,act,cur,opts,note)=>`<div class="setline"><span>${lab}</span><div class="seg">${segBtns(act,cur,opts)}</div></div>${note?`<p class="meta" style="margin:0 0 6px">${note}</p>`:''}`;
|
||||
const onoff=k=>[[k+':1',tr('common.on')],[k+':0',tr('common.off')]],cur=k=>k+':'+(pref(k)?1:0);
|
||||
const onoff=k=>[[k+':1',tr('common.on')],[k+':0',tr('common.off')]],cur=k=>k+':'+((k==='quiet'?quietOn():pref(k))?1:0);
|
||||
return `<div style="display:flex;align-items:center"><h2 style="font-size:26px">⚙️ ${tr('common.settings')}</h2><button class="x" data-act="settingsClose" aria-label="${tr('common.close')}">×</button></div><p class="tagline">${tr('settings.saved_on_this_device')}</p>
|
||||
<h3 class="sub4">${tr('settings.customers_and_alerts')}</h3>
|
||||
${seg(tr('settings.pause_when_a_customer_is_furious'),'prefSet',cur('pauseFurious'),onoff('pauseFurious'),tr('settings.the_game_stops_so_you_can'))}
|
||||
${seg(tr('settings.warn_when_a_customer_gets_unhappy'),'prefSet',cur('warnUnhappy'),onoff('warnUnhappy'),tr('settings.an_early_heads_up_below_60'))}
|
||||
${seg(tr('settings.pause_on_outages_that_hurt'),'prefSet',cur('pauseIncident'),onoff('pauseIncident'),tr('settings.stops_the_game_when_a_failure'))}
|
||||
${seg(tr('settings.quiet_notifications'),'prefSet',cur('quiet'),onoff('quiet'),tr('settings.only_trouble_and_milestones_pop_up'))}
|
||||
<h3 class="sub4">${tr('settings.display_and_sound')}</h3>
|
||||
${seg(tr('common.animations'),'animSet',UI.anim||'auto',[['auto',tr('common.auto')],['on',tr('common.on')],['off',tr('common.off')]],tr('settings.auto_follows_your_device_s_reduce'))}
|
||||
${seg(tr('common.sound'),'soundSet',UI.muted?'off':'on',[['on',tr('common.on')],['off',tr('common.off')]])}
|
||||
|
|
|
|||
|
|
@ -283,11 +283,13 @@
|
|||
"bank.the_rest_is_due_at_the":"the rest is due at the end",
|
||||
"bank.then_about_price_at_once":"then about {price} at once",
|
||||
"bank.you_pay_pct_of_your_transit":"You pay {pct} of your transit bill until {price} is repaid.",
|
||||
"banks.a_rescue_loan_of_amount_keeps":"A rescue loan of {amount} keeps the lights on: {pay} a month for five years, no conditions.",
|
||||
"banks.always_open_ask_no_questions_do":"Always open. Ask no questions. Do not be late.",
|
||||
"banks.always_run_an_odd_number_of":"Always run an odd number of POPs. Our numerologist insists.",
|
||||
"banks.bank_are_circling_they_now_take":"<b>{bank} are circling.</b><br>They now take {pct} of your revenue.",
|
||||
"banks.bank_is_unhappy_you_broke_a":"<b>{bank} is unhappy.</b><br>You broke a loan condition: {cond} Fix it within 10 days or pay a penalty.",
|
||||
"banks.bank_sign_is_in_retrograde_your":"<b>{bank}: {sign} is in retrograde.</b><br>Your rate is now {apr}%.",
|
||||
"banks.bank_stepped_in":"{bank} stepped in.",
|
||||
"banks.bank_the_balloon_popped_the":"<b>{bank}: the balloon popped.</b><br>The remaining {price} was due today, all at once. It has left your account.",
|
||||
"banks.bank_would_like_to_lend_you":"<b>{bank} would like to lend you {amount}.</b>",
|
||||
"banks.cheap_patient_and_very_particular":"Cheap, patient, and very particular about Stuttgart.",
|
||||
|
|
@ -3534,6 +3536,7 @@
|
|||
"rules.a_billion_dollars_every_unlock_your":"A billion dollars, every unlock, your own subsea cable.",
|
||||
"rules.a_cut_now_and_then":"A cut now and then.",
|
||||
"rules.a_third_of_the_outages_no_ddos_pnis":"A third of the outages, no DDoS. PNIs and builds in days. No shortages, no sold-out routes, no de-peering.",
|
||||
"rules.best_effort":"Best Effort",
|
||||
"rules.bgp_at_3_a_m":"BGP at 3 a.m.",
|
||||
"rules.change_freeze":"Change Freeze",
|
||||
"rules.chaos_calm":"Calm",
|
||||
|
|
@ -3545,11 +3548,13 @@
|
|||
"rules.like_the_real_game":"Like the real game.",
|
||||
"rules.more_and_longer_outages_more_ddos":"Almost twice the outages, half as long again, twice the DDoS. Everything on.",
|
||||
"rules.no_clock_no_bills_nothing_breaks":"No clock, no bills, nothing breaks.",
|
||||
"rules.no_sla_no_pager_no_promises":"No SLA, no pager, no promises. Just tubes.",
|
||||
"rules.nobody_touches_prod_even_the_backhoes":"Nobody touches prod. Even the backhoes are on holiday.",
|
||||
"rules.nothing_ever_breaks":"Nothing ever breaks.",
|
||||
"rules.on_call":"On-call",
|
||||
"rules.one_small_network_one_tricky_goal":"One small network, one tricky goal.",
|
||||
"rules.puzzle":"Puzzle",
|
||||
"rules.rare_outages_no_ddos_no_conferences":"Rare outages, no DDoS, no chaos monkey, no conferences. Sea cuts mend without cable ships, builds take days, prices stay put. Patient customers, quiet notifications, and a rescue loan instead of game over.",
|
||||
"rules.real_lead_times_real_outages_a_real":"Real lead times, real outages, a real market. The classic game.",
|
||||
"rules.rules_are_locked_for_this_network":"{rules}: rules are locked for this network.",
|
||||
"rules.the_real_thing_your_pager_has":"The real thing. Your pager has opinions.",
|
||||
|
|
@ -3646,8 +3651,10 @@
|
|||
"settings.customers_and_alerts":"Customers and alerts",
|
||||
"settings.display_and_sound":"Display and sound",
|
||||
"settings.for_reporting_layout_bugs_shows_what":"For reporting layout bugs: shows what your screen tells the game.",
|
||||
"settings.only_trouble_and_milestones_pop_up":"Only trouble and milestones pop up; everything else goes quietly into the NOC log. On by default in Best Effort.",
|
||||
"settings.pause_on_outages_that_hurt":"Pause on outages that hurt",
|
||||
"settings.pause_when_a_customer_is_furious":"Pause when a customer is furious",
|
||||
"settings.quiet_notifications":"Quiet notifications",
|
||||
"settings.saved_on_this_device":"Saved on this device.",
|
||||
"settings.stops_the_game_when_a_failure":"Stops the game when a failure costs you real traffic, not when it reroutes by itself.",
|
||||
"settings.the_game_stops_so_you_can":"The game stops so you can fix their service before they cancel. Most useful at high speed.",
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi
|
|||
.door.on,.preset.on,.chs.on{background:#FFE3F0;border-color:var(--me);box-shadow:0 4px 0 var(--me)}
|
||||
.door.on::after,.preset.on::after,.chs.on::after{content:"✓";position:absolute;top:6px;right:9px;font:900 15px var(--display);color:var(--me)}
|
||||
.door[data-door=puzzle],.door[data-door=scn]{background:var(--soft)}
|
||||
.presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
|
||||
.presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
|
||||
.preset small{font-size:11px;color:var(--ink2);line-height:1.3;margin-top:4px;border-top:2px dashed var(--line);padding-top:4px}
|
||||
.preset[data-preset=bgp].on{background:#FFE9D6;border-color:#FF6A2B;box-shadow:0 4px 0 #FF6A2B}.preset[data-preset=bgp].on::after{color:#FF6A2B}
|
||||
.preset[data-preset=freeze].on{background:#E2F5FF;border-color:var(--sea2);box-shadow:0 4px 0 var(--sea2)}.preset[data-preset=freeze].on::after{color:var(--sea2)}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transpar
|
|||
.tagline{font-size:13.5px;margin:8px 0 10px}
|
||||
.slots{max-height:38vh}.slot-go{padding:7px 4px 7px 9px;gap:8px}.slot-go>i{font-size:22px}.slot .sn b{font-size:16px}.slot .sm em{font-size:13.5px}.slot .sn small,.slot .sm small{font-size:11.5px}
|
||||
.door{padding:7px 9px 6px}.door i{font-size:22px}.door b{font-size:16px}.door span{font-size:11.5px}
|
||||
.presets{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
|
||||
.presets{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
|
||||
.presets .preset{flex-direction:column;align-items:center;text-align:center;padding:6px 4px;gap:0}
|
||||
.presets .preset i{font-size:20px}.presets .preset b{font-size:13.5px}
|
||||
.chaos{grid-template-columns:repeat(2,minmax(0,1fr))}
|
||||
|
|
@ -80,7 +80,7 @@ button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transpar
|
|||
#left.full,#panel.full{width:min(640px,80%) !important}
|
||||
#tabbar button .ic{font-size:16px}
|
||||
.doors{grid-template-columns:repeat(4,minmax(0,1fr))}.chaos{grid-template-columns:repeat(4,minmax(0,1fr))}
|
||||
.presets{grid-template-columns:repeat(3,minmax(0,1fr))}.preset{display:flex}
|
||||
.presets{grid-template-columns:repeat(4,minmax(0,1fr))}.preset{display:flex}
|
||||
body.sheet-open #coach{bottom:calc(var(--tabbar) + 8px);left:8px;transform:none;width:calc(42% - 16px)}
|
||||
}
|
||||
/* Installed as an app: no browser chrome, so leave room for the notch and the home indicator. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue