Pie in the Sky: the Founder's antics make markets jumpy, then it wears off

- Every 60 to 120 days while a rocket company exists (the first 90 days after the plan starts), the
  Founder does something daft: a post, a gasp toast and a temporary effect (99-pie-jitters.js).
  A once-a-game antic takes orbit billing down for 3 to 5 days (no orbit income, then a restore post);
  a 3 a.m. spree (orbit offers x0.6 and a 4-point orbit mood dip for 14 days); a fight with a regulator
  (a landing-rights spat via pieSpatStart in a country with a dish or rights, within the spat limit);
  a leaked launch date (insurance 8% -> 14% for 30 days); Mars next year (offers x1.5 for 14 days, a
  promise like the others whose slip cancels the unhappiest 2% of orbit customers).
- Market jitters (S.pie.founder.jit, 0..1): each antic bumps it, it fades by 1/30 a day, and while
  high it lowers orbit offer odds (up to -30%) and holds orbit happiness under 100-25*jit (never low
  enough to cancel at renewal). The Company tab shows one line and a small meter next to the feed.
- Rule O5: harm only with pieChaos(); with chaos off he only posts. Dice only with a company.
- Saves: new founder fields in pieBlank, repaired in pieSanitize (pieAnticFix); old saves load calm.
- Insurance button shows the current premium (pie.ins_on_p replaces pie.ins_on). Agent docs updated.
- pie-balance: compute() also reruns when orbit billing goes down or comes back.
- tests/pie-founder.test.js: each antic, decay, once-only billing outage, chaos off, saves, 360 px.
This commit is contained in:
Frederic Jung 2026-11-06 07:51:43 +01:00
parent 9d74873edb
commit 2243280aff
No known key found for this signature in database
17 changed files with 510 additions and 21 deletions

View file

