Charters: a popup at the start, and a third one, the Cable broker (#300)
A new Normal game now asks what it is building before anything else, in a popup that holds the clock and cannot be closed without an answer; the tutorial waits for it. A save still in its first month that never picked is asked on load. Sandbox, puzzles and scenarios never ask. The Cable broker builds and lights glass from day one at the prices everyone pays at the top level: dark fiber, every line system and optic, digging without the pioneer markup, own subsea cables and their upgrades, eight pairs, and every router those optics need. Everything else unlocks by level as before. Its offers lean to carriers buying waves and pairs, capacity conferences are open to it at any level, and carriers call about three times a year with a capacity deal. It runs its own ten-goal ladder and wins Glass Baron (own cables on five continents, $1M a month of capacity sales), with a badge; Tier 1 stays its own win. Classic and boutique networks may lay their own subsea cable from customer level 9 as well as after Tier 1. Rule M6 (gameplay-rules): a charter changes what you set out to do, never what things cost. Closes #300.
This commit is contained in:
parent
f303f29f22
commit
934a83588a
40 changed files with 535 additions and 97 deletions
|
|
@ -157,14 +157,14 @@ const API_CMD={
|
|||
orderDf:{args:[['a','cityId'],['b','cityId'],['source','dfSource'],['system','systemId']],
|
||||
bindsUI:['pending','dfSrc','dfSys'],bind:a=>{UI.pending={a:a.a,b:a.b};UI.dfSrc=a.source;UI.dfSys=a.system;},
|
||||
quote:a=>{const A=a.a,B=a.b,sc=isSub(A,B)?subDfCable(A,B):null,km=sc?sc.km:kmBetween(A,B);
|
||||
const building=a.source==='build'&&lvl()>=3&&!sc,sys=DF_SYS[a.system]&&DF_SYS[a.system].lvl<=lvl()?a.system:'lite';
|
||||
const building=a.source==='build'&&glassLvl()>=3&&!sc,sys=DF_SYS[a.system]&&DF_SYS[a.system].lvl<=glassLvl()?a.system:'lite';
|
||||
const amps=ampCount(km),blocked=[];
|
||||
if(!S.pops[A])blocked.push(linkFromWhy(A));
|
||||
if(isSub(A,B)&&!sc)blocked.push(tr('fiber_modals.nobody_sells_dark_fiber_on_a'));
|
||||
else if(uaePair(A,B))blocked.push(tr('fiber_modals.no_dark_fiber_inside_the_uae'));
|
||||
else if(landX(A,B)&&cnCity(A)===cnCity(B))blocked.push(tr('fiber_modals.nobody_sells_one_fiber_pair_across'));
|
||||
else if(!dfAllowed(A,B))blocked.push(tr('fiber_modals.dark_fiber_across_the_chinese_border'));
|
||||
if(lvl()<2)blocked.push(tr('fiber_modals.dark_fiber_unlocks_at_customer_level'));
|
||||
if(glassLvl()<2)blocked.push(tr('fiber_modals.dark_fiber_unlocks_at_customer_level'));
|
||||
return {setup:(building?dfBuildCost(km):0)+DF_SYS[sys].cost+amps*AMP_COST+(S.pops[B]?0:popCost(B)),
|
||||
monthly:(building?Math.round(km*0.15):dfLeaseMo(km))+amps*AMP_MO,days:building?dfBuildDays(km):30,blocked};},
|
||||
doc:'Get dark fiber from one of your POPs (a): lease an IRU, dig your own (level 3+), or take a pair on a subsea cable; opens a POP in b if there is none. Then light it with a line system.'},
|
||||
|
|
@ -204,7 +204,7 @@ const API_CMD={
|
|||
hwLock:{args:[],quote:a=>({setup:hwLockCost()}),
|
||||
doc:'Lock router, optic and build prices for a year, shortages included. Costs twice as much while a shortage runs.'},
|
||||
buySpare:{args:[['o','opticId']],
|
||||
quote:a=>({setup:optCost(a.o),blocked:[OPT[a.o]&&OPT[a.o].lvl>lvl()?tr('action_helpers.unlocks_at_customer_level_n',{n:OPT[a.o].lvl}):''].filter(Boolean)}),
|
||||
quote:a=>({setup:optCost(a.o),blocked:[OPT[a.o]&&OPT[a.o].lvl>glassLvl()?tr('action_helpers.unlocks_at_customer_level_n',{n:OPT[a.o].lvl}):''].filter(Boolean)}),
|
||||
doc:'Buy a spare optic for the shelf, up to 64 of a kind. The next channel of that type is then free of optic cost.'},
|
||||
sellSpare:{args:[['o','opticId']],quote:a=>({setup:-spareValue(a.o)}),
|
||||
doc:'Sell a spare on eBuy for 40% of list.'},
|
||||
|
|
@ -342,7 +342,7 @@ const API_CMD={
|
|||
seatNo:{args:[],watch:['seatOff'],
|
||||
doc:'Decline the consortium cable offer.'},
|
||||
charter:{args:[['k','charterKey']],watch:['charter'],
|
||||
doc:'Sign your first-month charter: global backbone (the classic game) or low-latency boutique (trading firms pay 40% more, and it has its own win). One choice per network, normal games only.'},
|
||||
doc:'Sign the charter a new normal game asks for before anything else (the player sees a popup until it is signed): global backbone (the classic game), low-latency boutique (trading firms pay 40% more, and it has its own win) or broker (dark fiber, line systems, optics and own subsea cables from day one at the usual prices, its own goals and its own win, Glass Baron). One choice per network, normal games only.'},
|
||||
mkBanana:{args:[],watch:['monkey'],
|
||||
quote:a=>({setup:mkBananaCost()}),
|
||||
doc:'Throw the chaos monkey a banana and it leaves early. Only while it is in your network; the price scales with your revenue.'},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ const API_STATE_DOC={
|
|||
priceMul:{type:'number',doc:'Multiplier on transit prices (weekly modifier).'},
|
||||
mode:{type:'string',doc:'normal | sandbox | scenario | puzzle.'},
|
||||
rules:{type:'map',doc:'The rules this network locked in at its door: preset (soft, freeze, oncall, bgp, sandbox or puzzle), the chaos dial, lead times, the market, and the Best Effort extras (sea, confs, broke, moods, pnis), which are only written where they differ from the classic game. They stay for the network\'s whole life.'},
|
||||
charter:{type:'string',doc:'The charter picked in the first month of a normal game: global | boutique.'},
|
||||
charter:{type:'string',doc:'The charter a normal game signed when it started: global | boutique | broker. chartSet is false until one is signed.'},
|
||||
baronWon:{type:'number',doc:'The day a broker won Glass Baron, or 0.'},
|
||||
chartSet:{type:'boolean',doc:'The charter has been picked; false while the choice is still open.'},
|
||||
solWon:{type:'integer',doc:'The day the Speed of Light win landed (boutique charter), or 0.'},
|
||||
lvl:{type:'integer',doc:'Customer level (unlocks customer types).'},
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ function apiJson(v){
|
|||
carries the keys confGo/confSponsor need, which exist in no field of S; TE_RECIPES renders
|
||||
each recipe's script, because the source is a function and some read the live network. The
|
||||
recipes' relevance score is not exposed: judging which one fits is the agent's job. */
|
||||
const API_TABLES={SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
|
||||
const API_TABLES={SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
|
||||
const API_MADE={
|
||||
BADGES:()=>!S?[]:BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!hof()[b.id];
|
||||
return b.secret&&!on&&!ever?{id:b.id,i:'❔',t:'???',d:tr('badges.a_secret_badge'),r:b.r,secret:true}:{...b,ever};}),
|
||||
|
|
@ -78,7 +78,7 @@ const apiMyPops=()=>Object.keys(S.pops).map(apiCityName).join(', ');
|
|||
|
||||
/* ---------- the network at a glance, and the world ---------- */
|
||||
function apiStatus(){
|
||||
const goal=GOALS.find(g=>S.done[g.id]===undefined),t1=isTier1(),k=o=>Object.fromEntries(Object.entries(o||{}).map(([a,v])=>[a,Math.round(v)]).filter(([,v])=>v));
|
||||
const goal=goals().find(g=>S.done[g.id]===undefined),t1=isTier1(),k=o=>Object.fromEntries(Object.entries(o||{}).map(([a,v])=>[a,Math.round(v)]).filter(([,v])=>v));
|
||||
return {
|
||||
name:S.name,asn:S.asn,home:apiCityName(S.home),mode:S.mode,rules:S.rules&&S.rules.preset,
|
||||
day:S.day,date:dateStr(S.day),cash:Math.round(S.cash),level:S.lvl||0,
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ const RMAX=16;
|
|||
// The plain, badge-less model of each class is the default upgrade path; the others are side-grades.
|
||||
const mainRG=k=>RG.findIndex(r=>r.cls===k&&!r.badge);
|
||||
// Ports and waves beyond 1.6T / 6.4T only show once a router that takes them is unlocked.
|
||||
const portShown=i=>i<=4||RG.some(r=>r.lvl<=lvl()&&r.maxP>=i),waveShown=i=>i<=5||RG.some(r=>r.lvl<=lvl()&&r.maxLT>=i);
|
||||
const portShown=i=>i<=4||RG.some((r,g)=>rgOpen(g)&&r.maxP>=i),waveShown=i=>i<=5||RG.some((r,g)=>rgOpen(g)&&r.maxLT>=i);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ 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 isRdm=y=>y==='roadm'||y==='cl';
|
||||
const PAIRS_MAX=4,PAIRS_BIG=8,PAIRS_LV=12,SUB_PAIRS_MAX=8,SUB_PAIR_UP=1500000,pairsMax=l=>l.seat?Math.max(1,l.pairs|0):l.sub?SUB_PAIRS_MAX:lvl()>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,chMax=l=>DF_SYS[l.sys].max*(isRdm(l.sys)&&l.own?Math.max(1,l.pairs|0):1),
|
||||
const PAIRS_MAX=4,PAIRS_BIG=8,PAIRS_LV=12,SUB_PAIRS_MAX=8,SUB_PAIR_UP=1500000,pairsMax=l=>l.seat?Math.max(1,l.pairs|0):l.sub?SUB_PAIRS_MAX:glassLvl()>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,chMax=l=>DF_SYS[l.sys].max*(isRdm(l.sys)&&l.own?Math.max(1,l.pairs|0):1),
|
||||
pairCost=l=>DF_SYS[isRdm(l.sys)?l.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('dark_fiber.coherent_pluggable_in_the_router_no')},
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const SUBR=[],subReach=(t,e)=>SUBR[(t?1:0)+(e?2:0)]??(SUBR[(t?1:0)+(e?2:0)]=Math
|
|||
subNeed=km=>km<=subReach(0,0)?[]:km<=subReach(1,0)?['terminal']:km<=subReach(0,1)?['engineering']:km<=subReach(1,1)?['terminal','engineering']:null;
|
||||
// Upgrades a cable of this length still needs on top of the chosen ones; ['design'] when nothing can light it.
|
||||
const seaLack=(km,up)=>{const n=subNeed(km);return n?n.filter(k=>!up[k]):['design'];};
|
||||
const submarineRate=l=>Math.max(0,...Object.keys(OPT).filter(o=>OPT[o].lvl<=lvl()&&(OPT[o].sys!=='roadm'||isRdm(l.sys||'roadm'))).map(o=>optG(o,l)));
|
||||
const submarineRate=l=>Math.max(0,...Object.keys(OPT).filter(o=>OPT[o].lvl<=glassLvl()&&(OPT[o].sys!=='roadm'||isRdm(l.sys||'roadm'))).map(o=>optG(o,l)));
|
||||
// The fastest single carrier any optic can run over this much subsea cable.
|
||||
const subCarrier=km=>Math.max(0,...Object.values(OPT).map(O=>{const m=(O.modes||[[O.g,O.reach]]).find(([,r])=>km<=reachOn(r,true));return m?m[0]:0;}));
|
||||
// A big leased wave is several carriers (6.4T = 4×1.6T), so each carrier has to make it across on its own.
|
||||
|
|
|
|||
|
|
@ -20,4 +20,19 @@ const GOALS=[
|
|||
{id:'t10',t:tr('goals.serve_10_tbps'),d:tr('goals.ten_terabits_per_second_of_happy'),r:250000,ok:()=>R.served>=10000},
|
||||
{id:'t1',t:tr('common.go_transit_free_tier_1'),d:tr('goals.peer_with_every_tier_1_their_customers'),r:0,win:true,ok:()=>isTier1()},
|
||||
];
|
||||
|
||||
// The Cable broker's goals (#300): light glass, sell it, lay cables across the oceans, and end as a Glass Baron
|
||||
// (37-cable-broker.js). Ids of their own, so a save keeps the ladder it ran. Rewards are larger: glass costs more.
|
||||
const BROKER_GOALS=[
|
||||
{id:'bk_df',t:tr('goals.light_your_own_dark_fiber'),d:tr('broker.goal_df_d'),r:25000,ok:()=>S.links.some(l=>l.kind==='df'&&dfCap(l)>0)},
|
||||
{id:'bk_wave',t:tr('broker.goal_wave'),d:tr('broker.goal_wave_d'),r:40000,ok:()=>S.biz.some(b=>b.type==='wwave'||b.type==='capw'&&!capPend(b))},
|
||||
{id:'bk_pair',t:tr('broker.goal_pair'),d:tr('broker.goal_pair_d'),r:50000,ok:()=>S.biz.some(b=>(b.type==='dfpair'||b.type==='pairs'||b.type==='capfib')&&!capPend(b))},
|
||||
{id:'bk_sea',t:tr('broker.goal_sea'),d:tr('broker.goal_sea_d'),r:150000,ok:()=>S.links.some(l=>ownGlassL(l)&&l.sub)},
|
||||
{id:'bk_deal',t:tr('broker.goal_deal'),d:tr('broker.goal_deal_d'),r:100000,ok:()=>(S.stats.capDone||0)>0},
|
||||
{id:'bk_10k',t:tr('broker.goal_10k'),d:tr('broker.goal_10k_d'),r:200000,ok:()=>glassKm()>=10000},
|
||||
{id:'bk_16t',t:tr('broker.goal_16t'),d:tr('broker.goal_16t_d'),r:250000,ok:()=>glassChain(1600)},
|
||||
{id:'bk_c4',t:tr('broker.goal_c4'),d:tr('broker.goal_c4_d'),r:400000,ok:()=>cableConts()>=4},
|
||||
{id:'bk_10t',t:tr('broker.goal_10t'),d:tr('broker.goal_10t_d'),r:600000,ok:()=>capSoldG()>=10000},
|
||||
{id:'bk_win',t:tr('broker.glass_baron'),d:tr('broker.goal_win_d'),r:0,win:true,baron:true,ok:()=>baronOk()},
|
||||
];
|
||||
// The ladder this network runs: the broker's, or the classic one every other charter and mode plays.
|
||||
const goals=()=>broker()?BROKER_GOALS:GOALS;
|
||||
|
|
|
|||
|
|
@ -54,4 +54,5 @@ function beginGame(nm,city,o={}){if(needPitch()&&!UI.pitched){UI.pendGame=[nm,ci
|
|||
UI.lastSpeed=rule('clock')?0.5:0;setSpeed(UI.lastSpeed);UI.resumeSpeed=null;
|
||||
track('game_new');UI.started=true;closeModal();compute();cam.x=CITY[city].x;cam.y=CITY[city].y;cam.z=innerWidth<760?1.1:1.4;selectCity(city);
|
||||
toast(S.scn?`<b>${esc(S.scn.name)}</b><br>${o.scn.goal?esc(o.scn.goal)+'.':tr('common.serve_as_much_traffic_as_you')} ${tr('scenarios.you_have_n_days',{n:S.scn.days})}`:S.mode==='sandbox'?(chaosMul()?tr('scenarios.sandbox_mode_a_billion_dollars_chaos',{chaos:CHAOS[rule('chaos')].n}):tr('scenarios.sandbox_mode_a_billion_dollars_every')):tr('scenarios.welcome_name_the_ripe_ncc_assigned',{name:esc(nm),asn:S.asn,city:CITY[city].name}),'goal');
|
||||
renderAll();save();if(!S.scn&&S.mode!=='sandbox'&&S.mode!=='puzzle')tutorialStart();}
|
||||
// A Normal game asks for its charter first; the tutorial starts once it is signed.
|
||||
renderAll();save();if(!S.scn&&S.mode!=='sandbox'&&S.mode!=='puzzle'){if(charterDue()){UI.tutLater=true;charterAsk();}else tutorialStart();}}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function confTick(d){S.confReg=S.confReg||{};
|
|||
capDealTick(d);}
|
||||
function confSection(){const up=upcomingConfs(75).slice(0,3),cb=S.conf&&S.conf.until>S.day?S.conf:null;if(!up.length&&!cb)return '';
|
||||
return `<h3 style="font-size:15px;margin:10px 0 4px">${tr('common.conferences')}</h3>${cb?`<div class="inc" style="background:#EAF7EE"><div class="nm">${tr('conferences.name_glow_n_days_left',{name:esc(cb.name),n:cb.until-S.day})}</div><div class="meta">${tr('conferences.selective_networks_in_region_need',{region:esc(REG[cb.reg])})}${cb.sp?' '+tr('conferences.as_a_sponsor_you_also_get',{region:esc(REG[cb.reg])}):''}</div></div>`:''}${up.map(confRow).join('')}`;}
|
||||
function confRow(cf){const reg=S.confReg&&S.confReg[cf.key],open=cf.day>S.day,sp=confSp(cf),cost=confCost(cf),lk=cf.cap&&lvl()<CAP_LV;
|
||||
function confRow(cf){const reg=S.confReg&&S.confReg[cf.key],open=cf.day>S.day,sp=confSp(cf),cost=confCost(cf),lk=cf.cap&&glassLvl()<CAP_LV;
|
||||
const tags=(reg==='sp'?'<span class="tag st on">'+tr('conferences.sponsor')+'</span>':reg?'<span class="tag st on">'+tr('common.registered')+'</span>':open?'':'<span class="tag st">'+tr('common.registration_closed')+'</span>');
|
||||
const btns=!open||reg==='sp'?'':(reg?'':lk?btn(tr('sites_and_service.level_n',{n:CAP_LV}),'confGo',{key:cf.key},'sm',true):btn(tr('conferences.attend_cost',{cost:fmt$(cost)}),'confGo',{key:cf.key},'sm',S.cash<cost))+(sp?btn(tr('conferences.sponsor_cost',{cost:fmt$(CONF_SP-(reg?CONF_COST:0))}),'confSponsor',{key:cf.key},'pink sm',S.cash<CONF_SP-(reg?CONF_COST:0)):'');
|
||||
return `<div class="row"><div class="grow"><div class="nm">${esc(cf.n)} · ${esc(CITY[cf.c].name)}</div><div class="meta">${cf.day===S.day?tr('common.today'):tr('conferences.in_n_days',{n:cf.day-S.day})} · ${esc(REG[CITY[cf.c].reg])}${cf.cap?' · '+tr('conferences.capacity_conference_carriers_buy_in'):sp&&open&®!=='sp'?' · '+tr('conferences.sponsorships_available'):''}</div></div>${tags}${btns?`<div class="btns">${btns}</div>`:''}</div>`;}
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@ const DEMO_MUL=1.6,DEMO_DAYS=14;
|
|||
function demoItem(k,id){return k==='rg'?RG[+id]||null:k==='sys'?(own(DF_SYS,id)?DF_SYS[id]:null):k==='opt'?(own(OPT,id)?OPT[id]:null):null;}
|
||||
const demoAt=(k,id)=>{const d=S&&S.demo&&S.demo[k+':'+id];return d===undefined?null:d;};
|
||||
const demoCan=L=>!gatesOpen()&&L===lvl()+1;
|
||||
function techOk(k,id,L){if(L<=lvl())return true;const d=demoAt(k,id);return demoCan(L)&&d!==null&&d<=S.day;}
|
||||
const techMul=L=>L>lvl()?DEMO_MUL:1;
|
||||
function techOk(k,id,L){if(L<=(k==='rg'?(rgGlass(+id)?LEVELS.length:lvl()):k==='sys'||k==='opt'?glassLvl():lvl()))return true;const d=demoAt(k,id);return demoCan(L)&&d!==null&&d<=S.day;}
|
||||
const techMul=L=>L>glassLvl()?DEMO_MUL:1;
|
||||
function demoBtn(k,id,L,lock,cls){const d=demoAt(k,id);if(!demoCan(L))return btn(lock,'demoAsk',{k,id},cls,true);
|
||||
if(d!==null&&d>S.day)return btn(tr('specialist.demo_unit_ships_in_n_days',{n:d-S.day}),'demoAsk',{k,id},cls,true);
|
||||
return btn(tr('specialist.ask_for_a_demo_unit_p_n',{p:Math.round((DEMO_MUL-1)*100),n:leadDays(DEMO_DAYS)}),'demoAsk',{k,id},cls);}
|
||||
const sysCost=k=>Math.round(DF_SYS[k].cost*techMul(DF_SYS[k].lvl));
|
||||
// Digging your own fiber before level 3: the pioneer pays for the permits nobody has asked for yet.
|
||||
const PIONEER=1.6;
|
||||
const digMul=()=>lvl()>=3?1:PIONEER,digCost=km=>Math.round(dfBuildCost(km)*digMul());
|
||||
const digMul=()=>glassLvl()>=3?1:PIONEER,digCost=km=>Math.round(dfBuildCost(km)*digMul());
|
||||
|
||||
/* A seat on a consortium cable (#173): pay your share of the build, wait for the ship, and own fiber pairs on it,
|
||||
lit with your own optics like your own cable. Capacity conferences offer them, and now and then a consortium calls. */
|
||||
|
|
@ -64,11 +64,18 @@ function seatSection(){const o=S.seatOff;if(!o||o.exp<=S.day)return '';const pop
|
|||
<div class="btns">${SEAT_N.map(n=>{const c=seatCost(o.km,n)+pop;return btn(`${trn('specialist.n_fiber_pairs',n)} <small>${fmt$(c)} · ${tr('common.price_mo',{price:fmt$(seatMo(o.km,n))})}</small>`,'seatBuy',{n},'sm',S.cash<c);}).join('')}${btn(tr('common.decline'),'seatNo',{},'ghost sm')}</div></div>`;}
|
||||
function seatPanel(l){if(!l.seat)return '';return `<div class="kv"><span>${tr('specialist.consortium_seat')}</span><b>${esc(l.cname||'')} · ${trn('specialist.n_fiber_pairs',Math.max(1,l.pairs|0))}</b></div><p class="note">${tr('specialist.the_consortium_runs_the_cable_your')}</p>`;}
|
||||
|
||||
/* Charters: what the network sets out to be, picked once at the start of a Normal game. Global backbone is the game as
|
||||
it always was; the Low-latency boutique sells speed to traders and has its own win, Speed of Light. */
|
||||
const CHARTERS={global:{i:'🌐',n:N_('specialist.global_backbone'),d:N_('specialist.the_classic_game_grow_everywhere_and')},boutique:{i:'⚡',n:N_('specialist.low_latency_boutique'),d:N_('specialist.trading_firms_and_other_latency_customers')}};
|
||||
/* Charters: what the network sets out to be, picked once when a Normal game starts, in a popup that waits for an
|
||||
answer. Global backbone is the game as it always was; the Low-latency boutique sells speed to traders and has its own
|
||||
win, Speed of Light; the Cable broker (#300) lays and lights glass on land and under the sea from day one, at the
|
||||
usual prices, sells it, and has its own goals and win, Glass Baron (37-cable-broker.js). */
|
||||
const CHARTERS={global:{i:'🌐',n:N_('specialist.global_backbone'),d:N_('specialist.the_classic_game_grow_everywhere_and')},boutique:{i:'⚡',n:N_('specialist.low_latency_boutique'),d:N_('specialist.trading_firms_and_other_latency_customers')},broker:{i:'🚢',n:N_('specialist.cable_broker'),d:N_('specialist.cable_broker_desc')}};
|
||||
const CHARTER_DAYS=30,LAT_PAY=1.4,SOL_ROUTES=3,SOL_CUST=2;
|
||||
const charter=()=>S&&!S.scn&&S.mode==='normal'&&S.charter==='boutique'?'boutique':'global';
|
||||
const charter=()=>S&&!S.scn&&S.mode==='normal'&&(S.charter==='boutique'||S.charter==='broker')?S.charter:'global';
|
||||
const broker=()=>charter()==='broker';
|
||||
// The level glass is judged at: fiber, line systems, optics, pairs and subsea gear. A broker has all of it from day one.
|
||||
const glassLvl=()=>broker()?LEVELS.length:lvl();
|
||||
// The router class the fastest optics need: a broker may buy every router up to it, so all its optics can be lit.
|
||||
const RG_GLASS=Math.max(...Object.values(OPT).map(o=>o.rg)),rgGlass=g=>broker()&&!!RG[g]&&RG[g].cls<=RG_GLASS,rgOpen=g=>!!RG[g]&&(RG[g].lvl<=lvl()||rgGlass(g));
|
||||
const latPay=()=>charter()==='boutique'?LAT_PAY:1;
|
||||
// The fastest a leased wave or fiber gets between two cities: overland, or the quickest cable on the route.
|
||||
function leasedLat(a,b){let best=isSub(a,b)?Infinity:kmBetween(a,b)*1.25/200;for(const c of cablesFor(a,b))best=Math.min(best,c.km*Math.min(CAB[c.cid].lat||1,1.25)/200);return best;}
|
||||
|
|
@ -78,19 +85,29 @@ function solRoutes(){const k=S.day+'|'+S.links.length+'|'+S.links.reduce((n,l)=>
|
|||
const f=FIN.filter(c=>S.pops[c]),v=[];if(S.links.some(ownGlass))for(let i=0;i<f.length;i++)for(let j=i+1;j<f.length;j++){const a=f[i],b=f[j],o=bestLat(a,b,ownGlass),l=leasedLat(a,b);if(isFinite(o)&&isFinite(l)&&o<l)v.push({a,b,o,l});}
|
||||
SOLC={s:S,k,v};return v;}
|
||||
const solCust=()=>S.biz.filter(b=>BIZ_T[b.type]&&BIZ_T[b.type].lat&&b.mood>=50&&reqOk(b)).length;
|
||||
// What each charter promises, as the picker and the agent's docs say it.
|
||||
const charterDesc=C=>tr(C.d,{p:Math.round((LAT_PAY-1)*100),r:SOL_ROUTES,c:SOL_CUST,n:BARON_CONT,m:fmt$(BARON_MO)});
|
||||
/* The picker: when a Normal game starts (and when a save that never picked loads), before anything else. It pauses the
|
||||
clock like any open window and cannot be closed without a choice; the tutorial waits for it. Seeded tests skip it unless
|
||||
they ask (window.__TUBES_CHARTER__), as they skip the tutorial: they sign a charter with ACT.charter when they need one. */
|
||||
const charterDue=()=>!!(S&&UI.started&&!S.lost&&!S.scn&&S.mode==='normal'&&!S.chartSet&&!pzOn());
|
||||
function charterPickHtml(){return `<div class="chpick"><div class="eyebrow">${esc(S.name)} · AS${S.asn}</div><h2 style="font-size:26px">${tr('specialist.what_are_you_building')}</h2><p class="tagline">${tr('specialist.your_charter_sets_your_goals')}</p><div class="chopts">`
|
||||
+Object.entries(CHARTERS).map(([k,C])=>`<button class="chopt" data-act="charter" data-args='${JSON.stringify({k})}'><span class="chi" aria-hidden="true">${C.i}</span><span class="cht"><b>${tr(C.n)}</b><span>${charterDesc(C)}</span></span></button>`).join('')+`</div></div>`;}
|
||||
function charterAsk(){if(!charterDue()||!$('modal').hidden||window.__TUBES_TEST__&&!window.__TUBES_CHARTER__)return;openModal(charterPickHtml(),'charter');}
|
||||
function charterCard(){if(S.scn||S.mode!=='normal')return '';
|
||||
if(!S.chartSet&&S.day<=CHARTER_DAYS)return `<div class="inc" style="background:#EEF0FF"><div class="nm">${tr('specialist.pick_a_charter')}</div><div class="meta">${tr('specialist.what_kind_of_network_are_you',{n:CHARTER_DAYS-S.day})}</div>${Object.entries(CHARTERS).map(([k,C])=>`<div class="row"><div class="grow"><div class="nm">${C.i} ${tr(C.n)}</div><div class="meta">${tr(C.d,{p:Math.round((LAT_PAY-1)*100),r:SOL_ROUTES,c:SOL_CUST})}</div></div>${btn(charter()===k?tr('specialist.keep_it'):tr('specialist.pick'),'charter',{k},k==='global'?'ghost sm':'pink sm')}</div>`).join('')}</div>`;
|
||||
if(broker())return baronCard();
|
||||
if(charter()!=='boutique')return '';
|
||||
if(S.solWon)return `<div class="inc" style="background:#EAF7EE"><div class="nm">⚡ ${tr('specialist.speed_of_light')}</div><div class="meta">${tr('specialist.won_on_date_your_own_glass',{date:dateStr(S.solWon)})}</div></div>`;
|
||||
const r=solRoutes();return `<div class="inc" style="background:#EEF0FF"><div class="nm">⚡ ${tr('specialist.speed_of_light')}</div><div class="meta">${tr('specialist.routes_r_of_n_beat_the',{r:Math.min(r.length,SOL_ROUTES),n:SOL_ROUTES,c:Math.min(solCust(),SOL_CUST),m:SOL_CUST})}</div>${r.slice(0,SOL_ROUTES).map(x=>`<div class="meta">✓ ${CITY[x.a].name} ⇄ ${CITY[x.b].name}: ${tr('common.ms_ms_one_way',{ms:x.o.toFixed(1)})} < ${x.l.toFixed(1)}</div>`).join('')}</div>`;}
|
||||
// Once a day: seats expire or call, and the boutique checks its win.
|
||||
function specDay(d){if(S.seatOff&&S.seatOff.exp<=d)S.seatOff=null;
|
||||
// Once a day: seats expire or call, the boutique checks its win and carriers call the broker.
|
||||
function specDay(d){if(broker())brokerDay(d);if(S.seatOff&&S.seatOff.exp<=d)S.seatOff=null;
|
||||
if(!S.seatOff&&!S.scn&&S.mode!=='puzzle'&&lvl()>=SEAT_LV&&hstr(S.asn+'|seatcall|'+d)%SEAT_ODDS===0)seatConf(null);
|
||||
if(charter()==='boutique'&&!S.solWon&&solRoutes().length>=SOL_ROUTES&&solCust()>=SOL_CUST){S.solWon=Math.max(1,d);track('win_sol');toast(`<b>⚡ ${tr('specialist.speed_of_light')}</b><br>${tr('specialist.your_own_glass_beats_every_leased')}`,'goal');sfx('coin');checkBadges();}}
|
||||
// Saves: the charter, demo orders, a seat on offer and the boutique's win. Old saves are Global backbone, picked.
|
||||
function specSanitize(s){s.charter=s.charter==='boutique'&&s.mode==='normal'&&!s.scn?'boutique':'global';s.chartSet=s.chartSet===false&&s.day<=CHARTER_DAYS?false:true;
|
||||
// Saves: the charter, demo orders, a seat on offer and the boutique's and the broker's wins. Old saves are Global
|
||||
// backbone, picked; one still in its first month that never picked is asked again.
|
||||
function specSanitize(s){s.charter=(s.charter==='boutique'||s.charter==='broker')&&s.mode==='normal'&&!s.scn?s.charter:'global';s.chartSet=s.chartSet===false&&s.day<=CHARTER_DAYS?false:true;
|
||||
const dm={};if(s.demo&&typeof s.demo==='object'&&!Array.isArray(s.demo))for(const key of Object.keys(s.demo).slice(0,64)){const [k,id]=key.split(':');if(demoItem(k,id)&&Number.isFinite(+s.demo[key]))dm[key]=Math.round(+s.demo[key]);}s.demo=dm;
|
||||
const o=s.seatOff;s.seatOff=o&&typeof o==='object'&&typeof o.name==='string'&&seatRoute(o.name)&&seatRoute(o.name)[0]===o.a&&seatRoute(o.name)[1]===o.b?{a:o.a,b:o.b,name:o.name,km:seatKm(o.a,o.b),exp:num(o.exp,0)}:null;
|
||||
s.solWon=Number.isFinite(+s.solWon)&&+s.solWon>0?Math.round(+s.solWon):0;
|
||||
s.solWon=Number.isFinite(+s.solWon)&&+s.solWon>0?Math.round(+s.solWon):0;s.baronWon=Number.isFinite(+s.baronWon)&&+s.baronWon>0?Math.round(+s.baronWon):0;
|
||||
for(const l of s.links)if(l.seat!==undefined){if(l.seat===true&&l.kind==='df'&&l.own&&l.sub)l.pairs=Math.max(1,Math.min(Math.max(...SEAT_N),l.pairs|0));else delete l.seat;}
|
||||
for(const b of [...s.biz,...s.offers])if(b.spot!==undefined){const x=b.spot;if(x&&typeof x==='object'&&own(SPOT_W,x.k))b.spot={k:x.k,n:num(x.n,0)};else delete b.spot;}}
|
||||
|
|
|
|||
34
src/game/60-features/37-cable-broker.js
Normal file
34
src/game/60-features/37-cable-broker.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* ---------- The Cable broker (#300) ----------
|
||||
A charter for building glass and selling it. Dark fiber, every line system and optic, digging, own subsea cables,
|
||||
their upgrades and more pairs are open from day one at the usual prices (glassLvl, rgGlass in 36-specialist.js); the
|
||||
rest of the game unlocks by level as always. Carriers call for capacity, the goals are about glass (BROKER_GOALS), and
|
||||
the win is Glass Baron: your own cables land on five continents while carriers pay you $1M a month for capacity. */
|
||||
const BARON_CONT=5,BARON_MO=1000000,BROKER_CALL=120,BROKER_CALL_FROM=60;
|
||||
// Your own glass: fiber you dug and cables you laid, once ready. A leased IRU is someone else's; so is a consortium seat.
|
||||
const ownGlassL=l=>l.kind==='df'&&l.own&&!l.seat&&l.ready<=S.day;
|
||||
const glassKm=()=>S.links.reduce((a,l)=>a+(ownGlassL(l)?l.km:0),0);
|
||||
// The continents your own subsea cables land on.
|
||||
function cableConts(){const r=new Set();for(const l of S.links)if(ownGlassL(l)&&l.sub)for(const c of [l.a,l.b])r.add(CITY[c].reg);return r.size;}
|
||||
// Capacity other carriers buy from you: alien waves, fiber pairs and capacity deals (once delivered).
|
||||
const CAP_TYPES=['wwave','dfpair','pairs','capw','capsub','capfib'];
|
||||
const capSold=b=>CAP_TYPES.includes(b.type)&&!capPend(b);
|
||||
const capSalesMo=()=>S.biz.reduce((a,b)=>a+(capSold(b)?bizMo(b):0),0);
|
||||
// Lit capacity sold, in Gbps: waves (400G each) and subsea capacity. A dark pair is the buyer's to light.
|
||||
const capSoldG=()=>S.biz.reduce((a,b)=>a+(!capSold(b)?0:b.type==='wwave'?(b.slots||1)*400:b.type==='capw'||b.type==='capsub'?b.bw:0),0);
|
||||
// Two hops of your own glass through one city, each lit to at least g.
|
||||
function glassChain(g){const by={};for(const l of S.links)if(ownGlassL(l)&&dfCap(l)>=g)for(const [c,o] of [[l.a,l.b],[l.b,l.a]])(by[c]=by[c]||new Set()).add(o);
|
||||
return Object.values(by).some(s=>s.size>=2);}
|
||||
const baronOk=()=>cableConts()>=BARON_CONT&&capSalesMo()>=BARON_MO;
|
||||
// On the goals tab, under the charter: how far Glass Baron is.
|
||||
function baronCard(){if(S.baronWon)return `<div class="inc" style="background:#EAF7EE"><div class="nm">🌊 ${tr('broker.glass_baron')}</div><div class="meta">${tr('broker.won_on_date',{date:dateStr(S.baronWon)})}</div></div>`;
|
||||
return `<div class="inc" style="background:#E6F4FF"><div class="nm">🌊 ${tr('broker.glass_baron')}</div><div class="meta">${tr('broker.progress',{c:Math.min(cableConts(),BARON_CONT),n:BARON_CONT,mo:fmt$(capSalesMo()),m:fmt$(BARON_MO)})}</div></div>`;}
|
||||
function showBaronWin(){openModal(`<h1 style="font-family:var(--display);font-size:40px;margin:0">🌊 ${tr('broker.glass_baron')}</h1><p class="tagline">${tr('broker.win_text',{name:esc(S.name),asn:S.asn,days:S.day,n:BARON_CONT,mo:fmt$(capSalesMo())})}</p><div class="btns">${btn(tr('help.share_my_network'),'share',{},'pink')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost')}</div>`);}
|
||||
/* Carriers call the broker now and then (about three times a year, from day 60) with a capacity deal on a route the
|
||||
capacity conferences trade: the same deals at the same terms, without the trip. Picked by a hash of the day, so a
|
||||
broker's other dice roll as they would. */
|
||||
function brokerDay(d){if(d<BROKER_CALL_FROM||S.scn||hstr(S.asn+'|capcall|'+d)%BROKER_CALL!==0)return;
|
||||
const pool=Object.values(CAP_ROUTES).flat().filter(r=>isCity(r[0])&&isCity(r[1])&&!S.offers.some(o=>o.city===r[0]&&o.city2===r[1]&&o.type===r[2]));if(!pool.length)return;
|
||||
const [a,b,t]=pool[hstr(S.asn+'|caproute|'+d)%pool.length],T=BIZ_T[t];
|
||||
const nm=()=>{const list=T.names.filter(n=>!S.usedNames.includes(n)),n=list.length?pick(list):pick(T.names);useName(n);return n;};
|
||||
const o=capOffer(a,b,t,nm);S.offers.push(o);
|
||||
toast(tr('broker.a_carrier_calls',{name:esc(o.name),what:capWhat(o),a:CITY[a].name,b:CITY[b].name}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);sfx('coin');}
|
||||
|
|
@ -133,7 +133,7 @@ const OPS_RUN={
|
|||
const ld=Math.max((R.nodeLoad[c]||0)/(R.nodeCap[c]||nodeCap(c)||1),portsUsed(c)/Math.max(1,portsMax(c)));if(ld<at)continue;
|
||||
const rt=p.routers||1,g=p.rgen||0,nx=mainRG(RG[g].cls+1);
|
||||
// A swap with one router is a maintenance window: the intern only swaps where a second router carries the traffic.
|
||||
const swap=nx>=0&&RG[nx].lvl<=lvl()&&!modelFits(c,nx)&&(rt>1||popIdle(c)),add=rt<RMAX;
|
||||
const swap=nx>=0&&rgOpen(nx)&&!modelFits(c,nx)&&(rt>1||popIdle(c)),add=rt<RMAX;
|
||||
const doSwap=how==='swap'?swap:how==='add'?false:swap&&(rt>=4||!add);if(!doSwap&&(how==='swap'||!add))continue;
|
||||
const cost=doSwap?swapCost(c,nx):routerCost(g,rt);if(!X.can('routers',cost))continue;
|
||||
if(X.pay('routers',()=>doSwap?ACT.upRouter({city:c,g:nx}):ACT.addRouter({city:c})))X.did('routers',c+(doSwap?' ⇧'+RG[nx].pn:' +1'));}},
|
||||
|
|
|
|||
|
|
@ -100,8 +100,10 @@ function spawnOffer(){
|
|||
const mine=spMine(Object.keys(S.pops).filter(bizCity)),lv=lvl();
|
||||
const types=['dia','dia','game','host'];if(mine.length>=2)types.push('l2vpn','l2vpn');if(S.day>60)types.push('scrub');
|
||||
if(lv>=2)types.push('isp','stream','edu','host','hft','bulk','event','event');if(mine.length>=3&&lv>=2)types.push('sdwan','sdwan');
|
||||
if(S.links.some(l=>l.kind==='df'&&l.ready<=S.day))types.push('wwave','wwave');if(S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('dfpair');if(lv>=3)types.push('gpu','gpu','onramp','onramp');if(lv>=4)types.push('ai','ai','hyper','hyper');
|
||||
if(lv>=3&&MEGA.some(m=>mine.includes(m.c)))types.push('ingest');if(lv>=4&&MEGA.some(m=>mine.includes(m.c)))types.push('aiwan','aiwan','mtrain');if(lv>=4&&S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('pairs');
|
||||
// A broker's callers are mostly carriers who want capacity on its glass (#300).
|
||||
const bk=broker(),dfR=S.links.some(l=>l.kind==='df'&&l.ready<=S.day),dfO=S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day);
|
||||
if(dfR)types.push('wwave','wwave');if(dfO)types.push('dfpair');if(bk){if(dfR)types.push('wwave','wwave','wwave','wwave');if(dfO)types.push('dfpair','dfpair','dfpair');}if(lv>=3)types.push('gpu','gpu','onramp','onramp');if(lv>=4)types.push('ai','ai','hyper','hyper');
|
||||
if(lv>=3&&MEGA.some(m=>mine.includes(m.c)))types.push('ingest');if(lv>=4&&MEGA.some(m=>mine.includes(m.c)))types.push('aiwan','aiwan','mtrain');if((lv>=4||bk)&&dfO)types.push('pairs');
|
||||
if(lv>=5)types.push('esport');if(lv>=6&&mine.length>=2)types.push('sov','sov');if(lv>=8)types.push('cgame','cgame');if(lv>=9)types.push('metav','metav');if(lv>=11&&MEGA.some(m=>mine.includes(m.c)))types.push('agi');if(lv>=13&&mine.length>=2)types.push('mars');
|
||||
const br=mine.filter(c=>CITY[c].br);if(br.length)types.push('provedor','provedor','provedor');
|
||||
// Countries with thousands of ASNs (Brazil's provedores, US regionals) are full of small ISPs shopping for transit.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const BADGES=[
|
|||
{id:'landlord',i:'🧵',t:tr('common.trench_landlord'),d:tr('badges.lease_hundreds_of_fiber_pairs_to'),r:'e',ok:()=>S.biz.some(b=>b.type==='pairs')},
|
||||
{id:'t1',i:'👑',t:tr('common.tier_1'),d:tr('badges.go_transit_free'),r:'e',ok:()=>!!S.won},
|
||||
{id:'sol',i:'⚡',t:tr('specialist.speed_of_light'),d:tr('specialist.win_as_a_low_latency_boutique'),r:'e',ok:()=>!!S.solWon},
|
||||
{id:'baron',i:'🌊',t:tr('broker.glass_baron'),d:tr('broker.win_as_a_cable_broker'),r:'e',ok:()=>!!S.baronWon},
|
||||
{id:'seat',i:'🚢',t:tr('specialist.part_owner_of_the_sea'),d:tr('specialist.take_a_seat_on_a_consortium'),r:'r',ok:()=>S.links.some(l=>l.seat)},
|
||||
{id:'bait',i:'🎣',t:tr('common.shark_bait'),d:tr('badges.get_bitten_by_sharks_3_times'),r:'l',ok:()=>(st().sharks||0)>=3},
|
||||
{id:'nines',i:'💎',t:tr('common.five_nines'),d:tr('badges.serve_99_5_of_demand_every'),r:'l',ok:()=>(st().clean||0)>=365},
|
||||
|
|
@ -110,9 +111,10 @@ function badgeGrid(){const h=hof(),got=BADGES.filter(b=>S.ach&&S.ach[b.id]!==und
|
|||
<div class="badges">${BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!h[b.id],R0=RARITY[b.r],hide=b.secret&&!on&&!ever,vk=on?bvar(S.achP&&S.achP[b.id]).k:ever?h[b.id].v:'',vn=vk&&vk!=='oncall'?' · '+BVAR[vk].i+' '+tr(BVAR[vk].n):'';
|
||||
return `<div class="bdg ${on?'on':ever?'ever':''}${vk?' v-'+vk:''}" style="--rc:${R0.col}" title="${esc(hide?tr('badges.a_secret_badge'):b.t+': '+b.d+vn)}"><span class="bi">${hide?'❔':b.i}</span><span class="bt">${esc(hide?'???':b.t)}</span><span class="br">${R0.n}${ever&&!on?' · '+tr('common.earned_before'):''}</span>${vk&&vk!=='oncall'?`<span class="bv">${BVAR[vk].i} ${esc(tr(BVAR[vk].n))}</span>`:''}${hide?'':`<span class="bd">${esc(b.d)}</span>`}</div>`;}).join('')}</div>`;}
|
||||
function checkGoals(){checkBadges();
|
||||
for(const g of GOALS){if(S.done[g.id]!==undefined)continue;let ok=false;try{ok=g.ok();}catch(e){}
|
||||
for(const g of goals()){if(S.done[g.id]!==undefined)continue;let ok=false;try{ok=g.ok();}catch(e){}
|
||||
if(ok){S.done[g.id]=S.day;if(g.r&&S.mode!=='sandbox'){S.cash+=g.r;}
|
||||
toast(`<b>${tr('badges.goal_complete_name',{name:esc(g.t)})}</b>${g.r?`<br>${tr('badges.reward_amt',{amt:fmt$(g.r)})}`:''}`,'goal',[],{a:'tab',v:'goals'});sfx('coin');
|
||||
track('goal_'+g.id);if(g.win&&!S.won){S.won=true;track('win_tier1');checkBadges();showWin();}}}
|
||||
// Glass Baron is the broker's win; S.won stays Tier 1, which a broker can still become.
|
||||
track('goal_'+g.id);if(g.baron){if(!S.baronWon){S.baronWon=S.day||1;track('win_baron');checkBadges();showBaronWin();}}else if(g.win&&!S.won){S.won=true;track('win_tier1');checkBadges();showWin();}}}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const ACT={
|
|||
repayLoan:({id})=>{const l=S.loans.find(x=>x.id===id);if(!l)return;const B=BANKS[l.bank];const cost=repayCost(l,B);
|
||||
if(UI.confirm!==id){UI.confirm=id;renderBank();return;}UI.confirm=null;if(!spend(cost)){renderBank();return;}S.loans=S.loans.filter(x=>x!==l);track('loan_repaid');
|
||||
toast(B.equity?tr('interface.you_bought_out_bank_they_flew',{bank:esc(B.name)}):tr('interface.loan_from_bank_repaid_early',{bank:esc(B.name)}),'good');after();renderBank();},
|
||||
leaseSwap:({a,b,src})=>{if(!S.pops[a]||!S.pops[b]||a===b)return;$('dash').hidden=true;UI.lmode='df';UI.dfSrc=['lease','build','cable'].includes(src)?src:isSub(a,b)?'cable':'build';UI.dfSys=lvl()>=3?'roadm':'lite';openLinkModal(a,b);},
|
||||
leaseSwap:({a,b,src})=>{if(!S.pops[a]||!S.pops[b]||a===b)return;$('dash').hidden=true;UI.lmode='df';UI.dfSrc=['lease','build','cable'].includes(src)?src:isSub(a,b)?'cable':'build';UI.dfSys=glassLvl()>=3?'roadm':'lite';openLinkModal(a,b);},
|
||||
dashLink:({id})=>{$('dash').hidden=true;selectLink(id);focusLink(id);},
|
||||
mapSet:({v})=>{if(!['auto','2d'].includes(v))return;mapGl(v==='auto');refreshSettings();},
|
||||
animSet:({v})=>{if(!['auto','on','off'].includes(v))return;UI.anim=v;try{localStorage.setItem('sot-anim',v);}catch(e){}applyAnim();refreshSettings();},
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Object.assign(ACT,{
|
|||
share:()=>shareModal(),
|
||||
shareDl:()=>shareFile(f=>{if(!f)return;const a=document.createElement('a');a.href=URL.createObjectURL(f);a.download=f.name;document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove();},1000);track('share_download');}),
|
||||
shareGo:()=>shareFile(f=>{const d={title:'Series of Tubes',text:tr('route_script_and_tools.name_as_asn_tier_peak_peak',{name:S.name,asn:S.asn,tier:tierLabel(),peak:fmtG(S.stats.peak||0)}),url:'https://seriesoftub.es/'};try{if(f&&navigator.canShare&&navigator.canShare({files:[f]}))d.files=[f];navigator.share(d).then(()=>track('share_done')).catch(()=>{});}catch(e){}}),
|
||||
confGo:({key})=>{S.confReg=S.confReg||{};if(S.confReg[key])return;const cf=upcomingConfs(75).find(x=>x.key===key);if(!cf||cf.day<=S.day||(cf.cap&&lvl()<CAP_LV))return;if(!spend(confCost(cf)))return;S.confReg[key]=true;toast(tr('route_script_and_tools.registered_flights_booked_badge'),'good');after();},
|
||||
confGo:({key})=>{S.confReg=S.confReg||{};if(S.confReg[key])return;const cf=upcomingConfs(75).find(x=>x.key===key);if(!cf||cf.day<=S.day||(cf.cap&&glassLvl()<CAP_LV))return;if(!spend(confCost(cf)))return;S.confReg[key]=true;toast(tr('route_script_and_tools.registered_flights_booked_badge'),'good');after();},
|
||||
confSponsor:({key})=>{S.confReg=S.confReg||{};const was=S.confReg[key];if(was==='sp')return;const cf=upcomingConfs(75).find(x=>x.key===key);if(!cf||cf.day<=S.day||!confSp(cf))return;if(!spend(CONF_SP-(was?CONF_COST:0)))return;S.confReg[key]='sp';toast(tr('conferences.you_are_sponsoring_conf_your_logo',{conf:esc(cf.n),region:esc(REG[CITY[cf.c].reg])}),'good');sfx('coin');after();},
|
||||
tutSkip:()=>{S.tut=null;try{localStorage.setItem('sot-tut','1');}catch(e){}renderCoach();},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,5 +7,6 @@ Object.assign(ACT,{
|
|||
S.seatOff=null;S.stats.seats=(S.stats.seats||0)+1;UI.sel={type:'link',id};
|
||||
toast(tr('specialist.you_own_n_fiber_pairs_on',{n,name:esc(o.name),a:CITY[o.a].name,b:CITY[o.b].name,d:days}),'goal');sfx('build');after();},
|
||||
seatNo:()=>{S.seatOff=null;after();},
|
||||
charter:({k})=>{if(!own(CHARTERS,k)||S.chartSet||S.scn||S.mode!=='normal')return;S.charter=k;S.chartSet=true;toast(tr('specialist.charter_signed_name',{name:tr(CHARTERS[k].n)}),'good');after();},
|
||||
charter:({k})=>{if(!own(CHARTERS,k)||S.chartSet||S.scn||S.mode!=='normal')return;S.charter=k;S.chartSet=true;if($('modal').className==='charter')closeModal();
|
||||
toast(tr('specialist.charter_signed_name',{name:tr(CHARTERS[k].n)}),'good');if(UI.tutLater){UI.tutLater=false;tutorialStart();}after();},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Object.assign(ACT,{
|
|||
dfMode:({m})=>{UI.lmode=m;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);},
|
||||
seaPackage:({k})=>{const p=UI.pending;if(!own(SUB_UPGRADES,k)||!p)return;const km=seaQuote(p.a,p.b,own(SEA_DESIGNS,UI.seaDesign)?UI.seaDesign:'standard').km,up=seaUps(km);
|
||||
if(!up[k]&&!subHelps(km,k,up[subOther(k)]))return;UI.seaterminal=up.terminal;UI.seaengineering=up.engineering;UI['sea'+k]=!up[k];openLinkModal(p.a,p.b);},
|
||||
subUpgrade:({id,k})=>{const l=S.links.find(l=>l.id===id);if(!l||l.kind!=='df'||!l.own||!l.sub||l.seat||!own(SUB_UPGRADES,k)||lvl()<4||l['sub'+k]!==undefined||!subHelps(l.km,k,l['sub'+subOther(k)]!==undefined))return;if(!spend(subUpgradeCost(l,k)))return;l.paid=(l.paid>0?l.paid:ownCabCost(l.km))+subUpgradeCost(l,k);l['sub'+k]=Math.max(S.day,l.ready||0)+leadDays(SUB_UPGRADES[k].days);after();},
|
||||
subUpgrade:({id,k})=>{const l=S.links.find(l=>l.id===id);if(!l||l.kind!=='df'||!l.own||!l.sub||l.seat||!own(SUB_UPGRADES,k)||glassLvl()<4||l['sub'+k]!==undefined||!subHelps(l.km,k,l['sub'+subOther(k)]!==undefined))return;if(!spend(subUpgradeCost(l,k)))return;l.paid=(l.paid>0?l.paid:ownCabCost(l.km))+subUpgradeCost(l,k);l['sub'+k]=Math.max(S.day,l.ready||0)+leadDays(SUB_UPGRADES[k].days);after();},
|
||||
seaDesign:({v})=>{if(!own(SEA_DESIGNS,v))return;UI.seaDesign=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);},
|
||||
ownCab:()=>{UI.lmode='df';UI.dfSrc='cable';UI.seaDesign='standard';UI.seaterminal=UI.seaengineering=false;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);},
|
||||
|
|
@ -15,7 +15,7 @@ Object.assign(ACT,{
|
|||
S.stats.ownCab=(S.stats.ownCab||0)+1;UI.dfSrc='lease';closeModal();UI.sel={type:'link',id};
|
||||
toast(tr('fiber_and_hardware.the_ship_sets_sail_name_your',{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||noTalk(p.a,p.b))return;const {a,b}=p;if(!dfAllowed(a,b)||!linkFromOk(a)||!linkToOk(b))return;const sc=isSub(a,b)?subDfCable(a,b):null,km=sc?sc.km:kmBetween(a,b);
|
||||
const own=UI.dfSrc==='build'&&!sc,sys=DF_SYS[UI.dfSys]&&techOk('sys',UI.dfSys,DF_SYS[UI.dfSys].lvl)?UI.dfSys:'lite';if(lvl()<2)return;
|
||||
const own=UI.dfSrc==='build'&&!sc,sys=DF_SYS[UI.dfSys]&&techOk('sys',UI.dfSys,DF_SYS[UI.dfSys].lvl)?UI.dfSys:'lite';if(glassLvl()<2)return;
|
||||
const up=(own?digCost(km):0)+sysCost(sys)+ampCount(km)*AMP_COST+(S.pops[b]?0:popCost(b));if(!spend(up))return;
|
||||
if(!S.pops[b]){S.pops[b]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false,rgen:0};popStdApply(b);}
|
||||
const sib=pairLinks(a,b).filter(l=>l.kind!=='vxc'),id=uid();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ function morphKids(a,b){let x=a.firstChild,y=b.firstChild;
|
|||
else if(x.nodeValue!==y.nodeValue)x.nodeValue=y.nodeValue;
|
||||
x=x&&x.nextSibling;y=ny;}
|
||||
while(x){const nx=x.nextSibling;a.removeChild(x);x=nx;}}
|
||||
function renderAll(){if(isTablet()&&!UI.sel)UI.leftOpen=false;renderHUD();renderLeft();renderPanel();renderHint();renderMega();renderCoach();pzRender();routingRefresh();}
|
||||
function renderAll(){if(isTablet()&&!UI.sel)UI.leftOpen=false;renderHUD();renderLeft();renderPanel();renderHint();renderMega();renderCoach();pzRender();routingRefresh();if(S)charterAsk();}
|
||||
function renderMega(){const el=$('mega');if(!el)return;const on=!!(S&&S.ev&&S.ev.php>S.day);if(el.hidden===!on)return;el.hidden=!on;}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
const isPhone=()=>innerWidth<=760||(innerHeight<=500&&matchMedia('(pointer:coarse)').matches);
|
||||
const SPEEDS=[0.5,1,2,4,8];
|
||||
function renderTabbar(){const tb=$('tabbar');if(!tb||(pressing&&UI.ticking))return;if(!isPhone()||!S||!UI.started||pzOn()){tb.hidden=true;document.body.classList.toggle('sheet-open',pzOn()&&isPhone()&&!!UI.sel);return;}tb.hidden=false;
|
||||
const open=UI.leftOpen&&!UI.sel,cur=UI.left||'goals',ndone=GOALS.filter(g=>S.done[g.id]!==undefined).length;
|
||||
const open=UI.leftOpen&&!UI.sel,cur=UI.left||'goals',G=goals(),ndone=G.filter(g=>S.done[g.id]!==undefined).length;
|
||||
const tab=(k,ic,l,cnt,red)=>`<button class="${open&&cur===k?'on':''}" data-act="phoneTab" data-args='{"t":"${k}"}' aria-label="${esc(l)}"><span class="ic" aria-hidden="true">${ic}</span>${esc(l)}${cnt?(cnt===' '?`<span class="cnt red dot"></span>`:`<span class="cnt${red?' red':''}">${cnt}</span>`):''}</button>`;
|
||||
// A locked clock's two buttons come from whatever locked it (HOOKS.tabbar), in the same two slots, so the tabs stay put.
|
||||
const h=(rule('clock')?UI.clockLocked&&HOOKS.tabbar?HOOKS.tabbar():`<button class="play${UI.speed?'':' paused'}" data-act="phonePlay" aria-label="${UI.speed?tr('common.pause'):tr('common.play')}"><span class="ic" aria-hidden="true">${UI.speed?'❚❚':'▶'}</span>${UI.speed?tr('common.pause'):tr('common.play')}</button>`+
|
||||
`<button data-act="phoneSpeed" aria-label="${tr('common.game_speed')}"><span class="ic" aria-hidden="true">${UI.speed===0.5?'½':(UI.lastSpeed||UI.speed||1)}×</span>${tr('common.speed')}</button>`:'')+
|
||||
(()=>{const P=scnProg();return tab('goals','🎯',tr('common.goals'),P&&!S.scn.done&&!S.scn.failed?`${Math.round(P.f*100)}%`:`${ndone}/${GOALS.length}`);})()+(()=>{const u=custStats().unhappy;return u?tab('deals','💼',tr('common.deals'),u,true):tab('deals','💼',tr('common.deals'),S.offers.length||'');})()+tab('noc','🚨','NOC',S.inc.length?' ':'',true)+tab('nets','🌐',tr('common.networks'),'');
|
||||
(()=>{const P=scnProg();return tab('goals','🎯',tr('common.goals'),P&&!S.scn.done&&!S.scn.failed?`${Math.round(P.f*100)}%`:`${ndone}/${G.length}`);})()+(()=>{const u=custStats().unhappy;return u?tab('deals','💼',tr('common.deals'),u,true):tab('deals','💼',tr('common.deals'),S.offers.length||'');})()+tab('noc','🚨','NOC',S.inc.length?' ':'',true)+tab('nets','🌐',tr('common.networks'),'');
|
||||
if(h!==UI._tb){UI._tb=h;tb.innerHTML=h;}
|
||||
document.body.classList.toggle('sheet-open',!!(UI.sel||UI.leftOpen));}
|
||||
function haptic(ms){if(UI.muted)return;try{navigator.vibrate&&navigator.vibrate(ms||12);}catch(e){}}
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ function renderLeft(){checkLayer();
|
|||
const tab=isTablet(),L=$('left');L.classList.toggle('closed',tab?(!!UI.sel&&!UI.leftOpen):!UI.leftOpen);const tg=$('leftToggle');if(tg&&innerWidth>760)tg.hidden=!(tab&&L.classList.contains('closed'));
|
||||
renderTabbar();
|
||||
if(!S||pzOn()){L.hidden=true;return;}L.hidden=false;
|
||||
const ndone=GOALS.filter(g=>S.done[g.id]!==undefined).length;
|
||||
const tabs=[['goals',`<span class="tl">${tr('common.goals')}</span><span class="cnt">${ndone}/${GOALS.length}</span>`],['deals',`<span class="tl">${tr('common.deals')}</span>${S.offers.length+clHags()?`<span class="cnt">${S.offers.length+clHags()}</span>`:''}`],['noc',`<span class="tl">NOC</span>${S.inc.length?`<span class="cnt red dot" aria-hidden="true"></span>`:''}`],['nets',`<span class="tl">${tr('common.networks')}</span>`]];
|
||||
const G=goals(),ndone=G.filter(g=>S.done[g.id]!==undefined).length;
|
||||
const tabs=[['goals',`<span class="tl">${tr('common.goals')}</span><span class="cnt">${ndone}/${G.length}</span>`],['deals',`<span class="tl">${tr('common.deals')}</span>${S.offers.length+clHags()?`<span class="cnt">${S.offers.length+clHags()}</span>`:''}`],['noc',`<span class="tl">NOC</span>${S.inc.length?`<span class="cnt red dot" aria-hidden="true"></span>`:''}`],['nets',`<span class="tl">${tr('common.networks')}</span>`]];
|
||||
$('leftTabs').innerHTML=tabs.map(([k,l])=>`<button class="${UI.left===k?'on':''}" data-act="leftTab" data-args='{"t":"${k}"}'>${l}</button>`).join('')+(innerWidth<760?`<button data-act="toggleLeft" style="margin-left:auto" aria-label="${tr('common.close')}">×</button>`:'');
|
||||
let h='';
|
||||
if(UI.left==='goals'){
|
||||
h+=charterCard()+scnCard()+lvlCard()+t1Card();
|
||||
const cur=GOALS.find(g=>S.done[g.id]===undefined);
|
||||
h+=GOALS.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `<div class="goal ${d?'done':''} ${c?'cur':''}"><div class="ck">${d?'✓':''}</div><div><div class="gt">${esc(g.t)}</div>${c||!d?`<div class="gd">${esc(g.d)}</div>`:''}${!d&&g.r?`<div class="gr">${tr('hud_and_panels.reward_cash',{cash:fmt$(g.r)})}</div>`:''}</div></div>`;}).join('');
|
||||
const cur=G.find(g=>S.done[g.id]===undefined);
|
||||
h+=G.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `<div class="goal ${d?'done':''} ${c?'cur':''}"><div class="ck">${d?'✓':''}</div><div><div class="gt">${esc(g.t)}</div>${c||!d?`<div class="gd">${esc(g.d)}</div>`:''}${!d&&g.r?`<div class="gr">${tr('hud_and_panels.reward_cash',{cash:fmt$(g.r)})}</div>`:''}</div></div>`;}).join('');
|
||||
h+=badgeGrid();
|
||||
}else if(UI.left==='deals'){
|
||||
{const st=custStats();if(st.n)h+=`<div class="row" style="margin-bottom:8px"><div class="grow"><div class="nm">${tr('common.your_customers')} <span class="meta">${st.n} · ${tr('hud_and_panels.happiness_p',{p:Math.round(st.avg)})}</span></div><div class="bar ${moodCls(st.avg)}"><i style="width:${st.avg}%"></i></div>${st.unhappy?`<div class="why">${trn('hud_and_panels.n_unhappy_customer_price_mo_at',st.unhappy,{price:fmt$(st.risk)})}</div>`:''}</div>${btn(st.unhappy?tr('common.see_who'):tr('common.all_customers'),'custOpen',{sad:st.unhappy?1:0},st.unhappy?'pink sm':'ghost sm')}</div>`;}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ function dfPanel(l){
|
|||
const md=optMode(k,l),cc=chCost(l,k),sp=spareN(k);
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${O.n} <span class="meta">${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}</span></div><div class="meta">${esc(O.blurb)}${n?` · <b>${tr('link_panels.n_lit',{n})}</b>`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}${(np=>np>1?` · ${trn('link_panels.takes_n_router_ports_per_end',np)}`:'')(Math.max(chPorts(k,l.a),chPorts(k,l.b)))}</div>${md&&!md.full?`<div class="meta">⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${(!l.sub||l.seat)&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}</div>`:''}${why?`<div class="why">${esc(why)}</div>`:''}${!techOk('opt',k,O.lvl)&&demoCan(O.lvl)?`<div class="btns">${demoBtn('opt',k,O.lvl,'','ghost sm')}</div>`:''}${opticCountControl(l,k,n)}</div>${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ <small>${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}</small>`:`+ <small>${fmt$(cc)}</small>`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash<cc)}</div>`;}
|
||||
{const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`<p class="note">${tr('link_panels.unplugged_optics_go_on_the_spares')}</p>`;
|
||||
{const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=lvl());if(used.length)h+=`<div class="btns">${used.map(k=>btn(tr('link_panels.stock_a_spare_optic_price',{optic:OPT[k].n,price:fmt$(optCost(k))}),'buySpare',{o:k},'ghost sm',S.cash<optCost(k)||spareN(k)>=64)).join('')}</div><p class="meta">${tr('link_panels.spares_bought_now_are_already_paid')}</p>`;}if(st.length)h+=`<h4 class="sub4">${tr('common.spares_shelf')}</h4>`+st.map(k=>`<div class="row"><div class="grow"><div class="nm">${spareN(k)} × ${OPT[k].n}</div></div>${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}</div>`).join('');}
|
||||
{const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=glassLvl());if(used.length)h+=`<div class="btns">${used.map(k=>btn(tr('link_panels.stock_a_spare_optic_price',{optic:OPT[k].n,price:fmt$(optCost(k))}),'buySpare',{o:k},'ghost sm',S.cash<optCost(k)||spareN(k)>=64)).join('')}</div><p class="meta">${tr('link_panels.spares_bought_now_are_already_paid')}</p>`;}if(st.length)h+=`<h4 class="sub4">${tr('common.spares_shelf')}</h4>`+st.map(k=>`<div class="row"><div class="grow"><div class="nm">${spareN(k)} × ${OPT[k].n}</div></div>${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}</div>`).join('');}
|
||||
const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH);
|
||||
h+=`</section><section><h3>${tr('common.line_system')}</h3><div class="kv"><span>${esc(sysD.n)}</span><b>${tr('link_panels.n_amplifiers',{n:amps})}</b></div>
|
||||
<div class="kv"><span>${tr('common.regen_sites')}</span><b>${rg?tr('link_panels.n_optical_spans_of_km_km',{n:rg,km:spanKm(l).toLocaleString()}):tr('common.none')}</b></div><p class="note">${tr('link_panels.a_regen_site_turns_the_light',{price:fmt$(REGEN_MO)})}</p>${l.seat?`<p class="note">${tr('broker.seat_regen_note')}</p>`:''}${l.sub&&l.own&&!l.seat?`<p class="note">${tr('link_panels.no_regen_sites_in_the_middle')}</p>`:`<div class="btns">${rg<REGEN_MAX?btn(tr('link_panels.regen_site_price',{price:fmt$(rgAdd)}),'regen',{id:l.id,d:1},'sm',S.cash<rgAdd):''}${rg?btn(tr('common.regen_site'),'regen',{id:l.id,d:-1},'ghost sm'):''}</div>`}<p class="note">${esc(sysD.blurb)}</p><div class="btns">${(()=>{const t=sysNext(l);if(!t)return '';const T=DF_SYS[t],c=sysUpCost(l);return !techOk('sys',t,T.lvl)?demoBtn('sys',t,T.lvl,tr('link_panels.sys_level_n',{sys:T.n,n:T.lvl}),'sm'):btn(tr('link_panels.upgrade_to_sys_price',{sys:T.n,price:fmt$(c)}),'upSys',{id:l.id},'sm',S.cash<c);})()}${pairBtn(l)}${btn(l.spares?tr('link_panels.spares_kit_on'):tr('link_panels.keep_a_spares_kit_price_mo',{price:fmt$(Math.round(150+(l.ch||[]).length*80))}),'spares',{id:l.id},l.spares?'green sm':'sm')}</div><p class="note">${tr('link_panels.spare_optics_and_amplifier_cards_on')}</p></section>`;
|
||||
|
|
|
|||
|
|
@ -28,4 +28,4 @@ function lvlItems(){const lv=S.lvl||1,pk=S.stats.peak||0,pops=Object.keys(S.pops
|
|||
// Lost Tier 1 status explains itself where you look for it, not only in a toast you may have missed (#73).
|
||||
const t1Note=()=>S.won&&!isTier1()?`<p class="why">${tr('progress.not_tier_1_right_now_why',{why:esc(t1Why())})}</p>`:'';
|
||||
function lvlCard(){const lv=S.lvl||1,nx=LEVELS[lv];
|
||||
return `<div class="pcard lv"><div class="eyebrow">${tr('progress.customer_level_lv_of_max',{lv,max:LEVELS.length})}</div><div class="pt">${esc(LEVELS[lv-1].n)}</div><div class="meta"><i>${esc(LEVELS[lv-1].q)}</i></div>${t1Note()}${nx?`<div class="meta">${tr('progress.next_name_unlocks_what',{name:esc(nx.n),what:esc(lc1(nx.unlock))})}</div>${lvlItems().map(pRow).join('')}`:`<div class="meta">${tr('common.every_customer_type_is_unlocked_go')}</div>`}</div>`;}
|
||||
return `<div class="pcard lv"><div class="eyebrow">${tr('progress.customer_level_lv_of_max',{lv,max:LEVELS.length})}</div><div class="pt">${esc(LEVELS[lv-1].n)}</div><div class="meta"><i>${esc(LEVELS[lv-1].q)}</i></div>${t1Note()}${nx?`<div class="meta">${tr('progress.next_name_unlocks_what',{name:esc(nx.n),what:esc(lc1(nx.unlock))})}</div>${broker()?`<div class="meta">🚢 ${tr('broker.your_glass_gear_is_already_yours')}</div>`:''}${lvlItems().map(pRow).join('')}`:`<div class="meta">${tr('common.every_customer_type_is_unlocked_go')}</div>`}</div>`;}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/* Leased lines you could swap for your own glass: waves, fabric circuits and IRUs between two of your POPs,
|
||||
priced against digging (land) or laying a cable (subsea), with enough optics to match what you lease today. */
|
||||
function swapOptics(km,cap,sub,sys){for(let r=0;r<=(sub?0:REGEN_MAX);r++){const l={km,regen:r,sub};let b=null;
|
||||
for(const o in OPT){if(OPT[o].lvl>lvl()||sys==='lite'&&OPT[o].sys==='roadm')continue;const g=optG(o,l),c=optCost(o);if(g&&(!b||c/g<b.c/b.g))b={g,c};}
|
||||
for(const o in OPT){if(OPT[o].lvl>glassLvl()||sys==='lite'&&OPT[o].sys==='roadm')continue;const g=optG(o,l),c=optCost(o);if(g&&(!b||c/g<b.c/b.g))b={g,c};}
|
||||
if(b){const n=Math.ceil(cap/b.g);return {n,r,up:Math.round(n*b.c*(1+REGEN_CH*r))+r*REGEN_COST,mo:r*REGEN_MO};}}return null;}
|
||||
const leaseCap=ls=>ls.reduce((s,l)=>s+(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?(l.ch||[]).reduce((t,o)=>t+optG(o,l),0):LT[l.tier].g),0);
|
||||
const swapOpt=(k,up,omo,days,mo)=>{const save=mo-omo;return {k,up,omo,days,save,pay:save>0?Math.ceil(up/save):0};};
|
||||
// Lighting leased capacity on a fiber you already have (#72 review): needs free channels, and optics cost money.
|
||||
function litOn(L,cap){const free=chMax(L)-(L.ch||[]).length-soldSlots(L);let b=null;
|
||||
for(const o in OPT){const O=OPT[o];if(O.lvl>lvl()||(O.sys==='roadm'&&!isRdm(L.sys))||[L.a,L.b].some(c=>S.pops[c]&&RG[S.pops[c].rgen||0].cls<O.rg))continue;const g=optG(o,L),c=chCost(L,o);if(g&&(!b||c/g<b.c/b.g))b={o,g,c};}
|
||||
for(const o in OPT){const O=OPT[o];if(O.lvl>glassLvl()||(O.sys==='roadm'&&!isRdm(L.sys))||[L.a,L.b].some(c=>S.pops[c]&&RG[S.pops[c].rgen||0].cls<O.rg))continue;const g=optG(o,L),c=chCost(L,o);if(g&&(!b||c/g<b.c/b.g))b={o,g,c};}
|
||||
if(!b)return {free,n:0,fits:false};const n=Math.ceil(cap/b.g);return {free,n,up:n*b.c,fits:n<=free};}
|
||||
function leaseSwaps(){const by={};
|
||||
for(const l of S.links){if(l.kind==='df'&&l.own||!S.pops[l.a]||!S.pops[l.b])continue;const k=[l.a,l.b].sort().join('|');(by[k]=by[k]||[]).push(l);}
|
||||
|
|
@ -16,11 +16,11 @@ function leaseSwaps(){const by={};
|
|||
// Waves and fabric circuits can also move onto a leased fiber pair: cheaper glass, but you buy the gear.
|
||||
const ws=ls.filter(l=>l.kind!=='df'),wmo=ws.reduce((s,l)=>s+(l.mo||0),0),sc=sub?subDfCable(a,b):null;x.iru=ls.find(l=>l.kind==='df');
|
||||
if(ws.length&&x.iru){x.fit=litOn(x.iru,leaseCap(ws));if(x.fit.fits)x.lit=wmo;}
|
||||
else if(ws.length&&lvl()>=2&&(sub?sc:dfAllowed(a,b))){const km=sc?sc.km:kmBetween(a,b),sys=lvl()>=3?'roadm':'lite',wc=leaseCap(ws),op=swapOptics(km,wc,sub,sys);
|
||||
else if(ws.length&&glassLvl()>=2&&(sub?sc:dfAllowed(a,b))){const km=sc?sc.km:kmBetween(a,b),sys=glassLvl()>=3?'roadm':'lite',wc=leaseCap(ws),op=swapOptics(km,wc,sub,sys);
|
||||
if(op&&op.n<=DF_SYS[sys].max)x.opts.push(swapOpt('iru',DF_SYS[sys].cost+ampCount(km)*AMP_COST+op.up,dfLeaseMo(km)+ampCount(km)*AMP_MO+op.mo,leadDays(IRU_DAYS),wmo));}
|
||||
// Dig on land, lay a cable between landing stations (even ones that share a landmass), or both.
|
||||
const whys=[];for(const cab of [false,true]){if(cab?!seaCab(a,b):sub)continue;
|
||||
const why=cab?ownCabWhy(a,b):!dfAllowed(a,b)?tr('lease_swaps.nobody_lets_you_dig_on_this'):lvl()<2?tr('lease_swaps.digging_your_own_fiber_unlocks_at'):'';
|
||||
const why=cab?ownCabWhy(a,b):!dfAllowed(a,b)?tr('lease_swaps.nobody_lets_you_dig_on_this'):glassLvl()<2?tr('lease_swaps.digging_your_own_fiber_unlocks_at'):'';
|
||||
if(why){whys.push(why);continue;}const km=cab?ownCabKm(a,b):kmBetween(a,b),op=swapOptics(km,cap,cab,'roadm');
|
||||
if(!op){whys.push(tr('lease_swaps.no_optic_you_can_buy_reaches',{km:km.toLocaleString()}));continue;}
|
||||
x.opts.push(swapOpt(cab?'cab':'own',(cab?ownCabCost(km):digCost(km)+DF_SYS.roadm.cost+ampCount(km)*AMP_COST)+op.up,(cab?ownCabMo(km):Math.round(km*0.15)+ampCount(km)*AMP_MO)+op.mo,cab?ownCabDays(km):dfBuildDays(km),mo));}
|
||||
|
|
|
|||
|
|
@ -196,16 +196,18 @@ const seaCab=(a,b)=>isSub(a,b)||(landing(a)&&landing(b)&&cablesFor(a,b).length>0
|
|||
const cabBack=l=>{if(!l||l.kind!=='df'||!l.own||!l.sub)return 0;const c=l.paid>0?l.paid:ownCabCost(l.km);if(!subNeed(l.km))return c;
|
||||
if(l.ready>S.day){const tot=Math.max(1,l.ready-(l.day||0));return Math.round(c*0.75*Math.min(1,(l.ready-S.day)/tot));}return 0;};
|
||||
// Your own subsea cable is a Tier 1 privilege, or a sandbox toy (open gates).
|
||||
const cabOpen=()=>!!S.won||gatesOpen();
|
||||
// Your own subsea cable: after the Tier 1 win, from customer level CAB_LV (a big Tier 2 lays cables too, #300), or from
|
||||
// day one as a Cable broker.
|
||||
const CAB_LV=9,cabOpen=()=>!!S.won||gatesOpen()||broker()||lvl()>=CAB_LV;
|
||||
function ownCabWhy(a,b){if(!seaCab(a,b))return tr('own_cable.this_route_is_on_land_build');
|
||||
if(!cabOpen())return tr('own_cable.laying_your_own_subsea_cable_is');
|
||||
if(!cabOpen())return tr('own_cable.your_own_subsea_cable_needs_level',{n:CAB_LV});
|
||||
for(const c of [a,b])if(!landing(c))return tr('own_cable.city_has_no_cable_landing_station',{city:CITY[c].name});
|
||||
if(cnCity(a)||cnCity(b))return tr('own_cable.nobody_gives_a_foreign_network_a');
|
||||
if(!seaReady(a,b))return tr('own_cable.surveying_a_sea_route');
|
||||
const routes=seaRoutes(a,b);if(!routes.length)return tr('own_cable.no_navigable_sea_route_connects');
|
||||
const km=Math.min(...routes.map(r=>r.km));if(!subNeed(km))return tr('own_cable.km_km_is_more_than_any',{km:km.toLocaleString(),max:Math.round(SUB_MAXKM()).toLocaleString()});
|
||||
return '';}
|
||||
function ownCabTeaser(a,b){const why=ownCabWhy(a,b);return `<div class="btns" style="margin-top:8px">${btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},cabOpen()&&!why?'pink':'ghost',!!why)}</div>${why&&cabOpen()?`<p class="note" ${seaSurveyAttr(a,b)}>${esc(why)}</p>`:''}`;}
|
||||
function ownCabTeaser(a,b){const why=ownCabWhy(a,b);return `<div class="btns" style="margin-top:8px">${btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_level_n',{n:CAB_LV}),'ownCab',{},cabOpen()&&!why?'pink':'ghost',!!why)}</div>${why&&cabOpen()?`<p class="note" ${seaSurveyAttr(a,b)}>${esc(why)}</p>`:''}`;}
|
||||
function ownCabBody(a,b,pop){const why=ownCabWhy(a,b);if(why)return `<p class="lead" style="margin-top:10px" ${seaSurveyAttr(a,b)}>${esc(why)}</p>${btn(tr('common.back'),'dfSrc',{v:'lease'},'ghost sm')}`;
|
||||
const design=own(SEA_DESIGNS,UI.seaDesign)?UI.seaDesign:'standard',upgrades=seaUps(seaQuote(a,b,design).km),q=seaQuote(a,b,design,upgrades),{km,cost,days}=q,lack=seaLack(km,upgrades),mo=ownCabMo(km),wt=subMaxTier(km),w=Math.round(waveMo(km,true,wt)*waveMarket(a,b,true).m),save=10*w*LT[4].g/LT[wt].g-mo,pay=save>0?Math.ceil(cost/save):0;
|
||||
return `<p class="lead" style="margin-top:8px">${tr('own_cable.your_very_own_subsea_cable_a')}</p>
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ function dfModalBody(a,b,km,pop){
|
|||
if(uaePair(a,b))return `<p class="lead" style="margin-top:10px">${tr('fiber_modals.no_dark_fiber_inside_the_uae')}</p>`+sea;
|
||||
if(landX(a,b)&&cnCity(a)===cnCity(b))return `<p class="lead" style="margin-top:10px">${tr('fiber_modals.nobody_sells_one_fiber_pair_across')}</p>`+sea;
|
||||
if(!dfAllowed(a,b))return `<p class="lead" style="margin-top:10px">${tr('fiber_modals.dark_fiber_across_the_chinese_border')}</p>`+sea;
|
||||
if(lvl()<2)return `<p class="lead" style="margin-top:10px">${tr('fiber_modals.dark_fiber_unlocks_at_customer_level')}</p>`+sea;
|
||||
if(glassLvl()<2)return `<p class="lead" style="margin-top:10px">${tr('fiber_modals.dark_fiber_unlocks_at_customer_level')}</p>`+sea;
|
||||
const src=UI.dfSrc==='build'&&!sc?'build':'lease',sys=DF_SYS[UI.dfSys]&&techOk('sys',UI.dfSys,DF_SYS[UI.dfSys].lvl)?UI.dfSys:'lite',amps=ampCount(km);
|
||||
const up=(src==='build'?digCost(km):0)+sysCost(sys)+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 `<p class="lead" style="margin-top:8px">${tr('fiber_modals.a_fiber_pair_of_your_own',{km:AMP_EVERY})}</p>
|
||||
<h4 class="sub4">${tr('common.the_glass')}</h4><div class="seg">${btn(tr('fiber_modals.lease_an_iru_price_mo_ready_n',{price:fmt$(dfLeaseMo(km)),n:leadDays(IRU_DAYS)}),'dfSrc',{v:'lease'},src==='lease'?'pink':'ghost')}${sc?btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},'ghost',!!ownCabWhy(a,b)):btn(lvl()>=3?tr('fiber_modals.build_your_own_price_n_days',{price:fmt$(dfBuildCost(km)),n:dfBuildDays(km)}):tr('specialist.dig_your_own_as_a_pioneer',{price:fmt$(digCost(km)),n:dfBuildDays(km),p:Math.round((PIONEER-1)*100)}),'dfSrc',{v:'build'},src==='build'?'pink':'ghost')}${sea?btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},'ghost',!!ownCabWhy(a,b)):''}</div>${sc?`<p class="note">${tr('fiber_modals.a_fiber_pair_on_cable_km',{cable:esc(CAB[sc.cid].name),km:sc.km.toLocaleString()})}</p>`:''}
|
||||
<h4 class="sub4">${tr('common.the_glass')}</h4><div class="seg">${btn(tr('fiber_modals.lease_an_iru_price_mo_ready_n',{price:fmt$(dfLeaseMo(km)),n:leadDays(IRU_DAYS)}),'dfSrc',{v:'lease'},src==='lease'?'pink':'ghost')}${sc?btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_level_n',{n:CAB_LV}),'ownCab',{},'ghost',!!ownCabWhy(a,b)):btn(glassLvl()>=3?tr('fiber_modals.build_your_own_price_n_days',{price:fmt$(dfBuildCost(km)),n:dfBuildDays(km)}):tr('specialist.dig_your_own_as_a_pioneer',{price:fmt$(digCost(km)),n:dfBuildDays(km),p:Math.round((PIONEER-1)*100)}),'dfSrc',{v:'build'},src==='build'?'pink':'ghost')}${sea?btn(cabOpen()?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_level_n',{n:CAB_LV}),'ownCab',{},'ghost',!!ownCabWhy(a,b)):''}</div>${sc?`<p class="note">${tr('fiber_modals.a_fiber_pair_on_cable_km',{cable:esc(CAB[sc.cid].name),km:sc.km.toLocaleString()})}</p>`:''}
|
||||
${src==='build'?`<p class="note">${tr('fiber_modals.your_own_trench_almost_no_rent')}</p>`:''}
|
||||
<h4 class="sub4">${tr('common.line_system')}</h4><div class="seg">${Object.keys(DF_SYS).map(k=>btn(`${DF_SYS[k].n} <small>${!techOk('sys',k,DF_SYS[k].lvl)?tr('fiber_modals.level_n',{n:DF_SYS[k].lvl}):fmt$(sysCost(k))}</small>`,'dfSys',{v:k},sys===k?'pink':'ghost',!techOk('sys',k,DF_SYS[k].lvl))).join('')}</div>${Object.keys(DF_SYS).filter(k=>!techOk('sys',k,DF_SYS[k].lvl)&&demoCan(DF_SYS[k].lvl)).map(k=>`<div class="btns">${demoBtn('sys',k,DF_SYS[k].lvl,'','ghost sm')} <small class="meta">${DF_SYS[k].n}</small></div>`).join('')}
|
||||
<p class="note">${esc(DF_SYS[sys].blurb)} ${trn('fiber_modals.plus_n_in_line_amplifier_price',amps,{price:fmt$(AMP_COST),mo:fmt$(AMP_MO)})}</p>${km>reachOn(OPT.tp16.reach,!!sc)?`<p class="note">${tr('fiber_modals.km_km_is_longer_than_any',{km:km.toLocaleString()})}</p>`:''}
|
||||
|
|
|
|||
|
|
@ -42,5 +42,5 @@ cv.addEventListener('pointerup',endPtr);cv.addEventListener('pointercancel',canc
|
|||
const ZMIN=0.35,ZMAX=32;
|
||||
function zoomAt(mx,my,f){const wx=cam.x+(mx-CW/2)/cam.z,wy=cam.y+(my-CH/2)/cam.z;cam.z=clamp(cam.z*f,ZMIN,ZMAX);cam.x=wx-(mx-CW/2)/cam.z;cam.y=wy-(my-CH/2)/cam.z;wrapCam();}
|
||||
cv.addEventListener('wheel',e=>{e.preventDefault();zoomAt(e.clientX,e.clientY,Math.exp(-e.deltaY*0.0015));},{passive:false});
|
||||
addEventListener('keydown',e=>{if(e.key==='Enter'&&e.target.id==='metIn'){ACT.metricSet({id:e.target.dataset.id});return;}if(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]'))return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(e.code==='Space'&&e.target.closest&&e.target.closest('button,a'))return;if(e.code==='Space'&&(!S||rule('clock'))&&!pzOn()&&!UI.clockLocked){e.preventDefault();playPause();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}});
|
||||
addEventListener('keydown',e=>{if(e.key==='Enter'&&e.target.id==='metIn'){ACT.metricSet({id:e.target.dataset.id});return;}if(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]'))return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(e.code==='Space'&&e.target.closest&&e.target.closest('button,a'))return;if(e.code==='Space'&&(!S||rule('clock'))&&!pzOn()&&!UI.clockLocked){e.preventDefault();playPause();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost&&$('modal').className!=='charter')closeModal();}else{UI.sel=null;renderPanel();}}});
|
||||
|
||||
|
|
|
|||
|
|
@ -351,6 +351,26 @@
|
|||
"banks.your_ceo_plays_golf_with_our":"Your CEO plays golf with our CEO every Thursday.",
|
||||
"banks.your_rate_is_set_by_the":"Your rate is set by the stars every month. Mercury is in retrograde a lot.",
|
||||
"banks.your_rising_sign":"Your rising sign",
|
||||
"broker.a_carrier_calls":"<b>{name} wants capacity</b><br>{what} between {a} and {b}. It is in your deals.",
|
||||
"broker.glass_baron":"Glass Baron",
|
||||
"broker.goal_10k":"10,000 km of your own glass",
|
||||
"broker.goal_10k_d":"Fiber you dug and cables you laid, ready and added up end to end.",
|
||||
"broker.goal_10t":"Sell 10 Tbps",
|
||||
"broker.goal_10t_d":"Waves and subsea capacity that carriers pay you for add up to 10 Tbps.",
|
||||
"broker.goal_16t":"1.6T on two hops in a row",
|
||||
"broker.goal_16t_d":"Light two of your own fibers or cables that meet in one city with 1.6T or more each.",
|
||||
"broker.goal_c4":"Cables on four continents",
|
||||
"broker.goal_c4_d":"Your own subsea cables land on four continents.",
|
||||
"broker.goal_deal":"Deliver a capacity deal",
|
||||
"broker.goal_deal_d":"Sign a deal at a capacity conference, or when a carrier calls, and light it before its date.",
|
||||
"broker.goal_df_d":"Lease or dig dark fiber and put an optic on it. As a broker, every line system and optic is open from day one.",
|
||||
"broker.goal_pair":"Lease out a dark fiber pair",
|
||||
"broker.goal_pair_d":"Dig your own fiber, then rent a spare pair to a carrier or a hyperscaler.",
|
||||
"broker.goal_sea":"Lay your own subsea cable",
|
||||
"broker.goal_sea_d":"Pick a sea route in the dark fiber window and send the ship. Every cable you own counts toward Glass Baron.",
|
||||
"broker.goal_wave":"Sell a wave on your glass",
|
||||
"broker.goal_wave_d":"Carriers rent alien waves on fiber you have lit. Accept one from your deals.",
|
||||
"broker.goal_win_d":"Your own cables land on five continents, and carriers pay you $1M a month for capacity.",
|
||||
"broker.how":"it sells as the market wants; the broker keeps 10%",
|
||||
"broker.lead":"The broker keeps your listing and sells it off over time, as carriers between these two cities want capacity. It keeps 10% of each sale.",
|
||||
"broker.list_all":"List all {n}",
|
||||
|
|
@ -364,9 +384,14 @@
|
|||
"broker.n_waves":{"one":"{n} more wave","other":"{n} more waves"},
|
||||
"broker.n_waves_left":{"one":"{n} wave left to sell","other":"{n} waves left to sell"},
|
||||
"broker.no_market":"Nobody wants more capacity between these two cities right now. A listing waits until they do.",
|
||||
"broker.progress":"Your own cables land on {c} of {n} continents · carriers pay you {mo} of {m} a month.",
|
||||
"broker.seat_regen_note":"On a consortium cable, your regen sites sit in the landing stations along the way.",
|
||||
"broker.sold":"<b>Your broker sold capacity.</b><br>{name} rents {what} for {price}/mo.",
|
||||
"broker.unlist":"Take it off the market",
|
||||
"broker.win_as_a_cable_broker":"Win as a Cable broker.",
|
||||
"broker.win_text":"{name} (AS{asn}) laid its own cables onto {n} continents and sells {mo} a month of capacity to other carriers, in {days} days. The oceans are your trench now.",
|
||||
"broker.won_on_date":"Won on {date}: your own cables span the oceans, and carriers pay you to use them.",
|
||||
"broker.your_glass_gear_is_already_yours":"As a Cable broker, every fiber, line system, optic, subsea cable and the routers to light them are yours already, whatever the level says.",
|
||||
"businesses.a_free_pni_with_voda_phony":"A free PNI with Voda-Phony. Gear: Absolute Unit 3.2T routers, 3.2T ports and 12.8T waves.",
|
||||
"businesses.agi_lab_allegedly":"AGI lab (allegedly)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"AGI labs (allegedly) wanting AI WANs of 12.8 to 25.6 Tbps, and free PNIs with Du-opoly and Ooh-redoo. Gear: Mikrowtik CCR 3.2T routers.",
|
||||
|
|
@ -3008,7 +3033,7 @@
|
|||
"modal_and_names.the_real_thing_by_thomas_kj":"The real thing, by Thomas Kjær Aabo: a zoomable, interactive map of how your packets actually travel, from Wi-Fi to undersea fiber, today, in 2010 and in 1995. This game makes it up as it goes. That one gets it right.",
|
||||
"modal_and_names.the_real_thing_follow_a_packet":"The real thing: follow a packet from Wi-Fi to undersea fiber.",
|
||||
"modals.lay_your_own_subsea_cable":"Lay your own subsea cable…",
|
||||
"modals.your_own_subsea_cable_tier_1":"Your own subsea cable <small>Tier 1 only</small>",
|
||||
"modals.your_own_subsea_cable_level_n":"Your own subsea cable <small>level {n} or Tier 1</small>",
|
||||
"networks.a_mobile_network_named_after_the":"A mobile network named after the sound of a toast. Cheers to every 5G tower.",
|
||||
"networks.a_spanish_carrier_starring_in_every":"A Spanish carrier starring in every Latin American market, at least until it sells the next one.",
|
||||
"networks.a_tiny_telco_in_a_country":"A tiny telco in a country where the world’s cables come ashore. Prices to match.",
|
||||
|
|
@ -3298,7 +3323,6 @@
|
|||
"own_cable.km_km_is_too_far_for":"{km} km is too far for your optics on their own. Add {what} to light this cable.",
|
||||
"own_cable.km_km_of_seabed":"{km} km of seabed",
|
||||
"own_cable.lay_the_cable_price":"Lay the cable <small>{price}</small>",
|
||||
"own_cable.laying_your_own_subsea_cable_is":"Laying your own subsea cable is a Tier 1 thing. Go transit-free first.",
|
||||
"own_cable.n_days":"+{n} days",
|
||||
"own_cable.n_in_the_cable_the_first":"{n} in the cable, the first one lit",
|
||||
"own_cable.no_navigable_sea_route_connects":"No navigable sea route connects these landing stations.",
|
||||
|
|
@ -3311,6 +3335,7 @@
|
|||
"own_cable.the_seabed_survey_found_an_old":"The seabed survey found an old sea mine. A small, very careful detour.",
|
||||
"own_cable.this_design_s_route_is_km":"This design’s route is {km} km: too long for any optics, even with both upgrades. A shorter design can make it.",
|
||||
"own_cable.this_route_is_on_land_build":"This route is on land. Build your own fiber instead.",
|
||||
"own_cable.your_own_subsea_cable_needs_level":"Your own subsea cable needs customer level {n}, or Tier 1. A Cable broker lays them from day one.",
|
||||
"own_cable.your_very_own_subsea_cable_a":"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.",
|
||||
"page.a_free_cartoon_browser_game_about":"A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.",
|
||||
"page.breaking_cve_2026_31337_in_php":"🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET",
|
||||
|
|
@ -4156,6 +4181,8 @@
|
|||
"specialist.a_b_km_km_ready_in":"{a} ⇄ {b} · {km} km · about {ms} ms · ready in about {n} days",
|
||||
"specialist.a_consortium_is_selling_seats_on":"A consortium is selling seats on {name}, a new cable from {a} to {b}. Your own fiber pairs on it, before you are Tier 1.",
|
||||
"specialist.ask_for_a_demo_unit_p_n":"Demo unit: +{p}%, {n} days",
|
||||
"specialist.cable_broker":"Cable broker",
|
||||
"specialist.cable_broker_desc":"Lay fiber on land and cables under the sea from day one, light them and sell the capacity to other carriers. Goals of its own; win Glass Baron: your own cables land on {n} continents while carriers pay you {m} a month. Everything else unlocks by level, as always.",
|
||||
"specialist.charter_signed_name":"Charter signed: {name}.",
|
||||
"specialist.consortium_seat":"Consortium seat",
|
||||
"specialist.consortium_seat_name":"Consortium seat: {name}",
|
||||
|
|
@ -4163,12 +4190,9 @@
|
|||
"specialist.dig_your_own_as_a_pioneer":"Dig your own as a pioneer (+{p}%) · {price} · {n} days",
|
||||
"specialist.global_backbone":"Global backbone",
|
||||
"specialist.includes_pops_at_the_landings_price":"Includes POPs at the landings: {price}.",
|
||||
"specialist.keep_it":"Keep it",
|
||||
"specialist.low_latency_boutique":"Low-latency boutique",
|
||||
"specialist.n_fiber_pairs":{"one":"{n} fiber pair","other":"{n} fiber pairs"},
|
||||
"specialist.part_owner_of_the_sea":"Part-owner of the sea",
|
||||
"specialist.pick":"Pick",
|
||||
"specialist.pick_a_charter":"Pick a charter",
|
||||
"specialist.routes_r_of_n_beat_the":"Finance routes faster on your own glass than any leased path: {r}/{n} · paying latency customers: {c}/{m}",
|
||||
"specialist.speed_of_light":"Speed of Light",
|
||||
"specialist.spotted_your_broadband_in_a_one":"They spotted your broadband in {a}, one of the big eyeball cities.",
|
||||
|
|
@ -4180,10 +4204,11 @@
|
|||
"specialist.the_consortium_runs_the_cable_your":"The consortium runs the cable and its repeaters. Your pairs are yours to light with your own optics; a cut on the cable cuts them too.",
|
||||
"specialist.the_vendor_ships_a_demo_name":"The vendor ships a demo {name} in {n} days. Until your level catches up, every unit costs {p}% more.",
|
||||
"specialist.trading_firms_and_other_latency_customers":"Trading firms and other latency customers call more often and pay {p}% more. Win Speed of Light: beat the fastest leased latency on {r} finance routes with your own glass while {c} latency customers pay you. Tier 1 still counts.",
|
||||
"specialist.what_kind_of_network_are_you":"What kind of network are you building? You can pick for {n} more days; until then you are a Global backbone.",
|
||||
"specialist.what_are_you_building":"What are you building?",
|
||||
"specialist.win_as_a_low_latency_boutique":"Win as a low-latency boutique",
|
||||
"specialist.won_on_date_your_own_glass":"Won on {date}: your own glass beat every leased path.",
|
||||
"specialist.you_own_n_fiber_pairs_on":"Signed: you own {n} fiber pairs on {name}, {a} ⇄ {b}. The cable ships sail; it is ready in about {d} days.",
|
||||
"specialist.your_charter_sets_your_goals":"Your charter sets your goals and your win. You pick once, for the life of this network.",
|
||||
"specialist.your_own_fiber_pairs_on_a":"Your own fiber pairs on a new subsea cable: pay your share of the build now, light them with your own optics when it lands.",
|
||||
"specialist.your_own_glass_beats_every_leased":"Your own glass beats every leased path on three finance routes, and the traders pay for it. The boutique has won!",
|
||||
"supply_chain.as_when_you_started":"as when you started",
|
||||
|
|
|
|||
|
|
@ -206,3 +206,13 @@ h2 .rn{font-size:18px;vertical-align:middle;padding:2px 4px}
|
|||
.findrow .nm,.findrow .meta{display:block}
|
||||
.findrow.on{background:var(--soft);border-radius:10px}
|
||||
.findrow:hover{background:var(--soft)}
|
||||
/* The charter picker (36-specialist.js): three big choices, one tap each, nothing else to close it with. */
|
||||
.chpick h2{margin:2px 0 4px}.chpick .tagline{margin:0 0 6px}
|
||||
.chopt{display:flex;align-items:flex-start;gap:12px;width:100%;margin-top:8px;border:3px solid var(--ink);border-radius:14px;padding:10px 12px;background:var(--paper);box-shadow:0 3px 0 var(--ink);font:inherit;color:var(--ink);text-align:left;cursor:pointer}
|
||||
.chopt:hover,.chopt:focus-visible{background:var(--soft)}.chopt:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
|
||||
.chi{font-size:28px;line-height:1.1;flex:none}.cht{display:flex;flex-direction:column;gap:2px;min-width:0}
|
||||
.cht b{font:800 17px/1.2 var(--display)}.cht span{font-size:13px;line-height:1.35;color:var(--ink2)}
|
||||
@media (max-width:760px){.chopt{padding:9px 10px;gap:10px}.chi{font-size:24px}.cht span{font-size:12.5px}}
|
||||
/* A phone on its side: the three side by side, so nothing scrolls. */
|
||||
@media (orientation:landscape) and (max-height:500px){.chpick h2{font-size:21px !important}.chpick .tagline{display:none}
|
||||
.chopts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.chopt{flex-direction:column;gap:2px;margin-top:6px;padding:8px 10px}.chi{font-size:22px}.cht span{font-size:12px;line-height:1.3}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue