diff --git a/CHANGELOG.md b/CHANGELOG.md index f54e8ba..33095f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Reach in the top bar no longer rounds up to 100% when it is just short, and the Goals tab now says why you are not Tier 1 right now (#73). Tier 1 needs more than 99.9% reach, so one small network out of reach is enough to lose the title. - New waves can join any route you already have between two cities, so two waves can run on the main route and two on the diverse one (#77). Each extra route shows up as its own choice, priced like the route it joins. - Opening a link from the NOC on mobile now closes the NOC sheet so the link details are visible. diff --git a/site/i18n/it.js b/site/i18n/it.js index 117f4aa..7eecdd0 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -2393,4 +2393,7 @@ "Main route":"Percorso principale", "New diverse route +40% · survives cuts alone":"Nuovo percorso diverso +40% · sopravvive da solo ai tagli", "Waves on the same route share its fate: one backhoe cuts them all.":"Le wave sullo stesso percorso ne condividono la sorte: una ruspa le taglia tutte.", +"you cannot reach {list}":"non raggiungi {list}", +"and {n} more":"e altri {n}", +"Not Tier 1 right now: {why}.":"Al momento non sei Tier 1: {why}.", }; diff --git a/site/index.html b/site/index.html index f0533f5..001b308 100644 --- a/site/index.html +++ b/site/index.html @@ -1507,6 +1507,8 @@ function newGame(name,home){ const fmt$=v=>{const a=Math.abs(v),s=v<0?'-':'';if(a>=1e6)return s+'$'+(a/1e6).toFixed(a>=1e7?1:2)+'M';if(a>=1e3)return s+'$'+(a/1e3).toFixed(a>=1e5?0:1)+'k';return s+'$'+Math.round(a);}; const fmtG=g=>g>=1000?(g/1000).toFixed(g>=10000?1:2)+' Tbps':(g>=100?g.toFixed(0):g.toFixed(1))+' Gbps'; const pct=x=>Math.round(x*100)+'%'; +// Reach never rounds up to 100%: Tier 1 needs more than 99.9%, and 99.6% must not look like a full house (#73). +const reachPct=x=>x>0.999?'100%':x>=0.99?(Math.floor(x*1000)/10).toFixed(1)+'%':pct(x); const clamp=(v,a,b)=>Math.max(a,Math.min(b,v)); const pick=a=>a[Math.floor(Math.random()*a.length)]; const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); @@ -1639,7 +1641,7 @@ const t1Need=()=>NETS.filter(n=>n.type==='t1'&&(n.id!=='skl'||(S&&S.t1v>=2))); function isTier1(){return t1Need().every(n=>S.pni.some(p=>p.net===n.id))&&S.transit.length===0&&R.reach>0.999;} // What you are now, not what you once were (#46): buying transit again or losing reach drops the label. function tierLabel(){return S.won&&isTier1()?'Tier 1':isTier2()?'Tier 2':'Tier 3';} -function t1Why(){if(S.transit.length)return tr('you buy transit again');const miss=t1Need().filter(n=>!S.pni.some(p=>p.net===n.id));if(miss.length)return tr('no PNI with {list}',{list:miss.map(n=>n.name).join(', ')});return tr('your reach is {p}, not 100%',{p:pct(R.reach)});} +function t1Why(){if(S.transit.length)return tr('you buy transit again');const miss=t1Need().filter(n=>!S.pni.some(p=>p.net===n.id));if(miss.length)return tr('no PNI with {list}',{list:miss.map(n=>n.name).join(', ')});{const lost=NETS.filter(n=>!R.reachable[n.id]).sort((a,b)=>NSH[b.id]-NSH[a.id]);if(lost.length)return tr('you cannot reach {list}',{list:lost.slice(0,3).map(n=>n.name).join(', ')+(lost.length>3?' '+tr('and {n} more',{n:lost.length-3}):'')});}return tr('your reach is {p}, not 100%',{p:reachPct(R.reach)});} /* ================= SIMULATION ================= */ // Binary-heap Dijkstra over an adjacency map {city:[[neighbour,edge],...]}. wf(edge) gives the weight, @@ -2918,7 +2920,7 @@ function renderHUD(){ $('hTraffic').textContent=`${fmtG(R.served)}`; $('hTrafBar').style.width=(R.demand?R.served/R.demand*100:0)+'%'; $('hTrafBar').style.background=R.demand&&R.served/R.demand<0.9?'var(--bad)':'var(--ok)'; - $('hReach').textContent=pct(R.reach);$('hReach').style.color=R.reach<0.99?'var(--bad)':'var(--eye)'; + $('hReach').textContent=reachPct(R.reach);$('hReach').style.color=R.reach<0.99?'var(--bad)':'var(--eye)'; $('hTier').textContent=tierLabel()+' · '+tr('Lv {n}',{n:S.lvl||1}); {const P=scnProg(),hs=$('hScn');hs.hidden=!P;if(P){const sc=S.scn;$('hScnVal').textContent=sc.done?tr('Done!'):sc.failed?tr("Time's up"):`${Math.round(P.f*100)}% · ${tr('{n}d left',{n:Math.max(0,sc.days-S.day)})}`;}} $('hDate').textContent=dateStr(S.day); @@ -3266,8 +3268,10 @@ function scnCard(){const sc=S.scn,P=scnProg();if(!sc||!P)return '';const left=Ma return `
${tr('Not Tier 1 right now: {why}.',{why:esc(t1Why())})}
`:''; function lvlCard(){const lv=S.lvl||1,nx=LEVELS[lv]; - return `