The early and mid-game satellite option, before Pie in the Sky. Build a teleport at a POP that a satellite sees, then rent capacity from it to a remote POP: GEO (Intelsplat, Kacophony) needs no capex but costs a lot a month per Gbps, 1-10 Gbps at about 600 ms; MEO (O3bservant) needs tracking antennas at the teleport and gives multi-Gbps at about 130 ms where both ends are under its ring, at least 5 degrees up. Coverage follows each bird's footprint by ocean region. Latency feeds the latency model: users who ride a satellite notice, in proportion to the share. A circuit beside a cable goes on standby, whichever came first, and carries only what the cable cannot: the classic single-cable island backup. Satellites are not subsea links for covenants, scenario goals or subsidies (Pitcairn's UK grant needs a cable). Express fiber and the build standard leave satellite circuits alone.
34 lines
6.8 KiB
JavaScript
34 lines
6.8 KiB
JavaScript
function loanSummary(o){return o.model==='transit'?tr('bank.you_pay_pct_of_your_transit',{pct:pct(o.cut||0.3),price:fmt$(o.owe||o.amount)}):o.model==='balloon'?tr('bank.nothing_to_pay_for_n_months',{n:o.term}):tr('bank.pay_mo_for_n_months',{pay:fmt$(o.pay),n:o.term})+(o.share?' '+tr('bank.plus_pct_of_your_revenue_until',{pct:pct(o.share)}):'');}
|
||
function loanLine(l){const sh=l.share?' · '+tr('bank.plus_pct_of_revenue',{pct:pct(l.share)}):'',fee=loanFees(l)?' · '+tr('bank.price_mo_in_extras',{price:fmt$(loanFees(l))}):'';
|
||
if(l.model==='transit')return tr('bank.pct_of_your_transit_bill_n',{pct:pct(l.cut||0.3),n:l.left})+sh+fee;
|
||
if(l.model==='balloon')return tr('bank.nothing_to_pay_until_the_end',{n:l.left,apr:(l.apr*100).toFixed(1)})+sh+fee;
|
||
return tr('bank.pay_mo_n_months_left_apr',{pay:fmt$(l.pay),n:l.left,apr:(l.apr*100).toFixed(1)})+(l.model==='storm'?' · '+tr('bank.2_per_open_incident'):l.model==='astro'?' · '+tr('bank.rate_set_by_the_stars_each'):'')+sh+fee;}
|
||
function renderBank(){
|
||
if(!S||$('bankBox').hidden)return;const rt=rating(),net=R.revMo-R.costMo;
|
||
const terms=(o)=>{const B=BANKS[o.bank],sh=o.share&&!B.equity?`<span class="tag selective">${tr('bank.plus_pct_of_revenue_until_repaid',{pct:pct(o.share)})}</span>`:'';
|
||
if(o.model==='transit')return `<span class="tag st on">${tr('bank.pct_of_your_transit_bill',{pct:pct(o.cut||0.3)})}</span><span class="tag st">${tr('bank.price_to_repay',{price:fmt$(o.owe||o.amount)})}</span><span class="tag st">${tr('bank.n_months',{n:o.term})}</span><span class="tag selective">${tr('bank.the_rest_is_due_at_the')}</span>${sh}`;
|
||
if(o.model==='balloon')return `<span class="tag st on">${tr('bank.nothing_to_pay_until_the_end_2a38')}</span><span class="tag st">${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}</span><span class="tag st">${tr('bank.n_months',{n:o.term})}</span><span class="tag selective">${tr('bank.then_about_price_at_once',{price:fmt$(o.amount*Math.pow(1+o.apr/12,o.term))})}</span>${sh}`;
|
||
const extra=o.model==='storm'?`<span class="tag selective">${tr('bank.2_per_open_incident')}</span>`:o.model==='astro'?`<span class="tag selective">${tr('bank.rate_set_by_the_stars_each')}</span>`:'';
|
||
return (B.equity?`<span class="tag st on">${tr('common.no_repayments')}</span><span class="tag st">${tr('bank.pct_of_revenue_forever',{pct:pct(o.share)})}</span><span class="tag st">${tr('bank.buy_out_price',{price:fmt$(o.amount*3)})}</span>`:`<span class="tag st on">${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}</span><span class="tag st">${tr('bank.n_months',{n:o.term})}</span><span class="tag st">${tr('common.price_mo',{price:fmt$(o.pay)})}</span>${B.crypto?'<span class="tag selective">'+tr('bank.paid_in_tubecoin')+'</span>':''}`)+extra+sh;};
|
||
const covList=(l)=>l.covs.length?l.covs.map(c=>{const ok=COVS[c].ok(l);return `<div class="meta"><b style="color:${ok?'var(--eye)':'var(--bad)'}">${ok?'✓':'✗'}</b> ${esc(covLabel(c,l))}</div>`;}).join(''):'<div class="meta">'+tr('bank.no_conditions_that_is_the_scary')+'</div>';
|
||
let h=`<div style="display:flex;align-items:center;gap:12px"><div><div class="eyebrow">AS${S.asn} · ${esc(S.name)}</div><h2 style="font-size:28px">${tr('common.bank')}</h2></div><button class="x" data-act="bankClose" aria-label="${tr('common.close')}">×</button></div>
|
||
<div class="dgrid"><div class="tile"><div class="lbl">${tr('common.cash')}</div><div class="val" style="color:${S.cash<0?'var(--bad)':'inherit'}">${fmt$(S.cash)}</div><div class="sub">${S.cash<0?tr('bank.bankrupt_at_100k'):tr('bank.in_the_vault')}</div></div>
|
||
<div class="tile"><div class="lbl">${tr('dashboard.monthly_p_l')}</div><div class="val" style="color:${net>=0?'var(--eye)':'var(--bad)'}">${net>=0?'+':''}${fmt$(net)}</div><div class="sub">${tr('bank.after_loan_payments')}</div></div>
|
||
<div class="tile"><div class="lbl">${tr('common.credit_rating')}</div><div class="val">${rt}</div><div class="sub">${rIdx(rt)>=5?tr('bank.bankers_return_your_calls'):rIdx(rt)>=3?tr('bank.bankers_return_your_emails'):tr('bank.bankers_pretend_to_be_out')}</div></div>
|
||
<div class="tile"><div class="lbl">${tr('common.debt')}</div><div class="val">${fmt$(loanDebt())}</div><div class="sub">${trn('bank.n_loan',S.loans.length)}</div></div></div>`;
|
||
const CT=CALL_TERMS[rt];
|
||
if(S.cash<RICH_NO_LOANS){const lim=CT?callLimit(CT):0;h+=`<h3 style="font-size:18px;margin-top:6px">${tr('bank.call_the_bank')}</h3>`;
|
||
h+=CT?`<div class="meta">${tr('bank.bank_picks_up_apr_apr_over',{bank:esc(BANKS[CT.bank].name),apr:(CT.apr*100).toFixed(1),n:CALL_MONTHS,limit:fmt$(lim)})}</div><div class="btns" style="margin-top:6px">${CALL_AMTS.map(a=>btn(fmt$(a),'callBank',{amount:a},'sm',a>lim)).join('')}</div>`:`<p class="empty">${tr('bank.get_to_an_aa_rating_and')}</p>`;}
|
||
h+=`<h3 style="font-size:18px;margin-top:14px">${tr('common.offers')}</h3>`;
|
||
if(!S.loanOffers.length)h+=`<p class="empty">${tr('bank.no_offers_right_now_banks_get')}</p>`;
|
||
for(const o of S.loanOffers){const B=BANKS[o.bank];h+=`<div class="loan"><span class="logo" style="--c:${B.col}">${initials(B)}</span><div class="grow"><div class="nm">${tr('bank.bank_offers_amount',{bank:esc(B.name),amount:fmt$(o.amount)})}</div><div class="meta">${esc(B.blurb)} · ${tr('bank.offer_ends_in_n_d',{n:o.exp-S.day})}</div><div class="terms">${terms(o)}</div>${covList({covs:o.covs,start:S.day,base:{sub:S.links.filter(seaLink).length}})}<div class="btns" style="margin-top:6px">${btn(tr('bank.take_the_money'),'takeLoan',{id:o.id},'pink')}${btn(tr('common.no_thanks'),'declineLoan',{id:o.id},'ghost sm')}</div></div></div>`;}
|
||
h+=`<h3 style="font-size:18px;margin-top:14px">${tr('common.your_loans')}</h3>`;
|
||
if(!S.loans.length)h+=`<p class="empty">${tr('bank.debt_free_your_accountant_is')}</p>`;
|
||
for(const l of S.loans){const B=BANKS[l.bank];const cost=repayCost(l,B);
|
||
h+=`<div class="loan"><span class="logo" style="--c:${B.col}">${initials(B)}</span><div class="grow"><div class="nm">${esc(B.name)} · ${fmt$(l.amount)}</div>
|
||
${B.equity?`<div class="meta">${tr('bank.taking_pct_of_your_revenue_every',{pct:pct(l.share)})}</div>`:`<div class="kv"><span>${tr('common.still_owed')}</span><b>${fmt$(l.bal)}</b></div><div class="bar me"><i style="width:${Math.min(100,(1-l.bal/l.amount)*100)}%"></i></div><div class="meta">${loanLine(l)}</div>`}
|
||
${covList(l)}${l.breach>=1?`<div class="why">${trn('bank.condition_broken_for_n_day',l.breach)} ${l.breach<10?tr('bank.penalty_in_n_days',{n:10-l.breach}):tr('bank.penalties_are_running')}</div>`:''}
|
||
<div class="btns" style="margin-top:6px">${btn(UI.confirm===l.id?tr('bank.really_pay_price',{price:fmt$(cost)}):B.equity?tr('bank.buy_them_out_price',{price:fmt$(cost)}):tr('bank.repay_early_price_incl_2_fee',{price:fmt$(cost)}),'repayLoan',{id:l.id},UI.confirm===l.id?'red sm':'sm',S.cash<cost)}</div></div></div>`;}
|
||
h+=pieGovBank()+ip4Bank();
|
||
if(h!==UI._bh){UI._bh=h;$('bankCard').innerHTML=h;}
|
||
}
|