@ -53,7 +53,7 @@ const API_STATE_DOC={
scrubMode:{type:'string',doc:'always | ondemand.'},
cnLic:{type:'map',doc:'Mainland China licence: none | pending (with ready day) | ok.'},
pieV:{type:'number',doc:'Pie in the Sky version stamp: 1 in games started since it shipped (only those unlock it, on a Tier 1 win).'},
pie:{type:'map',doc:'The rocket company (Pie in the Sky), or null: company, factory, stock, pads, crusts (cohorts of pies by launch day), dishes, landing rights (lic), launch queue (q), R&D, spats, founder posts, books, and government money (gov: auctions, awards, Ex-Im).'},
pie:{type:'map',doc:'The rocket company (Pie in the Sky), or null: company, factory, stock, pads, crusts (cohorts of pies by launch day), dishes, landing rights (lic), launch queue (q), R&D, spats, the founder (posts, promises made and broken with their due days, and his antics: jit, the market jitters 0..1 that fade over 30 days and lower orbit offer odds and happiness; next, the day of the next antic; kid, 1 + the index of PIE_KIDS once he has named his son; bill, the day orbit billing comes back (no orbit income until then); nerv, hype, leak: days a posting spree, Mars hype and a leaked launch date (dearer launch insurance) last until; mars, the due day of the Mars promise, whose slip loses a few orbit customers; all only with chaos on), books, and government money (gov: auctions, awards, Ex-Im).'},
ppol:{type:'string',doc:'Your published peering policy: open | selective | closed.'},
pdesk:{type:'map',doc:'This week\'s peering desk summary: sessions accepted and declined at which exchanges.'},
pdeskRep:{type:'map',doc:'Last week\'s peering desk summary, as the NOC log reported it.'},
@ -95,7 +95,7 @@ const API_STATE_DOC={
};
const API_RESULTS_DOC={
pie:{type:'map',doc:'Orbit this compute (only with a rocket company): revenue (rev, including patchy: {mo, cr} from patchy-sky customers who pay from 10% coverage, before a crust carries anything, and fade out between 40% and 60%), service per orbit customer, landing dishes, flows through the sky, backhaul for cut-off POPs (bh), crust and dish load, government money (gov).'},
pie:{type:'map',doc:'Orbit this compute (only with a rocket company): revenue (rev; 0 while the founder has orbit billing down, with billOff what it would have been; including patchy: {mo, cr} from patchy-sky customers who pay from 10% coverage, before a crust carries anything, and fade out between 40% and 60%), service per orbit customer, landing dishes, flows through the sky, backhaul for cut-off POPs (bh), crust and dish load, government money (gov).'},
nt:{type:'map',doc:'Traffic per network through transit, by net id.'},
tNet:{type:'map',doc:'Traffic per network you hand to each upstream, by "net@upstream".'},
reachNT:{type:'number',doc:'Networks reachable without transit.'},

View file

@ -18,7 +18,7 @@
- book.earned: revenue from orbit, for the customers that come with routing. */
function pieBlank(day){const crusts={};for(const id in CRUSTS)crusts[id]={cohorts:[],queued:0};
return {born:day,co:null,fac:false,stock:0,rd:{reuse:false,heavy:false,heavyTests:0},pads:[],crusts,dishes:[],lic:{},q:[],
founder:{posts:[],promises:0,broken:0,due:[]},book:{spent:0,earned:0,wouldHave:0},spat:{},safe:false,gov:pieGovBlank()};}
founder:{posts:[],promises:0,broken:0,due:[],jit:0,next:0,kid:0,bill:0,nerv:0,hype:0,leak:0,mars:0},book:{spent:0,earned:0,wouldHave:0},spat:{},safe:false,gov:pieGovBlank()};}
function pieInit(){if(!S.pie)S.pie=pieBlank(S.day);return S.pie;}
// The unlock: only on the Tier 1 transition of a save of this version, and only in a normal game.
function pieUnlock(){if(S.pie||!(S.pieV>=1)||S.mode!=='normal'||S.scn)return;pieInit();track('pie_unlock');
@ -50,8 +50,8 @@ function pieSpatDay(d){const sp=S.pie.spat;for(const k of Object.keys(sp)){const
const pieYear=d=>1+Math.floor(d/360);
function pieFounder(k,v={}){const F=S.pie.founder,p={d:S.day,k};if(v.n!==undefined)p.n=v.n;if(v.c)p.c=v.c;F.posts.unshift(p);if(F.posts.length>PIE_POSTS)F.posts.length=PIE_POSTS;}
// Every promise slips by a year: made today, due in a year, broken then.
function piePromise(){const F=S.pie.founder;F.promises++;const due=S.day+360;F.due.push(due);if(F.due.length>8)F.due.shift();pieFounder(N_('pie.fp_promise'),{n:pieYear(due)});}
function pieFpText(p){const C=own(CRUSTS,p.c||'')?tr(CRUSTS[p.c].n):'',n=p.n||0;return tr(p.k,{co:pieCoName(),n,crust:C});}
function piePromise(k=N_('pie.fp_promise')){const F=S.pie.founder;F.promises++;const due=S.day+360;F.due.push(due);if(F.due.length>8)F.due.shift();pieFounder(k,{n:pieYear(due)});return due;}
function pieFpText(p){const C=own(CRUSTS,p.c||'')?tr(CRUSTS[p.c].n):'',n=p.n||0,K=pieKid();return tr(p.k,{co:pieCoName(),n,crust:C,kid:K?K.n:'',nick:K?K.k:''});}
// Pads that can reach a crust: an orbit's inclination is at least the pad's latitude.
const piePadOk=(c,cr)=>CRUSTS[cr].polar||Math.abs(CITY[c].lat)<=CRUSTS[cr].inc;
const pieRkOk=rk=>{const R0=ROCKETS[rk];return !R0.rd||!!S.pie.rd[R0.rd];};
@ -68,7 +68,7 @@ function pieQuote(rk,cr,o={}){const P=S.pie;if(!P||!own(ROCKETS,rk)||!own(CRUSTS
if(!test&&pieLive(cr)+P.crusts[cr].queued+n>C.full*PIE_SPARE)return {why:tr('pie.why_full')};
const t0=S.day+leadDays(PIE_PREP),pad=pads.slice().sort((a,b)=>Math.max(t0,a.next)-Math.max(t0,b.next)||Math.abs(CITY[a.city].lat)-Math.abs(CITY[b.city].lat))[0];
const rocket=piePrice(R0.cost)*(1-pieEq(pad.city))*pieCrMul(cr),boost=rk==='again'&&!pad.boosters.length?piePrice(PIE_BOOST):0,pies=n*piePrice(PIE_PIE+(o.las?PIE_LAS:0));
const ins=o.ins&&!test?Math.round((rocket+pies)*PIE_INS):0;
const ins=o.ins&&!test?Math.round((rocket+pies)*PIE_INS*pieInsMul()):0;
return {ok:true,test,n,pad:pad.city,day:Math.max(t0,pad.next),cost:Math.round(rocket+boost+pies+ins),insured:Math.round(rocket+pies),ins:!!ins};}
// The cheapest a crust can be filled from nothing (one-off costs only): rule O7.
function pieFullCost(cr){const C=CRUSTS[cr],base=PIE_CO+PIE_FAC+PIE_PAD,pies=C.full*PIE_PIE;
@ -112,7 +112,7 @@ function pieDay(d){const P=S.pie;if(!P)return;
if(P.q.length){const due=P.q.filter(L=>L.day<=d);if(due.length){P.q=P.q.filter(L=>L.day>d);for(const L of due)pieFly(L);}}
for(const id in CRUSTS){const c=P.crusts[id],life=CRUSTS[id].life;if(c.cohorts.length&&d-c.cohorts[0].day>=life)c.cohorts=c.cohorts.filter(k=>d-k.day<life);
if(!c.bk&&pieBaked(id)){c.bk=1;pieFounder(N_('pie.fp_baked'),{c:id});toast(tr('pie.t_baked_all',{crust:tr(CRUSTS[id].n)}),'goal');piePromise();}}
{const F=P.founder;if(F.due.length&&F.due[0]<=d){F.due.shift();F.broken++;pieFounder(N_('pie.fp_slip'),{n:pieYear(d+360)});}}
{const F=P.founder;if(F.due.length&&F.due[0]<=d){const x=F.due.shift();F.broken++;if(F.mars&&x===F.mars)pieMarsSlip(d);else pieFounder(N_('pie.fp_slip'),{n:pieYear(d+360)});}}
// Running costs are billed with the rest each day (compute()); the book keeps the tally, and the sandbox its shame.
{const mo=pieMo()/30;if(mo){if(pieSand())P.book.wouldHave+=mo;else P.book.spent+=mo;}}
pieSpatDay(d);for(const f of PIE_ON.day)f(d);}
@ -142,7 +142,7 @@ function pieSanitize(s){s.pieV=int(s.pieV,0,1,0);pieEximFix(s);const p=s.pie,ob=
for(const L of o.q)o.crusts[L.cr].queued+=L.n;
if(ob(p.founder)){const F=p.founder;o.founder.promises=n(F.promises,1e6);o.founder.broken=n(F.broken,o.founder.promises);
o.founder.posts=(Array.isArray(F.posts)?F.posts:[]).filter(x=>ob(x)&&FOUNDER_POSTS.includes(x.k)).slice(0,PIE_POSTS).map(x=>{const q={d:int(x.d,0,day,day),k:x.k};if(x.n!==undefined)q.n=n(x.n,1e7);if(own(CRUSTS,x.c||''))q.c=x.c;return q;});
o.founder.due=(Array.isArray(F.due)?F.due:[]).map(v=>int(v,0,day+720,day)).sort((a,b)=>a-b).slice(-8);}
o.founder.due=(Array.isArray(F.due)?F.due:[]).map(v=>int(v,0,day+720,day)).sort((a,b)=>a-b).slice(-8);pieAnticFix(o.founder,F,day);}
if(ob(p.book))for(const k of ['spent','earned','wouldHave'])o.book[k]=m(p.book[k],1e15);
if(ob(p.spat))for(const k of Object.keys(p.spat)){const D=PIE_SPATS[k];if(!D||!ob(p.spat[k]))continue;const v=D.fix?D.fix(p.spat[k],s):null;if(v)o.spat[k]=v;}
o.gov=pieGovFix(p.gov,s);

View file

@ -0,0 +1,68 @@
/* ---------- Pie in the Sky: the Founder's antics and the market's jitters (docs/plans/pie-in-the-sky.md) ----------
Every 60 to 120 days while a rocket company exists, the Founder does something daft: a post, a gasp (a toast) and a
real effect that wears off. Each antic also bumps the market's jitters (S.pie.founder.jit, 0..1), which fade to nothing
over PIE_JIT_DAYS and meanwhile make orbit customers call less and keep the happiest a little less happy (at most
PIE_JIT_CAP under 100, never low enough to cancel over it): Ooooh, Uuuuuh, then it normalises.
Rule O5: the harm needs pieChaos() (chaos on, the 90 quiet days over); without it he still posts and nothing else
happens. Dice are rolled only with a company (pieAnticDay returns first), so every other game plays as before.
State in S.pie.founder (pieBlank, pieSanitize): jit; next, the day of the next antic (0: not planned yet); kid, 1 + an
index of PIE_KIDS (once a game, then a running gag); bill, the day orbit billing is back; nerv, hype, leak: the days
those last until; mars, the due day (in due) of the Mars promise, whose slip costs a few orbit customers. */
const PIE_ANTIC_FIRST=90,PIE_ANTIC_GAP=60,PIE_ANTIC_SPAN=61,PIE_JIT_DAYS=30,PIE_JIT_OFFER=0.3,PIE_JIT_CAP=25,
PIE_KID_DAYS=3,PIE_SPREE_DAYS=14,PIE_NERV=0.6,PIE_SPREE_MOOD=4,PIE_LEAK_DAYS=30,PIE_LEAK_INS=1.75,PIE_HYPE_DAYS=14,PIE_HYPE=1.5,PIE_MARS_CHURN=0.02;
// The kid's name (code, not words: never translated) and what the feed calls him afterwards.
const PIE_KIDS=[{n:"Orbit'); DROP TABLE invoices;--",k:'Orby Tables'},{n:"Perigee'); DELETE FROM billing;--",k:'Perry Tables'},{n:"Max Q'); TRUNCATE customers;--",k:'Maxie Tables'}];
FOUNDER_POSTS.push(N_('pie.fp_backup'),N_('pie.fp_kid'),N_('pie.fp_leak'),N_('pie.fp_leak_kid'),N_('pie.fp_mars'),N_('pie.fp_mars_kid'),N_('pie.fp_mars_slip'),N_('pie.fp_reg'),N_('pie.fp_spree'),N_('pie.fp_spree_kid'));
const pieKid=()=>{const F=S&&S.pie&&S.pie.founder;return F&&F.kid?PIE_KIDS[F.kid-1]:null;};
const pieBump=(F,v)=>{F.jit=Math.min(1,+(F.jit+v).toFixed(4));};
const pieOrbitBiz=()=>S.biz.filter(b=>BIZ_T[b.type].orbit);
// Read by pieMoney() (no orbit income while billing is down), pieQuote() (insurance) and the orbit sales desk (offers).
function pieBillOff(){const P=S&&S.pie;return !!P&&P.founder.bill>S.day&&pieChaos();}
function pieInsMul(){const P=S&&S.pie;return P&&P.founder.leak>S.day&&pieChaos()?PIE_LEAK_INS:1;}
function pieOfferMul(){const P=S.pie;if(!P||!pieChaos())return 1;const F=P.founder;let m=1-PIE_JIT_OFFER*F.jit;if(F.nerv>S.day)m*=PIE_NERV;if(F.hype>S.day)m*=PIE_HYPE;return m;}
// The antics: w their weight, ok(F) whether he can, go(F,harm,d) posts and, with harm, does it and returns the toast's text;
// j: how much it rattles the market.
const PIE_ANTICS={
kid:{w:1.5,j:0.7,ok:F=>!F.kid,go:(F,h,d)=>{F.kid=1+Math.floor(Math.random()*PIE_KIDS.length);pieFounder(N_('pie.fp_kid'));if(!h)return '';
const n=rint(PIE_KID_DAYS,3);F.bill=d+n+1;return tr('pie_ant.kid',{kid:esc(pieKid().n),n});}},
spree:{w:3,j:0.6,ok:()=>true,go:(F,h,d)=>{const n=rint(40,50);pieFounder(F.kid?N_('pie.fp_spree_kid'):N_('pie.fp_spree'),{n});if(!h)return '';
F.nerv=d+PIE_SPREE_DAYS;pieMood(b=>!!BIZ_T[b.type].orbit,-PIE_SPREE_MOOD);return tr('pie_ant.spree',{n,d:PIE_SPREE_DAYS});}},
reg:{w:1,j:0.4,ok:()=>true,go:(F,h)=>{pieFounder(N_('pie.fp_reg'));if(!h)return '';const P=S.pie;
// A country where you have a dish or landing rights, through the spats' own machinery (pieSpatStart).
if(Object.keys(P.spat).length<PIE_SPAT_MAX){const cs=[...new Set([...pieDishCc(),...Object.keys(P.lic).filter(pieLicOk)])].sort(),o=cs.length?Math.floor(Math.random()*cs.length):0;
for(const id of ['lic'])for(let i=0;i<cs.length;i++)if(!P.spat[id]&&pieSpatStart(id,cs[(o+i)%cs.length]))return tr('pie_ant.reg');}
return tr('pie_ant.reg_none');}},
leak:{w:2,j:0.3,ok:()=>true,go:(F,h,d)=>{pieFounder(F.kid?N_('pie.fp_leak_kid'):N_('pie.fp_leak'));if(!h)return '';
F.leak=d+PIE_LEAK_DAYS;return tr('pie_ant.leak',{p:pct(PIE_INS*PIE_LEAK_INS),n:PIE_LEAK_DAYS});}},
mars:{w:2,j:0.3,ok:F=>!F.mars,go:(F,h,d)=>{F.mars=piePromise(F.kid?N_('pie.fp_mars_kid'):N_('pie.fp_mars'));if(!h)return '';
F.hype=d+PIE_HYPE_DAYS;return tr('pie_ant.mars',{n:PIE_HYPE_DAYS});}},
};
const PIE_ANTIC_KEYS=Object.keys(PIE_ANTICS);
// One antic (k forces which, for tests); true when he did something.
function pieAntic(k){const P=S.pie;if(!P||!P.co)return false;const F=P.founder,d=S.day,h=pieChaos();
if(!k){const o=PIE_ANTIC_KEYS.filter(x=>PIE_ANTICS[x].ok(F));let r=Math.random()*o.reduce((a,x)=>a+PIE_ANTICS[x].w,0);k=o[o.length-1];for(const x of o){r-=PIE_ANTICS[x].w;if(r<=0){k=x;break;}}}
const A=PIE_ANTICS[k];if(!A||!A.ok(F))return false;S.stats.pieAnt=(S.stats.pieAnt||0)+1;
const b=A.go(F,h,d);if(!h)return true;
pieBump(F,A.j);toast(`<b>😱 ${tr('pie_ant.gasp')}</b><br>${b}`,'bad');sfx('alert');return true;}
// The Mars promise slipped (pieDay, when its due day comes): the unhappiest few orbit customers had enough.
function pieMarsSlip(d){const F=S.pie.founder;F.mars=0;pieFounder(N_('pie.fp_mars_slip'),{n:pieYear(d+360)});if(!pieChaos())return;pieBump(F,PIE_ANTICS.mars.j);
const bs=pieOrbitBiz().sort((a,b)=>a.mood-b.mood),n=Math.round(bs.length*PIE_MARS_CHURN);
if(n){const go=new Set(bs.slice(0,n));S.biz=S.biz.filter(b=>!go.has(b));S.stats.pieChurn=(S.stats.pieChurn||0)+n;}
toast(`<b>😱 ${tr('pie_ant.gasp')}</b><br>${n?trn('pie_ant.mars_slip',n):tr('pie_ant.mars_slip_none')}`,'bad');}
function pieAnticDay(d){const P=S.pie,F=P.founder;if(!P.co)return;
if(F.bill&&d>=F.bill-1){F.bill=0;pieFounder(N_('pie.fp_backup'));if(pieChaos())toast(tr('pie_ant.backup'),'good');}
if(F.mars&&!F.due.includes(F.mars))F.mars=0;
if(F.jit>0){if(pieChaos()){const top=100-PIE_JIT_CAP*F.jit;for(const b of S.biz)if(BIZ_T[b.type].orbit&&b.mood>top)b.mood=top;}const j=+(F.jit-1/PIE_JIT_DAYS).toFixed(4);F.jit=j<0.005?0:j;}
if(!F.next)F.next=d+PIE_ANTIC_FIRST;else if(d>=F.next){F.next=d+rint(PIE_ANTIC_GAP,PIE_ANTIC_SPAN);pieAntic();}}
PIE_ON.day.push(pieAnticDay);
// sanitize: the antics' part of S.pie.founder (o: the repaired founder, F: the saved one).
function pieAnticFix(o,F,day){const n=(v,hi)=>int(v,0,hi,0);o.jit=clamp(num(F.jit,0),0,1);o.next=n(F.next,day+PIE_ANTIC_FIRST+PIE_ANTIC_GAP+PIE_ANTIC_SPAN);o.kid=n(F.kid,PIE_KIDS.length);
o.bill=n(F.bill,day+PIE_KID_DAYS+3);if(o.bill<=day)o.bill=0;o.nerv=n(F.nerv,day+PIE_SPREE_DAYS);o.hype=n(F.hype,day+PIE_HYPE_DAYS);o.leak=n(F.leak,day+PIE_LEAK_DAYS);
o.mars=n(F.mars,day+720);if(!o.due.includes(o.mars))o.mars=0;}
// The Company tab, next to the feed: how jumpy the market is and how long until it calms down.
function pieJitHtml(F){const j=F.jit||0,K=pieKid();let h='';
if(!(j>0))h=`<p class="meta pie-jit">${tr('pie_ant.jit_calm')}</p>`;
else{const l=j>=0.6?tr('pie_ant.jit_high'):j>=0.3?tr('pie_ant.jit_mid'):tr('pie_ant.jit_low');
h=`<p class="meta pie-jit">${trn('pie_ant.jit_line',Math.ceil(j*PIE_JIT_DAYS),{lvl:l})}</p><div class="bar ${j>=0.6?'bad':'warn'} pie-jit-bar"><i style="width:${Math.round(j*100)}%"></i></div>`;}
if(pieBillOff())h+=`<p class="note pie-jit">${tr('pie_ant.bill_paused',{d:dateStr(F.bill),kid:esc(K?K.n:'')})}</p>`;
return h;}

View file

@ -32,4 +32,4 @@ function pieSpawn(t){const T=BIZ_T[t],min=T.opts[0],ok=pieCands(t).filter(c=>{if
const PIE_OPEN_DAYS=30,PIE_OPEN_OFFERS=4;
function pieOpening(){const P=S.pie;let on=false;for(const id of pieHubs()){const c=P.crusts[id];if(!c)continue;if(c.open===undefined&&pieCap(id)>0)c.open=S.day;if(c.open!==undefined&&S.day-c.open<PIE_OPEN_DAYS)on=true;}return on;}
// Orbit has its own sales desk, so the ground's offers keep their odds: about one call every three days, two on the table at most.
PIE_ON.day.push(()=>{const op=pieOpening();if(S.offers.filter(o=>BIZ_T[o.type].orbit).length>=(op?PIE_OPEN_OFFERS:PIE_OFFERS))return;const t=pieOfferTypes();if(t.length&&(op||Math.random()<PIE_OFFER_RATE))pieSpawn(pick(t));});
PIE_ON.day.push(()=>{const op=pieOpening();if(S.offers.filter(o=>BIZ_T[o.type].orbit).length>=(op?PIE_OPEN_OFFERS:PIE_OFFERS))return;const t=pieOfferTypes();if(t.length&&(op||Math.random()<PIE_OFFER_RATE*pieOfferMul()))pieSpawn(pick(t));});

View file

@ -109,7 +109,9 @@ function pieMoney(X,R2,V){let rev=0;const sf={},flows=[];
for(const o of X.bhNo)bh.push({city:o.city,land:null,g:0,cap:0,why:o.why});
// Patchy-sky customers (99-pie-patchy.js): a revenue line before a crust carries anything, handed over as it does.
const patchy=piePatchy(X.ds);rev+=patchy.mo;
V.orbit=rev;R2.pie={rev,patchy,sf,gs:X.gs,isl:X.isl,used,term:X.gsBw,hubs:X.hubs,sky:X.up.length,flows,bh,...pieLoads(X,flows,used,term,bhG)};
// The billing database is down (the Founder's antics, 99-pie-jitters.js): the sky carries on, nobody is invoiced.
const billOff=pieBillOff()?rev:0;if(billOff)rev=0;
V.orbit=rev;R2.pie={rev,billOff,patchy,sf,gs:X.gs,isl:X.isl,used,term:X.gsBw,hubs:X.hubs,sky:X.up.length,flows,bh,...pieLoads(X,flows,used,term,bhG)};
// For the lazy fiber comparison (pieFiberMs): the graph of this compute, kept out of JSON.
Object.defineProperty(R2.pie,'_x',{value:{adj:X.adj,fm:{}}});}
// A sky circuit for the Traffic tab and the traceroute: entry and exit, the dishes it lands at, and each hop through space.

View file

@ -45,7 +45,7 @@ function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pi
:`<p class="note pie-nudge">${tr('pie.pace_pad_none')}</p>`;}
return x;})()}
<div class="ops-p">${Object.keys(ROCKETS).filter(pieRkOk).map(rk=>{const q=pieQuote(rk,id,{ins:!!UI.pieIns,las:!!UI.pieLas});return btn(`${tr(ROCKETS[rk].n)} <small>${q.ok?(q.test?tr('pie.test_flight')+' · ':'')+fmt$(q.cost):esc(q.why)}</small>`,'pieLaunch',{rk,cr:id},'ghost sm',!q.ok);}).join('')}</div></div>`;}).join('');
h+=`<div class="ops-p">${btn(UI.pieIns?tr('pie.ins_on'):tr('pie.ins_off'),'pieIns',{},UI.pieIns?'green sm':'ghost sm')}${btn(UI.pieLas?tr('pie.las_on'):tr('pie.las_off'),'pieLas',{},UI.pieLas?'green sm':'ghost sm')}</div>`;
h+=`<div class="ops-p">${btn(UI.pieIns?tr('pie.ins_on_p',{p:pct(PIE_INS*pieInsMul())}):tr('pie.ins_off'),'pieIns',{},UI.pieIns?'green sm':'ghost sm')}${btn(UI.pieLas?tr('pie.las_on'):tr('pie.las_off'),'pieLas',{},UI.pieLas?'green sm':'ghost sm')}</div>`;
h+=`<p class="meta">${tr('pie.stock_line',{n:Math.floor(P.stock)})}</p>`;
if(P.q.length)h+=`<h3 style="font-size:15px;margin:10px 0 4px">${tr('pie.queue')}</h3>`+P.q.slice().sort((a,b)=>a.day-b.day).map(L=>`<div class="kv"><span>${esc(tr(ROCKETS[L.rk].n))} → ${esc(tr(CRUSTS[L.cr].n))}</span><b>${L.test?tr('pie.test_flight'):L.n} · ${esc(CITY[L.pad].name)} · ${dateStr(L.day)}</b></div>`).join('');
}else if(T==='dish'){
@ -61,6 +61,6 @@ function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pi
openModal(h,'pie');{const cv=document.querySelector('#modal .pgcv');if(cv)pieGlobeOpen(cv,pieGlobeData);}}
// The Founder's posts are flavour: the newest few at the bottom of the Company tab, the older ones folded away.
function pieFeedHtml(F){const post=p=>`<div class="ops-rep"><div class="eyebrow">${esc(dateStr(p.d))}</div><div>${esc(pieFpText(p))}</div></div>`,top=F.posts.slice(0,PIE_FEED_TOP),more=F.posts.slice(PIE_FEED_TOP);
return `<div class="pie-feed"><h3>${tr('pie.founder_feed')}</h3><div class="kv"><span>${tr('pie.promises')}</span><b>${tr('pie.promises_line',{n:F.promises,b:F.broken})}</b></div>`
return `<div class="pie-feed"><h3>${tr('pie.founder_feed')}</h3><div class="kv"><span>${tr('pie.promises')}</span><b>${tr('pie.promises_line',{n:F.promises,b:F.broken})}</b></div>`+pieJitHtml(F)
+(top.length?top.map(post).join(''):`<p class="meta">${tr('pie.feed_empty')}</p>`)
+(more.length?`<details><summary>${trn('pie.feed_older',more.length)}</summary>${more.map(post).join('')}</details>`:'')+'</div>';}

View file

@ -3423,24 +3423,34 @@
"pie.founder_feed":"The Founder posts",
"pie.fp_3am":"Posting at 3 a.m. because sleep is a legacy protocol. Our pies are 40% more delicious than last quarter.",
"pie.fp_astro":"Astronomers say our pies photobomb their telescopes. Have they tried looking between them?",
"pie.fp_backup":"Billing is back from last Tuesday's backup. Little {nick} is grounded until he learns about prepared statements.",
"pie.fp_baked":"{crust} is fully baked. Next stop: Mars. Probably next year.",
"pie.fp_booster":"The booster tipped over on landing. It was a planned tip. We call it a rapid horizontal recovery.",
"pie.fp_debris":"A minor food fight in {crust}. Crumbs are a sign of a healthy constellation.",
"pie.fp_dish":"Our first pie dish is up. My mum says the signal is great.",
"pie.fp_fail":"Today's launch was a huge success. The rocket is now in many places at once.",
"pie.fp_found":"Founded {co}. Our mission: put pies in the sky so everyone gets a slice.",
"pie.fp_kid":"Welcome to the world, {kid}. Little {nick} for short. Proud dad.",
"pie.fp_launch":"{n} more pies in {crust}. Bold. Visionary. On schedule (this one).",
"pie.fp_leak":"Next launch: Tuesday, 6:42, pad two, payload photo attached. Legal says delete this. Not deleting this.",
"pie.fp_leak_kid":"Little {nick} posted the next launch date from my phone. Kids, eh. (It was me.)",
"pie.fp_mars":"Mars next year. Pies on Mars. Book now.",
"pie.fp_mars_kid":"Promised little {nick} a birthday party on Mars. Next year. Definitely next year.",
"pie.fp_mars_slip":"Mars is now year {n}. Mars was always year {n}. The red planet can wait.",
"pie.fp_promise":"Promise: full coverage by year {n}. Write it down.",
"pie.fp_reg":"Regulators are just firewalls with lanyards. Come at me.",
"pie.fp_rename":"We are {co} now. The old name was holding back the vision.",
"pie.fp_slip":"Full coverage is now year {n}. It was always year {n}. Read the footnotes.",
"pie.fp_spat":"Some government has questions. We love questions. We answer them all, eventually, in a thread.",
"pie.fp_spree":"Thread 1/{n}: why sleep is a legacy protocol, why pies are a lifestyle, and why my critics are bots.",
"pie.fp_spree_kid":"3 a.m. again. Little {nick} is teething, so I wrote a thread. 1/{n}.",
"pie.fp_storm":"The Sun is jealous of {crust}. Totally normal. Space weather is just weather, but more.",
"pie.fp_test":"Test flight {n} ended in a fireball, exactly as we hoped. We learned so much.",
"pie.fp_tour":"Stepping back from Tier 1 to go on a listening tour. Mostly I will be talking.",
"pie.half_baked":"Half-baked",
"pie.heavy_tests":"Test flights flown: {n} of {max}. The first ones always explode.",
"pie.ins_off":"Insurance: off",
"pie.ins_on":"Insurance: on (8%)",
"pie.ins_on_p":"Insurance: on ({p})",
"pie.landing_rights":"Landing rights",
"pie.las_off":"Lasers: off",
"pie.las_on":"Lasers: on (+$0.5M a pie)",
@ -3513,6 +3523,22 @@
"pie.why_queue_full":"The launch schedule is full.",
"pie.why_stock":"Needs {n} pies; the factory has {have}.",
"pie.would_have":"Would have cost",
"pie_ant.backup":"Orbit billing is restored from backup. Invoices are going out again.",
"pie_ant.bill_paused":"Orbit billing is down until {d}: the database is still choking on {kid}.",
"pie_ant.gasp":"Ooooh. Uuuuuh.",
"pie_ant.jit_calm":"Market jitters: 😌 calm",
"pie_ant.jit_high":"😬 high",
"pie_ant.jit_line":{"one":"Market jitters: {lvl}, calming down in ~{n} day","other":"Market jitters: {lvl}, calming down in ~{n} days"},
"pie_ant.jit_low":"🙂 low",
"pie_ant.jit_mid":"😟 nervous",
"pie_ant.kid":"The Founder named his son <b>{kid}</b>. The billing database read the birth announcement and choked: no orbit invoices go out for {n} days.",
"pie_ant.leak":"The Founder posted the next launch date, the pad and a photo of the payload. Launch insurers are not amused: insurance costs {p} for {n} days.",
"pie_ant.mars":"The Founder promised Mars by next year. Orbit sales are giddy for {n} days; nobody asks what happens next year.",
"pie_ant.mars_slip":{"one":"Mars slipped another year. {n} orbit customer quietly cancelled.","other":"Mars slipped another year. {n} orbit customers quietly cancelled."},
"pie_ant.mars_slip_none":"Mars slipped another year. Orbit customers roll their eyes.",
"pie_ant.reg":"The Founder called a regulator a legacy protocol, live on air. The regulator has replied, in writing.",
"pie_ant.reg_none":"The Founder called a regulator a legacy protocol, live on air. Everyone is waiting for the reply.",
"pie_ant.spree":"The Founder posted {n} times between 3 and 4 a.m. Orbit customers are nervous: fewer calls and grumpier customers for {d} days.",
"pie_globe.switch_to_day_view":"Switch to day view",
"pie_globe.switch_to_night_view":"Switch to night view",
"pie_globe.your_pies_in_orbit":"Your pies in orbit, drag to turn the Earth",

View file

@ -18,6 +18,8 @@
.pie-feed{border-top:2px solid var(--line);margin-top:12px;padding-top:4px}
.pie-feed h3{font-size:15px;margin:8px 0 4px}
.pie-feed summary{cursor:pointer;font-weight:800;font-size:13px;color:var(--ink2);padding:8px 0;min-height:24px}
.pie-jit{margin:6px 0 2px;overflow-wrap:anywhere}
.pie-jit-bar{margin-bottom:6px}
/* Government money in the bank: the same boxes as the loans next to it. */
.bank-gov>.meta{font-size:13px;color:var(--ink2);margin:2px 0 6px;line-height:1.35}
.bank-gov .ops-o{border:2.5px solid var(--ink);border-radius:14px;padding:10px 12px;margin-top:10px}