Skip to content

Tier 0: BO2 mechanics fidelity (numbers, curves, stuck-zombie fix)#166

Open
ikbenignace wants to merge 10 commits into
TheTurkeyDev:masterfrom
ikbenignace:feat/bo2-fidelity
Open

Tier 0: BO2 mechanics fidelity (numbers, curves, stuck-zombie fix)#166
ikbenignace wants to merge 10 commits into
TheTurkeyDev:masterfrom
ikbenignace:feat/bo2-fidelity

Conversation

@ikbenignace

Copy link
Copy Markdown
Contributor

Tier 0 — Black Ops 2 mechanics fidelity

First tier of a multi-PR effort to make the plugin's core numbers/mechanics match classic BO1/BO2 Zombies. Mechanics-only — no new content systems (those come in later tiers). Every BO2 value is exposed in config.yml so server owners can tune to taste.

Stacking: builds on #165 (26.2 migration) and #164 (PR-155 backport). Please merge those first — this PR's diff will then reduce to just the Tier 0 commits below.

What's in this PR

  • 0a Zombie HP curve: linear +100/round to round 9, then ×1.1 compounding (was linear forever → late rounds trivial). RoundSpawner.zombieHealth.
  • 0b Board cap + per-round count player-scaled: 24 + 6·(players-1), rounds 1-4 ramp .2/.4/.6/.8, round 5+ round·0.15·boardMax.
  • 0c Per-zombie attack cooldown (no shared i-frame) so swarm hits stack; zombieDamage 9→10 = 2-hit down (≈5 with Jugg).
  • 0d Final-blow point bonuses: headshot kill +30, melee kill +60, double-points aware.
  • 0e Speed Cola ↔ Double Tap un-swapped: Speed Cola now halves reload; Double Tap speeds fire rate (was reversed).
  • 0f Knife = flat damage, one-shots through a configurable round (was HP/wave, never clean).
  • 0g Dog rounds scale with player count (not round); guaranteed Max Ammo when the last dog dies.
  • 0h Per-gun fire_delay retuned to real BO2 RPM (~4× faster; 1200-RPM/20-TPS ceiling documented) + per-gun reload_time.
  • 0i Roster top-up (MSMC, Skorpion EVO, Vector K10, Peacekeeper, Mk 48) + two real starter kits.
  • 0j Power-up ground cap (4) with oldest-eviction, timer refresh on re-pickup, PaP re-pack ammo refill.
  • 0k Teleporter polish: recharge cooldown, charge-up delay, kills zombies on the pad, teleport sound.
  • 0L Stuck-zombie fix: a zombie making no progress for zombieStuckSeconds (default 6) is teleported to the nearest reachable spawn — fixes the common "1 zombie left wedged on geometry" round hang.

Testing

Pure game logic is extracted into testable statics and covered by a JUnit harness (49 tests, all green): HP curve, board/round/dog scaling, kill points, reload/fire-rate ticks, knife one-shot band, power-up cap, teleporter cooldown, stuck accumulator, plus a guns.json/kits.json data validator. Build: JDK 21, target 17 (spigot-api 26.2). Bukkit-glue paths are compile-verified; an in-game playtest is still recommended before merge.

🤖 Generated with Claude Code

Ignace Mella and others added 10 commits June 26, 2026 14:19
…spawn selection, thread-safety)

Cherry-picks/finishes three items from skbeh's PR TheTurkeyDev#155 that were not yet on
master:

* Shift-to-repair barriers (resolves TheTurkeyDev#97): new BarrierRepairListener lets a
  player repair a nearby barrier by holding sneak, alongside the existing
  sign-break repair. Reimplements the PR's listener with a corrected detection
  box - the PR left a "// TODO: incorrect subtract" on its asymmetric bounding
  box; this uses a symmetric cuboid centred on the repair sign.
* Rewrite SpawnManager.getNearestPoints: replaces the manual insertion-sort
  over a parallel POSITIVE_INFINITY distance list with a
  stream/distanceSquared/limit. Extracted to a package-private static for
  testing.
* Thread-safety: activeActions and isEditingASign are now ConcurrentHashMap.
  AsyncPlayerChatEvent reads them off the async chat thread while the main
  thread mutates them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate from the 20 per-version NMS modules (topping out at an untested
1.21.5) to a single build that runs on Minecraft 26.2 (Java 25 server):

- Build against spigot-api 26.2, targeting Java 17 bytecode (26.2's API is
  Java 17; Java 25 is only needed to run the server). Drop the unused
  server jar and add jsr305 (26.2 no longer ships javax.annotation).
- Replace the 20 NMS support modules with one pure-Bukkit NMSUtil_Modern
  (Lidded + Player#sendBlockDamage). Keep the INMSUtil seam and version
  dispatch so older versions can be re-added later as a module + a case.
- Fix enum/registry renames surfaced by compiling against 26.2:
  Attribute.GENERIC_* -> *, PotionEffectType.SLOW -> SLOWNESS,
  Particle REDSTONE/SPELL_WITCH/CRIT_MAGIC/SMOKE_NORMAL/FIREWORKS_SPARK ->
  DUST/WITCH/ENCHANTED_HIT/SMOKE/FIREWORK, EntityType.FIREWORK ->
  FIREWORK_ROCKET, GameRule.DO_DAYLIGHT_CYCLE -> ADVANCE_TIME.
- Route config-driven Sound/Material lookups through a new Compat helper
  (graceful fallback + warning instead of crashing on a stale name).
- Bump plugin.yml api-version to 1.21.

Fix a ClassCastException that corrupted game state:

Door.closeDoor cast a block to Sign without checking. A wall sign mounted
on a door block pops off when the door opens (block -> air), so closeDoor
threw inside endGame and aborted the entire game-end cleanup, leaving the
player "still in game" with broken teleport-back and rejoin state.

- Door.closeDoor: guard the cast and recreate the sign if it popped off.
- Game.endGame: isolate each door's close so one failure cannot abort the
  rest of the cleanup.
- Guard the remaining unguarded (Sign) casts in SignManager (runs on a
  repeating task) and PlayerChatListener.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 0a: two-phase zombie HP curve (linear to r9, x1.1 compounding after) in
  RoundSpawner.zombieHealth(), wired into both spawners. TDD'd.
- Config foundation: expose every BO2 tunable in config.yml + ConfigSetup
  (board scaling, attack cooldown, kill bonuses, perk rewire multipliers,
  knife round, dog scaling, power-up cap/refresh, PaP re-pack, teleporter).
- Default tweaks: zombieDamage 9->10 (2-hit down), healTime 5->2.5.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lat knife

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d, roster+kits

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…efill

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Zombies that make no progress for zombieStuckSeconds (default 6) are
teleported to the door-open spawn point nearest the targeted player so
they can resume pathing. Fixes the common "1 zombie left wedged on
geometry" round hang. Pure accumulator SpawnManager.updateStuckTicks is
TDD-covered; both thresholds are config-exposed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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