diff --git a/CHANGELOG.md b/CHANGELOG.md index fbebed3..4ef5a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project are documented here. The project follows - Every capital in Europe is on the map: Tirana, Andorra la Vella, Minsk, Sarajevo, Zagreb, Nicosia, Vaduz, Vilnius, Valletta, Chișinău, Monaco, Podgorica, Skopje, San Marino, Bratislava, Ljubljana and Bern. Each country brings its real telcos, exchanges sit only where real ones do, and Malta and Cyprus are islands on the real PEACE, MedNautilus and Blue cables. - Every capital in the Americas is on the map: the eastern Caribbean islands, Central America, Haiti, Guyana, Suriname and Bolivia's constitutional capital Sucre. The islands land the real cables (ECFS and Southern Caribbean Fiber), Flow and Digicel serve all of them, and Belize, Guyana, Suriname and Haiti get their own national telcos. - Every US state capital and Washington, DC are on the map, with every Canadian provincial and territorial capital and Greenland. Greenland's capital Nuuk and three towns up the coast hang on the real Greenland Connect cables; Iqaluit has only satellites, so land your own cable there. New carriers sell transit in the north and the Canadian provinces, and exchanges sit only where real ones do. +- Your own subsea cable from Buenos Aires to Santiago now earns The Long Way Round, like a wave leased on the old ring round Cape Horn. (#272) ## [2.7.0] — 2026-11-03 - Three new cities in northern Australia: Port Hedland, Townsville and Alice Springs (#255). Port Hedland lands a new cable up the coast to Darwin and a branch of Darwin's cable out to Singapore; Alice Springs has no sea at all. In the wet season, November to April, fiber cuts in the tropical north, Darwin included, take twice as long to reach. diff --git a/src/game/88-days/20-badges.js b/src/game/88-days/20-badges.js index 63f6650..33d99e0 100644 --- a/src/game/88-days/20-badges.js +++ b/src/game/88-days/20-badges.js @@ -2,6 +2,8 @@ device in a hall of fame, so there is always something grand to work towards. */ const RARITY={c:{n:tr('common.common'),col:'#16A866'},r:{n:tr('common.rare'),col:'#3A7BEA'},e:{n:tr('common.epic'),col:'#9D4EDD'},l:{n:tr('common.legendary'),col:'#FF8A3D'}}; const st=()=>S.stats||{}; +// Round Cape Horn: a wave on the old ring, or your own cable whose surveyed path passes south of Tierra del Fuego (#272). +const hornLink=l=>(l.cable==='sam1'&&[l.a,l.b].includes('bue')&&[l.a,l.b].includes('scl'))||(l.kind==='df'&&l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.some(p=>p[1]<-55&&p[0]>-75&&p[0]<-60)); const BADGES=[ {id:'hello',i:'👋',t:tr('common.hello_neighbour'),d:tr('badges.bring_up_your_first_peering_session'),r:'c',ok:()=>R.sessions>=1}, // Keeps its old id so badges already earned (in saves and the hall of fame) carry over. @@ -22,7 +24,7 @@ const BADGES=[ {id:'shed',i:'🔌',t:tr('common.stage_six'),d:tr('badges.ride_out_load_shedding_on_your'),r:'r',ok:()=>(st().shed||0)>=1}, {id:'metro3',i:'🏢',t:tr('badges.two_buildings_three_cities'),d:tr('badges.have_a_second_site_in_3'),r:'r',ok:()=>Object.values(S.pops).filter(p=>p.site2).length>=3}, {id:'penguin',i:'🐧',t:tr('common.lonely_penguin'),d:tr('badges.light_a_wave_on_the_humboldt'),r:'e',ok:()=>S.links.some(l=>l.cable==='humb')}, - {id:'horn',i:'⛵',t:tr('badges.the_long_way_round'),d:tr('badges.run_a_link_round_cape_horn'),r:'e',ok:()=>S.links.some(l=>l.cable==='sam1'&&[l.a,l.b].includes('bue')&&[l.a,l.b].includes('scl'))}, + {id:'horn',i:'⛵',t:tr('badges.the_long_way_round'),d:tr('badges.run_a_link_round_cape_horn'),r:'e',ok:()=>S.links.some(hornLink)}, {id:'six',i:'🌍',t:tr('common.six_continents'),d:tr('badges.pops_in_every_region_on_the'),r:'e',ok:()=>regionsCount()>=6}, {id:'giants',i:'🏭',t:tr('badges.friend_of_giants'),d:tr('badges.hold_deals_at_3_different_ai'),r:'e',ok:()=>new Set(S.biz.filter(b=>BIZ_T[b.type]&&BIZ_T[b.type].mega).flatMap(b=>bCities(b))).size>=3}, {id:'landlord',i:'🧵',t:tr('common.trench_landlord'),d:tr('badges.lease_hundreds_of_fiber_pairs_to'),r:'e',ok:()=>S.biz.some(b=>b.type==='pairs')}, diff --git a/tests/badge-cape-horn.test.js b/tests/badge-cape-horn.test.js new file mode 100644 index 0000000..4ae1793 --- /dev/null +++ b/tests/badge-cape-horn.test.js @@ -0,0 +1,32 @@ +// #272: "The Long Way Round" asks for a link round Cape Horn. Your own subsea cable from Buenos Aires to Santiago +// goes round the Horn too, not only a wave leased on the old ring. +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +const horn = (ev) => ev("BADGES.find(b=>b.id==='horn').ok()"); +const start = (ev) => ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=5e9;S.lvl=4;S.won=true;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'bue'})"); + +test('#272 your own subsea cable from Buenos Aires to Santiago earns The Long Way Round', () => { + const { ev, errors } = load(); + start(ev); + assert.equal(horn(ev), false, 'no link round the Horn yet'); + assert.equal(ev("ownCabWhy('bue','scl')"), '', 'a cable can be laid Buenos Aires–Santiago'); + ev("UI.lmode='df';UI.dfSrc='lease';openLinkModal('bue','scl');ACT.ownCab();ACT.orderCable()"); + assert.ok(ev("S.links.some(l=>l.own&&l.sub&&!l.cable&&[l.a,l.b].includes('scl'))"), 'the cable is ordered'); + assert.equal(horn(ev), true, 'it goes round Cape Horn'); + ev('checkBadges()'); + assert.notEqual(ev("S.ach.horn"), undefined, 'and the badge is earned'); + assert.deepEqual(errors, []); +}); + +test('#272 a wave on the old ring still earns it, a cable that stays north of the Horn does not', () => { + const { ev, errors } = load(); + start(ev); + ev("S.links.push({id:'w1',a:'bue',b:'scl',kind:'wave',tier:1,km:5000,sub:true,cable:'sam1',mo:1,mult:1,trench:'cab:sam1',cut:0,day:0})"); + assert.equal(horn(ev), true, 'a wave on the ring round the Horn'); + ev("S.links=S.links.filter(l=>l.id!=='w1')"); + ev("S.links.push({id:'c1',a:'bue',b:'rio',kind:'df',own:true,sub:true,seaPath:[[-58.4,-34.6],[-50,-30],[-43.2,-22.9]],km:2000,cable:null,ch:[],mo:1,trench:'own:c1',cut:0,day:0,ready:0})"); + assert.equal(horn(ev), false, 'Buenos Aires–Rio never gets near the Horn'); + assert.deepEqual(errors, []); +});