diff --git a/site/i18n/it.js b/site/i18n/it.js index 636adef..8a0542a 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -1923,7 +1923,6 @@ "A fiber pair of your own. The glass is cheap, the gear is not: you buy a line system with an amplifier every {km} km, then optics for each channel. Your gear can fail, and you fix it.":"Una coppia di fibre tutta tua. Il vetro costa poco, l’hardware no: compri un sistema di linea con un amplificatore ogni {km} km, poi le ottiche per ogni canale. Il tuo hardware può guastarsi, e lo ripari tu.", "The glass":"Il vetro", "Lease an IRU {price}/mo · ready in 30 days":"Affitta un IRU {price}/mese · pronta in 30 giorni", -"Build your own not under the sea":"Costruiscila tu non sotto il mare", "Build your own {price} · ~{n} days":"Costruiscila tu {price} · ~{n} giorni", "Build your own level 3":"Costruiscila tu livello 3", "A fiber pair on {cable}, {km} km. It shares the cable with everyone else's waves, anchors included.":"Una coppia di fibre su {cable}, {km} km. Condivide il cavo con le wave di tutti gli altri, ancore comprese.", @@ -2220,4 +2219,33 @@ "{n} fiber pairs lit, the trench is full":"{n} coppie di fibre accese, il cavidotto è pieno", "Light fiber pair {n} {price} + {mo}/mo":"Accendi la coppia {n} {price} + {mo}/mese", "The banks have stopped calling.
You have more money than most of them. Loan offers come back if your cash ever drops below {cash}.":"Le banche hanno smesso di chiamare.
Hai più soldi della maggior parte di loro. Le offerte di prestito tornano se la tua cassa scende sotto {cash}.", +"The {ship} sets sail!
{name}, your own {km} km cable from {a} to {b}. Ready in about {n} days, if the whales cooperate.":"La {ship} salpa!
{name}, il tuo cavo di {km} km da {a} a {b}. Pronto in circa {n} giorni, se le balene collaborano.", +"Light fiber pair {n} {price}":"Accendi la coppia {n} {price}", +"your own subsea cable {name}":"il tuo cavo sottomarino {name}", +"No regen sites in the middle of the ocean: long cables run their optics in long-haul mode.":"Niente siti di rigenerazione in mezzo all’oceano: sui cavi lunghi le ottiche lavorano in modalità long-haul.", +"A whale has parked on the route and will not move.":"Una balena si è parcheggiata sul percorso e non si sposta.", +"The cable ship’s coffee machine broke. Nobody works without coffee.":"La macchina del caffè della nave posacavi si è rotta. Senza caffè non lavora nessuno.", +"A fishing fleet is trawling exactly where you need to lay.":"Una flotta di pescherecci sta strascicando proprio dove devi posare.", +"The seabed survey found an old sea mine. A small, very careful detour.":"Il rilievo del fondale ha trovato una vecchia mina. Una piccola, attentissima deviazione.", +"Storm season. The ship is sheltering in port, playing cards.":"Stagione delle tempeste. La nave è al riparo in porto, a giocare a carte.", +"The crew fished out somebody else’s cable by mistake and has to put it back.":"L’equipaggio ha ripescato per sbaglio il cavo di qualcun altro e deve rimetterlo giù.", +"This route is on land. Build your own fiber instead.":"Questo percorso è via terra. Costruisci la tua fibra invece.", +"Laying your own subsea cable is a Tier 1 thing. Go transit-free first.":"Posare un proprio cavo sottomarino è roba da Tier 1. Prima liberati dal transit.", +"{city} has no cable landing station.":"{city} non ha una stazione di approdo per cavi.", +"Nobody gives a foreign network a landing licence in mainland China.":"Nessuno dà a una rete straniera una licenza di approdo nella Cina continentale.", +"Lay your own subsea cable…":"Posa il tuo cavo sottomarino…", +"Your own subsea cable Tier 1 only":"Il tuo cavo sottomarino solo Tier 1", +"Back":"Indietro", +"Your very own subsea cable. A ship lays it across the seabed, you own every fiber pair in it, and nobody else’s waves share your glass. It costs a frankly rude amount of money and takes a long time.":"Il tuo cavo sottomarino personale. Una nave lo posa sul fondale, possiedi ogni coppia di fibre e le onde di nessun altro dividono il tuo vetro. Costa una cifra francamente maleducata e ci vuole parecchio.", +"{km} km of seabed":"{km} km di fondale", +"Fiber pairs":"Coppie di fibre", +"{n} in the cable, the first one lit":"{n} nel cavo, la prima accesa", +"Landing stations":"Stazioni di approdo", +"{a} and {b}":"{a} e {b}", +"Build time":"Tempo di costruzione", +"about {n} days":"circa {n} giorni", +"A leased 1.6T wave on this route costs {price}/mo.":"Un’onda 1.6T in affitto su questa tratta costa {price}/mese.", +"Replace ten of them and the cable pays for itself in about {n} months.":"Sostituiscine dieci e il cavo si ripaga in circa {n} mesi.", +"Cuts still happen, anchors and sharks included, but the repair ship is yours to call.":"I tagli succedono lo stesso, ancore e squali compresi, ma la nave di riparazione la chiami tu.", +"Lay the cable {price}":"Posa il cavo {price}", }; diff --git a/site/index.html b/site/index.html index a74d20e..44a609b 100644 --- a/site/index.html +++ b/site/index.html @@ -673,7 +673,8 @@ const DF_SYS={ const AMP_EVERY=100, AMP_COST=8000, AMP_MO=300; /* Your own trench holds more than one fiber pair (#35). Once a ROADMaster is full you can light the next pair: another ROADMaster and another chain of amplifiers, 64 more channels. Regen huts are shared. */ -const PAIRS_MAX=4,chMax=l=>DF_SYS[l.sys].max*(l.sys==='roadm'&&l.own?Math.max(1,l.pairs|0):1),pairCost=l=>DF_SYS.roadm.cost+ampCount(l.km)*AMP_COST; +const PAIRS_MAX=4,SUB_PAIRS_MAX=8,SUB_PAIR_UP=1500000,pairsMax=l=>l.sub?SUB_PAIRS_MAX:PAIRS_MAX,chMax=l=>DF_SYS[l.sys].max*(l.sys==='roadm'&&l.own?Math.max(1,l.pairs|0):1), + pairCost=l=>DF_SYS.roadm.cost+(l.sub?SUB_PAIR_UP:ampCount(l.km)*AMP_COST); const OPT={ zr4:{n:'Ackackia 400ZR+',g:400,cost:12000,reach:1500,modes:[[400,1500],[200,3000]],rg:1,lvl:2,sys:'lite',blurb:tr('Coherent pluggable in the router. No transponder shelf.')}, zr8:{n:'Sizzle 800ZR+',g:800,cost:22000,reach:900,modes:[[800,900],[400,1800],[200,3600]],rg:2,lvl:3,sys:'lite',blurb:tr('Twice the speed, shorter reach.')}, @@ -1755,7 +1756,7 @@ function compute(){ // money const C=R2.cost,V=R2.rev,pm=S.priceMul; C.pops=Object.values(S.pops).reduce((a,p)=>a+POP_MO+((p.routers||1)-1)*ROUTER_MO+(p.routers||1)*RG[p.rgen||0].mo+(p.gen?GEN_MO:0),0); - C.optical=S.links.filter(l=>l.kind==='df').reduce((a,l)=>a+(l.ready>S.day?0:ampCount(l.km)*AMP_MO*(l.own&&l.sys==='roadm'?Math.max(1,l.pairs|0):1)+(l.regen|0)*REGEN_MO)+(l.spares?Math.round(150+(l.ch||[]).length*80):0),0); + C.optical=S.links.filter(l=>l.kind==='df').reduce((a,l)=>a+(l.ready>S.day?0:ampCount(l.km)*AMP_MO*(l.own&&l.sys==='roadm'&&!l.sub?Math.max(1,l.pairs|0):1)+(l.regen|0)*REGEN_MO)+(l.spares?Math.round(150+(l.ch||[]).length*80):0),0); C.links=S.links.reduce((a,l)=>a+(l.mo||0),0); C.nni=(S.nni||[]).reduce((a,x)=>a+NNI[x.tier].mo,0); C.transit=S.transit.reduce((a,t)=>{const q=p95(t,R2.useT[t.id]||0);R2.p95[t.id]=q;return a+transitMo(t,q);},0); @@ -1799,7 +1800,7 @@ function sanitize(s){ for(const c of Object.keys(s.pops)){const p=s.pops[c];if(!isCity(c)||!p||typeof p!=='object'){delete s.pops[c];continue;}p.routers=int(p.routers,1,RMAX,1);if(p.rgen!==undefined)p.rgen=int(p.rgen,0,RG.length-1,0);p.down=num(p.down,0);if(p.bb&&typeof p.bb==='object')p.bb.d=num(p.bb.d,0);else p.bb=null;} if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra'; const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40); - s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.pairs!==undefined)l.pairs=Math.min(PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&!own(CAB,l.cable))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);if(l.metric&&!own(MET,l.metric))l.metric='normal';return l;}); + s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&!own(CAB,l.cable))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);if(l.metric&&!own(MET,l.metric))l.metric='normal';return l;}); const degO=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null; s.transit=s.transit.filter(t=>t&&isCity(t.city)&&isNet(t.net)).map(t=>(t.lacp=degO(t.lacp),t.site=['a','b','ab'].includes(t.site)?t.site:'a',t.id=sid(t.id),t.tier=tier(t.tier),t.n=lag(t.n),t.down=num(t.down,0),t.clean=!!t.clean,t)); s.pni=s.pni.filter(x=>x&&isCity(x.city)&&isNet(x.net)).map(x=>(x.lacp=degO(x.lacp),x.site=['a','b','ab'].includes(x.site)?x.site:'a',x.id=sid(x.id),x.tier=tier(x.tier),x.n=lag(x.n),x.sacrif=!!x.sacrif,x)); @@ -2280,7 +2281,7 @@ function dayTick(){ {const lv=custLevel();if(lv>(S.lvl||1)){S.lvl=lv;track('level_'+lv);toast(tr('Customer level {lv}: {name}
New customers unlocked: {unlock}',{lv,name:LEVELS[lv-1].n,unlock:LEVELS[lv-1].unlock}),'goal');sfx('coin');}} for(const l of S.links){if(l.kind!=='df')continue; if(l.ready===d){toast(`${l.own?tr('Your fiber is finished: {a}–{b}',{a:CITY[l.a].name,b:CITY[l.b].name}):tr('Dark fiber handed over: {a}–{b}',{a:CITY[l.a].name,b:CITY[l.b].name})}
${(l.ch||[]).length?tr('Channels are lighting up now.'):tr('It is dark. Add optics to light it up.')}`,'goal',[{l:tr('Open'),act:'selLink',args:{id:l.id}}]);sfx('coin');} - if(l.own&&l.ready>d&&Math.random()<0.012){const extra=10+Math.floor(Math.random()*40);l.ready+=extra;toast(tr('Construction delay: +{n} days
{why} ({a}–{b})',{n:extra,why:pick([tr('Archaeologists found a Roman bathhouse on your route.'),tr('A protected hamster species lives along the right-of-way.'),tr('The railway changed its mind about the easement.'),tr('The drilling crew hit a granite boulder the size of a bus.'),tr('A town council wants a public hearing. About the color of the manhole covers.'),tr('Somebody else’s gas main was exactly where the map said it was not.'),tr('The permit office lost your permit. And then the replacement.')]),a:CITY[l.a].name,b:CITY[l.b].name}),'bad');}} + if(l.own&&l.ready>d&&Math.random()<0.012){const extra=10+Math.floor(Math.random()*40);l.ready+=extra;toast(tr('Construction delay: +{n} days
{why} ({a}–{b})',{n:extra,why:pick(l.sub?SEA_DELAYS.map(x=>tr(x)):[tr('Archaeologists found a Roman bathhouse on your route.'),tr('A protected hamster species lives along the right-of-way.'),tr('The railway changed its mind about the easement.'),tr('The drilling crew hit a granite boulder the size of a bus.'),tr('A town council wants a public hearing. About the color of the manhole covers.'),tr('Somebody else’s gas main was exactly where the map said it was not.'),tr('The permit office lost your permit. And then the replacement.')]),a:CITY[l.a].name,b:CITY[l.b].name}),'bad');}} // DDoS protection SLA: if a protected customer's own city is hit and still goes down, you pay out (once per attack). if(S.ev.ddos&&S.ev.ddos.until>d){const a=S.ev.ddos; for(const b of S.biz)if(b.type==='scrub'&&b.city===a.city&&b.slaFor!==a.start&&sfOf(R,b.city)<0.85){ @@ -2616,8 +2617,15 @@ const ACT={ else toast(tr('Rolling upgrade in {city}
{n} × {model}, swapped one at a time. Zero downtime.',{city:CITY[city].name,n:rt,model:esc(RG[g].n)}),'good'); floater(CITY[city].x,CITY[city].y-30,RG[g].n+'!','#FF4F9A');after();}, dfMode:({m})=>{UI.lmode=m;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + ownCab:()=>{UI.lmode='df';UI.dfSrc='cable';if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, dfSrc:({v})=>{UI.dfSrc=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, dfSys:({v})=>{UI.dfSys=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + orderCable:()=>{const p=UI.pending;if(!p)return;const {a,b}=p;if(ownCabWhy(a,b))return;const km=ownCabKm(a,b),cost=ownCabCost(km)+(S.pops[b]?0:popCost(b));if(!spend(cost))return; + if(!S.pops[b])S.pops[b]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false,rgen:0}; + const used=new Set(S.links.map(l=>l.cname).filter(Boolean)),cname=OWNCAB_NAMES.find(n=>!used.has(n))||`${pick(OWNCAB_NAMES)} ${used.size+1}`,ship=pick(OWNCAB_SHIPS),id=uid(),days=ownCabDays(km); + S.links.push({id,a,b,kind:'df',own:true,sub:true,sys:'roadm',ch:[],km,cable:null,cname,mo:Math.round(km*OWNCAB_OM),trench:'own:'+id,cut:0,day:S.day,ready:S.day+days,spares:false,pairs:1}); + S.stats.ownCab=(S.stats.ownCab||0)+1;UI.dfSrc='lease';closeModal();UI.sel={type:'link',id}; + toast(tr('The {ship} sets sail!
{name}, your own {km} km cable from {a} to {b}. Ready in about {n} days, if the whales cooperate.',{ship,name:cname,km:km.toLocaleString(),a:CITY[a].name,b:CITY[b].name,n:days}),'goal');sfx('build');after();}, orderDf:()=>{const p=UI.pending;if(!p)return;const {a,b}=p;if(!dfAllowed(a,b))return;const sc=isSub(a,b)?subDfCable(a,b):null,km=sc?sc.km:kmBetween(a,b); const own=UI.dfSrc==='build'&&lvl()>=3&&!sc,sys=DF_SYS[UI.dfSys]&&DF_SYS[UI.dfSys].lvl<=lvl()?UI.dfSys:'lite';if(lvl()<2)return; const up=(own?dfBuildCost(km):0)+DF_SYS[sys].cost+ampCount(km)*AMP_COST+(S.pops[b]?0:popCost(b));if(!spend(up))return; @@ -2626,13 +2634,13 @@ const ACT={ const l={id,a,b,kind:'df',own,sys,ch:[],km,sub:!!sc,cable:sc?sc.cid:null,mo:own?Math.round(km*0.15):dfLeaseMo(km),trench:sc?'cab:'+sc.cid:id,cut:0,day:S.day,ready:S.day+(own?dfBuildDays(km):30),spares:false}; S.links.push(l);closeModal();UI.sel={type:'link',id}; toast(own?tr('Groundbreaking!
Your own fiber from {a} to {b}. Permits and digging take about {n} days.',{a:CITY[a].name,b:CITY[b].name,n:dfBuildDays(km)}):tr('Dark fiber IRU signed.
{a}–{b} will be spliced and handed over in about 30 days.',{a:CITY[a].name,b:CITY[b].name}),'goal');after();}, - regen:({id,d})=>{d=+d;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||(d!==1&&d!==-1))return;const n=(l.regen|0)+d;if(n<0||n>REGEN_MAX)return; + regen:({id,d})=>{d=+d;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||l.sub||(d!==1&&d!==-1))return;const n=(l.regen|0)+d;if(n<0||n>REGEN_MAX)return; if(d<0&&(l.ch||[]).some(o=>!optMode(o,{km:l.km,regen:n}))){toast(tr('Those optics need the regen site.
Remove the long-haul channels first, or keep the site.'),'bad');sfx('err');return;} if(d>0&&!spend(REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH)))return;l.regen=n;toast(d>0?tr('Regen site {n} is up.
Optical spans on {a}–{b} are now {km} km.',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('Regen site removed.'),'good');sfx('build');after();}, addCh:({id,o})=>{const l=S.links.find(x=>x.id===id),O=OPT[o];if(!l||!O||l.kind!=='df')return;const why=chWhy(l,o);if(why){toast(tr("Can't add {optic}.
{why}",{optic:O.n,why:esc(why)}),'bad');sfx('err');return;}if(!portGate(l.a,1)||!portGate(l.b,1))return;const sp=spareN(o)>0;if(!spend(chCost(l,o)))return;if(sp)S.spares[o]--;(l.ch=l.ch||[]).push(o);floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,`+${O.n}`,'#FF4F9A');after();}, rmCh:({id,o})=>{const l=S.links.find(x=>x.id===id);if(!l||!OPT[o])return;const i=(l.ch||[]).lastIndexOf(o);if(i<0)return;l.ch.splice(i,1);S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,tr('{optic} to spares',{optic:OPT[o].n}),'#7B61FF');after();}, sellSpare:({o})=>{if(!OPT[o]||spareN(o)<1)return;S.spares[o]--;const v=spareValue(o);S.cash+=v;toast(tr('Sold a spare {optic} on eBuy.
{price} back, which is {p} of what it cost new.',{optic:OPT[o].n,price:fmt$(v),p:pct(SPARE_RESALE)}),'good');sfx('coin');after();}, - addPair:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||!l.own||l.sys!=='roadm'||l.ready>S.day)return;const n=Math.max(1,l.pairs|0);if(n>=PAIRS_MAX)return;if((l.ch||[]).length+soldSlots(l)Fill this pair first.
Light all {max} channels before you light another fiber pair.',{max:chMax(l)}),'bad');sfx('err');return;}if(!spend(pairCost(l)))return;l.pairs=n+1;toast(tr('Fiber pair {n} is lit: {a}–{b}.
Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.',{n:n+1,a:CITY[l.a].name,b:CITY[l.b].name,m:DF_SYS.roadm.max}),'good');sfx('build');after();}, + addPair:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||!l.own||l.sys!=='roadm'||l.ready>S.day)return;const n=Math.max(1,l.pairs|0);if(n>=pairsMax(l))return;if((l.ch||[]).length+soldSlots(l)Fill this pair first.
Light all {max} channels before you light another fiber pair.',{max:chMax(l)}),'bad');sfx('err');return;}if(!spend(pairCost(l)))return;l.pairs=n+1;toast(tr('Fiber pair {n} is lit: {a}–{b}.
Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.',{n:n+1,a:CITY[l.a].name,b:CITY[l.b].name,m:DF_SYS.roadm.max}),'good');sfx('build');after();}, upSys:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.sys==='roadm'||lvl()<3)return;if(!spend(DF_SYS.roadm.cost))return;l.sys='roadm';if(l.ready<=S.day){l.eqDown=S.day+1;toast(tr('Line system swap
All channels are dark for a day while the ROADMs go in.'),'bad');}after();}, spares:({id})=>{const l=S.links.find(x=>x.id===id);if(!l)return;l.spares=!l.spares;sfx('click');after();}, crews:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.ready<=S.day)return;const c=Math.round(15000+l.km*6);if(!spend(c))return;l.ready=Math.max(S.day+1,l.ready-30);toast(tr('More crews on site.
Construction is 30 days ahead.'),'good');after();}, @@ -2682,8 +2690,8 @@ function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)= const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math.round(optCost(o)*SPARE_RESALE); function chCost(l,o){const r=REGEN_CH*(l.regen|0);return Math.round(optCost(o)*(spareN(o)>0?r:1+r));} function optCost(o){return Math.round(OPT[o].cost*(S&&S.ev&&S.ev.tariff>S.day?1.4:1));} -function pairBtn(l){if(!l.own||l.sys!=='roadm'||l.ready>S.day)return '';const n=Math.max(1,l.pairs|0);if(n>=PAIRS_MAX)return `${tr('{n} fiber pairs lit, the trench is full',{n})}`; - const full=(l.ch||[]).length+soldSlots(l)>=chMax(l),c=pairCost(l);return btn(tr('Light fiber pair {n} {price} + {mo}/mo',{n:n+1,price:fmt$(c),mo:fmt$(ampCount(l.km)*AMP_MO)}),'addPair',{id:l.id},full?'pink sm':'ghost sm',!full||S.cashS.day)return '';const n=Math.max(1,l.pairs|0);if(n>=pairsMax(l))return `${tr('{n} fiber pairs lit, the trench is full',{n})}`; + const full=(l.ch||[]).length+soldSlots(l)>=chMax(l),c=pairCost(l);return btn(l.sub?tr('Light fiber pair {n} {price}',{n:n+1,price:fmt$(c)}):tr('Light fiber pair {n} {price} + {mo}/mo',{n:n+1,price:fmt$(c),mo:fmt$(ampCount(l.km)*AMP_MO)}),'addPair',{id:l.id},full?'pink sm':'ghost sm',!full||S.cashlvl())return tr('Unlocks at customer level {n}.',{n:O.lvl});if(O.sys==='roadm'&&l.sys!=='roadm')return tr('Needs a ROADMaster 9000 line system.');if(!optMode(o,l)){const mx=(O.modes||[[0,O.reach]]).at(-1)[1];return tr('Too far even at its slowest setting: an optical span here is {span} km and it reaches {max} km. Add a regen site (Line system).',{span:spanKm(l).toLocaleString(),max:mx.toLocaleString()});} if((l.ch||[]).length+soldSlots(l)>=chMax(l))return soldSlots(l)?tr('{sys} is full ({max} channels, {sold} sold to customers).',{sys:DF_SYS[l.sys].n,max:chMax(l),sold:soldSlots(l)}):tr('{sys} is full ({max} channels).',{sys:DF_SYS[l.sys].n,max:chMax(l)}); for(const c of [l.a,l.b]){const p=S.pops[c];if(p&&RG[p.rgen||0].cls

${tr('Fiber from {city}',{city:C.name})}

${tr("Drag from this router to any city on the map to lay a new link. Two paths to every POP means a backhoe can't take you offline.")}

`; if(!ls.length)h+=`

${tr('No links yet.')}

`; for(const l of ls){const o=l.a===c?l.b:l.a,u=capOf(l)?(R.load[l.id]||0)/capOf(l):0,cut=linkDown(l); - h+=`
→ ${CITY[o].name}${l.mult>1?' · '+tr('diverse'):''} ${cut?''+tr('CUT')+'':''}
${capName(l)} · ${l.km.toLocaleString()} km ${l.kind==='vxc'?tr('virtual circuit via {fab}',{fab:esc(FAB[l.prov].name)}):l.kind==='df'?(l.own?tr('own dark fiber'):tr('dark fiber IRU'))+(l.ready>S.day?` · ${tr('ready in {n}d',{n:l.ready-S.day})}`:''):l.sub?tr('subsea'):tr('terrestrial')} · ${tr('{price}/mo',{price:fmt$(l.mo)})}
${btn(tr('Open'),'selLink',{id:l.id},'ghost sm')}
`;} + h+=`
→ ${CITY[o].name}${l.mult>1?' · '+tr('diverse'):''} ${cut?''+tr('CUT')+'':''}
${capName(l)} · ${l.km.toLocaleString()} km ${l.kind==='vxc'?tr('virtual circuit via {fab}',{fab:esc(FAB[l.prov].name)}):l.kind==='df'?(l.own?(l.sub&&l.cname?tr('your own subsea cable {name}',{name:l.cname}):tr('own dark fiber')):tr('dark fiber IRU'))+(l.ready>S.day?` · ${tr('ready in {n}d',{n:l.ready-S.day})}`:''):l.sub?tr('subsea'):tr('terrestrial')} · ${tr('{price}/mo',{price:fmt$(l.mo)})}
${btn(tr('Open'),'selLink',{id:l.id},'ghost sm')}
`;} h+=``; if(Object.keys(S.pops).length>1)h+=`

${tr('Decommission')}

${tr('Shut this POP down: its links, ports and caches go with it, and every customer that depends on it is let go, with an early-termination penalty.')}

${btn(tr('Decommission {city}…',{city:C.name}),'decomOpen',{city:c},'ghost sm')}${btn(tr('Decommission several POPs…'),'decomOpen',{},'ghost sm')}
`; } @@ -3070,11 +3078,11 @@ function dfPanel(l){ h+=`

${tr('Optics')}

${tr('Each channel is a pair of optics, one per end. ZR+ optics plug straight into your routers. Transponders sit on a shelf.')}

`; for(const k of Object.keys(OPT)){const O=OPT[k],n=(l.ch||[]).filter(x=>x===k).length,why=chWhy(l,k); const md=optMode(k,l),cc=chCost(l,k),sp=spareN(k); - h+=`
${O.n} ${(O.modes||[[O.g,O.reach]]).map(([g,r])=>tr('{g} to {km} km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}
${esc(O.blurb)}${n?` · ${tr('{n} lit',{n})}`:''}${sp?` · ${trn('{n} spare on the shelf','{n} spares on the shelf',sp)}`:''}
${md&&!md.full?`
⚠️ ${tr('Runs at {g} per channel on this route (long-haul mode).',{g:fmtG(md.g)})} ${regenNeed(k,l)>(l.regen|0)?trn('{n} regen site would bring it back to {g}.','{n} regen sites would bring it back to {g}.',regenNeed(k,l),{g:fmtG(O.g)}):''}
`:''}${why?`
${esc(why)}
`:''}
${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ ${cc?tr('spare + {price}',{price:fmt$(cc)}):tr('spare')}`:`+ ${fmt$(cc)}`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash`;} + h+=`
${O.n} ${(O.modes||[[O.g,O.reach]]).map(([g,r])=>tr('{g} to {km} km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}
${esc(O.blurb)}${n?` · ${tr('{n} lit',{n})}`:''}${sp?` · ${trn('{n} spare on the shelf','{n} spares on the shelf',sp)}`:''}
${md&&!md.full?`
⚠️ ${tr('Runs at {g} per channel on this route (long-haul mode).',{g:fmtG(md.g)})} ${!l.sub&®enNeed(k,l)>(l.regen|0)?trn('{n} regen site would bring it back to {g}.','{n} regen sites would bring it back to {g}.',regenNeed(k,l),{g:fmtG(O.g)}):''}
`:''}${why?`
${esc(why)}
`:''}
${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ ${cc?tr('spare + {price}',{price:fmt$(cc)}):tr('spare')}`:`+ ${fmt$(cc)}`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash`;} {const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`

${tr('Unplugged optics go on the spares shelf and are used first next time.')}

`;if(st.length)h+=`

${tr('Spares shelf')}

`+st.map(k=>`
${spareN(k)} × ${OPT[k].n}
${btn(tr('Sell one {price}',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}
`).join('');} const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH); h+=`

${tr('Line system')}

${esc(sysD.n)}${tr('{n} amplifiers',{n:amps})}
-
${tr('Regen sites')}${rg?tr('{n} · optical spans of {km} km',{n:rg,km:spanKm(l).toLocaleString()}):tr('none')}

${tr('A regen site turns the light back into bits halfway and sends it on fresh, so optics only have to reach the next site. Each needs a regen card for every lit channel. {price}/mo per site for the hut.',{price:fmt$(REGEN_MO)})}

${rg{price}',{price:fmt$(rgAdd)}),'regen',{id:l.id,d:1},'sm',S.cash

${esc(sysD.blurb)}

${l.sys!=='roadm'?btn(lvl()>=3?tr('Upgrade to ROADMaster 9000 {price}',{price:fmt$(DF_SYS.roadm.cost)}):tr('ROADMaster 9000 level 3'),'upSys',{id:l.id},'sm',lvl()<3||S.cash{price}/mo',{price:fmt$(Math.round(150+(l.ch||[]).length*80))}),'spares',{id:l.id},l.spares?'green sm':'sm')}

${tr('Spare optics and amplifier cards on the shelf turn multi-day hardware failures into one-day swaps.')}

`; +
${tr('Regen sites')}${rg?tr('{n} · optical spans of {km} km',{n:rg,km:spanKm(l).toLocaleString()}):tr('none')}

${tr('A regen site turns the light back into bits halfway and sends it on fresh, so optics only have to reach the next site. Each needs a regen card for every lit channel. {price}/mo per site for the hut.',{price:fmt$(REGEN_MO)})}

${l.sub&&l.own?`

${tr('No regen sites in the middle of the ocean: long cables run their optics in long-haul mode.')}

`:`
${rg{price}',{price:fmt$(rgAdd)}),'regen',{id:l.id,d:1},'sm',S.cash`}

${esc(sysD.blurb)}

${l.sys!=='roadm'?btn(lvl()>=3?tr('Upgrade to ROADMaster 9000 {price}',{price:fmt$(DF_SYS.roadm.cost)}):tr('ROADMaster 9000 level 3'),'upSys',{id:l.id},'sm',lvl()<3||S.cash{price}/mo',{price:fmt$(Math.round(150+(l.ch||[]).length*80))}),'spares',{id:l.id},l.spares?'green sm':'sm')}

${tr('Spare optics and amplifier cards on the shelf turn multi-day hardware failures into one-day swaps.')}

`; {const sib=pairLinks(l.a,l.b).filter(x=>x!==l&&x.kind!=='vxc');h+=`

${tr('Redundancy')}

${sib.length?tr('Other links between these cities:'):tr('This is the only link between these cities. Add a parallel one, or a path through another city.')}

${sib.map(x=>`
${esc(capName(x))} ${linkDown(x)?''+tr('CUT')+'':''}
${(x.trench||x.id)===(l.trench||l.id)?tr('same trench'):tr('diverse route')}
${btn(tr('Open'),'selLink',{id:x.id},'ghost sm')}
`).join('')}
${btn(tr('Add parallel link'),'addParallel',{id:l.id},'pink sm')}
`;} h+=`${trafficSection(l)}${metricSection(l)}
${btn(UI.confirm===l.id?tr('Really give it up?'):(l.own?tr('Abandon the fiber'):tr('Cancel the IRU')),'rmLink',{id:l.id},'ghost sm')}
`; return h; @@ -3374,7 +3382,7 @@ function openLinkModal(a,b){ const mode=UI.lmode==='df'?'df':'wave',tabs=`
${btn(tr('Lease a wave'),'dfMode',{m:'wave'},mode==='wave'?'pink':'ghost')}${btn(tr('Dark fiber'),'dfMode',{m:'df'},mode==='df'?'pink':'ghost')}
`; const head=`
${sub?tr('Subsea'):tr('Terrestrial')} · ${km.toLocaleString()} km

${CITY[a].name} → ${CITY[b].name}

${tabs}`; if(mode==='df'){openModal(head+dfModalBody(a,b,km,pop));return;} - if(sub&&!cablesOk(a,b).length){const fr=[...new Set(CABLE_PAIRS.filter(c=>c.a===a||c.b===a).map(c=>CITY[c.a===a?c.b:c.a].name))];openModal(head+`

${tr('No subsea cable lands in both {a} and {b}. Cables from {a} reach {list}. Hop through one of those.',{a:CITY[a].name,b:CITY[b].name,list:fr.join(', ')||tr('nowhere')})}

`);return;} + if(sub&&!cablesOk(a,b).length){const fr=[...new Set(CABLE_PAIRS.filter(c=>c.a===a||c.b===a).map(c=>CITY[c.a===a?c.b:c.a].name))];openModal(head+`

${tr('No subsea cable lands in both {a} and {b}. Cables from {a} reach {list}. Hop through one of those.',{a:CITY[a].name,b:CITY[b].name,list:fr.join(', ')||tr('nowhere')})}

${S.won&&!ownCabWhy(a,b)?ownCabTeaser(a,b):''}`);return;} if(isSub(a,b)&&S.ev.landban&&S.ev.landban.until>S.day&&[a,b].includes(S.ev.landban.city)){openModal(head+`

${tr('The landing permit dispute in {city} blocks new subsea links for {n} more days.',{city:CITY[S.ev.landban.city].name,n:S.ev.landban.until-S.day})}

`);return;} if(uaePair(a,b)||andesPair(a,b))route+=`

${landWhy(a,b)}

`; route+=`

📈 ${esc(marketNote(a,b,sub))}

`; @@ -3384,8 +3392,37 @@ function openLinkModal(a,b){ ${pop?`

${tr('Includes a new POP in {city} ({price}{extra}).',{city:CITY[b].name,price:fmt$(popCost(b)),extra:ruCity(b)?', '+tr('government box included'):CITY[b].uae?', '+tr('free-zone license included'):CITY[b].saudi?', '+tr('local telecom licence included'):''})}

`:''}${route}${viaSeg(a,b)}
${LT.map((T,i)=>{const lc=Math.round(waveMo(wr.km,wr.sub,i)*wr.wm),c=lc+pop,ok=waveOk(a,b,i);return ``;}).join('')}
`); } +/* Your own subsea cable (#22). Tier 1 networks lay their own: very expensive, slow to build, and it pays for + itself after a few years if it replaces enough leased waves. Both ends need a cable landing station. You own + up to eight fiber pairs; the first comes lit with a ROADMaster, the repeaters are powered from shore. */ +const SEA_DELAYS=[N_('A whale has parked on the route and will not move.'),N_('The cable ship’s coffee machine broke. Nobody works without coffee.'),N_('A fishing fleet is trawling exactly where you need to lay.'),N_('The seabed survey found an old sea mine. A small, very careful detour.'),N_('Storm season. The ship is sheltering in port, playing cards.'),N_('The crew fished out somebody else’s cable by mistake and has to put it back.')]; +const OWNCAB_LAND=3000000,OWNCAB_KM=6000,OWNCAB_OM=25,OWNCAB_ROUTE=1.15; +const OWNCAB_NAMES=['Big Wet Tube','Davy Jones’ Backhaul','Kraken-1','Mariana Trench Coat','The Wet Ethernet','Sea-ya Later','Deep Pockets Express','Salty Sausage','Poseidon’s Patch Cable','Neptune Neutrality','Moby Disk','Fibre Nemo','The Long Wet Thing','Bermuda Triangle Routing','Seabed & Breakfast','Atlantis Backhaul']; +const OWNCAB_SHIPS=['MV Cable Guy','Spool of Thought','Wet Willy','Reel Deal','Splice Girl','Knot Today','Seas the Day','HMS Unplugged']; +const landing=c=>CABLE_PAIRS.some(p=>p.a===c||p.b===c); +const ownCabKm=(a,b)=>Math.round(kmBetween(a,b)*OWNCAB_ROUTE); +const ownCabCost=km=>2*OWNCAB_LAND+km*OWNCAB_KM+DF_SYS.roadm.cost; +const ownCabMo=km=>Math.round(km*OWNCAB_OM)+ampCount(km)*AMP_MO; +const ownCabDays=km=>Math.round(300+km*0.05); +function ownCabWhy(a,b){if(!isSub(a,b))return tr('This route is on land. Build your own fiber instead.'); + if(!S.won)return tr('Laying your own subsea cable is a Tier 1 thing. Go transit-free first.'); + for(const c of [a,b])if(!landing(c))return tr('{city} has no cable landing station.',{city:CITY[c].name}); + if(cnCity(a)||cnCity(b))return tr('Nobody gives a foreign network a landing licence in mainland China.'); + return '';} +function ownCabTeaser(a,b){const why=ownCabWhy(a,b);return `
${btn(S.won?tr('Lay your own subsea cable…'):tr('Your own subsea cable Tier 1 only'),'ownCab',{},S.won&&!why?'pink':'ghost',!!why)}
${why&&S.won?`

${esc(why)}

`:''}`;} +function ownCabBody(a,b,pop){const why=ownCabWhy(a,b);if(why)return `

${esc(why)}

${btn(tr('Back'),'dfSrc',{v:'lease'},'ghost sm')}`; + const km=ownCabKm(a,b),cost=ownCabCost(km),mo=ownCabMo(km),days=ownCabDays(km),w=Math.round(waveMo(km,true,4)*waveMarket(a,b,true).m),save=10*w-mo,pay=save>0?Math.ceil(cost/save):0; + return `

${tr('Your very own subsea cable. A ship lays it across the seabed, you own every fiber pair in it, and nobody else’s waves share your glass. It costs a frankly rude amount of money and takes a long time.')}

+
${tr('Route')}${tr('{km} km of seabed',{km:km.toLocaleString()})}
+
${tr('Fiber pairs')}${tr('{n} in the cable, the first one lit',{n:SUB_PAIRS_MAX})}
+
${tr('Landing stations')}${tr('{a} and {b}',{a:CITY[a].name,b:CITY[b].name})}
+
${tr('Build time')}${tr('about {n} days',{n:days})}
+
${tr('Due now')}${fmt$(cost+pop)}
${tr('Monthly')}${tr('{price}/mo',{price:fmt$(mo)})}
+

${tr('A leased 1.6T wave on this route costs {price}/mo.',{price:fmt$(w)})} ${pay?tr('Replace ten of them and the cable pays for itself in about {n} months.',{n:pay}):''} ${tr('Cuts still happen, anchors and sharks included, but the repair ship is yours to call.')}

+
${btn(tr('Lay the cable {price}',{price:fmt$(cost+pop)}),'orderCable',{},'pink big',S.cash`;} function dfModalBody(a,b,km,pop){ - if(isSub(a,b)&&!subDfCable(a,b))return `

${tr('Nobody sells dark fiber on a subsea cable here. Subsea capacity comes as leased waves.')}

`; + if(isSub(a,b)&&UI.dfSrc==='cable')return ownCabBody(a,b,pop); + if(isSub(a,b)&&!subDfCable(a,b))return `

${tr('Nobody sells dark fiber on a subsea cable here. Subsea capacity comes as leased waves.')}

`+ownCabTeaser(a,b); const sc=isSub(a,b)?subDfCable(a,b):null;if(sc)km=sc.km; if(uaePair(a,b))return `

${tr('No dark fiber inside the UAE. Only the two licensed operators may run fiber here, and they only sell waves.')}

`; if(landX(a,b)&&cnCity(a)===cnCity(b))return `

${tr('Nobody sells one fiber pair across a dozen borders. Between continents, overland capacity only comes as leased waves.')}

`; @@ -3395,7 +3432,7 @@ function dfModalBody(a,b,km,pop){ const up=(src==='build'?dfBuildCost(km):0)+DF_SYS[sys].cost+amps*AMP_COST+pop,mo=(src==='build'?Math.round(km*0.15):dfLeaseMo(km))+amps*AMP_MO; const w=Math.round(waveMo(km,false,4)); return `

${tr('A fiber pair of your own. The glass is cheap, the gear is not: you buy a line system with an amplifier every {km} km, then optics for each channel. Your gear can fail, and you fix it.',{km:AMP_EVERY})}

-

${tr('The glass')}

${btn(tr('Lease an IRU {price}/mo · ready in 30 days',{price:fmt$(dfLeaseMo(km))}),'dfSrc',{v:'lease'},src==='lease'?'pink':'ghost')}${sc?btn(tr('Build your own not under the sea'),'dfSrc',{v:'build'},'ghost',true):btn(lvl()>=3?tr('Build your own {price} · ~{n} days',{price:fmt$(dfBuildCost(km)),n:dfBuildDays(km)}):tr('Build your own level 3'),'dfSrc',{v:'build'},src==='build'?'pink':'ghost',lvl()<3)}
${sc?`

${tr("A fiber pair on {cable}, {km} km. It shares the cable with everyone else's waves, anchors included.",{cable:esc(CAB[sc.cid].name),km:sc.km.toLocaleString()})}

`:''} +

${tr('The glass')}

${btn(tr('Lease an IRU {price}/mo · ready in 30 days',{price:fmt$(dfLeaseMo(km))}),'dfSrc',{v:'lease'},src==='lease'?'pink':'ghost')}${sc?btn(S.won?tr('Lay your own subsea cable…'):tr('Your own subsea cable Tier 1 only'),'ownCab',{},'ghost',!!ownCabWhy(a,b)):btn(lvl()>=3?tr('Build your own {price} · ~{n} days',{price:fmt$(dfBuildCost(km)),n:dfBuildDays(km)}):tr('Build your own level 3'),'dfSrc',{v:'build'},src==='build'?'pink':'ghost',lvl()<3)}
${sc?`

${tr("A fiber pair on {cable}, {km} km. It shares the cable with everyone else's waves, anchors included.",{cable:esc(CAB[sc.cid].name),km:sc.km.toLocaleString()})}

`:''} ${src==='build'?`

${tr('Your own trench: almost no rent, but permits and digging take forever, and delays happen.')}

`:''}

${tr('Line system')}

${Object.keys(DF_SYS).map(k=>btn(`${DF_SYS[k].n} ${DF_SYS[k].lvl>lvl()?tr('level {n}',{n:DF_SYS[k].lvl}):fmt$(DF_SYS[k].cost)}`,'dfSys',{v:k},sys===k?'pink':'ghost',DF_SYS[k].lvl>lvl())).join('')}

${esc(DF_SYS[sys].blurb)} ${trn('Plus {n} in-line amplifier ({price} each, {mo}/mo for hut rent and power).','Plus {n} in-line amplifiers ({price} each, {mo}/mo for hut rent and power).',amps,{price:fmt$(AMP_COST),mo:fmt$(AMP_MO)})}

${km>OPT.tp16.reach?`

${km.toLocaleString()} km is longer than any optic reaches at full speed. Transponders will run in long-haul mode (800G or 400G per channel), or add regen sites along the way to get full speed back.

`:''} diff --git a/tests/regions.test.js b/tests/regions.test.js index 981f830..43db174 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -399,3 +399,39 @@ test('#47 Cairo reaches Asia overland across the Sinai, priced like the Bosporus assert.equal(ev("isSub('cai','lon')"), true, 'the Channel is still the sea'); assert.deepEqual(errors, []); }); + +test('#22 Tier 1 networks can lay their own subsea cable', () => { + const { ev, dom, errors } = load(); + ev("ACT.start({});S.cash=2e8;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'lon'});ACT.buildPop({city:'nyc'});compute()"); + const card = () => dom.window.document.getElementById('modalCard').textContent; + // not before Tier 1 + ev("UI.lmode='df';UI.via=null;openLinkModal('lon','nyc')"); + assert.match(card(), /Tier 1 only/); + assert.match(ev("ownCabWhy('lon','nyc')"), /Tier 1/); + ev('ACT.orderCable()'); + assert.equal(ev("S.links.filter(l=>l.own&&l.sub).length"), 0, 'refused before Tier 1'); + // as a Tier 1 + ev("S.won=true;ACT.ownCab()"); + assert.match(card(), /frankly rude amount of money/); + assert.match(card(), /pays for itself in about \d+ months/); + const c0 = ev('S.cash'), km = ev("ownCabKm('lon','nyc')"); + ev('ACT.orderCable()'); + const l = JSON.parse(ev("JSON.stringify(S.links.find(l=>l.own&&l.sub))")); + assert.ok(l, 'the cable is being laid'); + assert.equal(c0 - ev('S.cash'), ev(`ownCabCost(${km})`)); + assert.ok(l.ready - ev('S.day') > 300, 'it takes a long time'); + assert.equal(l.sys, 'roadm'); + assert.ok(l.cname && l.cname.length > 3, 'it gets a name'); + // finished: light it, fill a pair, light the next one; no mid-ocean regen + ev(`const L=S.links.find(x=>x.id==='${l.id}');S.day=L.ready;L.ch=Array(64).fill('tp16');compute()`); + ev(`ACT.regen({id:'${l.id}',d:1})`); + assert.equal(ev(`S.links.find(x=>x.id==='${l.id}').regen|0`), 0, 'no regen sites in the ocean'); + ev(`ACT.addPair({id:'${l.id}'})`); + assert.equal(ev(`S.links.find(x=>x.id==='${l.id}').pairs`), 2); + assert.equal(ev(`pairsMax(S.links.find(x=>x.id==='${l.id}'))`), 8, 'up to eight pairs in a subsea cable'); + // landing stations and China + const inland = ev("CITIES.find(c=>c.land==='eu'&&!landing(c.id)&&!cnCity(c.id)).id"); + assert.match(ev(`ownCabWhy('${inland}','nyc')`), /landing station/, 'both ends need a landing station'); + assert.match(ev("ownCabWhy('sha','sea')"), /China/); + assert.deepEqual(errors, []); +});