Shards of Valor bonus heroes sold one time (Marty approved 2026-11-05): Kestrel, Valda, Morag, Roland $20 each, $50 bundle (Valda + Morag + Roland), behind heroSales (OFF)
Paid exactly like a pass: no credits, no POL. POST /api/my/heroes/buy opens a waiting order (kind hero); a fresh package of at least the
price from one of the member's own positions fulfils it in gamepass.onEvent (one package, one order: the highest-priced it covers, pass
or hero; each tx once). Ownership is permanent on the passes record (heroes, heroBundle), never in bought, so hero sales never feed the
Pass Tournament pool. No double charge: an owned hero is refused, a bundle is refused once any of its heroes is owned, and waiting orders
made pointless by a purchase are cancelled.
Settings (Admin > Settings): heroSales '0', heroPrice<Kestrel|Valda|Morag|Roland>Cents 2000 (0 = free for every account),
heroBundlePriceCents 5000, heroBundleHeroes 'valda,morag,roland', heroBundleCap '' (unset: the bundle is heroes only, no cap change).
Hand-off: sovMint (and GET /api/partner/player for shardsofvalor) carries heroes, heroBundle, heroSale { free, bundle, each, bundlePrice },
and heroBundleCap only when set. TIER_DEFS perks: Champion no longer lists the Druid, Sovereign no longer the Necromancer (dropped),
Legend every bonus hero while active. Member Game Pass card: a Bonus heroes block (shown while heroSales is on or to an owner);
Admin > Game Pass: hero test on the admin's own account (test buy / cancel / give / remove) and /api/admin/heroes/stats.
Chatbot: canned sov-bonus-heroes answer + heroesFact following heroSales; KNOWLEDGE_DATE 2026-11-05. my.js?v=20261105hr, admin.js?v=20261105hr.
QA: qa/sov-heroes-store.cjs (39 checks, in member and sov-passes); sov-passes-local expects the hero test panel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+32
-1
@@ -1276,6 +1276,35 @@
|
||||
// Tier test and preview (2026-10-25, Marty): the member Games card shows the admin exactly what a member sees, so every tier test lives
|
||||
// here. Every action touches ONLY the signed-in admin's own account; a test buy opens the same waiting order a member gets (a fresh
|
||||
// package on /my fulfils it, sponsors paid as usual), a test comp starts the tier at once with no sale recorded.
|
||||
// Shards of Valor bonus heroes (2026-11-05, Marty approved): sold ONE TIME. The same test path as the tiers, on the admin's own account:
|
||||
// a test buy opens the real waiting order (a fresh $20 / $50 package on /my fulfils it), Give grants it at once as comped, Remove takes it back.
|
||||
function heroTestHtml(H) {
|
||||
if (!H || !H.items) return '';
|
||||
const row = (key, name, sub, usd, pkg, owned, waiting, free) => '<div class="gpt-tier' + (owned ? ' on' : '') + '"><h4>' + esc(name) + '</h4><p class="small muted" style="margin:0 0 4px">' + esc(sub) + '</p>'
|
||||
+ '<p class="gpt-price">' + (free ? 'Free for everyone' : '$' + usd + ' <span class="small muted">one time, the $' + pkg + ' package</span>') + '</p>'
|
||||
+ '<p class="small" style="margin:4px 0">' + (owned ? '<b>Your account: owned</b>' : waiting ? '<b>Your account: test order waiting for a $' + pkg + ' package</b>' : 'Your account: not owned') + '</p><div class="gpt-acts">'
|
||||
+ (free || owned ? '' : waiting ? '<a class="btn small" href="/my?from=heroes#buy" target="_blank" rel="noopener">Buy the $' + pkg + ' package on /my</a><button class="btn small sec" type="button" data-ht-cancel="' + key + '">Cancel test order</button>' : '<button class="btn small" type="button" data-ht-buy="' + key + '">Test buy (real order, $' + pkg + ' package)</button>')
|
||||
+ (owned || free ? '' : '<button class="btn small sec" type="button" data-ht-comp="' + key + '">Give my account ' + esc(name.split(' ')[0]) + ' now (test)</button>')
|
||||
+ (owned && !free && key !== 'bundle' ? '<button class="btn small sec" type="button" data-ht-revoke="' + key + '">Remove from my account</button>' : '') + '</div></div>';
|
||||
const B = H.bundle;
|
||||
return '<h3 style="margin:16px 0 6px">Shards of Valor bonus heroes <span class="chip flat">' + (H.sale ? 'on sale: members see them' : 'hidden from members (heroSales off)') + '</span></h3>'
|
||||
+ '<p class="muted" style="margin:0 0 8px">Sold one time, owned for good, paid by a fresh package like a pass (no credits). Prices, the free list and the bundle are settings: heroPrice<Name>Cents (0 = free for everyone), heroBundleHeroes, heroBundlePriceCents. heroBundleCap stays empty (the bundle is heroes only). Members see heroes only once <b>heroSales</b> is on.</p>'
|
||||
+ '<div class="gpt-grid">' + H.items.map(i => row(i.key, i.name, i.blurb, i.usd, i.package, i.owned, i.waiting, i.free)).join('')
|
||||
+ (B ? row('bundle', 'Hero bundle', B.names.join(', '), B.usd, B.package, B.owned, B.waiting, false) : '') + '</div>';
|
||||
}
|
||||
function wireHeroTest(box, g) {
|
||||
const nm = k => k === 'bundle' ? 'the hero bundle' : ((g.heroes.items.find(i => i.key === k) || {}).name || k);
|
||||
box.querySelectorAll('[data-ht-buy]').forEach(b => b.addEventListener('click', busy(b, async () => {
|
||||
const k = b.dataset.htBuy; if (!(await IAP.confirmBox('Open a TEST order for ' + nm(k) + ' on your own account (' + g.email + ')? It is fulfilled when a fresh package of at least its price from one of your positions settles on chain. Members still cannot buy heroes while heroSales is off.', { title: 'Test buy: ' + nm(k), ok: 'Open the test order', cancel: 'Not now' }))) return;
|
||||
const x = await api('/api/admin/heroes/test-buy', { hero: k }); IAP.status('Test order for ' + nm(k) + ' is waiting for a $' + x.package + ' package on ' + x.email + '.', 'ok'); await loadGpTest();
|
||||
})));
|
||||
box.querySelectorAll('[data-ht-cancel]').forEach(b => b.addEventListener('click', busy(b, async () => { const k = b.dataset.htCancel; await api('/api/admin/heroes/test-cancel', { hero: k }); IAP.status('Test order for ' + nm(k) + ' cancelled.', 'ok'); await loadGpTest(); })));
|
||||
box.querySelectorAll('[data-ht-comp]').forEach(b => b.addEventListener('click', busy(b, async () => {
|
||||
const k = b.dataset.htComp; if (!(await IAP.confirmBox('Give your own account ' + nm(k) + ' now, for testing? Recorded as comped (no sale); the game shows it the next time you sign in to it from /my Games.', { title: 'Test ' + nm(k), ok: 'Give it to me', cancel: 'Not now' }))) return;
|
||||
await api('/api/admin/heroes/test-comp', { hero: k }); IAP.status(nm(k) + ' is on your account (test).', 'ok'); await loadGpTest();
|
||||
})));
|
||||
box.querySelectorAll('[data-ht-revoke]').forEach(b => b.addEventListener('click', busy(b, async () => { const k = b.dataset.htRevoke; await api('/api/admin/heroes/test-revoke', { hero: k }); IAP.status(nm(k) + ' removed from your account.', 'ok'); await loadGpTest(); })));
|
||||
}
|
||||
async function loadGpTest() {
|
||||
const box = $('gpTest'); if (!box) return;
|
||||
let g; try { g = await api('/api/admin/gamepass/preview'); } catch (e) { box.innerHTML = '<p class="muted">' + esc(e.message) + '</p>'; return; }
|
||||
@@ -1299,8 +1328,10 @@
|
||||
+ 'These are the tier cards as members will see them. Every button here acts on your own account (' + esc(g.email) + ') and nobody else’s. The member Games card on /my shows you exactly what a member sees: while you hold a test tier it shows that tier the way it would for any member who holds one.</p>'
|
||||
+ '<div class="gpt-grid">' + rows.map(card).join('') + '</div>'
|
||||
+ '<p class="muted" style="margin:10px 0 0"><b>Test buy</b> opens the same waiting order a member gets: a fresh package of at least the price, bought on /my by one of your positions, starts it (sponsors paid as usual). Cancel a test order you will not pay, or a later real package of that size fulfils it. <b>Give my account</b> starts one pass period at once, recorded as comped (no sale); <b>End</b> stops it. '
|
||||
+ 'To test it in game, open <b>Shards of Valor > Passes</b> (key P) after signing in to the game again from /my Games: the game reads your highest tier from InstantAdPay at sign-in.</p>';
|
||||
+ 'To test it in game, open <b>Shards of Valor > Passes</b> (key P) after signing in to the game again from /my Games: the game reads your highest tier from InstantAdPay at sign-in.</p>'
|
||||
+ heroTestHtml(g.heroes);
|
||||
const tierName = k => (rows.find(r => r.tier === k) || {}).name || k;
|
||||
wireHeroTest(box, g);
|
||||
box.querySelectorAll('[data-gpt-buy]').forEach(b => b.addEventListener('click', busy(b, async () => {
|
||||
const k = b.dataset.gptBuy; const r = rows.find(x => x.tier === k);
|
||||
if (!(await IAP.confirmBox('Open a TEST order for ' + tierName(k) + ' on your own account (' + g.email + ')? It starts when a fresh $' + r.package + ' or bigger package from one of your positions settles on chain. Members still cannot see or buy this tier.', { title: 'Test buy: ' + tierName(k), ok: 'Open the test order', cancel: 'Not now' }))) return;
|
||||
|
||||
Reference in New Issue
Block a user