diff --git a/site/i18n/de.js b/site/i18n/de.js index f3559e4..ecfd547 100644 --- a/site/i18n/de.js +++ b/site/i18n/de.js @@ -2535,6 +2535,7 @@ "link_panels.stock_a_spare_optic_price":"Eine Reserve-{optic} einlagern {price}", "link_panels.sys_level_n":"{sys} Level {n}", "link_panels.take_it_off_standby":"Aus dem Standby holen", +"link_panels.takes_n_router_ports_per_end":{"one":"belegt {n} Router-Port an jedem Ende","other":"belegt {n} Router-Ports an jedem Ende"}, "link_panels.there_s_no_ix_in_city":"In {city} gibt es noch keinen IX. Gründe einen: Netze treten mit der Zeit bei, zahlen dir Ports und peeren kostenlos mit dir.", "link_panels.they_need_the_full_internet_your":"Sie brauchen das volle Internet. Deine Erreichbarkeit ist {pct}.", "link_panels.this_backhoe_wins":"Dieser Bagger gewinnt.", diff --git a/site/i18n/es.js b/site/i18n/es.js index aaf3b49..9da7234 100644 --- a/site/i18n/es.js +++ b/site/i18n/es.js @@ -2533,6 +2533,7 @@ "link_panels.stock_a_spare_optic_price":"Tener una {optic} de repuesto {price}", "link_panels.sys_level_n":"{sys} nivel {n}", "link_panels.take_it_off_standby":"Sacarlo de la espera", +"link_panels.takes_n_router_ports_per_end":{"one":"ocupa {n} puerto de router en cada extremo","other":"ocupa {n} puertos de router en cada extremo"}, "link_panels.there_s_no_ix_in_city":"Aún no hay IX en {city}. Funda uno: las redes se unen con el tiempo, te pagan por los puertos y hacen peering contigo gratis.", "link_panels.they_need_the_full_internet_your":"Necesitan todo internet. Tu alcance es del {pct}.", "link_panels.this_backhoe_wins":"Esta retroexcavadora gana.", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index bae82e8..b715f7a 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -2533,6 +2533,7 @@ "link_panels.stock_a_spare_optic_price":"Stocker un {optic} de rechange {price}", "link_panels.sys_level_n":"{sys} niveau {n}", "link_panels.take_it_off_standby":"Le sortir de l’attente", +"link_panels.takes_n_router_ports_per_end":{"one":"occupe {n} port de routeur à chaque bout","other":"occupe {n} ports de routeur à chaque bout"}, "link_panels.there_s_no_ix_in_city":"Pas encore d’IX à {city}. Fondes-en un : les réseaux te rejoignent peu à peu, te paient leurs ports et font du peering gratuit avec toi.", "link_panels.they_need_the_full_internet_your":"Ils veulent tout Internet. Ta couverture est de {pct}.", "link_panels.this_backhoe_wins":"Cette pelleteuse gagne.", diff --git a/site/i18n/it.js b/site/i18n/it.js index 7c0ee68..08330e5 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -2533,6 +2533,7 @@ "link_panels.stock_a_spare_optic_price":"Metti da parte un {optic} di scorta {price}", "link_panels.sys_level_n":"{sys} livello {n}", "link_panels.take_it_off_standby":"Toglilo dallo standby", +"link_panels.takes_n_router_ports_per_end":{"one":"occupa {n} porta del router a ogni capo","other":"occupa {n} porte del router a ogni capo"}, "link_panels.there_s_no_ix_in_city":"A {city} non c’è ancora un IX. Fondane uno: le reti si uniscono col tempo, ti pagano le porte e fanno peering con te gratis.", "link_panels.they_need_the_full_internet_your":"Vogliono internet per intero. La tua copertura è del {pct}.", "link_panels.this_backhoe_wins":"Questa ruspa vince.", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index 329bcc3..f97b66e 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -2533,6 +2533,7 @@ "link_panels.stock_a_spare_optic_price":"Guardar um {optic} sobressalente {price}", "link_panels.sys_level_n":"{sys} nível {n}", "link_panels.take_it_off_standby":"Tirar da reserva", +"link_panels.takes_n_router_ports_per_end":{"one":"ocupa {n} porta de roteador em cada ponta","other":"ocupa {n} portas de roteador em cada ponta"}, "link_panels.there_s_no_ix_in_city":"Ainda não há IX em {city}. Funde um: as redes entram com o tempo, pagam pelas portas e fazem peering com você de graça.", "link_panels.they_need_the_full_internet_your":"Eles querem a internet inteira. Seu alcance é de {pct}.", "link_panels.this_backhoe_wins":"Esta retroescavadeira vence.", diff --git a/src/game/10-catalog/40-ports.js b/src/game/10-catalog/40-ports.js index 54b7aa1..1f6f6d1 100644 --- a/src/game/10-catalog/40-ports.js +++ b/src/game/10-catalog/40-ports.js @@ -11,8 +11,11 @@ const cacheBox=c=>{const p=S.pops[c];return p&&portG(p.rgen||0)>=CACHE_BIG?{g:CA function cachePorts(c,extra=[],g){const n={a:0,b:0};for(const x of S.caches)if(x.city===c)n[x.site==='b'?'b':'a']+=cacheG(x);for(const x of extra)n[x.site==='b'?'b':'a']+=cacheG(x); const p=S.pops[c],k=p?portG(g===undefined?(p.rgen||0):g):CACHE_CAP;return Math.ceil(n.a/k-1e-9)+Math.ceil(n.b/k-1e-9);} const cachePortsAdd=(c,adds)=>cachePorts(c,adds)-cachePorts(c); +/* A dark fiber channel takes as many router ports at each end as the optic's speed needs (#256): a pluggable sits + in one port, but a 1.6T transponder shelf hands off to an 800G router as two 800G clients. */ +const chPorts=(o,c,g)=>{const p=S.pops[c];return p&&OPT[o]?Math.max(1,Math.ceil(OPT[o].g/portG(g===undefined?(p.rgen||0):g)-1e-9)):1;}; function portsUsed(c,g){let u=0; - for(const l of S.links){if(l.a!==c&&l.b!==c||l.kind==='vxc')continue;u+=l.kind==='df'?(l.ch||[]).length:1;} + for(const l of S.links){if(l.a!==c&&l.b!==c||l.kind==='vxc')continue;if(l.kind!=='df'){u++;continue;}for(const o of l.ch||[])u+=chPorts(o,c,g);} // A puzzle's content origin (t.pz) hands off on a port of its own: it takes none of yours. for(const t of S.transit)if(t.city===c&&!t.pz)u+=PORT_SLOT(t.tier)*(t.n||1); for(const x of S.pni)if(x.city===c)u+=PORT_SLOT(x.tier)*(x.n||1); diff --git a/src/game/90-actions/87-fiber-and-hardware.js b/src/game/90-actions/87-fiber-and-hardware.js index 4e0985c..3351b63 100644 --- a/src/game/90-actions/87-fiber-and-hardware.js +++ b/src/game/90-actions/87-fiber-and-hardware.js @@ -25,7 +25,7 @@ Object.assign(ACT,{ regen:({id,d})=>{d=+d;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||(l.sub&&!l.seat)||(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,Object.assign({},l,{regen:n})))){toast(tr('fiber_and_hardware.those_optics_need_the_regen_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('fiber_and_hardware.regen_site_n_is_up_optical',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('fiber_and_hardware.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('fiber_and_hardware.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();}, + 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('fiber_and_hardware.can_t_add_optic_why',{optic:O.n,why:esc(why)}),'bad');sfx('err');return;}if(!portGate(l.a,chPorts(o,l.a))||!portGate(l.b,chPorts(o,l.b)))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('fiber_and_hardware.optic_to_spares',{optic:OPT[o].n}),'#7B61FF');after();}, hwLock:()=>{if(hwLock())return;const c=hwLockCost();if(!spend(c))return;S.hw=S.hw||{};S.hw.lock={until:S.day+HW_LOCK_DAYS,mul:hwTrend(S.day)};toast(tr('fiber_and_hardware.prices_locked_until_date_your_vendor',{date:dateStr(S.hw.lock.until)}),'good');after();}, buySpare:({o})=>{if(!OPT[o]||!techOk('opt',o,OPT[o].lvl)||spareN(o)>=64)return;if(!spend(optCost(o)))return;S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;sfx('build');after();}, diff --git a/src/game/90-actions/88-optic-counts.js b/src/game/90-actions/88-optic-counts.js index 62d1e91..6215bd5 100644 --- a/src/game/90-actions/88-optic-counts.js +++ b/src/game/90-actions/88-optic-counts.js @@ -14,7 +14,7 @@ Object.assign(ACT,{ if(why){toast(tr('fiber_and_hardware.can_t_add_optic_why',{optic:OPT[o].n,why:esc(why)}),'bad');sfx('err');return;} const free=chMax(l)-(l.ch||[]).length-soldSlots(l); if(d>free){toast(tr('optic_counts.only_n_channels_free',{n:free}),'bad');sfx('err');return;} - if(!portGate(l.a,d)||!portGate(l.b,d)||!spend(opticCountCost(l,o,n)))return; + if(!portGate(l.a,d*chPorts(o,l.a))||!portGate(l.b,d*chPorts(o,l.b))||!spend(opticCountCost(l,o,n)))return; const sp=Math.min(d,spareN(o));if(sp)S.spares[o]-=sp; (l.ch=l.ch||[]).push(...Array(d).fill(o)); }else{ diff --git a/src/game/93-ui/70-link-panels.js b/src/game/93-ui/70-link-panels.js index eddfb18..c64aa1d 100644 --- a/src/game/93-ui/70-link-panels.js +++ b/src/game/93-ui/70-link-panels.js @@ -125,7 +125,7 @@ function dfPanel(l){ if(l.own&&l.sub&&!l.seat)h+=subUpgradePanel(l); 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+=`
${tr('link_panels.unplugged_optics_go_on_the_spares')}
`; {const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=lvl());if(used.length)h+=`