Merge remote-tracking branch 'origin/main' into df-pop-checks
# Conflicts: # src/game/90-actions/60-links.js # src/game/90-actions/87-fiber-and-hardware.js # src/game/90-actions/90-action-helpers.js
This commit is contained in:
commit
034a5de66e
19 changed files with 125 additions and 43 deletions
|
|
@ -8,7 +8,7 @@ function pairLinks(a,b){return S.links.filter(l=>(l.a===a&&l.b===b)||(l.a===b&&l
|
|||
function prunePairMet(){const m=S.pairMet;if(!m)return;const k=new Set(S.links.map(edgeKey));for(const x of Object.keys(m))if(!k.has(x))delete m[x];}
|
||||
// Short, busy subsea routes (London–Amsterdam, London–Paris) sell dark fiber pairs too.
|
||||
function subDfCable(a,b){return cablesOk(a,b).filter(c=>CAB[c.cid].df).sort((x,y)=>x.km-y.km)[0]||null;}
|
||||
function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)===cnCity(b)&&!uaePair(a,b)&&!landX(a,b);}
|
||||
function dfAllowed(a,b){if(noTalk(a,b))return false;if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)===cnCity(b)&&!uaePair(a,b)&&!landX(a,b);}
|
||||
// A link starts at one of your POPs. The map only drags one from a POP, but a typed order (the agent API) names both ends.
|
||||
function linkFromWhy(a){return S.pops[a]?'':tr('action_helpers.you_have_no_pop_in_city',{city:CITY[a].name});}
|
||||
function linkFromOk(a){const w=linkFromWhy(a);if(w){toast(w,'bad');sfx('err');}return !w;}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue