Merge main (city density rule) into the split layout via port-branch
This commit is contained in:
commit
dbbbdaa1e3
16 changed files with 63 additions and 34 deletions
|
|
@ -1,5 +1,5 @@
|
|||
Object.assign(ACT,{
|
||||
buildPop:({city})=>{if(S.pops[city])return;const flipNote=CITY[city]&&CITY[city].au;if(cnCity(city)&&!cnOk()){toast(tr('<b>You need a license first.</b><br>Foreign networks need a joint venture to build in mainland China.'),'bad');sfx('err');return;}if(!spend(popCost(city)))return;S.pops[city]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};floater(CITY[city].x,CITY[city].y-30,tr('New POP!'),'#FF4F9A');if(flipNote)toast(pick([tr('<b>Router installed in {city}.</b><br>Upside down, as is customary down here. The packets don’t seem to mind.',{city:CITY[city].name}),tr('<b>Router installed in {city}.</b><br>The vendor shipped it the right way up, so the local techs turned it over. Everything else here is upside down too.',{city:CITY[city].name})]),'good',[],{a:'city',v:city});UI.tab='cust';after();},
|
||||
buildPop:({city})=>{if(S.pops[city]||!cityOn(city))return;const flipNote=CITY[city]&&CITY[city].au;if(cnCity(city)&&!cnOk()){toast(tr('<b>You need a license first.</b><br>Foreign networks need a joint venture to build in mainland China.'),'bad');sfx('err');return;}if(!spend(popCost(city)))return;S.pops[city]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};floater(CITY[city].x,CITY[city].y-30,tr('New POP!'),'#FF4F9A');if(flipNote)toast(pick([tr('<b>Router installed in {city}.</b><br>Upside down, as is customary down here. The packets don’t seem to mind.',{city:CITY[city].name}),tr('<b>Router installed in {city}.</b><br>The vendor shipped it the right way up, so the local techs turned it over. Everything else here is upside down too.',{city:CITY[city].name})]),'good',[],{a:'city',v:city});UI.tab='cust';after();},
|
||||
launchBB:({city})=>{const p=S.pops[city];if(!p||p.bb)return;const C=CITY[city];if(!spend(bbCost(city)))return;p.bb={d:bbStart(city)};floater(C.x,C.y-30,tr('Eyeballs online!'),'#16A866');after();},
|
||||
ad:({city})=>{const p=S.pops[city];if(!p||!p.bb)return;if(!spend(8000))return;p.boost=S.day+30;floater(CITY[city].x,CITY[city].y-30,tr('Ad campaign!'),'#FF8A3D');after();},
|
||||
buyTransit:({city,net,tier})=>{tier=+tier;if(scnRule('noTransit')){toast(tr('<b>No transit in this scenario.</b><br>Peering, PNIs, caches and your own fiber only.'),'bad');sfx('err');return;}if(!S.pops[city]||!NET[net]||!sellsAt(NET[net],city)||!PORT[tier])return;if(!portOk(city,tier)){toast(tr("<b>Your router can't take a {port} port.</b><br>Upgrade it in the Infra tab.",{port:PORT[tier].n}),'bad');sfx('err');return;}const ex=S.transit.find(t=>t.city===city&&t.net===net);if(ex&&tier<=ex.tier)return;if(!portGate(city,ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier)))return;if(!spend(PORT[tier].setup*(ex&&ex.n||1)))return;if(ex)ex.tier=tier;else S.transit.push({id:uid(),city,net,tier,down:0});toast(tr('<b>{net} transit is live in {city}.</b><br>Full table received: ~1,000,000 routes.',{net:esc(NET[net].name),city:CITY[city].name}),'good');after();},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue