Skip to content

#4 boss size/weapon · #5 flicker · point-swap for basic weapons#42

Merged
0xward merged 2 commits into
mainfrom
claude/task-9-payment-button-igz1rq
Jul 20, 2026
Merged

#4 boss size/weapon · #5 flicker · point-swap for basic weapons#42
0xward merged 2 commits into
mainfrom
claude/task-9-payment-button-igz1rq

Conversation

@0xward

@0xward 0xward commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Three fixes. #4 & #5 were pushed to the branch after PR #41 was merged, so they never reached main — this PR lands them, plus the new point-swap request.

#5 — Screen/map "berkedip" (flicker) on certain weapons' autoattack

applyHitToEnemy() runs once per enemy, but aoe/cleave weapons (Verdant Reaper etc.) hit many in a single swing. Adding screen-shake per enemy re-pinned G.shake at max every swing → the camera jittered nonstop and the whole screen/map read as flickering. It also spawned 100+ premium particles + a ring per enemy, dropping the frame rate (which made the fps-gated light-rim layer blink); onEnemyKilled() stacked death-shake the same way on aoe crowd-kills.
Fix: gate all screen-level fx to once per swing — hit shake + sound + premium ring/shower once per ~0.08s (bosses always shake); death shake once per ~0.1s (boss kills always shake); ring list capped at 10 and the global particle pool at 420. Per-enemy feedback (damage numbers, knockback, basic burst) unchanged.

#4 — Boss too big + wielding the player's glowing PREMIUM weapon

Bosses shared the premium weapon overlays (argent_waraxe/void_katana/frost_spear/verdant_reaper). _lpcMon() now takes an optional weaponTint; each boss washes its weapon in a dark "corrupted" tint (and never passes weaponGlow), so it reads as the boss's own menacing weapon, not shiny premium gear. Boss scales pulled in 1.6–1.7 → 1.4–1.5. Enemy.draw forwards the tint; THE SUTURED ONE stays weaponless.

Point-swap for basic weapons (new owner finding)

NullState Point (earned from burning items) can now be swapped for basic weapons only, 5000–12000 Point:

  • Emberwood Maul 5000, Ironbolt Crossbow 8000, Argent Waraxe 12000 (marketplace.ts + mirrored marketplace-items.js). Premium fxTier-3 weapons keep no tokenPrice — real currency only.
  • The "Swap ⇄ Point" button sits under Buy and the confirm panel auto-expands once the wallet's Point covers the price (one-tap swap).
  • BUGFIX in /api/marketplace/swap: the deduction used a .transaction() that returned current (unchanged) when short — which COMMITS in RTDB (only undefined aborts), so the "not enough Point" branch was dead code and an under-funded swap granted the item for free. Replaced with a read-then-write (read balance, reject if short, else deduct).

Verification

node --check on game.js/entities.js/assets.js/marketplace-items.js; node-load asserts basic weapons carry tokenPrice 5000–12000 and premium weapons carry none.

Still to come (own PRs): default weapon + default skin + demo/guest play (#6), season pass (#7).

🤖 Generated with Claude Code

Two owner-reported issues (#5, #4).

#5 — Screen/map "berkedip" (flicker) on certain weapons' autoattack
   Root cause: applyHitToEnemy() runs once PER enemy, but aoe/cleave weapons
   (e.g. Verdant Reaper) hit many enemies in a SINGLE swing. It added
   screen-shake per enemy, so G.shake was re-pinned at its max every swing —
   the camera then jittered continuously (the shake target re-randomises each
   frame) and the whole screen/map read as flickering. It also spawned 100+
   premium impact particles + a ring per enemy, dropping the frame rate (which
   in turn made the fps-gated light-rim layer blink). onEnemyKilled() stacked
   death-shake the same way when an aoe killed a crowd.
   Fix: gate all SCREEN-LEVEL fx to once per swing —
   • melee hit shake + hit sound + the premium glow ring/shower now fire once
     per ~0.08s window (bosses always shake/sound);
   • death shake gated to once per ~0.1s window (boss kills always shake);
   • the premium ring list is capped at 10, and the global particle pool at
     420, so a crowd-hit can't pile up an additive brightness spike or tank
     the frame rate.
   Per-enemy feedback (damage numbers, knockback, basic hit burst) is unchanged.

#4 — Boss too big + wielding the player's glowing PREMIUM weapon
   Bosses shared the premium marketplace weapon overlays (argent_waraxe /
   void_katana / frost_spear / verdant_reaper), so they appeared to wield the
   exact bright, glowing gear the player buys. _lpcMon() now takes an optional
   weaponTint; each boss washes its weapon in a dark "corrupted" tint (and
   never passes weaponGlow), so the blade reads as the boss's own menacing
   weapon rather than a shiny premium one. Boss scales pulled in from 1.6–1.7
   to 1.4–1.5 so they loom without swallowing the room. Enemy.draw forwards the
   new weaponTint. THE SUTURED ONE stays weaponless as before.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Da8T111jTHKF4hJxJB9YuN
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nullstate Ready Ready Preview, Comment Jul 20, 2026 7:53am

Owner finding: NullState Point earned from burning items should be swappable
for BASIC weapons (not premium), lowest 5000 / highest 12000 Point, with the
swap option under Buy and auto-opening once the player has enough Point.

- Basic weapons now carry a tokenPrice: Emberwood Maul 5000, Ironbolt Crossbow
  8000, Argent Waraxe 12000 (marketplace.ts + mirrored marketplace-items.js).
  Premium fxTier-3 weapons keep NO tokenPrice — real currency only.
- MarketplaceScreen: the "Swap ⇄ Point" button stays directly under Buy and the
  confirm panel now AUTO-EXPANDS the moment the wallet's Point balance covers
  the price, so an affordable swap is one tap.
- BUGFIX in /api/marketplace/swap: the point deduction used a `.transaction()`
  that returned `current` (unchanged) when the balance was short. Returning a
  value COMMITS in RTDB (only `undefined` aborts), so the "not enough Point"
  branch was dead code and an under-funded swap GRANTED the item for free (it
  also hit the same cold-cache null-run hazard as the craft route). Replaced
  with a read-then-write: read the real balance, reject if short, else deduct.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Da8T111jTHKF4hJxJB9YuN
@0xward 0xward changed the title Fix screen flicker on aoe/multi-hit weapons + de-premium & shrink bosses (#4, #5) #4 boss size/weapon · #5 flicker · point-swap for basic weapons Jul 20, 2026
@0xward
0xward merged commit 7e6f736 into main Jul 20, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant