diff --git a/public/assets/plan-lab.js b/public/assets/plan-lab.js index 4fad3c8..628f166 100644 --- a/public/assets/plan-lab.js +++ b/public/assets/plan-lab.js @@ -626,12 +626,14 @@ } function gPayS(from, L, amt, origin, rem){ let r = gRouteS(from, L, rem, origin); - if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) - 0.005) r = gRouteS(from, L, true, origin); + if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) * PLAN.sponsor - 0.005) r = gRouteS(from, L, true, origin); if (!r.to) { G.aud.above += amt; G.aud.received += amt; G.mon.above += amt; return; } if (r.kind === 'cash') { r.to.cash += amt; r.to.sp += amt; G.mon.sp += amt; G.aud.received += amt; return; } - const n = r.to.level + 1, cost = net(n); - r.to.level = n; r.to.lic++; r.to.licV += cost; G.mon.lics++; - gFlow(r.to, n, cost, origin); + // each leg funds licences at its own share of the price: this leg's licence costs the sponsor share of level n, + // and that cost climbs the sponsor line. A licence is still a full level (licV records its full value). + const n = r.to.level + 1, cost = net(n) * PLAN.sponsor; + r.to.level = n; r.to.lic++; r.to.licV += net(n); G.mon.lics++; + gPayS(r.to, n, cost, origin, false); if (amt - cost > 0.005) gPayS(r.to, L, amt - cost, origin, true); } // every purchase, paid or licence, splits the same way: sponsor leg first, the rest by depth @@ -647,12 +649,12 @@ } function gPay(from, L, amt, skipN, origin, rem){ let r = gRoute(from, L, skipN, rem, origin); - if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) - 0.005) r = gRoute(from, L, skipN, true, origin); // short money never buys a licence; it climbs as cash + if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) * (1 - PLAN.sponsor) - 0.005) r = gRoute(from, L, skipN, true, origin); // short money never buys a licence; it climbs as cash if (!r.to) { G.aud.above += amt; G.aud.received += amt; G.mon.above += amt; return; } if (r.kind === 'cash') { r.to.cash += amt; G.aud.received += amt; return; } - const n = r.to.level + 1, cost = net(n); - r.to.level = n; r.to.lic++; r.to.licV += cost; G.mon.lics++; - gFlow(r.to, n, cost, origin); + const n = r.to.level + 1, cost = net(n) * (1 - PLAN.sponsor); // the depth leg's share of level n; with the sponsor leg off this is the whole price, as before + r.to.level = n; r.to.lic++; r.to.licV += net(n); G.mon.lics++; + gPay(r.to, n, cost, n - 2, origin, false); if (amt - cost > 0.005) gPay(r.to, L, amt - cost, 0, origin, true); } function gBuy(m, L){ m.bought = (m.bought || 0) + 1; const gross = price(L), fee = gross * PLAN.fee; G.aud.spent += gross; G.aud.admin += fee; G.aud.received += fee; G.mon.in += gross; G.mon.admin += fee; G.mon.buys++; m.level = Math.max(m.level, L); gFlow(m, L, gross - fee, m); } diff --git a/public/plan-lab.html b/public/plan-lab.html index ebb54ff..d6d3e68 100644 --- a/public/plan-lab.html +++ b/public/plan-lab.html @@ -353,6 +353,6 @@ details.adv.big summary{font-size:18px}

Unlisted working page for planning. Not a member page, not an offer. Every number here is a mechanic, not a prediction.

- +