Free tier and full tier (Marty 2026-11-02, every game must fund itself): a free InstantAdPay account hunts one code a day drawn on 0.02 to 0.10 POL; Game Pass holders keep five a day at the full draw, the weekly prizes and the Mystery Hunt Box (a box already open stays reachable); advertiser-funded finds pay what the advertiser set on every tier; with GAMEPASS off everyone stays on the full tier. New settings freeMissionsPerDay / freeMinPol / freeMaxPol (admin), tests updated

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-02 13:23:21 -06:00
parent 4c0aa35e6c
commit ab57b4089e
6 changed files with 41 additions and 23 deletions
+10 -5
View File
@@ -89,13 +89,16 @@ const closed = b => !!b && (b.status === 'won' || b.status === 'missed');
function putBox(b) { store.update('boxes', {}, all => { all[b.id] = b; return all; }); return b; }
function patchBox(id, patch) { let out = null; store.update('boxes', {}, all => { if (all[id]) { Object.assign(all[id], patch); out = all[id]; } return all; }); return out; }
function earned(me) { const s = settings(); return s.on && rewards.findsToday(me.memberId, ctDay()) >= s.base; }
// The box is a Game Pass perk since 2026-11-02 (Marty: the Pass is the purchase that funds the game): a free account hunts
// once a day and never reaches the box; pass = false answers 'pass' on the board and refuses to open.
function earned(me, pass) { const s = settings(); return s.on && pass !== false && rewards.findsToday(me.memberId, ctDay()) >= s.base; }
// what the board shows
function view(me) {
function view(me, pass) {
const s = settings(); if (!s.on) return { on: false };
const day = ctDay(); const b = getBox(me.memberId, day);
const done = rewards.findsToday(me.memberId, day);
if (!b && pass === false) return { on: true, status: 'pass', need: s.base, done: Math.min(done, s.base), pol: s.pol };
if (!b) return { on: true, status: done >= s.base ? 'ready' : 'locked', need: s.base, done: Math.min(done, s.base), pol: s.pol };
const m = missions.get(b.missionId) || {}; const q = bank().find(x => x.id === b.qid);
const out = { on: true, status: b.status, pol: b.pol, site: m.site || b.missionId, name: m.name || '', dwell: m.dwell || 30, url: b.url || null, expires: b.exp || null };
@@ -108,11 +111,13 @@ function view(me) {
}
// pass = the Game Pass perk (GAME-PASS.md 4): a second case a day once the first is closed; the first case stays the rule for everyone else
function open(me, pass) {
if (!earned(me)) return { error: 'Finish today’s Code Hunts first. The box unlocks when your last one is found.' };
// pass = the second-case perk; allowed = may a box open at all (the full tier: Game Pass holders, or everyone while GAMEPASS is off)
function open(me, pass, allowed) {
const day = ctDay(); const cur = getBox(me.memberId, day);
const second = !!(pass && cur && closed(cur) && !/:2$/.test(cur.id));
if (cur && !second) return { ok: true, box: cur };
if (cur && !second) return { ok: true, box: cur }; // a box already open today stays reachable (a pass that lapsed mid-day)
if (allowed === false) return { error: 'The Mystery Hunt Box opens for Game Pass holders.' };
if (!earned(me, true)) return { error: 'Finish today’s Code Hunts first. The box unlocks when your last one is found.' };
const c = pickCase(me.memberId, day); if (!c) return { error: 'No cases are open right now. Check back tomorrow.' };
let made = null;
// idempotent per member per day: a double tap or two tabs can never mint a second box