Stop loan offers once you have half a billion in the bank

Fixes #52
This commit is contained in:
Frederic Jung 2026-10-25 14:48:49 +01:00
parent bfe12cca7d
commit 856ecfbb37
No known key found for this signature in database
3 changed files with 17 additions and 0 deletions

View file

@ -2219,4 +2219,5 @@
"<b>Fiber pair {n} is lit: {a}–{b}.</b><br>Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.":"<b>Coppia di fibre {n} accesa: {a}–{b}.</b><br>Un altro ROADMaster 9000 e una nuova catena di amplificatori. Spazio per altri {m} canali.",
"{n} fiber pairs lit, the trench is full":"{n} coppie di fibre accese, il cavidotto è pieno",
"Light fiber pair {n} <small>{price} + {mo}/mo</small>":"Accendi la coppia {n} <small>{price} + {mo}/mese</small>",
"<b>The banks have stopped calling.</b><br>You have more money than most of them. Loan offers come back if your cash ever drops below {cash}.":"<b>Le banche hanno smesso di chiamare.</b><br>Hai più soldi della maggior parte di loro. Le offerte di prestito tornano se la tua cassa scende sotto {cash}.",
};

View file

@ -1270,8 +1270,11 @@ function loanTick(d){
// offers: now and then, and much more often when you are in trouble
S.loanOffers=S.loanOffers.filter(o=>o.exp>d);
const broke=S.cash<0;
// With half a billion in the vault, loan offers are just noise (#52): banks stop calling, open offers lapse.
if(S.cash>=RICH_NO_LOANS){if(S.loanOffers.length||!S.richTold){S.loanOffers=[];if(!S.richTold&&S.mode!=='sandbox'){S.richTold=1;toast(tr('<b>The banks have stopped calling.</b><br>You have more money than most of them. Loan offers come back if your cash ever drops below {cash}.',{cash:fmt$(RICH_NO_LOANS)}),'good');}}return;}
if(S.loanOffers.length<4&&(broke?Math.random()<0.25:(d>20&&Math.random()<1/40)))spawnLoanOffer(broke);
}
const RICH_NO_LOANS=5e8;
/* Seeded games (scenarios, weekly challenge) draw every random number from S.rng, so the same seed
gives the same world. Free play keeps using the browser's Math.random. */
const _rand=Math.random;