Phase 4: close loot/refund leaks, landing-site garrisons, speed-scaled shipping, update/offsite tooling, broad e2e
Built: - Economy: raid loot capped to the room the raiders have at home (rest stays with the victim, "lootLeft" in the report); trade escrow reserves its room so refunds always fit; trade accept refuses with no_room_for_goods when the goods would not fit. Loot destroyed per 30-day run 31-61k -> ~1k, refunds clipped ~27k -> 0 (docs/BALANCE.md, 3 seeds). - End game: members of the holding alliance garrison landing sites (migration 005_site_garrison.sql), garrison counts in site defence, 72 h capture shield, withdraw route, POP view lists garrisoned units. Shipping capacity scales with world speed (3x world: winner 76-98 -> ~30-36 days after sites open). Bot runs show real contests (84-194 attacks on held sites at 1x). - Ops: deploy/update.sh (backup, stop, ff-merge, npm ci --ignore-scripts, health check, rollback), deploy/upstream-offsite (rsync only), admin end-world snapshots results, EPIPE fix, docs/workflows/ filled in. - e2e 62 -> 163 checks: units, raids/reports, alliance+messages, trade, end game, nb, PWA, reconnect, slow polling fallback (opt-in). Two app bugs found: message push ignored, "New" button stayed English. Tested: npm test 274/274, openapi check, npm run e2e 163/163 (137 s), bot runs 50x30d seeds 1-3 and 140-day/60-day speed-3 end-game runs INVARIANTS OK, adversarial review pass (findings fixed or documented). NOT tested: update.sh on a real box (systemd, real npm, runuser; stubs only, shellcheck not installed), garrison card/loot text on a phone, Node 22.13, humans. Known leaks left open and documented (BALANCE S6): loot/shipments can still overflow when stock arrives in flight, bounced backbone shipments lose overflow (reported to the sender). Garrison numbers (heldDefenceMult 2, shield 72 h) are first guesses from 2 seeds. Not claimed: balanced. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
parent
9104480463
commit
3c23c51902
92 changed files with 4887 additions and 300 deletions
|
|
@ -38,12 +38,14 @@
|
|||
trade_accepted: (n, p) => ({ icon: 'swap', title: t('alerts.trade_accepted', { give: amt(p.give), want: amt(p.want) }), detail: t('alerts.build_done.in', { town: town(p.townId) }), go: 'trade', params: { tab: 'mine' } }),
|
||||
trade_completed: (n, p) => ({ icon: 'swap', title: t('alerts.trade_completed', { give: amt(p.give), want: amt(p.want) }), detail: '', go: 'trade', params: { tab: 'mine' } }),
|
||||
trade_expired: (n, p) => ({ icon: 'clock', title: t('alerts.trade_expired'), detail: t('alerts.trade_expired.back', { what: amt(p.returned), town: town(p.townId) }), go: 'trade', params: { tab: 'mine' } }),
|
||||
trade_refund_clipped: (n, p) => ({ icon: 'alert', title: t('alerts.trade_refund_clipped', { what: amt({ resource: p.resource, amount: p.lost }) }), detail: t('alerts.trade_refund_clipped.why', { town: town(p.townId) }), go: 'trade', params: { tab: 'mine' } }),
|
||||
trade_void: (n, p) => ({ icon: 'alert', title: t('alerts.trade_void'), detail: t('alerts.build_done.in', { town: town(p.townId) }), go: 'trade', params: { tab: 'mine' } }),
|
||||
|
||||
// ---- end game
|
||||
backbone_open: (n, p) => Object.assign({ icon: 'b-backbone_node', title: t('alerts.backbone_open'), detail: t('alerts.backbone_open.n', { n: (p.sites || []).length || 7 }) }, worldGo(null)),
|
||||
backbone_taken: (n, p) => Object.assign({ icon: 'flag', title: t('alerts.backbone_taken', { n: site(p) }), detail: [t('alerts.level', { n: p.level || 0 }), p.from ? t('alerts.backbone_taken.from', { tag: tag(p.from) }) : t('alerts.backbone_taken.incumbent'), there(p)].filter(Boolean).join(' · ') }, worldGo(p)),
|
||||
backbone_lost: (n, p) => Object.assign({ icon: 'alert', title: t('alerts.backbone_lost', { n: site(p), tag: tag(p.by) }), detail: [t('alerts.level', { n: p.level || 0 }), there(p)].filter(Boolean).join(' · ') }, worldGo(p)),
|
||||
backbone_incoming: (n, p) => Object.assign({ icon: 'alert', title: t('alerts.backbone_incoming', { n: site(p) }), detail: [p.arriveAt ? t('alerts.backbone_incoming.at', { time: c.clockTime(p.arriveAt) }) : '', there(p)].filter(Boolean).join(' · ') }, worldGo(p)),
|
||||
backbone_level: (n, p) => Object.assign({ icon: 'b-backbone_node', title: t('alerts.backbone_level', { n: site(p), level: p.level }), detail: '' }, worldGo(p)),
|
||||
backbone_delivered: (n, p) => ({ icon: 'box', title: t('alerts.backbone_delivered'), detail: cargoText(p.cargo), go: 'world', params: null }),
|
||||
backbone_ship_bounced: (n, p) => ({ icon: 'alert', title: t('alerts.backbone_ship_bounced'), detail: cargoText(p.cargo), go: 'movements', params: null }),
|
||||
|
|
|
|||
|
|
@ -219,6 +219,8 @@
|
|||
|
||||
// Resource transport between POPs (trade is built on it): `links` concurrent transports = Internet exchange level.
|
||||
// capacityPerLink was 500; 1000 since docs/BALANCE.md B2 (the end game was shipping-limited: 21.6 M units in 500-unit trips).
|
||||
// It is the capacity at world speed 1: the real capacity is rules.transportCapacity(speed) = capacityPerLink x speed (BALANCE.md B7), because
|
||||
// trips are per sitting, not per hour. Never read this constant directly in the client or in a command.
|
||||
const TRANSPORT = { building: 'internet_exchange', speed: 12, capacityPerLink: 1000 };
|
||||
|
||||
// Which unit roles may go on which movement type.
|
||||
|
|
@ -261,7 +263,10 @@
|
|||
graceDays: 2, // after level maxLevel is reached the world ends this long after (divided by world speed)
|
||||
siteRingMin: 0.35, siteRingMax: 0.8, // landing sites sit between these fractions of the map radius
|
||||
siteMinSpacing: 6, // tiles between two sites
|
||||
defenceMult: 12, // incumbent site defence x this = the heavy defence of a landing site
|
||||
defenceMult: 12, // incumbent site defence x this = the heavy defence of a landing site that NOBODY holds (the opening scramble)
|
||||
captureShieldHours: 72, // a site that has just changed hands cannot be attacked for this long (world hours, / speed): time for its new holders to garrison it (BALANCE.md E6: 24 h let sites flip every few hours)
|
||||
heldDefenceMult: 2, // a site HELD by an alliance: its static defence is incumbent defence x this (x the per-level bonus); units its members
|
||||
// station there (garrison, docs/DECISIONS.md E6) count on top, so a held site is as strong as its garrison
|
||||
defencePerLevel: 0.03, // + 3% per built Backbone node level (the node is a bigger target)
|
||||
scanStrength: 40, // a landing site counts as this many scanners when scanned
|
||||
maxLevel: 100, // = BUILDINGS.backbone_node.maxLevel
|
||||
|
|
|
|||
|
|
@ -78,10 +78,21 @@
|
|||
// Share of the way to the opening day, 0..1.
|
||||
const openProgress = (status) => (status && status.openDay ? Math.max(0, Math.min(1, status.ageDays / status.openDay)) : 0);
|
||||
|
||||
// The garrison of a site as the holders' manage sheet shows it (GET /backbone/:id: `defence` + `garrison`): rows sorted by defence, with the
|
||||
// share of the whole defence, and what the static part is worth. -> { static, garrison, total, rows: [{ ownerTownId, townName, name, units, power, share, mine, online }] }
|
||||
function garrisonView(data) {
|
||||
const def = (data && data.defence) || { static: 0, garrison: 0, total: 0 };
|
||||
const rows = ((data && data.garrison) || []).map((g) => ({
|
||||
ownerTownId: g.ownerTownId, townName: g.townName, name: g.operator ? g.operator.name : '', units: g.units || {}, power: g.power || 0,
|
||||
share: def.total > 0 ? (g.online ? (g.power || 0) / def.total : 0) : 0, mine: !!g.mine, online: g.online !== false,
|
||||
})).sort((a, b) => b.power - a.power || a.ownerTownId - b.ownerTownId);
|
||||
return { static: def.static, garrison: def.garrison, total: def.total, rows };
|
||||
}
|
||||
|
||||
const sumCargo = (c) => Object.keys(c || {}).reduce((s, k) => s + (c[k] || 0), 0);
|
||||
|
||||
// Rows of a final ranking list for display: the first `n` (a snapshot holds the top 100).
|
||||
const topRows = (list, n) => (list || []).slice(0, n);
|
||||
|
||||
return { leading, buildProgress, missing, holderKind, buildCheck, phaseNow, openProgress, sumCargo, topRows };
|
||||
return { leading, buildProgress, missing, holderKind, buildCheck, phaseNow, openProgress, sumCargo, topRows, garrisonView };
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@
|
|||
const town = {
|
||||
id: td.id, speed: st.world.speed, updatedAt: at,
|
||||
res: { fiber: td.resources.fiber.amount, hardware: td.resources.hardware.amount, capital: td.resources.capital.amount, battery: td.power.buffer },
|
||||
footprint: td.footprint, buildings, unitDraw: Math.max(0, Math.round(td.power.draw - bdraw)), bonus: td.bonus || {},
|
||||
footprint: td.footprint, buildings, unitDraw: Math.max(0, Math.round(td.power.draw - bdraw)), bonus: td.bonus || {}, escrow: td.escrow || {},
|
||||
};
|
||||
return town;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
const b = t.backbone || {};
|
||||
add('scan', has('scan'), 'no_units');
|
||||
if (!c.allianceId) add('attack', false, 'no_alliance');
|
||||
else if (b.mine) add('attack', false, 'own_site');
|
||||
else if (b.mine) { add('attack', false, 'own_site'); add('reinforce', has('reinforce'), 'no_units'); } // members of the holding alliance garrison the site
|
||||
else add('attack', has('attack'), 'no_units');
|
||||
} else if (t.type === 'land') {
|
||||
const s = t.settle || {};
|
||||
|
|
|
|||
|
|
@ -155,14 +155,20 @@
|
|||
kinds.report = (n, p) => ({ icon: 'report', title: App.t('alerts.report', { type: mil.reportTypeLabel(p.type) }), detail: '', go: 'reports', params: { open: p.reportId } });
|
||||
kinds.train_done = (n, p) => ({ icon: 'units', title: App.t('alerts.train_done', { n: App.fmt.num(p.count), unit: mil.unitName(p.unit) }), detail: App.t('alerts.build_done.in', { town: townTxt(p.townId) }), go: 'units' });
|
||||
kinds.research_done = (n, p) => ({ icon: 'flask', title: App.t('alerts.research_done', { unit: mil.unitName(p.unit), stat: App.t('stat.' + p.stat), level: p.level }), detail: App.t('alerts.build_done.in', { town: townTxt(p.townId) }), go: 'units' });
|
||||
kinds.movement_returned = (n, p) => ({ icon: 'return', title: App.t('alerts.movement_returned'), detail: [mil.unitsText(p.units)].concat(D.RESOURCES.some((r) => p.cargo && p.cargo[r]) ? [Object.keys(p.cargo).filter((r) => p.cargo[r]).map((r) => App.fmt.num(p.cargo[r]) + ' ' + App.resName(r)).join(', ')] : []).join(' · '), go: 'movements' });
|
||||
// Cargo that did not fit the Rack hall when it came home / arrived (cargoLost, exact amounts per resource): said out loud, never silent.
|
||||
const lostText = (lost) => (D.RESOURCES.some((r) => lost && lost[r] > 0) ? [App.t('alerts.cargo_lost', { what: D.RESOURCES.filter((r) => lost[r] > 0).map((r) => App.fmt.num(lost[r]) + ' ' + App.resName(r)).join(', ') })] : []);
|
||||
kinds.movement_returned = (n, p) => ({ icon: 'return', title: App.t('alerts.movement_returned'), detail: [mil.unitsText(p.units)].concat(D.RESOURCES.some((r) => p.cargo && p.cargo[r]) ? [Object.keys(p.cargo).filter((r) => p.cargo[r]).map((r) => App.fmt.num(p.cargo[r]) + ' ' + App.resName(r)).join(', ')] : [], lostText(p.cargoLost)).filter(Boolean).join(' · '), go: 'movements' });
|
||||
kinds.movement_lost = () => ({ icon: 'alert', title: App.t('alerts.movement_lost'), detail: '', go: 'movements' });
|
||||
kinds.transport_arrived = (n, p) => ({ icon: 'box', title: App.t('alerts.transport_arrived', { town: townTxt(p.townId) }), detail: Object.keys(p.cargo || {}).filter((r) => p.cargo[r]).map((r) => App.fmt.num(p.cargo[r]) + ' ' + App.resName(r)).join(', '), go: 'movements' });
|
||||
kinds.transport_arrived = (n, p) => ({ icon: 'box', title: App.t('alerts.transport_arrived', { town: townTxt(p.townId) }), detail: Object.keys(p.cargo || {}).filter((r) => p.cargo[r]).map((r) => App.fmt.num(p.cargo[r]) + ' ' + App.resName(r)).concat(lostText(p.cargoLost)).join(' · '), go: 'movements' });
|
||||
kinds.transport_delivered = (n, p) => ({ icon: 'box', title: App.t('alerts.transport_delivered'), detail: Object.keys(p.cargo || {}).filter((r) => p.cargo[r]).map((r) => App.fmt.num(p.cargo[r]) + ' ' + App.resName(r)).join(', '), go: 'movements' });
|
||||
kinds.units_offline = (n, p) => ({ icon: 'power', title: App.t('alerts.units_offline'), detail: App.t('alerts.build_done.in', { town: townTxt(p.townId) }), go: 'units' });
|
||||
kinds.units_decommissioned = (n, p) => ({ icon: 'power', title: App.t('alerts.units_decommissioned'), detail: mil.unitsText(p.units), go: 'units' });
|
||||
kinds.town_lost = (n, p) => ({ icon: 'alert', title: App.t('alerts.town_lost', { name: p.name }), detail: p.by ? App.t('alerts.town_lost.by', { name: p.by.name }) : '', go: 'pop' });
|
||||
kinds.town_gained = (n, p) => ({ icon: 'pop', title: App.t('alerts.town_gained', { name: p.name }), detail: '', go: 'pop' });
|
||||
kinds.reinforcements_sent_home = (n, p) => ({ icon: 'return', title: App.t('alerts.reinforcements_home'), detail: mil.unitsText(p.units), go: 'units' });
|
||||
// garrisons at backbone landing sites (docs/DECISIONS.md E6)
|
||||
const siteGo = (p) => ({ go: 'world', params: Number.isInteger(p.index) ? { site: p.index } : null });
|
||||
kinds.garrison_arrived = (n, p) => Object.assign({ icon: 'shield', title: App.t('alerts.garrison_arrived', { n: Number.isInteger(p.index) ? p.index + 1 : '?' }), detail: mil.unitsText(p.units) }, siteGo(p));
|
||||
kinds.garrison_released = (n, p) => Object.assign({ icon: 'return', title: App.t('alerts.garrison_released', { n: Number.isInteger(p.index) ? p.index + 1 : '?' }), detail: [App.t('alerts.garrison_released.' + (p.reason === 'alliance_dissolved' || p.reason === 'left_alliance' || p.reason === 'town_lost' ? p.reason : 'other')), mil.unitsText(p.units)].filter(Boolean).join(' · ') }, siteGo(p));
|
||||
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -228,6 +228,12 @@
|
|||
return Math.round(F.storageBase * Math.pow(F.storageGrowth, r.level - 1));
|
||||
}
|
||||
|
||||
// Room the Rack hall has for ONE resource: goods escrowed in open Internet exchange offers (town.escrow, per resource) still occupy
|
||||
// the hall, so the stock stops growing at the hall's size minus the escrow and a refund always fits (nothing is lost, nothing is stored extra).
|
||||
function storageCapOf(town, res) {
|
||||
return Math.max(0, storageCap(town) - ((town.escrow && town.escrow[res]) || 0));
|
||||
}
|
||||
|
||||
function batteryCap(town) {
|
||||
const b = town.buildings.battery_bank;
|
||||
return b && b.level > 0 ? Math.round(F.batteryBase * Math.pow(F.batteryGrowth, b.level - 1)) : 0;
|
||||
|
|
@ -266,16 +272,17 @@
|
|||
function resourcesAt(town, now) {
|
||||
const dtH = Math.max(0, now - town.updatedAt) / HOUR;
|
||||
const rates = ratesPerHour(town);
|
||||
const cap = storageCap(town);
|
||||
const bcap = batteryCap(town);
|
||||
const speed = town.speed || 1;
|
||||
const out = {};
|
||||
const out = {}, caps = {};
|
||||
for (const r of D.RESOURCES) {
|
||||
// An amount already above the cap (the rack hall was lowered) is kept, it just stops growing.
|
||||
out[r] = Math.max(0, Math.min(Math.max(cap, town.res[r]), town.res[r] + rates[r] * dtH));
|
||||
caps[r] = storageCapOf(town, r);
|
||||
out[r] = Math.max(0, Math.min(Math.max(caps[r], town.res[r]), town.res[r] + rates[r] * dtH));
|
||||
}
|
||||
out.battery = Math.max(0, Math.min(bcap, town.res.battery + rates.powerNet * speed * dtH));
|
||||
return { amounts: out, caps: { fiber: cap, hardware: cap, capital: cap, battery: bcap }, rates };
|
||||
caps.battery = bcap;
|
||||
return { amounts: out, caps, rates };
|
||||
}
|
||||
|
||||
// When will the battery hit zero (ms epoch)? null if it never does at the current rates. Units go offline then.
|
||||
|
|
@ -569,7 +576,9 @@
|
|||
// o.kind: 'attack' (full) | 'raid'
|
||||
// o.attackers: { units, research }
|
||||
// o.defenders: [{ id, units, research }] everything defending the POP (home crews first, then each reinforcement)
|
||||
// o.firewall: Firewall level of the target; o.staticDefence: a number for an incumbent site (no groups, no losses)
|
||||
// o.firewall: Firewall level of the target; o.staticDefence: a number for an incumbent site (no groups, no losses). A held backbone
|
||||
// landing site passes BOTH: the static number plus the garrison groups; then D = static + the groups' raw defence (no firewall, no
|
||||
// base defence) and the groups lose units by the same loss law as in a POP (the static part never loses anything).
|
||||
// Full attack: the loser loses everything, the winner loses (loser/winner)^1.5 of its units.
|
||||
// Raid: both sides lose 0.5 * (weaker/stronger)^1.5, whoever wins. Ties go to the defender.
|
||||
function resolveBattle(o) {
|
||||
|
|
@ -581,7 +590,7 @@
|
|||
const raw = groups.map((g) => defencePower(g.units, g.research));
|
||||
const rawTotal = raw.reduce((s, v) => s + v, 0);
|
||||
const isStatic = o.staticDefence !== undefined && o.staticDefence !== null;
|
||||
const Dv = isStatic ? o.staticDefence : (rawTotal + MIL.defenceBase) * firewallMult(effFw);
|
||||
const Dv = isStatic ? o.staticDefence + rawTotal : (rawTotal + MIL.defenceBase) * firewallMult(effFw);
|
||||
const attackerWins = A > Dv;
|
||||
const hi = Math.max(A, Dv), lo = Math.min(A, Dv);
|
||||
const ratio = hi > 0 ? lo / hi : 0;
|
||||
|
|
@ -593,7 +602,7 @@
|
|||
} else {
|
||||
attF = 1; defF = Math.min(1, Math.pow(ratio, MIL.lossExponent));
|
||||
}
|
||||
if (isStatic) defF = 0;
|
||||
if (isStatic && !groups.length) defF = 0;
|
||||
const a = applyLoss(att, attF);
|
||||
const defenders = groups.map((g, i) => {
|
||||
const r = applyLoss(g.units, defF);
|
||||
|
|
@ -615,15 +624,19 @@
|
|||
|
||||
// Loot: `carry` is split evenly over Fiber/Hardware/Capital; what one resource cannot give is shared by the others.
|
||||
// avail = what can be taken. -> whole-number { fiber, hardware, capital }.
|
||||
function lootSplit(carry, avail) {
|
||||
// `room` (optional, per resource) = what the raiders' home Rack hall can still bank: a resource with no room is not taken at all
|
||||
// and the carry goes to the others, so loot is never destroyed on arrival (default: no limit).
|
||||
function lootSplit(carry, avail, room) {
|
||||
const take = { fiber: 0, hardware: 0, capital: 0 };
|
||||
const lim = {};
|
||||
for (const r of D.RESOURCES) lim[r] = Math.min(avail[r], room && room[r] !== undefined ? room[r] : Infinity);
|
||||
let left = Math.max(0, carry);
|
||||
for (let pass = 0; pass < 4 && left > 1e-9; pass++) {
|
||||
const open = D.RESOURCES.filter((r) => avail[r] - take[r] > 1e-9);
|
||||
const open = D.RESOURCES.filter((r) => lim[r] - take[r] > 1e-9);
|
||||
if (!open.length) break;
|
||||
const share = left / open.length;
|
||||
for (const r of open) {
|
||||
const t = Math.min(share, avail[r] - take[r]);
|
||||
const t = Math.min(share, lim[r] - take[r]);
|
||||
take[r] += t; left -= t;
|
||||
}
|
||||
}
|
||||
|
|
@ -716,6 +729,9 @@
|
|||
|
||||
// ---- transport (trade is built on it): concurrent links = Internet exchange level, each carries up to capacityPerLink
|
||||
const transportLinks = (town) => buildingLevel(town, D.TRANSPORT.building);
|
||||
// What one link carries in a world of this speed: capacityPerLink x speed (trips are per sitting, not per hour, so a faster world must carry
|
||||
// more per trip or its end game stays as slow as a 1x world's, BALANCE.md B7). The ONLY place that reads D.TRANSPORT.capacityPerLink.
|
||||
const transportCapacity = (speed) => Math.max(1, Math.round(D.TRANSPORT.capacityPerLink * (speed > 0 ? speed : 1)));
|
||||
// Codes: validation_failed, capacity_exceeded, no_transport_link, not_enough_resources.
|
||||
function transportPlan(town, cargo, activeLinks, now) {
|
||||
let total = 0;
|
||||
|
|
@ -725,7 +741,8 @@
|
|||
}
|
||||
if (total < 1) return { ok: false, code: 'validation_failed' };
|
||||
if (activeLinks >= transportLinks(town)) return { ok: false, code: 'no_transport_link', links: transportLinks(town), active: activeLinks };
|
||||
if (total > D.TRANSPORT.capacityPerLink) return { ok: false, code: 'capacity_exceeded', capacity: D.TRANSPORT.capacityPerLink, total };
|
||||
const capacity = transportCapacity(town.speed);
|
||||
if (total > capacity) return { ok: false, code: 'capacity_exceeded', capacity, total };
|
||||
const have = resourcesAt(town, now).amounts;
|
||||
for (const r of D.RESOURCES) if (have[r] + 1e-6 < (cargo[r] || 0)) return { ok: false, code: 'not_enough_resources' };
|
||||
return { ok: true, total };
|
||||
|
|
@ -737,8 +754,8 @@
|
|||
// Is the exchange rate within the 1:ratioMax band (give/want in [1/ratioMax, ratioMax])?
|
||||
const tradeRatioOk = (give, want) => give > 0 && want > 0 && give <= want * D.TRADE.ratioMax && want <= give * D.TRADE.ratioMax;
|
||||
// Validate the terms of a new offer. `o` = { giveRes, giveAmount, wantRes, wantAmount, maxDistance }. Codes: validation_failed,
|
||||
// trade_ratio, capacity_exceeded. Does not look at the town (resources, links) - the command does.
|
||||
function tradeTermsCheck(o) {
|
||||
// trade_ratio, capacity_exceeded (one transport at the world's `speed`). Does not look at the town (resources, links) - the command does.
|
||||
function tradeTermsCheck(o, speed) {
|
||||
const bad = (path, message) => ({ ok: false, code: 'validation_failed', errors: [{ path, message }] });
|
||||
if (D.RESOURCES.indexOf(o.giveRes) < 0) return bad('giveRes', 'must be one of ' + D.RESOURCES.join(', '));
|
||||
if (D.RESOURCES.indexOf(o.wantRes) < 0) return bad('wantRes', 'must be one of ' + D.RESOURCES.join(', '));
|
||||
|
|
@ -746,7 +763,7 @@
|
|||
if (!Number.isInteger(o.giveAmount) || o.giveAmount < 1) return bad('giveAmount', 'must be a whole number >= 1');
|
||||
if (!Number.isInteger(o.wantAmount) || o.wantAmount < 1) return bad('wantAmount', 'must be a whole number >= 1');
|
||||
if (!Number.isInteger(o.maxDistance) || o.maxDistance < 1 || o.maxDistance > D.TRADE.maxDistance) return bad('maxDistance', 'must be a whole number of tiles 1..' + D.TRADE.maxDistance);
|
||||
const cap = D.TRANSPORT.capacityPerLink;
|
||||
const cap = transportCapacity(speed);
|
||||
if (o.giveAmount > cap || o.wantAmount > cap) return { ok: false, code: 'capacity_exceeded', capacity: cap };
|
||||
if (!tradeRatioOk(o.giveAmount, o.wantAmount)) return { ok: false, code: 'trade_ratio', max: D.TRADE.ratioMax };
|
||||
return { ok: true };
|
||||
|
|
@ -756,9 +773,15 @@
|
|||
const tradeInRange = (dist, maxDistance, level) => level >= 1 && dist <= maxDistance && dist <= tradeReach(level);
|
||||
|
||||
// ---- end game: backbone landing sites
|
||||
// Heavy static defence of a landing site: the incumbent's site defence x defenceMult, plus defencePerLevel per node level.
|
||||
function backboneDefence(seed, x, y, ageDays, level) {
|
||||
return Math.round(incumbentDefence(seed, x, y, ageDays) * D.ENDGAME.defenceMult * (1 + D.ENDGAME.defencePerLevel * Math.max(0, level || 0)));
|
||||
// Static defence of a landing site: the incumbent's site defence x a multiplier, plus defencePerLevel per node level. Nobody holds it:
|
||||
// defenceMult (heavy, the opening scramble). An alliance holds it (`held`): heldDefenceMult, and its garrison comes on top (E6).
|
||||
function backboneDefence(seed, x, y, ageDays, level, held) {
|
||||
const mult = held ? D.ENDGAME.heldDefenceMult : D.ENDGAME.defenceMult;
|
||||
return Math.round(incumbentDefence(seed, x, y, ageDays) * mult * (1 + D.ENDGAME.defencePerLevel * Math.max(0, level || 0)));
|
||||
}
|
||||
// Until when a landing site that changed hands at `takenAt` cannot be attacked (0 = no shield). Only a HELD site has one: the caller checks that.
|
||||
function siteShieldUntil(takenAt, speed) {
|
||||
return takenAt ? takenAt + Math.round(D.ENDGAME.captureShieldHours * HOUR / (speed || 1)) : 0;
|
||||
}
|
||||
// Cost to build the Backbone node UP TO `level` (1..maxLevel), per resource.
|
||||
function backboneCost(level) {
|
||||
|
|
@ -784,10 +807,10 @@
|
|||
}
|
||||
|
||||
return {
|
||||
unitDef, unitCount, costValue, unitValue, researchKey, researchLevel, researchMult, unitStat, unitCost, trainTimeMs, unitMissing, trainPlan, researchCost, researchTimeMs, researchSpeedBonus, researchPlan, slowestSpeed, movementMs, transportMs, checkUnitsForType, isProtected, firewallMult, effectiveFirewall, attackPower, defencePower, applyLoss, resolveBattle, battlePoints, cacheFraction, lootSplit, carryOf, siegeLevels, loyaltyDrop, takeoverBlock, footprintGate, settleCheck, cleanWild, newTownBuildings, scanStrength, resolveScan, incumbentDefence, decommissionMs, decommissionPlan, transportLinks, transportPlan, rng, hash, distance, tileAt, ruralNear, ruralBonus, pickSpawn,
|
||||
unitDef, unitCount, costValue, unitValue, researchKey, researchLevel, researchMult, unitStat, unitCost, trainTimeMs, unitMissing, trainPlan, researchCost, researchTimeMs, researchSpeedBonus, researchPlan, slowestSpeed, movementMs, transportMs, checkUnitsForType, isProtected, firewallMult, effectiveFirewall, attackPower, defencePower, applyLoss, resolveBattle, battlePoints, cacheFraction, lootSplit, carryOf, siegeLevels, loyaltyDrop, takeoverBlock, footprintGate, settleCheck, cleanWild, newTownBuildings, scanStrength, resolveScan, incumbentDefence, decommissionMs, decommissionPlan, transportLinks, transportCapacity, transportPlan, rng, hash, distance, tileAt, ruralNear, ruralBonus, pickSpawn,
|
||||
terrainAt, backboneSites, backboneSiteAt, isBackboneSite, worldAgeDays, worldPhase, tradeReach, tradeRatioOk, tradeTermsCheck, tradeInRange,
|
||||
backboneDefence, backboneCost, backboneTimeMs, backbonePlan,
|
||||
buildingDef, isFieldKey, fieldLayout, buildingCost, coreLevel, buildTimeMs, earlyTimeFactor, queueSlots, storageCap, batteryCap,
|
||||
backboneDefence, siteShieldUntil, backboneCost, backboneTimeMs, backbonePlan,
|
||||
buildingDef, isFieldKey, fieldLayout, buildingCost, coreLevel, buildTimeMs, earlyTimeFactor, queueSlots, storageCap, storageCapOf, batteryCap,
|
||||
fieldOutputPerHour, ratesPerHour, resourcesAt, batteryEmptyAt, unitsOnline, footprintPerDay, footprintAt,
|
||||
allianceCap, allianceCan, roleRank, outranks, diplomacyMove, pactCancelMs,
|
||||
footprintNeeded, loyaltyAt, buildPlan, initialBuildings, latencyMs,
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@
|
|||
body.push(h('p', { class: 'detail-desc', text: App.t('map.info.land') }));
|
||||
}
|
||||
body.push(row('', App.t('map.info.coords', { x, y })));
|
||||
if (App.openSend && App.state.towns.length && (town || (special && (special.type === 'incumbent' || (special.type === 'backbone' && !(special.site && special.site.holder && special.site.holder.allianceId === (App.state.operator && App.state.operator.allianceId))))) || (!special && known))) {
|
||||
if (App.openSend && App.state.towns.length && (town || (special && (special.type === 'incumbent' || special.type === 'backbone')) || (!special && known))) {
|
||||
body.push(h('button', { class: 'btn wide' + (town && town.owner.id === ownOperatorId() ? '' : ' primary'), type: 'button', onclick: () => App.openSend({ x, y }) }, icon('target'), App.t('send.open')));
|
||||
}
|
||||
if (cap && !(town && town.id === cap.id)) body.push(row('', App.t('map.info.distance', { d: App.fmt.dec(R.distance(cap.x, cap.y, x, y)) })));
|
||||
|
|
|
|||
|
|
@ -25,16 +25,25 @@
|
|||
const urls = { inbox: '/messages/inbox', sent: '/messages/outbox', alliance: '/messages/alliance' };
|
||||
|
||||
// ------------------------------------------------------------------ unread badge (works without the screen being open)
|
||||
const badge = { n: 0, polling: false };
|
||||
const badge = { n: 0, polling: false, again: false };
|
||||
async function pollUnread() {
|
||||
if (!App.state.user || badge.polling || document.hidden) return;
|
||||
if (!App.state.user || document.hidden) return;
|
||||
if (badge.polling) { badge.again = true; return; } // a message that lands while a poll is in flight: ask once more
|
||||
badge.polling = true;
|
||||
try { const r = await App.api.get('/messages/inbox', { limit: 1 }); setUnread(r.unread || 0); } catch (e) { /* a badge is a convenience */ } finally { badge.polling = false; }
|
||||
try { const r = await App.api.get('/messages/inbox', { limit: 1 }); setUnread(r.unread || 0); } catch (e) { /* a badge is a convenience */ } finally { badge.polling = false; if (badge.again) { badge.again = false; pollUnread(); } }
|
||||
}
|
||||
// App.setBadge (main.js) shows it on this screen's nav button, or summed on the "More" button when the screen lives there.
|
||||
function setUnread(n) { badge.n = n; App.state.unreadMsgs = n; App.setBadge('messages', n, 'info'); }
|
||||
setInterval(pollUnread, 60000);
|
||||
document.addEventListener('visibilitychange', () => { if (!document.hidden) pollUnread(); });
|
||||
// WebSocket hint {type:'message'} (ws.js forwards every push through api.emit): the unread count is stale, and so is the list on screen.
|
||||
let shown = false;
|
||||
App.api.on('push', (msg) => {
|
||||
if (!msg || msg.type !== 'message' || !App.state.user) return;
|
||||
pollUnread();
|
||||
if (!shown) return;
|
||||
if (thread) fetchThread(false); else if (tab === 'inbox' || tab === 'alliance') loadFeed(tab);
|
||||
});
|
||||
App.on('session', () => { setUnread(0); for (const k of Object.keys(feeds)) feeds[k] = blank(); blocks = { items: null, err: null }; thread = null; setTimeout(pollUnread, 800); });
|
||||
|
||||
// ------------------------------------------------------------------ loading
|
||||
|
|
@ -314,12 +323,13 @@
|
|||
h('div', { class: 'card-head page-head' }, h('h1', { id: 'soc-msg-h', text: App.t('screen.messages') }),
|
||||
h('div', { class: 'soc-head-actions' },
|
||||
h('button', { class: 'icon-btn', type: 'button', 'aria-label': App.t('common.retry'), onclick: () => { if (thread) fetchThread(false); else if (tab === 'blocked') loadBlocks(); else { feeds[tab] = blank(); loadFeed(tab); } } }, icon('refresh')),
|
||||
h('button', { class: 'btn small primary', type: 'button', onclick: () => openNew() }, icon('pencil'), App.t('soc.msg.new.go')))),
|
||||
h('button', { class: 'btn small primary soc-new-btn', type: 'button', onclick: () => openNew() }, icon('pencil'), App.t('soc.msg.new.go')))),
|
||||
tabsEl, listBox));
|
||||
},
|
||||
onShow(params) {
|
||||
gen++;
|
||||
gen++; shown = true;
|
||||
box.querySelector('#soc-msg-h').textContent = App.t('screen.messages');
|
||||
box.querySelector('.soc-new-btn').lastChild.textContent = App.t('soc.msg.new.go'); // built once in render(): follow a language switch
|
||||
const labels = { inbox: 'soc.msg.tab.inbox', sent: 'soc.msg.tab.sent', alliance: 'soc.msg.tab.alliance', blocked: 'soc.msg.tab.blocked' };
|
||||
for (const b of tabsEl.children) b.querySelector('.soc-tabt').textContent = App.t(labels[b.dataset.tab]);
|
||||
bc = null;
|
||||
|
|
@ -329,6 +339,6 @@
|
|||
startTick();
|
||||
pollUnread();
|
||||
},
|
||||
onHide() { if (offTick) { offTick(); offTick = null; } gen++; },
|
||||
onHide() { shown = false; if (offTick) { offTick(); offTick = null; } gen++; },
|
||||
});
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@
|
|||
if (d.loot && D.RESOURCES.some((x) => d.loot[x])) {
|
||||
out.push(sec(App.t('rep.loot'), mil().resChips(d.loot, true), d.cacheHidden ? h('p', { class: 'row-sub', text: App.t('rep.cache', { p: Math.round(d.cacheHidden * 100) }) }) : null));
|
||||
}
|
||||
if (d.lootLeft && D.RESOURCES.some((x) => d.lootLeft[x])) out.push(sec(App.t('rep.lootLeft'), mil().resChips(d.lootLeft, true), h('p', { class: 'row-sub', text: App.t('rep.lootLeft.why') })));
|
||||
if (d.siege) out.push(sec(App.t('rep.siege'), h('p', { text: App.t('rep.siege.line', { name: App.buildingName(d.siege.type), a: d.siege.from, b: d.siege.to }) })));
|
||||
if (d.takeover) {
|
||||
const t = d.takeover;
|
||||
|
|
@ -212,6 +213,8 @@
|
|||
if (d.site && d.site.type === 'backbone') { // end game landing site: the static defence is the number to beat
|
||||
out.push(sec(App.t('rep.intel'),
|
||||
kv(App.t('rep.power.defence'), h('b', { class: 'mono', text: num(intel.defence) })),
|
||||
Number.isFinite(intel.static) ? kv(App.t('wld.gar.static'), h('span', { class: 'mono', text: num(intel.static) })) : null,
|
||||
intel.garrison && intel.garrison.power > 0 ? kv(App.t('wld.gar.units'), h('span', { text: mil().unitsText(intel.garrison.units) + ' (' + num(intel.garrison.power) + ')' })) : null,
|
||||
kv(App.t('wld.levelShort'), h('b', { class: 'mono', text: App.t('wld.level', { n: intel.level || 0, max: D.ENDGAME.maxLevel }) })),
|
||||
kv(App.t('rep.landing.holder'), h('span', { text: intel.holder ? '[' + intel.holder.tag + '] ' + intel.holder.name : App.t('wld.incumbent') })),
|
||||
intel.build ? kv(App.t('wld.building', { n: intel.build.toLevel }), h('span', { text: mil().dayTime(intel.build.dueAt) })) : null));
|
||||
|
|
@ -272,6 +275,9 @@
|
|||
const p = d.power || {};
|
||||
out.push(sec(App.t('rep.power'), kv(App.t('rep.power.attack'), h('b', { class: 'mono', text: num(p.attack || 0) })), kv(App.t('rep.power.defence'), h('b', { class: 'mono', text: num(p.defence || 0) }))));
|
||||
out.push(sec(App.t('rep.attackerUnits'), unitsTable(d.attacker.units.sent, d.attacker.units.lost, d.attacker.units.survivors)));
|
||||
for (const g of (d.defender && d.defender.garrison) || []) { // the garrison (E6): one table per owner POP
|
||||
out.push(sec(App.t('rep.landing.garrisonOf', { name: g.operator ? g.operator.name : '?' }) + (g.offline ? ' (' + App.t('wld.gar.offline') + ')' : ''), unitsTable(g.sent, g.lost, g.survivors)));
|
||||
}
|
||||
out.push(h('button', { class: 'btn wide', type: 'button', 'data-keep': '', onclick: () => { UI.closeSheet(); App.go('world', Number.isInteger(site.index) ? { site: site.index } : null); } }, icon('b-backbone_node'), App.t('map.info.openWorld')));
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@
|
|||
h('span', { class: 'field-hint', text: App.t('send.siege.hint', { n: D.MILITARY.kitsMin }) })));
|
||||
}
|
||||
if (type === 'takeover') items.push(h('p', { class: 'row-sub wrap', text: App.t('send.takeover.hint') }));
|
||||
if (st.tile.type === 'backbone' && type === 'reinforce') items.push(h('p', { class: 'row-sub wrap', text: App.t('send.landing.reinforce') }));
|
||||
if (st.tile.type === 'backbone' && (type === 'attack' || type === 'scan')) items.push(h('p', { class: 'row-sub wrap', text: App.t('send.landing.hint', { mult: D.ENDGAME.defenceMult }) }));
|
||||
if (type === 'transport' && st.tile.town && !st.tile.town.mine) items.push(h('p', { class: 'row-sub wrap', text: App.t('send.transport.rival') }));
|
||||
if (type === 'raid') items.push(h('p', { class: 'row-sub wrap', text: App.t('send.raid.hint') }));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
const d = e.details || {};
|
||||
if (e.code === 'trade_out_of_range') return App.t('trd.err.range', { d: App.fmt.dec(d.distance || 0), max: d.maxDistance || 0, reach: d.reach || 0 });
|
||||
if (e.code === 'trade_ratio') return App.t('trd.err.ratio', { n: T.ratioMax });
|
||||
if (e.code === 'capacity_exceeded') return App.t('trd.err.cap', { n: D.TRANSPORT.capacityPerLink });
|
||||
if (e.code === 'capacity_exceeded') return App.t('trd.err.cap', { n: R.transportCapacity(speed()) });
|
||||
return App.errMsg(e);
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
const req = (D.BUILDINGS[EXCH].requires || []).map((r) => App.t('trd.need.req', { building: App.buildingName(r.type), level: r.level })).join(' ');
|
||||
return h('section', { class: 'card trd-need' },
|
||||
h('div', { class: 'card-head' }, h('h2', null, icon('b-' + EXCH), App.t('trd.need.title'))),
|
||||
h('p', { class: 'detail-desc', text: App.t('trd.need.body', { n: T.reachPerLevel, cap: D.TRANSPORT.capacityPerLink }) }),
|
||||
h('p', { class: 'detail-desc', text: App.t('trd.need.body', { n: T.reachPerLevel, cap: R.transportCapacity(speed()) }) }),
|
||||
h('p', { class: 'row-sub wrap', text: req }),
|
||||
h('button', { class: 'btn primary wide', type: 'button', onclick: () => App.go('pop') }, icon('pop'), App.t('trd.need.go')));
|
||||
}
|
||||
|
|
@ -253,18 +253,18 @@
|
|||
input.addEventListener('input', () => { F[key] = input.value === '' ? 0 : Math.floor(Number(input.value)) || 0; if (key === 'maxDistance') F.touchedDist = true; refresh(); });
|
||||
return input;
|
||||
};
|
||||
const giveIn = numField('giveAmount', App.t('trd.new.giveAmount'), 1, D.TRANSPORT.capacityPerLink);
|
||||
const wantIn = numField('wantAmount', App.t('trd.new.wantAmount'), 1, D.TRANSPORT.capacityPerLink);
|
||||
const giveIn = numField('giveAmount', App.t('trd.new.giveAmount'), 1, R.transportCapacity(speed()));
|
||||
const wantIn = numField('wantAmount', App.t('trd.new.wantAmount'), 1, R.transportCapacity(speed()));
|
||||
const distIn = numField('maxDistance', App.t('trd.new.maxDist'), 1, T.maxDistance);
|
||||
const maxBtn = h('button', { class: 'btn small', type: 'button', onclick: () => { const have = rec ? Math.floor(stock(rec)[F.giveRes]) : 0; F.giveAmount = Math.max(1, Math.min(D.TRANSPORT.capacityPerLink, have)); giveIn.value = String(F.giveAmount); refresh(); } }, App.t('send.all'));
|
||||
const maxBtn = h('button', { class: 'btn small', type: 'button', onclick: () => { const have = rec ? Math.floor(stock(rec)[F.giveRes]) : 0; F.giveAmount = Math.max(1, Math.min(R.transportCapacity(speed()), have)); giveIn.value = String(F.giveAmount); refresh(); } }, App.t('send.all'));
|
||||
const matchBtn = h('button', { class: 'btn small', type: 'button', onclick: () => { F.wantAmount = F.giveAmount; wantIn.value = String(F.wantAmount); refresh(); } }, App.t('trd.new.match'));
|
||||
|
||||
function validate() {
|
||||
const out = [];
|
||||
const chk = R.tradeTermsCheck({ giveRes: F.giveRes, giveAmount: F.giveAmount, wantRes: F.wantRes, wantAmount: F.wantAmount, maxDistance: F.maxDistance });
|
||||
const chk = R.tradeTermsCheck({ giveRes: F.giveRes, giveAmount: F.giveAmount, wantRes: F.wantRes, wantAmount: F.wantAmount, maxDistance: F.maxDistance }, speed());
|
||||
if (!chk.ok) {
|
||||
if (chk.code === 'trade_ratio') out.push(App.t('trd.err.ratio', { n: T.ratioMax }));
|
||||
else if (chk.code === 'capacity_exceeded') out.push(App.t('trd.err.cap', { n: D.TRANSPORT.capacityPerLink }));
|
||||
else if (chk.code === 'capacity_exceeded') out.push(App.t('trd.err.cap', { n: R.transportCapacity(speed()) }));
|
||||
else out.push(App.t('trd.v.' + ((chk.errors && chk.errors[0] && chk.errors[0].path) || 'terms')));
|
||||
}
|
||||
if (rec) {
|
||||
|
|
@ -282,14 +282,14 @@
|
|||
for (const p of problems) msgs.appendChild(h('p', { class: 'reason', text: p }));
|
||||
submit.disabled = problems.length > 0 || !rec;
|
||||
if (F.giveAmount >= 1) {
|
||||
const lo = Math.max(1, Math.ceil(F.giveAmount / T.ratioMax)), hi = Math.min(D.TRANSPORT.capacityPerLink, F.giveAmount * T.ratioMax);
|
||||
const lo = Math.max(1, Math.ceil(F.giveAmount / T.ratioMax)), hi = Math.min(R.transportCapacity(speed()), F.giveAmount * T.ratioMax);
|
||||
bandEl.textContent = App.t('trd.new.band', { lo: num(lo), hi: num(hi) });
|
||||
} else bandEl.textContent = '';
|
||||
stockEl.textContent = rec ? App.t('trd.have', { n: num(stock(rec)[F.giveRes]), res: App.resName(F.giveRes) }) : '';
|
||||
clear(note);
|
||||
const need = Math.max(1, Math.ceil((F.maxDistance || 1) / T.reachPerLevel));
|
||||
note.appendChild(h('p', { class: 'row-sub wrap', text: App.t('trd.new.level', { lv, reach, need, d: F.maxDistance || 0 }) }));
|
||||
note.appendChild(h('p', { class: 'row-sub wrap', text: App.t('trd.new.rules', { cap: D.TRANSPORT.capacityPerLink, n: T.ratioMax, ttl: App.fmt.dur(T.ttlHours * D.HOUR_MS / speed()) }) }));
|
||||
note.appendChild(h('p', { class: 'row-sub wrap', text: App.t('trd.new.rules', { cap: R.transportCapacity(speed()), n: T.ratioMax, ttl: App.fmt.dur(T.ttlHours * D.HOUR_MS / speed()) }) }));
|
||||
if (rec) { const ls = linkState(rec); note.appendChild(h('p', { class: 'row-sub wrap', text: App.t('trd.new.links', { free: ls.free, links: ls.links }) })); }
|
||||
}
|
||||
|
||||
|
|
@ -396,7 +396,7 @@
|
|||
const lookup = () => { if (xin.value === '' || yin.value === '') return; open(Math.round(Number(xin.value)), Math.round(Number(yin.value))); };
|
||||
into.appendChild(h('section', { class: 'card' },
|
||||
h('div', { class: 'card-head' }, h('h2', null, icon('box'), App.t('trd.send.head'))),
|
||||
h('p', { class: 'detail-desc', text: App.t('trd.send.body', { n: D.TRANSPORT.capacityPerLink }) }),
|
||||
h('p', { class: 'detail-desc', text: App.t('trd.send.body', { n: R.transportCapacity(speed()) }) }),
|
||||
S.levels.length > 1 ? h('label', { class: 'field' }, h('span', { class: 'field-lbl', text: App.t('send.from') }),
|
||||
sel(S.levels.map((l) => ({ value: l.townId, text: townName(l.townId) })), sd.fromId, (v) => { sd.fromId = Number(v); }, App.t('send.from'))) : h('p', { class: 'row-sub', text: App.t('send.from') + ': ' + townName(sd.fromId) }),
|
||||
h('h3', { class: 'sub', text: App.t('trd.send.own') }),
|
||||
|
|
|
|||
|
|
@ -97,6 +97,14 @@
|
|||
h('button', { class: 'btn small', type: 'button', onclick: (ev) => withdraw(g.hostTownId, td().id, ev.currentTarget) }, icon('return'), App.t('units.callBack'))),
|
||||
h('p', { class: 'row-sub wrap', text: mil().unitsText(g.units) }))))));
|
||||
}
|
||||
const gar = m.units.garrisoned || [];
|
||||
if (gar.length) { // standing in a landing site: they still draw this POP's power
|
||||
out.push(h('section', { class: 'card' },
|
||||
h('div', { class: 'card-head' }, h('h2', null, icon('flag'), App.t('units.garrisoned'))),
|
||||
h('ul', { class: 'mil-list' }, gar.map((g) => h('li', { class: 'mil-group' },
|
||||
h('div', { class: 'row' }, h('span', null, h('b', { text: App.t('units.garrisoned.site', { x: g.x, y: g.y }) }))),
|
||||
h('p', { class: 'row-sub wrap', text: mil().unitsText(g.units) }))))));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@
|
|||
kids.push(h('div', { class: 'wld-building' }, h('span', { class: 'row-sub wrap' }, App.t('wld.building', { n: s.build.toLevel }) + ' ', cd(s.build.dueAt)), b));
|
||||
}
|
||||
if (s.holder && s.id) kids.push(h('div', { class: 'row-sub wrap' }, App.t('wld.stock') + ' ', mil().resChips(s.pool)));
|
||||
if (s.shieldUntil && s.shieldUntil > now && !ended) kids.push(h('div', { class: 'row-sub wrap' }, h('span', { class: 'pill amber' }, icon('shield'), App.t('wld.shield', { t: mil().dayTime(s.shieldUntil) }))));
|
||||
const acts = [];
|
||||
if (kind === 'mine' && s.id) acts.push(h('button', { class: 'btn small primary', type: 'button', disabled: ended, onclick: () => openManage(s) }, icon('up'), App.t('wld.manage')));
|
||||
if (kind !== 'mine' && App.openSend && App.state.towns.length) acts.push(h('button', { class: 'btn small primary', type: 'button', disabled: ended, onclick: () => App.openSend({ x: s.x, y: s.y }) }, icon('target'), App.t('wld.attack')));
|
||||
|
|
@ -308,6 +309,35 @@
|
|||
sec.appendChild(btn);
|
||||
body.appendChild(sec);
|
||||
|
||||
// ---- garrison: what defends the site on top of its static part (units of the holders' POPs); call your own home, station more
|
||||
const gv = E.garrisonView(data);
|
||||
const gar = h('section', { class: 'wld-sec' }, h('h3', { class: 'sub', text: App.t('wld.gar.head') }));
|
||||
const garErr = h('p', { class: 'form-error', role: 'alert', hidden: true });
|
||||
gar.appendChild(h('div', null,
|
||||
kv(App.t('wld.gar.static'), h('b', { class: 'mono', text: num(gv.static) })),
|
||||
kv(App.t('wld.gar.units'), h('b', { class: 'mono', text: num(gv.garrison) })),
|
||||
kv(App.t('wld.gar.total'), h('b', { class: 'mono', text: num(gv.total) }))));
|
||||
if (!gv.rows.length) gar.appendChild(h('p', { class: 'row-sub wrap', text: App.t('wld.gar.empty') }));
|
||||
else {
|
||||
gar.appendChild(h('ul', { class: 'mil-list' }, gv.rows.map((r) => h('li', { class: 'mil-row' },
|
||||
h('span', { class: 'row-main' },
|
||||
h('b', { text: r.name + (r.mine ? ' · ' + App.t('wld.gar.mine') : '') }),
|
||||
h('span', { class: 'row-sub wrap', text: [r.townName, mil().unitsText(r.units), r.online ? App.t('wld.gar.share', { p: Math.round(r.share * 100) }) : App.t('wld.gar.offline')].filter(Boolean).join(' · ') })),
|
||||
r.mine ? h('button', { class: 'btn small', type: 'button', disabled: App.worldEnded(), onclick: async (ev) => {
|
||||
const b = ev.currentTarget; b.disabled = true; garErr.hidden = true;
|
||||
try {
|
||||
await App.api.post('/backbone/' + s.id + '/withdraw', { fromTownId: r.ownerTownId }, { intent: 'bb-wd:' + s.id + ':' + r.ownerTownId + ':' + nonce() });
|
||||
toast(App.t('wld.gar.withdrawn'), 'ok');
|
||||
App.refreshTown().catch(() => {}); App.refreshMovements().catch(() => {});
|
||||
await load();
|
||||
} catch (e) { garErr.textContent = App.errMsg(e); garErr.hidden = false; b.disabled = false; load(); }
|
||||
} }, icon('return'), App.t('wld.gar.withdraw')) : null))));
|
||||
}
|
||||
gar.appendChild(garErr);
|
||||
gar.appendChild(h('p', { class: 'row-sub wrap', text: App.t('wld.gar.hint') }));
|
||||
if (you.canReinforce && App.openSend && App.state.towns.length) gar.appendChild(h('button', { class: 'btn wide', type: 'button', disabled: App.worldEnded(), onclick: () => App.openSend({ x: s.x, y: s.y, type: 'reinforce' }) }, icon('shield'), App.t('wld.gar.station')));
|
||||
body.appendChild(gar);
|
||||
|
||||
// ---- ship resources
|
||||
const ship = h('section', { class: 'wld-sec' }, h('h3', { class: 'sub', text: App.t('wld.ship.head') }));
|
||||
const cur = pops.find((q) => q.id === sh.fromId);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
'alerts.trade_expired': 'An offer of yours expired',
|
||||
'alerts.trade_expired.back': '{what} is back in {town}',
|
||||
'alerts.trade_void': 'An offer was voided: the POP changed hands',
|
||||
'alerts.trade_refund_clipped': 'A refund did not fit: {what} was lost',
|
||||
'alerts.trade_refund_clipped.why': 'The Rack hall of {town} was too small for the rest of the escrow',
|
||||
// end game
|
||||
'alerts.backbone_open': 'The backbone landing sites are open',
|
||||
'alerts.backbone_open.n': '{n} landing sites are up for grabs. Scan one, then take it.',
|
||||
|
|
@ -20,6 +22,7 @@
|
|||
'alerts.backbone_taken.from': 'from {tag}', 'alerts.backbone_taken.incumbent': 'from the incumbent',
|
||||
'alerts.backbone_lost': 'Landing site {n} was taken by {tag}',
|
||||
'alerts.backbone_level': 'Backbone node on site {n} reached level {level}',
|
||||
'alerts.backbone_incoming': 'Something is on its way to your landing site {n}', 'alerts.backbone_incoming.at': 'arrives {time}',
|
||||
'alerts.backbone_delivered': 'Your shipment reached the landing site',
|
||||
'alerts.backbone_ship_bounced': 'A shipment was turned back: the site changed hands',
|
||||
'alerts.backbone_won': '{name} completed the Backbone',
|
||||
|
|
@ -51,12 +54,15 @@
|
|||
'alerts.trade_expired': 'Et tilbud fra deg gikk ut',
|
||||
'alerts.trade_expired.back': '{what} er tilbake i {town}',
|
||||
'alerts.trade_void': 'Et tilbud ble ugyldig: POP-en skiftet eier',
|
||||
'alerts.trade_refund_clipped': 'En refusjon fikk ikke plass: {what} gikk tapt',
|
||||
'alerts.trade_refund_clipped.why': 'Rack-hallen i {town} var for liten til resten av depositumet',
|
||||
'alerts.backbone_open': 'Ryggradens landingspunkter er åpne',
|
||||
'alerts.backbone_open.n': '{n} landingspunkter kan tas. Skann ett, og ta det.',
|
||||
'alerts.backbone_taken': 'Alliansen din tok landingspunkt {n}',
|
||||
'alerts.backbone_taken.from': 'fra {tag}', 'alerts.backbone_taken.incumbent': 'fra inkumbenten',
|
||||
'alerts.backbone_lost': 'Landingspunkt {n} ble tatt av {tag}',
|
||||
'alerts.backbone_level': 'Ryggradsnoden på punkt {n} nådde nivå {level}',
|
||||
'alerts.backbone_incoming': 'Noe er på vei mot landingspunkt {n} som du holder', 'alerts.backbone_incoming.at': 'kommer {time}',
|
||||
'alerts.backbone_delivered': 'Forsendelsen din nådde landingspunktet',
|
||||
'alerts.backbone_ship_bounced': 'En forsendelse ble snudd: punktet skiftet eier',
|
||||
'alerts.backbone_won': '{name} fullførte Ryggraden',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
'units.offline.title': 'Units offline', 'units.offline.body': 'The battery is empty, so your units are switched off and cannot be sent. Add power (Substation) or get rid of draw.',
|
||||
'units.offline.decom': 'Units are decommissioned in',
|
||||
'units.home': 'At home', 'units.home.empty': 'No units here yet. Train some below.',
|
||||
'units.hosted': 'Reinforcements here', 'units.away': 'Your units elsewhere',
|
||||
'units.garrisoned': 'In landing sites (they still draw this POP\'s power)', 'units.garrisoned.site': 'Landing site at {x}, {y}', 'units.hosted': 'Reinforcements here', 'units.away': 'Your units elsewhere',
|
||||
'units.sendHome': 'Send home', 'units.callBack': 'Call back', 'units.withdrawn': 'On their way home.',
|
||||
'units.training': 'Training', 'units.training.empty': 'Nothing in training.', 'units.train': 'Train units',
|
||||
'units.needs': 'Needs', 'units.perUnit': '{t} each', 'units.count': 'Number of units', 'units.max': 'As many as I can afford',
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
'rep.failed.title': '{type} failed', 'rep.failed.home': 'Units and cargo are on their way home.',
|
||||
'rep.reason.invalid_target': 'The target is no longer valid.', 'rep.reason.not_allied': 'The target is no longer an ally.', 'rep.reason.own_town': 'The POP changed hands and is yours now.',
|
||||
'rep.reason.pact': 'A pact with the target now prevents this.', 'rep.reason.protected': 'The target is under beginner protection.', 'rep.reason.target_gone': 'The target is gone.',
|
||||
'rep.reason.out_of_range': 'The site is out of range.', 'rep.reason.footprint_too_low': 'Your footprint was too low.',
|
||||
'rep.reason.site_shielded': 'The site had just changed hands and is protected for a while.', 'rep.reason.not_holder': 'Your alliance no longer holds the site, so the units could not join its garrison.', 'rep.reason.out_of_range': 'The site is out of range.', 'rep.reason.footprint_too_low': 'Your footprint was too low.',
|
||||
'rep.role.attacker': 'You attacked', 'rep.role.defender': 'You were attacked', 'rep.role.reinforcer': 'Your reinforcements were there', 'rep.role.sender': 'You sent', 'rep.role.target': 'You were the target',
|
||||
'rep.expires': 'kept until {t}', 'rep.arrived': 'Arrived {t}',
|
||||
'rep.attacker': 'Attacker', 'rep.defender': 'Defender', 'rep.target': 'Target', 'rep.from': 'From', 'rep.host': 'Host', 'rep.site': 'Site', 'rep.scannedBy': 'Scanned by',
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
'rep.attackerUnits': 'Attacking units', 'rep.defenderUnits': 'Defending units', 'rep.units': 'Units', 'rep.scanners': 'Scanners',
|
||||
'rep.sent': 'Sent', 'rep.lost': 'Lost', 'rep.left': 'Left', 'rep.noUnits': 'No units.',
|
||||
'rep.group.home': 'Home defence', 'rep.group.reinf': 'Reinforcements from {town}', 'rep.group.offline': 'offline, no defence',
|
||||
'rep.loot': 'Loot', 'rep.cache': '{p}% of the stock was hidden in the Rack hall.', 'rep.siege': 'Siege', 'rep.siege.line': '{name} damaged: level {a} → {b}',
|
||||
'rep.loot': 'Loot', 'rep.lootLeft': 'Left behind', 'rep.lootLeft.why': 'The raiders could carry this, but their home Rack hall had no room for it when they would be back. It stayed with the target.', 'rep.cache': '{p}% of the stock was hidden in the Rack hall.', 'rep.siege': 'Siege', 'rep.siege.line': '{name} damaged: level {a} → {b}',
|
||||
'rep.takeover': 'Takeover', 'rep.takeover.loyalty': 'Customer loyalty', 'rep.takeover.capital': 'A capital cannot change hands, it can only be drained.', 'rep.takeover.captured': 'The POP is now under new ownership.',
|
||||
'rep.takeover.blocked.last_pop': 'The target\'s last POP cannot be taken.', 'rep.takeover.blocked.footprint': 'Your footprint is too low to hold another POP.',
|
||||
'rep.intel': 'Intel', 'rep.intel.resources': 'Resources in stock', 'rep.intel.units': 'Units', 'rep.intel.offline': 'Their units are offline.', 'rep.intel.buildings': 'Buildings', 'rep.intel.outgoing': 'Their movements',
|
||||
|
|
@ -110,10 +110,12 @@
|
|||
// ---- notification feed
|
||||
'alerts.incoming': 'Incoming movement', 'alerts.incoming.at': 'Heading for {town}, arrives {time}',
|
||||
'alerts.report': 'New report: {type}', 'alerts.train_done': '{n} × {unit} trained', 'alerts.research_done': '{unit}: {stat} level {level} researched',
|
||||
'alerts.movement_returned': 'Units are home', 'alerts.movement_lost': 'A movement lost its way home',
|
||||
'alerts.cargo_lost': 'LOST, the Rack hall was full: {what}', 'alerts.movement_returned': 'Units are home', 'alerts.movement_lost': 'A movement lost its way home',
|
||||
'alerts.transport_arrived': 'Cargo arrived at {town}', 'alerts.transport_delivered': 'Your cargo was delivered',
|
||||
'alerts.units_offline': 'Units went offline: battery empty', 'alerts.units_decommissioned': 'Units decommissioned after too long without power',
|
||||
'alerts.town_lost': '{name} was taken over', 'alerts.town_lost.by': 'By {name}', 'alerts.town_gained': '{name} is now yours', 'alerts.reinforcements_home': 'Reinforcements sent home',
|
||||
'alerts.garrison_arrived': 'Your units joined the garrison of landing site {n}', 'alerts.garrison_released': 'Your units left landing site {n} and are on their way home',
|
||||
'alerts.garrison_released.alliance_dissolved': 'The alliance was disbanded', 'alerts.garrison_released.left_alliance': 'You are no longer in the alliance that holds it', 'alerts.garrison_released.town_lost': 'The POP they belong to was taken over', 'alerts.garrison_released.other': 'Called home',
|
||||
|
||||
// ---- expansion
|
||||
'exp.title': 'Expansion', 'exp.count': '{n} POPs', 'exp.crews': 'Rollout crews at home', 'exp.footprint': 'Footprint (this POP / needed in total)', 'exp.footprint.v': '{have} / {need}',
|
||||
|
|
@ -159,7 +161,7 @@
|
|||
'units.offline.title': 'Enheter offline', 'units.offline.body': 'Batteriet er tomt, så enhetene er slått av og kan ikke sendes. Legg til strøm (Transformatorstasjon) eller kutt trekk.',
|
||||
'units.offline.decom': 'Enhetene avvikles om',
|
||||
'units.home': 'Hjemme', 'units.home.empty': 'Ingen enheter her ennå. Tren noen under.',
|
||||
'units.hosted': 'Forsterkninger her', 'units.away': 'Dine enheter andre steder',
|
||||
'units.garrisoned': 'I landingspunkter (de trekker fortsatt strøm fra denne POP-en)', 'units.garrisoned.site': 'Landingspunkt ved {x}, {y}', 'units.hosted': 'Forsterkninger her', 'units.away': 'Dine enheter andre steder',
|
||||
'units.sendHome': 'Send hjem', 'units.callBack': 'Kall tilbake', 'units.withdrawn': 'På vei hjem.',
|
||||
'units.training': 'Trening', 'units.training.empty': 'Ingenting under trening.', 'units.train': 'Tren enheter',
|
||||
'units.needs': 'Krever', 'units.perUnit': '{t} per stk.', 'units.count': 'Antall enheter', 'units.max': 'Så mange jeg har råd til',
|
||||
|
|
@ -214,7 +216,7 @@
|
|||
'rep.failed.title': '{type} mislyktes', 'rep.failed.home': 'Enheter og last er på vei hjem.',
|
||||
'rep.reason.invalid_target': 'Målet er ikke gyldig lenger.', 'rep.reason.not_allied': 'Målet er ikke lenger alliert.', 'rep.reason.own_town': 'POP-en skiftet eier og er din nå.',
|
||||
'rep.reason.pact': 'En avtale med målet hindrer dette nå.', 'rep.reason.protected': 'Målet har nybegynnerbeskyttelse.', 'rep.reason.target_gone': 'Målet finnes ikke lenger.',
|
||||
'rep.reason.out_of_range': 'Stedet er utenfor rekkevidde.', 'rep.reason.footprint_too_low': 'Fotavtrykket ditt var for lavt.',
|
||||
'rep.reason.site_shielded': 'Punktet hadde nettopp skiftet eier og er beskyttet en stund.', 'rep.reason.not_holder': 'Alliansen din holder ikke punktet lenger, så enhetene kunne ikke bli med i garnisonen.', 'rep.reason.out_of_range': 'Stedet er utenfor rekkevidde.', 'rep.reason.footprint_too_low': 'Fotavtrykket ditt var for lavt.',
|
||||
'rep.role.attacker': 'Du angrep', 'rep.role.defender': 'Du ble angrepet', 'rep.role.reinforcer': 'Forsterkningene dine var der', 'rep.role.sender': 'Du sendte', 'rep.role.target': 'Du var målet',
|
||||
'rep.expires': 'lagres til {t}', 'rep.arrived': 'Ankom {t}',
|
||||
'rep.attacker': 'Angriper', 'rep.defender': 'Forsvarer', 'rep.target': 'Mål', 'rep.from': 'Fra', 'rep.host': 'Vert', 'rep.site': 'Sted', 'rep.scannedBy': 'Skannet av',
|
||||
|
|
@ -222,17 +224,19 @@
|
|||
'rep.attackerUnits': 'Angripende enheter', 'rep.defenderUnits': 'Forsvarende enheter', 'rep.units': 'Enheter', 'rep.scanners': 'Skannere',
|
||||
'rep.sent': 'Sendt', 'rep.lost': 'Tapt', 'rep.left': 'Igjen', 'rep.noUnits': 'Ingen enheter.',
|
||||
'rep.group.home': 'Hjemmeforsvar', 'rep.group.reinf': 'Forsterkninger fra {town}', 'rep.group.offline': 'offline, uten forsvar',
|
||||
'rep.loot': 'Bytte', 'rep.cache': '{p} % av lageret var skjult i Racksalen.', 'rep.siege': 'Beleiring', 'rep.siege.line': '{name} skadet: nivå {a} → {b}',
|
||||
'rep.loot': 'Bytte', 'rep.lootLeft': 'Latt igjen', 'rep.lootLeft.why': 'Raiderne kunne ha båret dette, men Racksalen hjemme hadde ikke plass da de var tilbake. Det ble hos målet.', 'rep.cache': '{p} % av lageret var skjult i Racksalen.', 'rep.siege': 'Beleiring', 'rep.siege.line': '{name} skadet: nivå {a} → {b}',
|
||||
'rep.takeover': 'Oppkjøp', 'rep.takeover.loyalty': 'Kundelojalitet', 'rep.takeover.capital': 'En hovedstad kan ikke skifte eier, bare tappes.', 'rep.takeover.captured': 'POP-en har nå ny eier.',
|
||||
'rep.takeover.blocked.last_pop': 'Målets siste POP kan ikke tas.', 'rep.takeover.blocked.footprint': 'Fotavtrykket ditt er for lavt til å holde enda en POP.',
|
||||
'rep.intel': 'Etterretning', 'rep.intel.resources': 'Ressurser på lager', 'rep.intel.units': 'Enheter', 'rep.intel.offline': 'Enhetene deres er offline.', 'rep.intel.buildings': 'Bygninger', 'rep.intel.outgoing': 'Bevegelsene deres',
|
||||
|
||||
'alerts.incoming': 'Innkommende bevegelse', 'alerts.incoming.at': 'På vei mot {town}, ankommer {time}',
|
||||
'alerts.report': 'Ny rapport: {type}', 'alerts.train_done': '{n} × {unit} ferdig trent', 'alerts.research_done': '{unit}: {stat} nivå {level} ferdig forsket',
|
||||
'alerts.movement_returned': 'Enhetene er hjemme', 'alerts.movement_lost': 'En bevegelse fant ikke veien hjem',
|
||||
'alerts.cargo_lost': 'GIKK TAPT, Rack-hallen var full: {what}', 'alerts.movement_returned': 'Enhetene er hjemme', 'alerts.movement_lost': 'En bevegelse fant ikke veien hjem',
|
||||
'alerts.transport_arrived': 'Last kom frem til {town}', 'alerts.transport_delivered': 'Lasten din er levert',
|
||||
'alerts.units_offline': 'Enheter gikk offline: tomt batteri', 'alerts.units_decommissioned': 'Enheter avviklet etter for lenge uten strøm',
|
||||
'alerts.town_lost': '{name} ble overtatt', 'alerts.town_lost.by': 'Av {name}', 'alerts.town_gained': '{name} er nå din', 'alerts.reinforcements_home': 'Forsterkninger sendt hjem',
|
||||
'alerts.garrison_arrived': 'Enhetene dine ble med i garnisonen på landingspunkt {n}', 'alerts.garrison_released': 'Enhetene dine forlot landingspunkt {n} og er på vei hjem',
|
||||
'alerts.garrison_released.alliance_dissolved': 'Alliansen ble oppløst', 'alerts.garrison_released.left_alliance': 'Du er ikke lenger i alliansen som holder det', 'alerts.garrison_released.town_lost': 'POP-en de hører til ble overtatt', 'alerts.garrison_released.other': 'Kalt hjem',
|
||||
|
||||
'exp.title': 'Ekspansjon', 'exp.count': '{n} POP-er', 'exp.crews': 'Utrullingslag hjemme', 'exp.footprint': 'Fotavtrykk (denne POP-en / kreves totalt)', 'exp.footprint.v': '{have} / {need}',
|
||||
'exp.range': 'Rekkevidde fra dine POP-er', 'exp.hint': 'Tre utrullingslag etablerer en POP på tomt land. En ny POP krever også nok totalt fotavtrykk.',
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
'trd.new.match': 'Match', 'trd.new.band': 'Fair range for what you ask: {lo} to {hi}.',
|
||||
'trd.new.maxDist': 'Max distance (tiles)', 'trd.new.maxDistHint': 'Only POPs this close can take it. 1 to {max}.',
|
||||
'trd.new.level': 'Posting needs an Internet exchange of level 1 or higher: this POP has level {lv} (reach {reach} tiles). A taker needs level {need} to trade across {d} tiles.',
|
||||
'trd.new.rules': 'Each side fits one transport link, at most {cap}, and the two amounts may differ by at most 1:{n}. What you give is held in escrow and one link is reserved until somebody takes the offer, you cancel it, or it expires after {ttl}.',
|
||||
'trd.new.rules': 'Each side fits one transport link, at most {cap}, and the two amounts may differ by at most 1:{n}. What you give is held in escrow and one link is reserved until somebody takes the offer, you cancel it, or it expires after {ttl}. The goods keep their room in your Rack hall meanwhile (that store stops filling by that amount below the hall size), so they always fit back.',
|
||||
'trd.new.links': 'Free transport links here: {free} of {links}.', 'trd.new.go': 'Post offer', 'trd.new.done': 'Offer posted. The goods wait in escrow.',
|
||||
'trd.v.giveRes': 'Pick a resource to give.', 'trd.v.wantRes': 'Give and want must be different resources.', 'trd.v.giveAmount': 'Give at least 1.',
|
||||
'trd.v.wantAmount': 'Ask for at least 1.', 'trd.v.maxDistance': 'Max distance must be a whole number of tiles.', 'trd.v.terms': 'Check the terms.',
|
||||
|
|
@ -51,6 +51,7 @@
|
|||
'trd.err.range': 'That POP is {d} tiles away. The offer reaches {max} tiles and your exchange reaches {reach}.',
|
||||
'trd.err.ratio': 'The two amounts may differ by at most 1:{n}.', 'trd.err.cap': 'Each side must fit one transport link: at most {n}.',
|
||||
'err.trade_ratio': 'The two amounts may differ by at most 1:2.', 'err.offer_closed': 'That offer is not open any more.', 'err.own_offer': 'You cannot take your own offer.',
|
||||
'err.no_room_for_goods': 'Your Rack hall will not have room for those goods when they arrive: spend some stock or raise the hall first.',
|
||||
'err.trade_out_of_range': 'That POP is too far from the offer: its max distance or your exchange reach is exceeded.',
|
||||
},
|
||||
nb: {
|
||||
|
|
@ -81,7 +82,7 @@
|
|||
'trd.new.match': 'Likt', 'trd.new.band': 'Rimelig område for det du ber om: {lo} til {hi}.',
|
||||
'trd.new.maxDist': 'Maks avstand (felt)', 'trd.new.maxDistHint': 'Bare POP-er så nær kan ta det. 1 til {max}.',
|
||||
'trd.new.level': 'Å legge ut krever et Internettknutepunkt på nivå 1 eller høyere: denne POP-en har nivå {lv} (rekkevidde {reach} felt). Den som tar det trenger nivå {need} for å handle over {d} felt.',
|
||||
'trd.new.rules': 'Hver side må rommes av én transportlenke, maks {cap}, og de to mengdene kan avvike med høyst 1:{n}. Det du gir holdes i depot og én lenke reserveres til noen tar tilbudet, du trekker det, eller det utløper etter {ttl}.',
|
||||
'trd.new.rules': 'Hver side må rommes av én transportlenke, maks {cap}, og de to mengdene kan avvike med høyst 1:{n}. Det du gir holdes i depot og én lenke reserveres til noen tar tilbudet, du trekker det, eller det utløper etter {ttl}. Varene beholder plassen sin i Racksalen i mellomtiden (lageret slutter å fylles så mye under salens størrelse), så de får alltid plass igjen.',
|
||||
'trd.new.links': 'Ledige transportlenker her: {free} av {links}.', 'trd.new.go': 'Legg ut tilbud', 'trd.new.done': 'Tilbudet er lagt ut. Varene venter i depot.',
|
||||
'trd.v.giveRes': 'Velg en ressurs å gi.', 'trd.v.wantRes': 'Du må gi og ønske ulike ressurser.', 'trd.v.giveAmount': 'Gi minst 1.',
|
||||
'trd.v.wantAmount': 'Be om minst 1.', 'trd.v.maxDistance': 'Maks avstand må være et helt antall felt.', 'trd.v.terms': 'Sjekk vilkårene.',
|
||||
|
|
@ -99,6 +100,7 @@
|
|||
'trd.err.range': 'Den POP-en er {d} felt unna. Tilbudet rekker {max} felt og knutepunktet ditt rekker {reach}.',
|
||||
'trd.err.ratio': 'De to mengdene kan avvike med høyst 1:{n}.', 'trd.err.cap': 'Hver side må rommes av én transportlenke: høyst {n}.',
|
||||
'err.trade_ratio': 'De to mengdene kan avvike med høyst 1:2.', 'err.offer_closed': 'Det tilbudet er ikke åpent lenger.', 'err.own_offer': 'Du kan ikke ta ditt eget tilbud.',
|
||||
'err.no_room_for_goods': 'Rack-hallen din får ikke plass til varene når de kommer: bruk noe av lageret eller bygg ut hallen først.',
|
||||
'err.trade_out_of_range': 'Den POP-en er for langt unna tilbudet: maks avstand eller knutepunktets rekkevidde er overskredet.',
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -33,12 +33,18 @@
|
|||
'wld.ship.head': 'Ship resources', 'wld.ship.no': 'Only members of the holding alliance can ship.', 'wld.ship.go': 'Ship', 'wld.ship.cargo': 'Cargo',
|
||||
'wld.ship.hint': 'A shipment is a transport: up to {n} per link. It lands in the stockpile, or rides home if the site has changed hands on the way.',
|
||||
'wld.ship.done': 'Shipment on its way.', 'wld.ledger': 'Who shipped what',
|
||||
'wld.gar.head': 'Garrison', 'wld.gar.static': 'Static defence', 'wld.gar.units': 'Stationed units', 'wld.gar.total': 'Whole defence', 'wld.gar.empty': 'Nobody has stationed units here. A held site is only as strong as its garrison.',
|
||||
'wld.gar.hint': 'Members of the alliance can station units here (Station units). They defend together with the static part, draw power from the POP they come from, and a lost wave only kills part of them. A won attack wipes them all.',
|
||||
'wld.gar.station': 'Station units', 'wld.gar.withdraw': 'Call home', 'wld.gar.withdrawn': 'Units on their way home.', 'wld.gar.offline': 'offline (no power at home)', 'wld.gar.mine': 'yours', 'wld.gar.share': '{p}% of the defence',
|
||||
'wld.results': 'Final standings', 'wld.rank.operators': 'Operators', 'wld.rank.alliances': 'Alliances', 'wld.rank.attackers': 'Attackers', 'wld.rank.defenders': 'Defenders',
|
||||
'wld.rank.empty': 'Nobody on this list.', 'wld.rank.totals': '{o} operators in {a} alliances',
|
||||
|
||||
'tile.backbone': 'Backbone landing site', 'map.legend.backbone': 'Landing site', 'map.info.openWorld': 'Backbone race',
|
||||
'map.info.backbone': 'A backbone landing site. The first alliance to build the node here to level {max} wins the world.',
|
||||
'send.landing.hint': 'A landing site has no garrison: only its static defence counts (a scan shows the number, about {mult} times an incumbent site). Winning makes your alliance the holder.',
|
||||
'send.landing.hint': 'A landing site is defended by its static defence (a scan shows the number: about {mult} times an incumbent site while nobody holds it, much less once an alliance does) plus the garrison its holders have stationed there. A lost wave only kills part of the garrison, so the next one faces less. Winning wipes the garrison and makes your alliance the holder.',
|
||||
'send.landing.reinforce': 'Units you station here defend the site together with the other members\' garrison and keep drawing power from the POP they come from. Only members of the holding alliance can. You can call them home at any time from the site sheet; they leave automatically if you leave the alliance.',
|
||||
'send.invalid.site_shielded': 'The site changed hands recently and cannot be attacked yet (see the site card).', 'wld.shield': 'Protected until {t}',
|
||||
'send.invalid.not_holder': 'Only members of the alliance that holds the site can station units there.',
|
||||
'send.transport.rival': 'This is a POP you do not own: the cargo is a gift, and its owner sees an incoming movement until it lands. For a trade use the Internet exchange.',
|
||||
'send.reason.no_alliance': 'only alliance members can attack a landing site', 'send.reason.own_site': 'your alliance already holds this site',
|
||||
'send.invalid.no_alliance': 'Join an alliance first.', 'send.invalid.own_site': 'Your alliance holds that site.',
|
||||
|
|
@ -48,6 +54,7 @@
|
|||
'report.type.landing': 'Landing site attack',
|
||||
'rep.vs': '{a} vs {d}', 'rep.by': 'By {name}', 'rep.attackerWon': 'Attacker won', 'rep.defenderWon': 'Defender won',
|
||||
'rep.landing.title': 'Landing site {n}', 'rep.landing.taken': 'Site taken', 'rep.landing.held': 'Site held', 'rep.landing.holder': 'Holder',
|
||||
'rep.landing.garrisonOf': 'Garrison of {name}',
|
||||
'rep.landing.takenLine': '{tag} took the site.', 'rep.landing.heldLine': 'The defence held. The site did not change hands.',
|
||||
'rep.tab.mine': 'My reports', 'rep.tab.alliance': 'Alliance', 'rep.sharedBy': 'shared by {name}',
|
||||
'rep.folder.none': 'Join an alliance to use the shared folder.', 'rep.folder.empty': 'Nothing shared yet. Open a report and share it with the alliance.',
|
||||
|
|
@ -86,12 +93,18 @@
|
|||
'wld.ship.head': 'Send ressurser', 'wld.ship.no': 'Bare medlemmer av eieralliansen kan sende.', 'wld.ship.go': 'Send', 'wld.ship.cargo': 'Last',
|
||||
'wld.ship.hint': 'En forsendelse er en transport: opptil {n} per lenke. Den lander på lageret, eller drar hjem hvis punktet har skiftet eier underveis.',
|
||||
'wld.ship.done': 'Forsendelsen er på vei.', 'wld.ledger': 'Hvem sendte hva',
|
||||
'wld.gar.head': 'Garnison', 'wld.gar.static': 'Statisk forsvar', 'wld.gar.units': 'Stasjonerte enheter', 'wld.gar.total': 'Hele forsvaret', 'wld.gar.empty': 'Ingen har stasjonert enheter her. Et holdt punkt er bare så sterkt som garnisonen.',
|
||||
'wld.gar.hint': 'Medlemmer av alliansen kan stasjonere enheter her (Stasjoner enheter). De forsvarer sammen med den statiske delen, trekker strøm fra POP-en de kommer fra, og en tapt bølge dreper bare en del av dem. Et vunnet angrep tømmer alle.',
|
||||
'wld.gar.station': 'Stasjoner enheter', 'wld.gar.withdraw': 'Kall hjem', 'wld.gar.withdrawn': 'Enhetene er på vei hjem.', 'wld.gar.offline': 'offline (ingen strøm hjemme)', 'wld.gar.mine': 'dine', 'wld.gar.share': '{p}% av forsvaret',
|
||||
'wld.results': 'Sluttresultat', 'wld.rank.operators': 'Operatører', 'wld.rank.alliances': 'Allianser', 'wld.rank.attackers': 'Angripere', 'wld.rank.defenders': 'Forsvarere',
|
||||
'wld.rank.empty': 'Ingen på denne listen.', 'wld.rank.totals': '{o} operatører i {a} allianser',
|
||||
|
||||
'tile.backbone': 'Landingspunkt for ryggraden', 'map.legend.backbone': 'Landingspunkt', 'map.info.openWorld': 'Ryggradskappløpet',
|
||||
'map.info.backbone': 'Et landingspunkt for ryggraden. Første allianse som bygger noden her til nivå {max} vinner verdenen.',
|
||||
'send.landing.hint': 'Et landingspunkt har ingen garnison: bare det statiske forsvaret teller (en skanning viser tallet, omtrent {mult} ganger et inkumbentpunkt). Seier gjør alliansen din til eier.',
|
||||
'send.landing.hint': 'Et landingspunkt forsvares av sitt statiske forsvar (en skanning viser tallet: omtrent {mult} ganger et inkumbentpunkt så lenge ingen holder det, mye mindre når en allianse gjør det) pluss garnisonen holderne har stasjonert der. En tapt bølge dreper bare en del av garnisonen, så den neste møter mindre. Seier tømmer garnisonen og gjør alliansen din til eier.',
|
||||
'send.landing.reinforce': 'Enheter du stasjonerer her forsvarer punktet sammen med garnisonen til de andre medlemmene og trekker fortsatt strøm fra POP-en de kommer fra. Bare medlemmer av eieralliansen kan. Du kan kalle dem hjem når som helst fra punktarket; de går automatisk hjem hvis du forlater alliansen.',
|
||||
'send.invalid.site_shielded': 'Punktet skiftet eier nylig og kan ikke angripes ennå (se punktkortet).', 'wld.shield': 'Beskyttet til {t}',
|
||||
'send.invalid.not_holder': 'Bare medlemmer av alliansen som holder punktet kan stasjonere enheter der.',
|
||||
'send.transport.rival': 'Dette er en POP du ikke eier: lasten er en gave, og eieren ser en innkommende bevegelse til den lander. For handel, bruk Internettknutepunktet.',
|
||||
'send.reason.no_alliance': 'bare alliansemedlemmer kan angripe et landingspunkt', 'send.reason.own_site': 'alliansen din holder allerede dette punktet',
|
||||
'send.invalid.no_alliance': 'Bli med i en allianse først.', 'send.invalid.own_site': 'Alliansen din holder det punktet.',
|
||||
|
|
@ -101,6 +114,7 @@
|
|||
'report.type.landing': 'Angrep på landingspunkt',
|
||||
'rep.vs': '{a} mot {d}', 'rep.by': 'Av {name}', 'rep.attackerWon': 'Angriper vant', 'rep.defenderWon': 'Forsvarer vant',
|
||||
'rep.landing.title': 'Landingspunkt {n}', 'rep.landing.taken': 'Punktet ble tatt', 'rep.landing.held': 'Punktet holdt', 'rep.landing.holder': 'Eier',
|
||||
'rep.landing.garrisonOf': 'Garnisonen til {name}',
|
||||
'rep.landing.takenLine': '{tag} tok punktet.', 'rep.landing.heldLine': 'Forsvaret holdt. Punktet skiftet ikke eier.',
|
||||
'rep.tab.mine': 'Mine rapporter', 'rep.tab.alliance': 'Allianse', 'rep.sharedBy': 'delt av {name}',
|
||||
'rep.folder.none': 'Bli med i en allianse for å bruke den delte mappen.', 'rep.folder.empty': 'Ingenting delt ennå. Åpne en rapport og del den med alliansen.',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue