Add Best Effort, a soft mode, and quiet notifications
A fourth Normal preset, gentler than Change Freeze: calm chaos (so no DDoS and no chaos monkey), quick builds and no market, plus four new rules that only it softens: sea cuts mend on their own clock without cable ships, no conference season, a five-year Ministry of Tubes rescue loan instead of game over, and customers who sour half as fast. The new rules are written into S.rules only when they differ from the classic game, so older networks' rules stay byte for byte what they were. Quiet notifications is a new setting for every mode, on by default in Best Effort: toasts the day itself raises pop up only for trouble and milestones, the rest goes to the NOC log; what a click says still shows. Best Effort badges count as Freeze-dried. The preset picker is four wide, two by two on a phone in portrait.
This commit is contained in:
parent
de4a750cdd
commit
09f205e458
21 changed files with 228 additions and 28 deletions
|
|
@ -78,6 +78,13 @@ function spawnLoanOffer(emergency){
|
|||
S.loanOffers.push(o);
|
||||
toast(tr('banks.bank_would_like_to_lend_you',{bank:esc(B.name),amount:fmt$(amount)})+'<br>'+(emergency?tr('banks.they_heard_you_might_be_in'):tr('banks.terms_apply_several_terms')),emergency?'bad':'goal',[{l:tr('common.open_bank'),act:'bank',args:{}}]);
|
||||
}
|
||||
// Best Effort has no game over: deep in the red, the Ministry of Tubes lends what it takes to be back in the black,
|
||||
// cheap, over five years, no conditions. The repayments are still yours.
|
||||
const RESCUE_APR=0.02,RESCUE_TERM=60;
|
||||
function rescueLoan(){const amount=niceAmt(Math.max(250000,-S.cash+Math.max(150000,(R.costMo||0)*2)));
|
||||
S.cash+=amount;S.stats.rescues=(S.stats.rescues||0)+1;S.neg=0;
|
||||
S.loans.push({id:uid(),bank:'gov',start:S.day,amount,got:amount,bal:amount,apr:RESCUE_APR,apr0:RESCUE_APR,pay:Math.round(annuity(amount,RESCUE_APR,RESCUE_TERM)),left:RESCUE_TERM,term:RESCUE_TERM,share:0,covs:[],base:{sub:S.links.filter(x=>x.sub).length}});
|
||||
track('rescue');toast(`<b>${tr('banks.bank_stepped_in',{bank:esc(BANKS.gov.name)})}</b><br>${tr('banks.a_rescue_loan_of_amount_keeps',{amount:fmt$(amount),pay:fmt$(Math.round(annuity(amount,RESCUE_APR,RESCUE_TERM)))})}`,'bad',[{l:tr('common.open_bank'),act:'bank',args:{}}]);sfx('coin');}
|
||||
function loanTick(d){
|
||||
// conditions: 15-day grace, then a penalty every 30 days while broken
|
||||
for(const l of S.loans){const B=BANKS[l.bank];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ const confSp=cf=>!cf.cap&&[...cf.key].reduce((a,ch)=>(a*31+ch.charCodeAt(0))>>>0
|
|||
const confCost=cf=>cf.cap?CAP_COST:CONF_COST;
|
||||
const confDay=(cf,y)=>dayOf(y+1,cf.m,10);
|
||||
function confKey(cf,y){return cf.n+'@'+cf.c+'@'+y;}
|
||||
function upcomingConfs(within){const y0=cal(S.day).y-1,out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
// No conference season in Best Effort: nothing to register for, nothing in the panel, no invitations.
|
||||
function upcomingConfs(within){if(!confsOn())return [];const y0=cal(S.day).y-1,out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
function confBoost(id){const cb=S.conf;if(!cb||!(cb.until>S.day))return 1;const n=NET[id];return n&&n.pops.some(c=>CITY[c]&&CITY[c].reg===cb.reg)?0.5:1;}
|
||||
function confTick(d){S.confReg=S.confReg||{};
|
||||
for(const cf of upcomingConfs(30)){if(cf.day-d===30&&!S.confReg[cf.key])toast(tr('conferences.conf_comes_to_city_in_30',{conf:esc(cf.n),city:esc(CITY[cf.c].name)}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue