${btn(l.sub?tr('link_panels.charter_another_cable_ship_price_30',{price:fmt$(crewCost(l))}):tr('link_panels.hire_extra_crews_price_30_days',{price:fmt$(crewCost(l))}),'crews',{id:l.id},'sm',l.ready<=S.day+1||S.cash
${l.sub?`${tr('link_panels.only_a_few_dozen_cable_ships')}
`:''}`:''}${tr('link_panels.you_can_pre_install_optics_now')}
`;}
else if(inc&&linkDown(l))h+=`${tr('common.dark_6bf5')}
${esc(inc.msg)}
${inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash`;
h+=`${tr('common.capacity')}
${tr('link_panels.n_of_max_channels_lit',{n:(l.ch||[]).length,max:chMax(l)})}${soldSlots(l)?` · ${tr('link_panels.n_sold_as_alien_waves',{n:soldSlots(l)})}`:''}${fmtG(load)} / ${fmtG(cap)}
${seatPanel(l)}${l.own&&l.sub?`${tr('common.cable_design')}${tr((SEA_DESIGNS[l.seaDesign]||SEA_DESIGNS.standard).n)}
`:''}
diff --git a/src/i18n/en.js b/src/i18n/en.js
index eb71f08..4efd0fd 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -1917,6 +1917,7 @@
"failures.geopolitical_cable_cut":"Geopolitical cable cut",
"failures.hash_polarisation_on_your_lab_nearly":"Hash polarisation on your {lab}: nearly every flow hashes onto the same member. The bundle says it is up. It is also full.",
"failures.hide_the_vacuum":"Hide the vacuum",
+"failures.jump_the_cable_ship_queue":"Jump the cable-ship queue",
"failures.lacp_fast_slow_timer_mismatch_on":"LACP fast/slow timer mismatch on your {lab}: one member keeps timing out of the bundle and coming back.",
"failures.lightning_hit_an_amp_site_on":"Lightning hit an amp site on {a}–{b}. The surge protector was decorative.",
"failures.load_shedding_in_city_stage_n":"Load shedding in {city}
Stage {n} today. Your generator coughed, then kept the lights on.",
@@ -1997,6 +1998,7 @@
"failures.your_spares_kit_gets_it_back":"Your spares kit gets it back tomorrow.",
"features.done_in_d_days":"done in {d} days",
"features.weekly_challenge_key":"Weekly challenge {key}",
+"fiber_and_hardware.another_cable_ship_joins_the_lay":{"one":"Another cable ship joins the lay.
The cable is {n} day ahead.","other":"Another cable ship joins the lay.
The cable is {n} days ahead."},
"fiber_and_hardware.can_t_add_optic_why":"Can't add {optic}.
{why}",
"fiber_and_hardware.dark_fiber_iru_signed_a_b":"Dark fiber IRU signed.
{a}–{b} will be spliced and handed over in about 30 days.",
"fiber_and_hardware.fiber_pair_n_is_lit_a":"Fiber pair {n} is lit: {a}–{b}.
Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.",
@@ -2412,6 +2414,7 @@
"link_panels.build_a_pop_here_first":"Build a POP here first.",
"link_panels.cancel_the_iru":"Cancel the IRU",
"link_panels.carry_here":"Carry here",
+"link_panels.charter_another_cable_ship_price_30":"Charter another cable ship {price} · −30 days",
"link_panels.click_to_tear_down":"Click to tear down",
"link_panels.collecting_data_check_back_in_a":"Collecting data. Check back in a few days.",
"link_panels.congested_upgrade_it_or_add_a":"Congested. Upgrade it or add a parallel path.",
@@ -2472,6 +2475,7 @@
"link_panels.on_standby_idle_while_the_other":"On standby: idle while the other links between these cities have room.",
"link_panels.on_standby_taking_the_overflow":"On standby: taking the overflow, because the other links between these cities are full.",
"link_panels.one_backhoe_is_not_enough":"One backhoe is not enough.",
+"link_panels.only_a_few_dozen_cable_ships":"Only a few dozen cable ships exist, and they are booked months ahead, so a second one for your lay costs millions.",
"link_panels.open_peer_but_not_on_any":"Open peer, but not on any IX where you have a POP. Nearest: {city}",
"link_panels.open_peer_but_not_on_any_bfbb":"Open peer, but not on any IX where you have a POP",
"link_panels.open_peer_join_the_route_server":"Open peer: join the route server at {ix}",
diff --git a/tests/subsea-acceleration.test.js b/tests/subsea-acceleration.test.js
new file mode 100644
index 0000000..4a06aaf
--- /dev/null
+++ b/tests/subsea-acceleration.test.js
@@ -0,0 +1,60 @@
+const test = require('node:test');
+const assert = require('node:assert/strict');
+const { load } = require('./harness');
+
+// Hurrying anything at sea takes a cable ship: a charter for a build, a place in the repair queue for a cut. Both cost
+// millions, while the same hurry on land stays cheap.
+const start = "ACT.start({});S.cash=1e9;S.lvl=13;S.day=200;for(const g of GOALS)S.done[g.id]=0;";
+
+test('more crews on a subsea build means chartering a cable ship, for millions', () => {
+ const { ev, dom, errors } = load();
+ ev(start + "S.links=[{id:'sea',a:'lag',b:'bde',kind:'df',own:true,sub:true,sys:'roadm',km:6000,ch:[],day:200,ready:800,cut:0,mo:1},"
+ + "{id:'land',a:'fra',b:'ams',kind:'df',own:true,sys:'roadm',km:400,ch:[],day:200,ready:500,cut:0,mo:1}]");
+ assert.equal(ev("crewCost(S.links[0])"), 3000000 + 6000 * 500, 'mobilising a ship plus its time at sea');
+ assert.ok(ev("crewCost(S.links[1])") < 50000, 'land crews stay cheap');
+ const cash = ev('S.cash');
+ ev("ACT.crews({id:'sea'})");
+ assert.equal(cash - ev('S.cash'), 6000000);
+ assert.equal(ev('S.links[0].ready'), 770);
+ assert.match(dom.window.document.body.innerHTML, /Another cable ship joins the lay/);
+ ev("UI.sel={type:'link',id:'sea'};renderPanel()");
+ const panel = () => dom.window.document.querySelector('#panelBody').textContent;
+ assert.match(panel(), /Charter another cable ship/);
+ assert.match(panel(), /Only a few dozen cable ships exist/);
+ assert.doesNotMatch(panel(), /Hire extra crews/);
+ ev("UI.sel={type:'link',id:'land'};renderPanel()");
+ assert.match(panel(), /Hire extra crews/);
+ assert.doesNotMatch(panel(), /cable ship/);
+ // The whole lay in one go is the charter times every 30 days left.
+ ev("S.cash=1e9;UI.sel={type:'link',id:'sea'};renderPanel()");
+ assert.equal(ev("crewSteps(S.links[0])*crewCost(S.links[0])"), 19 * 6000000);
+ assert.deepEqual(errors, []);
+});
+
+test('a rush repair on a subsea cut, even on a leased wave, costs a cable ship, a trench cut stays cheap', () => {
+ const { ev, errors } = load();
+ ev(start + "S.links=[{id:'sea',a:'lag',b:'bde',kind:'wave',sub:true,tier:0,km:6000,cut:0,mo:1000}];S.inc=[];fireFailure('cut')");
+ const sea = JSON.parse(ev("JSON.stringify(S.inc.find(i=>i.type==='cut'))"));
+ assert.equal(sea.cost, 1000000 + 6000 * 200);
+ assert.equal(sea.fix, 'Jump the cable-ship queue');
+ ev("S.links=[{id:'land',a:'fra',b:'ams',kind:'wave',tier:0,km:400,cut:0,mo:1000}];S.inc=[];fireFailure('cut')");
+ const land = JSON.parse(ev("JSON.stringify(S.inc.find(i=>i.type==='cut'))"));
+ assert.equal(land.cost, 4000);
+ assert.equal(land.fix, undefined);
+ // Paying it brings the cable back at once, like any rush repair.
+ ev("S.links=[{id:'sea',a:'lag',b:'bde',kind:'wave',sub:true,tier:0,km:6000,cut:0,mo:1000}];S.inc=[];fireFailure('cut')");
+ const id = ev("S.inc.find(i=>i.type==='cut').id"), cash = ev('S.cash');
+ ev(`ACT.fixInc({id:'${id}'})`);
+ assert.equal(cash - ev('S.cash'), 2200000);
+ assert.equal(ev("linkDown(S.links[0])"), false);
+ assert.deepEqual(errors, []);
+});
+
+test('the chaos monkey snipping a subsea cable prices the rush the same way', () => {
+ const { ev, errors } = load();
+ ev(start + "S.links=[{id:'sea',a:'lag',b:'bde',kind:'wave',sub:true,tier:0,km:3000,cut:0,mo:1000}];S.inc=[];"
+ + "S.monkey={n:0,hurt:0,until:S.day+100};mkSnip()");
+ const i = JSON.parse(ev("JSON.stringify(S.inc.find(i=>i.type==='cut'))"));
+ assert.equal(i.cost, 1000000 + 3000 * 200);
+ assert.deepEqual(errors, []);
+});
diff --git a/tests/subsea-upgrade-timing.test.js b/tests/subsea-upgrade-timing.test.js
index 0f88d39..0d71cf3 100644
--- a/tests/subsea-upgrade-timing.test.js
+++ b/tests/subsea-upgrade-timing.test.js
@@ -129,11 +129,11 @@ test('one-click completion costs the same as repeated crew hires and advances pe
const button = [...dom.window.document.querySelectorAll('#panelBody [data-act=crews]')].find(b => JSON.parse(b.dataset.args).all);
assert.ok(button && !button.disabled, 'one-click option is available');
const cash = ev('S.cash');
- assert.ok(button.textContent.includes(ev('fmt$(30*Math.round(15000+15000*6))')), 'full price is shown before purchase');
+ assert.ok(button.textContent.includes(ev('fmt$(30*Math.round(3000000+15000*500))')), 'full price is shown before purchase');
button.click();
const bulkDates = dates(ev), bulkCash = ev('S.cash');
assert.deepEqual(bulkDates, [101, 131, 281]);
- assert.equal(cash - bulkCash, 30 * 105000);
+ assert.equal(cash - bulkCash, 30 * 10500000);
const after = [...dom.window.document.querySelectorAll('#panelBody [data-act=crews]')];
assert.ok(after.every(b => b.disabled), 'both options stop at one day');
ev("ACT.crews({id:'cable',all:1})");
@@ -150,18 +150,18 @@ test('one-click completion is atomic when unaffordable and handles short or comp
const { ev, dom } = load();
try {
setup(ev);
- ev("S.cash=30*105000-1;UI.sel={type:'link',id:'cable'};renderPanel()");
+ ev("S.cash=30*10500000-1;UI.sel={type:'link',id:'cable'};renderPanel()");
const bulk = [...dom.window.document.querySelectorAll('#panelBody [data-act=crews]')].find(b => JSON.parse(b.dataset.args).all);
assert.equal(bulk.disabled, true);
ev("ACT.crews({id:'cable',all:1})");
- assert.equal(ev('S.cash'), 30 * 105000 - 1);
+ assert.equal(ev('S.cash'), 30 * 10500000 - 1);
assert.equal(ev('S.links[0].ready'), 1000, 'no partial purchase');
- ev("S.cash=105000;S.links[0].ready=102;ACT.crews({id:'cable',all:1})");
+ ev("S.cash=10500000;S.links[0].ready=102;ACT.crews({id:'cable',all:1})");
assert.equal(ev('S.cash'), 0);
assert.equal(ev('S.links[0].ready'), 101, 'two days remaining costs one normal hire');
- assert.match(dom.window.document.body.textContent, /Construction is 1 day ahead\./);
- ev("S.cash=105000;S.day=101;ACT.crews({id:'cable',all:1})");
- assert.equal(ev('S.cash'), 105000, 'completed construction cannot be rushed');
+ assert.match(dom.window.document.body.textContent, /The cable is 1 day ahead\./);
+ ev("S.cash=10500000;S.day=101;ACT.crews({id:'cable',all:1})");
+ assert.equal(ev('S.cash'), 10500000, 'completed construction cannot be rushed');
ev("S.day=100;S.links[0].ready=1000;S.links[0].own=false;ACT.crews({id:'cable',all:1})");
assert.equal(ev('S.links[0].ready'), 1000, 'leased handovers cannot buy construction crews');
} finally { dom.window.close(); }