feat(peering): step exchange ports, transit ports and PNIs down one size
Shrinking a port meant leaving and rejoining. The exchange, transit and PNI panels now have a button that steps the port down one size (downIx, downT, downP). A PNI cannot step down while an augment is on order. The actions are classified in the MCP command table. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2366ed260
commit
35854ee253
13 changed files with 100 additions and 3 deletions
9
src/game/90-actions/21-ix-downgrade.js
Normal file
9
src/game/90-actions/21-ix-downgrade.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/* Step a port down one size: exchange ports, transit ports and PNIs. Upgrading was possible, downsizing meant leaving and rejoining. */
|
||||
Object.assign(ACT,{
|
||||
downIx:({city})=>{const had=S.ixp[city];if(had===undefined||S.myIx[city]||!(had>0))return;
|
||||
S.ixp[city]=had-1;toast(tr('ix_downgrade.port_downgraded_at_ix',{port:PORT[had-1].n,ix:esc(ixName(city))}),'good');sfx('click');after();},
|
||||
downT:({id})=>{const t=S.transit.find(x=>x.id===id);if(!t||!(t.tier>0))return;t.tier--;
|
||||
toast(tr('ix_downgrade.transit_downgraded',{net:esc(NET[t.net].name),city:CITY[t.city].name,port:lagName(t.tier,t.n)}),'good');sfx('click');after();},
|
||||
downP:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p||!pniOn(p)||p.up||p.g1||!(p.tier>0))return;p.tier--;
|
||||
toast(tr('ix_downgrade.pni_downgraded',{net:esc(NET[p.net].name),city:CITY[p.city].name,port:pniPN(p)}),'good');sfx('click');after();},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue