From 9d73d6d4496ea64acd97ee58b9c9bddf17f0f0ef Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Fri, 23 Oct 2026 15:41:53 +0200 Subject: [PATCH] 16 more badges --- CHANGELOG.md | 5 +++++ site/index.html | 21 +++++++++++++++++++-- tests/issues.test.js | 11 +++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3efbda0..c8ef821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ All notable changes to this project are documented here. The project follows spills onto up to two alternate paths with free capacity instead of being dropped. Without it, traffic still reroutes around failures, but a full link stays full, just like a real IGP. +- 16 more badges, mostly rare, epic and legendary: Traffic Whisperer, Same + Street, Anchors Aweigh, Samba Peering, DE-KICKS Bingo, Ring of Fire, Iron + Curtain Call, Island Hopper, Through the Wall, Darwin Award, Unbreakable, + Gigawatt Landlord, Blitz, Hundred Terabits and a few more, one of them + secret. That makes 46. ## [1.6.0] โ€” 2026-10-23 diff --git a/site/index.html b/site/index.html index ab085ad..9d87415 100644 --- a/site/index.html +++ b/site/index.html @@ -1217,7 +1217,7 @@ function portNote(c){const p=S.pops[c];if(!p)return '';const g=p.rgen||0;return function sfOf(r,c){const d=r.cityDem[c]||0;return d<=1e-6?1:clamp(r.citySrv[c]/d,0,1);} /* ---------- failures & events ---------- */ -function addInc(o){o.id=uid();o.start=S.day;S.inc.push(o);S.stats.incidents++;S.stats.by=S.stats.by||{};S.stats.by[o.type]=(S.stats.by[o.type]||0)+1;if(/shark/i.test(o.msg||''))S.stats.sharks=(S.stats.sharks||0)+1;} +function addInc(o){o.id=uid();o.start=S.day;S.inc.push(o);S.stats.incidents++;S.stats.by=S.stats.by||{};S.stats.by[o.type]=(S.stats.by[o.type]||0)+1;if(/shark/i.test(o.msg||''))S.stats.sharks=(S.stats.sharks||0)+1;const f=S.stats.f=S.stats.f||{};if(/anchor/i.test(o.msg||''))f.anchor=1;if(/crocodile/i.test(o.msg||''))f.croc=1;if(/llama/i.test(o.msg||''))f.llama=1;} const HARMLESS=[ ['Certificate expired','The TLS certificate on your NOC dashboard expired. Nobody can see any graphs, so technically there are no problems.'], ['It was DNS','Someone deleted the DNS record for the internal wiki. The runbook for fixing DNS was on the wiki.'], @@ -1393,6 +1393,7 @@ function dayTick(){ const d=S.day; dkTick(d); if(!S.phpDone&&d>45&&Math.random()<1/400)elephant(); + if(R&&R.teMoved)S.stats.teMax=Math.max(S.stats.teMax||0,R.teMoved); if(R&&R.demand>0)S.stats.clean=R.served/R.demand>=0.995?(S.stats.clean||0)+1:0; if(S.ev.php===d)toast('The internet is back.
Half of it, anyway. Everything was patched in a hurry and nobody learned anything.','good'); for(const k in S.peers){const [id,c]=k.split('@'),sn=snub(id,c);if(!sn)continue;delete S.peers[k];S.stats.depeered=(S.stats.depeered||0)+1; @@ -1501,6 +1502,22 @@ const BADGES=[ {id:'unicorn',i:'๐Ÿฆ„',t:'Unicorn',d:'Hold a billion dollars in cash.',r:'l',ok:()=>S.cash>=1e9}, {id:'clean',i:'๐Ÿงผ',t:'Debt-Free Tier 1',d:'Win without ever taking a loan.',r:'l',ok:()=>!!S.won&&!(st().loans||0)&&!(S.loans||[]).length}, {id:'speed',i:'โšก',t:'Speedrun',d:'Reach Tier 1 within three years.',r:'l',ok:()=>!!S.won&&S.day<=1095}, + {id:'te',i:'๐Ÿงญ',t:'Traffic Whisperer',d:'Have Auto-TE move 100 Gbps onto alternate paths at once.',r:'r',ok:()=>(st().teMax||0)>=100}, + {id:'street',i:'๐Ÿšง',t:'Same Street',d:'Lose a metro ring to one backhoe.',r:'r',ok:()=>(st().by||{}).ring>=1}, + {id:'anchor',i:'โš“',t:'Anchors Aweigh',d:'Have a cable cut by a dragged anchor.',r:'r',ok:()=>!!(st().f||{}).anchor}, + {id:'retained',i:'๐ŸŽ',t:'Customer Success Story',d:'Take a DE-KICKS retention offer.',r:'r',ok:()=>!!st().retained}, + {id:'brrr',i:'๐Ÿ‡ง๐Ÿ‡ท',t:'Samba Peering',d:'Ports on all three IX.brrr exchanges.',r:'e',ok:()=>['sao','rio','for'].every(c=>S.ixp[c]!==undefined)}, + {id:'bingo',i:'๐ŸŽฐ',t:'DE-KICKS Bingo',d:'Ports at all six DE-KICKS exchanges. They thank you for your continued partnership.',r:'e',ok:()=>DK_CITIES.filter(c=>CITY[c]&&CITY[c].ix).every(c=>S.ixp[c]!==undefined)}, + {id:'fire',i:'๐ŸŒ‹',t:'Ring of Fire',d:'POPs all the way round the Pacific: Los Angeles, Tokyo, Taipei, Manila, Jakarta, Sydney, Auckland and Santiago.',r:'e',ok:()=>['lax','tok','tpe','mnl','jkt','syd','akl','scl'].every(c=>S.pops[c])}, + {id:'curtain',i:'๐ŸŽญ',t:'Iron Curtain Call',d:'POPs in Warsaw, Prague, Vienna, Budapest, Bucharest, Sofia, Belgrade and Tallinn.',r:'e',ok:()=>['waw','prg','vie','bud','buh','sof','beg','tll'].every(c=>S.pops[c])}, + {id:'islands',i:'๐Ÿ๏ธ',t:'Island Hopper',d:'POPs in Reykjavik, Dublin, London, Colombo, Taipei, Manila, Tokyo and Auckland.',r:'e',ok:()=>['rek','dub','lon','cbo','tpe','mnl','tok','akl'].every(c=>S.pops[c])}, + {id:'wall',i:'๐Ÿงฑ',t:'Through the Wall',d:'Run a licensed POP in mainland China.',r:'e',ok:()=>cnOk()&&Object.keys(S.pops).some(cnCity)}, + {id:'croc',i:'๐ŸŠ',t:'Darwin Award',d:'Have your fiber bitten by a crocodile.',r:'l',ok:()=>!!(st().f||{}).croc}, + {id:'unbreak',i:'๐Ÿ›ก๏ธ',t:'Unbreakable',d:'Survive 100 incidents without customer impact.',r:'l',ok:()=>(st().survived||0)>=100}, + {id:'gigawatt',i:'โš›๏ธ',t:'Gigawatt Landlord',d:'Hold an AI WAN, a training run, an ingest and a fiber-pairs deal at the same time.',r:'l',ok:()=>['aiwan','mtrain','ingest','pairs'].every(t=>S.biz.some(b=>b.type===t))}, + {id:'blitz',i:'๐Ÿš€',t:'Blitz',d:'Reach Tier 1 within two years.',r:'l',ok:()=>!!S.won&&S.day<=730}, + {id:'peta',i:'๐ŸŒŒ',t:'Hundred Terabits',d:'Serve 100 Tbps.',r:'l',ok:()=>R.served>=100000}, + {id:'llama',i:'๐Ÿฆ™',t:'Llama Drama',d:'Lose fiber to a llama herd.',r:'l',secret:true,ok:()=>!!(st().f||{}).llama}, {id:'elephant',i:'๐Ÿ˜',t:'I Survived the Elephant',d:'Live through the day half the internet went down.',r:'l',secret:true,ok:()=>!!S.phpDone&&!(S.ev.php>S.day)}, {id:'zero',i:'๐Ÿ•ณ๏ธ',t:'Zero Peers Given',d:'Reach Tier 2 with every single session over the route server.',r:'l',secret:true,ok:()=>isTier2()&&!Object.keys(S.peers).length&&!S.pni.length}, ]; @@ -1569,7 +1586,7 @@ const ACT={ else{dk.stall=S.day+5+Math.floor(Math.random()*6);dk.q=null;closeModal();toast(`Haggling paused.
${esc(pick(DK_STALL))}`,'bad');}}, dkWalk:()=>{const dk=dkState();dk.q=null;closeModal();toast('DE-KICKS will "circle back".
Expect an email titled "Quick question ๐Ÿ™‚" within the hour.','');}, dkOptOut:({city,n})=>{const dk=dkState(),k='dk'+city+n;if(UI.confirm!==k){UI.confirm=k;renderPanel();return;}dk.add[city]=(dk.add[city]||[]).filter(x=>x.n!==n);UI.confirm=null;S.stats.optouts=(S.stats.optouts||0)+1;toast(`Opted out of ${esc(n)}.
It took four clicks, a survey and a "we're sad to see you go" page.`,'good');after();}, - dkStay:({city})=>{const dk=dkState();dk.ret[city]=S.day+180;dk.retUsed[city]=true;UI.confirm=null;closeModal();toast(`40% off ${esc(ixName(city))} for 6 months.
Your account manager is relieved. Read the small print later.`,'good');after();}, + dkStay:({city})=>{S.stats.retained=1;const dk=dkState();dk.ret[city]=S.day+180;dk.retUsed[city]=true;UI.confirm=null;closeModal();toast(`40% off ${esc(ixName(city))} for 6 months.
Your account manager is relieved. Read the small print later.`,'good');after();}, buyTE:()=>{if(S.te)return;if(lvl()<3){toast('Auto-TE unlocks at customer level 3.','bad');sfx('err');return;}if(!spend(TE_COST))return;S.te={on:true,day:S.day};toast('Auto-TE is live.
The controller now pushes overflow onto alternate paths whenever the shortest one is full.','good');after();}, teToggle:()=>{if(!S.te)return;S.te.on=!S.te.on;after();}, addSite:({city})=>{const p=S.pops[city];if(!p||p.site2)return;if(!spend(SITE2_COST))return;p.site2=true;p.site2Day=S.day;toast(`Second site live in ${CITY[city].name}.
${esc(siteName(city,'b'))} is joined to ${esc(siteName(city,'a'))} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.`,'good');sfx('build');after();}, diff --git a/tests/issues.test.js b/tests/issues.test.js index 08fdb87..7dd0d0f 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -149,3 +149,14 @@ test('Auto-TE spills overflow onto an alternate path when the shortest one is fu assert.ok(ev("R.served") < dem - 1, 'switching it off goes back to shortest path only'); assert.deepEqual(errors, []); }); + +test('rare badges hook into incidents and deals', () => { + const { ev, errors } = load(); + base(ev); + ev("addInc({type:'cut',ref:'x',until:S.day+1,msg:'A crocodile took a bite. A ship dragged its anchor.'});checkGoals()"); + assert.ok(ev("S.ach.croc!==undefined&&S.ach.anchor!==undefined&&S.ach.backhoe!==undefined")); + ev("S.stats.survived=100;checkGoals()"); + assert.ok(ev("S.ach.unbreak!==undefined")); + assert.equal(ev("BADGES.length>=46&&new Set(BADGES.map(b=>b.id)).size===BADGES.length"), true); + assert.deepEqual(errors, []); +});