Puzzles: a city to avoid reads as a rule
You cannot build in it anyway, so the card shows "Rule: not via Frankfurt" instead of a goal that could never be failed.
This commit is contained in:
parent
9902599a23
commit
28743698a3
9 changed files with 21 additions and 9 deletions
|
|
@ -4,7 +4,6 @@ function pzTwistTxt(t){const P=S.pz;
|
|||
if(t.k==='sub')return tr('puzzles.no_subsea_cables');
|
||||
if(t.k==='ring')return tr('puzzles.one_ring_through_every_pop');
|
||||
if(t.k==='g')return tr('puzzles.every_link_n_g_or_more',{n:P.minG});
|
||||
if(t.k==='avoid')return tr('puzzles.no_pop_in_list',{list:P.avoid.map(c=>CITY[c].name).join(', ')});
|
||||
const [a,b,ms]=P.lat;return isFinite(t.ms)?tr('puzzles.a_to_b_under_ms_now',{a:CITY[a].name,b:CITY[b].name,ms,now:t.ms.toFixed(1)}):tr('puzzles.a_to_b_under_ms',{a:CITY[a].name,b:CITY[b].name,ms});}
|
||||
// The short version, for the puzzle list.
|
||||
function pzTwistTag(d){const t=[];if(d.noSub)t.push(tr('puzzles.no_subsea'));if(d.ring)t.push(tr('puzzles.ring'));if(d.lat)t.push(tr('puzzles.under_n_ms',{n:d.lat[2]}));if(d.minG)t.push(tr('puzzles.n_g_links',{n:d.minG}));if(d.avoid)t.push(tr('puzzles.avoid_list',{list:d.avoid.map(c=>CITY[c].name).join(', ')}));return t;}
|
||||
|
|
@ -17,7 +16,8 @@ function pzRender(){const el=$('pzBox');if(!pzOn()){el.hidden=true;return;}el.hi
|
|||
if(d)h+=`<p class="pzj">${esc(d.j)}</p>`;
|
||||
h+=`<div class="pzs">${star(e.goal,tr('puzzles.goal'))}${star(e.goal&&e.cheap,P.budget?tr('puzzles.budget'):tr('puzzles.free'))}${star(e.goal&&e.n1,'N-1')}</div>`;
|
||||
h+=`<div class="pzck">${e.marks.map(m=>`<span class="pzc s${m.st}">${esc(CITY[m.c].name)}${m.st===2?' ✓':m.st===1?' ·':' …'}</span>`).join('')}</div>`;
|
||||
for(const t of e.tw)h+=`<div class="pztw ${t.ok?'ok':''}">${t.ok?'✓':'✗'} ${pzTwistTxt(t)}</div>`;
|
||||
// Cities to avoid cannot be built in at all, so they read as a rule, not as a box to tick.
|
||||
for(const t of e.tw)h+=t.k==='avoid'?`<div class="pztw rule">🚫 ${tr('puzzles.rule_not_via_list',{list:P.avoid.map(c=>esc(CITY[c].name)).join(', ')})}</div>`:`<div class="pztw ${t.ok?'ok':''}">${t.ok?'✓':'✗'} ${pzTwistTxt(t)}</div>`;
|
||||
const sp=fmt$(e.spend);
|
||||
h+=P.budget?`<div class="pzbud"><div class="kv"><span>${tr('puzzles.spent_x_of_y',{x:sp,y:fmt$(P.budget)})}</span><b>${e.cheap?'✓':'✗'}</b></div><div class="bar ${e.cheap?(e.spend>P.budget*0.85?'warn':''):'bad'}"><i style="width:${Math.min(100,e.spend/P.budget*100).toFixed(1)}%"></i></div></div>`
|
||||
:`<div class="pzbud"><div class="kv"><span>${tr('puzzles.spent_x',{x:sp})}</span><b>${tr('puzzles.no_budget_star_on_the_house')}</b></div></div>`;
|
||||
|
|
|
|||
|
|
@ -2885,7 +2885,6 @@
|
|||
"puzzles.no_budget_star_on_the_house":"no budget: ⭐ on the house",
|
||||
"puzzles.no_cable_lands_in_both_try":"No cable lands in both {a} and {b}. Try a stepping stone in between.",
|
||||
"puzzles.no_clock_no_bills_nothing_breaks":"No clock, no bills, nothing breaks. Connect the cities, then go for three stars: under budget, and still connected when any one link is cut.",
|
||||
"puzzles.no_pop_in_list":"No POP in {list}",
|
||||
"puzzles.no_subsea":"no subsea",
|
||||
"puzzles.no_subsea_cables":"No subsea cables",
|
||||
"puzzles.nobody_ever_got_fired_for_buying":"Nobody ever got fired for buying 100G.",
|
||||
|
|
@ -2912,6 +2911,7 @@
|
|||
"puzzles.ring":"ring",
|
||||
"puzzles.ring_of_fire":"Ring of Fire",
|
||||
"puzzles.rock_solid_and_gold_plated_the":"Rock solid, and gold plated. The CFO has questions.",
|
||||
"puzzles.rule_not_via_list":"Rule: not via {list}",
|
||||
"puzzles.samba_sprint":"Samba Sprint",
|
||||
"puzzles.same_puzzle_for_everyone_this_week":"Same puzzle for everyone this week",
|
||||
"puzzles.same_trench_cheaper_one_backhoe_cuts":"Same trench (cheaper, one backhoe cuts both)",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ body.pz #hud .chip:not(.brand):not(.speed),body.pz #hud .speed button:not(#muteB
|
|||
.pzs span small{font:900 10px var(--body);text-transform:uppercase;letter-spacing:.05em}.pzs span.on{filter:none;opacity:1;background:#FFF3C4;transform:scale(1.05)}
|
||||
.pzck{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0}.pzc{font-weight:900;font-size:12px;border:2px solid var(--ink);border-radius:999px;padding:1px 8px;background:#fff}
|
||||
.pzc.s1{background:#FFE3F0}.pzc.s2{background:var(--ok);color:#fff}
|
||||
.pztw{font-size:12.5px;font-weight:800;color:var(--bad);margin:3px 0}.pztw.ok{color:var(--eye)}
|
||||
.pztw{font-size:12.5px;font-weight:800;color:var(--bad);margin:3px 0}.pztw.ok{color:var(--eye)}.pztw.rule{color:var(--ink2)}
|
||||
.pzbud{margin:6px 0}.pzbud .kv{font-size:12.5px}
|
||||
.pzn1{font-size:12.5px;font-weight:800;margin:6px 0;padding:4px 8px;border:2px solid var(--line);border-radius:10px;color:var(--ink2)}
|
||||
.pzn1.on{border-color:var(--ok);background:#DFFBEA;color:var(--ink);animation:pzglow 1.6s ease-in-out infinite}.pzn1.bad{border-color:var(--warn);background:#FFF4D6;color:var(--ink)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue