diff --git a/CHANGELOG.md b/CHANGELOG.md index aca88ae..6571cb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- "Meet halfway" on a renewal now offers the price halfway between what the customer pays and what they ask, and the button shows it before you press (#293). +- Fujairah sits on the UAE's east coast again, where its cables land, instead of on top of Muscat (#295). + ## [2.10.0] — 2026-11-05 **The map now runs on your graphics card.** Panning, zooming and fast play stay smooth even on huge networks. If something looks wrong or your phone gets warm, switch back to the old map in **Settings › Map drawing › Always 2D**. Older browsers stay in 2D on their own, and Settings › Diagnostic info shows which one you have. diff --git a/site/i18n/de.js b/site/i18n/de.js index 03e9246..4ea2cb0 100644 --- a/site/i18n/de.js +++ b/site/i18n/de.js @@ -2627,7 +2627,7 @@ "lifecycle.market_below":"{p} unter deinem Start", "lifecycle.match":"Mitgehen", "lifecycle.matched":"{name} hat zum gewünschten Preis verlängert.", -"lifecycle.meet_halfway":"In der Mitte treffen", +"lifecycle.meet_halfway":"In der Mitte treffen: {price}", "lifecycle.meet_no":"{name} hat das Angebot der Konkurrenz genommen und ist weg.", "lifecycle.meet_yes":"{name} hat dein Angebot angenommen und für {price}/Monat verlängert.", "lifecycle.moved_stays":"{name} ist von {from} nach {to} gezogen, wo du einen POP hast, und bleibt also.", diff --git a/site/i18n/es.js b/site/i18n/es.js index 3bf0442..c702e7e 100644 --- a/site/i18n/es.js +++ b/site/i18n/es.js @@ -2625,7 +2625,7 @@ "lifecycle.market_below":"{p} por debajo de cuando empezaste", "lifecycle.match":"Igualar", "lifecycle.matched":"{name} renovó al precio que pidió.", -"lifecycle.meet_halfway":"Partir la diferencia", +"lifecycle.meet_halfway":"Partir la diferencia: {price}", "lifecycle.meet_no":"{name} aceptó la oferta de la competencia y se fue.", "lifecycle.meet_yes":"{name} aceptó tu oferta y renovó por {price}/mes.", "lifecycle.moved_stays":"{name} se mudó de {from} a {to}, donde tienes POP, así que se queda.", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index 776b0b9..2691495 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -2625,7 +2625,7 @@ "lifecycle.market_below":"{p} en dessous de vos débuts", "lifecycle.match":"S'aligner", "lifecycle.matched":"{name} a renouvelé au prix demandé.", -"lifecycle.meet_halfway":"Couper la poire en deux", +"lifecycle.meet_halfway":"Couper la poire en deux : {price}", "lifecycle.meet_no":"{name} a pris l'offre du concurrent et est partie.", "lifecycle.meet_yes":"{name} a accepté votre offre et renouvelé à {price}/mois.", "lifecycle.moved_stays":"{name} a déménagé de {from} à {to}, où vous avez un POP : elle reste.", diff --git a/site/i18n/it.js b/site/i18n/it.js index 7d9dc5b..b266267 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -2625,7 +2625,7 @@ "lifecycle.market_below":"{p} sotto a quando hai iniziato", "lifecycle.match":"Accettare", "lifecycle.matched":"{name} ha rinnovato al prezzo richiesto.", -"lifecycle.meet_halfway":"Venirsi incontro", +"lifecycle.meet_halfway":"Venirsi incontro: {price}", "lifecycle.meet_no":"{name} ha preso l'offerta del concorrente e se n'è andata.", "lifecycle.meet_yes":"{name} ha accettato la tua offerta e rinnovato a {price}/mese.", "lifecycle.moved_stays":"{name} si è trasferita da {from} a {to}, dove hai un POP, quindi resta.", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index ce8feae..04430bb 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -2625,7 +2625,7 @@ "lifecycle.market_below":"{p} abaixo do começo", "lifecycle.match":"Igualar", "lifecycle.matched":"{name} renovou pelo preço que pediu.", -"lifecycle.meet_halfway":"Meio-termo", +"lifecycle.meet_halfway":"Meio-termo: {price}", "lifecycle.meet_no":"{name} aceitou a proposta do concorrente e foi embora.", "lifecycle.meet_yes":"{name} aceitou sua proposta e renovou por {price}/mês.", "lifecycle.moved_stays":"{name} mudou de {from} para {to}, onde você tem POP, então fica.", diff --git a/src/game/20-world/50-cities.js b/src/game/20-world/50-cities.js index ec41e1c..dc7eec9 100644 --- a/src/game/20-world/50-cities.js +++ b/src/game/20-world/50-cities.js @@ -453,7 +453,7 @@ const CITY_NUDGE={ dxb:[9,-7], fec:[-10.8,1.4], fln:[0.8,4.4], - fuj:[8,15], + fuj:[2,2], gdl:[-1.2,0.2], gyn:[-4,2.6], hel:[-.8,-.2], diff --git a/src/game/80-simulation/75-customer-lifecycle.js b/src/game/80-simulation/75-customer-lifecycle.js index ec09dd6..97a5d5d 100644 --- a/src/game/80-simulation/75-customer-lifecycle.js +++ b/src/game/80-simulation/75-customer-lifecycle.js @@ -109,13 +109,16 @@ function clReferral(d){if(d%45!==0||S.offers.length>=6)return; // New offers are priced at today's market (spawnOffer and friends price at 1; this moves them). function mktPrice(from){const m=mkt();for(let i=from;iMath.round((b.rate+b.hag.rate)/2); +const clBill=(b,rate)=>BIZ_T[b.type].fiber?rate:b.bw*rate; const clHags=()=>S?S.biz.reduce((a,b)=>a+(b.hag?1:0),0):0; // The renewals waiting for an answer, at the top of Deals. function clDealsHtml(){const hs=S.biz.filter(b=>b.hag).sort((a,b)=>a.hag.until-b.hag.until);if(!hs.length)return ''; return `

${tr('lifecycle.renewals')}

${tr('lifecycle.unanswered_matches')}

`+hs.map(b=>{const now=BIZ_T[b.type].fiber?b.hag.rate:b.bw*b.hag.rate,was=bizMo(b); return `
${esc(b.name)}
${esc(BIZ_T[b.type].l)} · ${esc(clWhere(b))} · ${tr('ui.n_d_left',{n:b.hag.until-S.day})}
${tr('lifecycle.wants_price',{was:fmt$(was),price:fmt$(now),p:pct(1-now/Math.max(1,was))})}
-
${btn(tr('lifecycle.match'),'renewMatch',{id:b.id},'green sm')}${btn(tr('lifecycle.meet_halfway'),'renewMeet',{id:b.id},'sm')}${btn(tr('lifecycle.let_them_go'),'renewLet',{id:b.id},'ghost sm')}
`;}).join('');} +
${btn(tr('lifecycle.match'),'renewMatch',{id:b.id},'green sm')}${btn(tr('lifecycle.meet_halfway',{price:fmt$(clBill(b,clMid(b)))}),'renewMeet',{id:b.id},'sm')}${btn(tr('lifecycle.let_them_go'),'renewLet',{id:b.id},'ghost sm')}
`;}).join('');} // The contract line on a customer row. const clTermTxt=b=>clOn(b)&&b.te?(b.hag?tr('lifecycle.renewal_haggle',{date:dateStr(b.te)}):tr('lifecycle.contract_until',{date:dateStr(b.te)})):''; diff --git a/src/game/90-actions/50-customers.js b/src/game/90-actions/50-customers.js index aa6e6f4..aa5e4c8 100644 --- a/src/game/90-actions/50-customers.js +++ b/src/game/90-actions/50-customers.js @@ -24,8 +24,8 @@ Object.assign(ACT,{ function clHagOf(id){const b=S.biz.find(x=>x.id===id);return b&&b.hag?b:null;} Object.assign(ACT,{ renewMatch:({id})=>{const b=clHagOf(id);if(!b)return;clRenew(b,b.hag.rate);clNote('ren');toast(tr('lifecycle.matched',{name:esc(b.name)}),'good');sfx('coin');after();}, - renewMeet:({id})=>{const b=clHagOf(id);if(!b)return;const mid=Math.round((b.hag.rate+clFair(b))/2); - if(clR(b,'meet'){const b=clHagOf(id);if(!b)return;const mid=clMid(b); + if(clR(b,'meet'){const b=clHagOf(id);if(!b)return;clGone(b,'cheap');toast(tr('lifecycle.let_go',{name:esc(b.name)}),'');after();}, }); diff --git a/src/i18n/en.js b/src/i18n/en.js index ff97ffe..c34f7df 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -2626,7 +2626,7 @@ "lifecycle.market_below":"{p} below when you started", "lifecycle.match":"Match", "lifecycle.matched":"{name} renewed at the price they asked.", -"lifecycle.meet_halfway":"Meet halfway", +"lifecycle.meet_halfway":"Meet halfway: {price}", "lifecycle.meet_no":"{name} took the competitor's bid and left.", "lifecycle.meet_yes":"{name} took your offer and renewed at {price}/mo.", "lifecycle.moved_stays":"{name} moved from {from} to {to}, where you have a POP, so it stays.", diff --git a/tests/customer-lifecycle.test.js b/tests/customer-lifecycle.test.js index b824160..42c8cd7 100644 --- a/tests/customer-lifecycle.test.js +++ b/tests/customer-lifecycle.test.js @@ -120,6 +120,22 @@ test('a haggle: 30 days ahead, in Deals; match, meet halfway, let go, or no answ assert.deepEqual(errors, []); }); +test('meeting halfway lands between what the customer pays and what they ask, as the button says (#293)', () => { + const { ev, errors } = load(); + ev(start); + // The market has fallen a lot since they signed, so the old reference (today's fair price) sat right next to the ask. + // A name whose roll accepts the offer: the rolls are hashes of the deal, so the test picks one, never luck. + const id = ev(`(()=>{for(let i=0;i<200;i++){const b={id:'m'+i,city:'ams',city2:null,name:'m'+i,type:'dia',bw:5,rate:1000,reqs:[],mood:90,since:S.day-800,te:S.day+20,mk:2,hag:{rate:700,until:S.day+20}};if(clR(b,'meet') { const { ev, errors } = load(); ev(start);