Files
iron-requiem/test_dataflow_tmp.js
Kay Kayyali 4bef8e66df
Some checks failed
Iron Requiem CI/CD / test (push) Failing after 11s
Iron Requiem CI/CD / deploy (push) Has been skipped
Build & Deploy / build-and-deploy (push) Has been cancelled
Fix Recovery Phase 4: Single bundle script, correct Traefik network
- build.sh: Remove old bundle tag before injecting hashed version
- index.html: Remove duplicate script tag from template
- docker-compose.yml: Fix network name (hermes-net, not litellm_hermes-net)
- Deployment verified: HTTPS 200 via Cloudflare + Traefik
2026-05-24 04:30:06 +00:00

35 lines
1.6 KiB
JavaScript

/**
* Targeted repro: AmmoSystem.fire() return shape vs Projectile._hydrateShell expectations
*/
const { Projectile } = require("./src/game/entities/Projectile.js");
const { shells } = require("./src/data/shells.js");
// Simulate exactly what AmmoSystem.fire() returns
const fireResult = { type: "apcbc", velocity: 750, penetration: 100, splash: 0 };
const proj = new Projectile(0, 0, 0, fireResult);
console.log("=== From AmmoSystem.fire() return value ===");
console.log("shellType:", proj.shellType, "(expected 'apcbc')");
console.log("penetration:", proj.penetration, "(expected 100)");
console.log("velocity:", proj.velocity, "(expected 750)");
console.log("limited:", proj.limited, "(expected false)");
console.log("color:", proj.color, "(expected '#808080' gray)");
console.log("splash:", proj.splash, "(expected 0)");
console.log("");
// With proper shells.js definition
const proj2 = new Projectile(0, 0, 0, shells.apcbc);
console.log("=== From shells.apcbc directly ===");
console.log("shellType:", proj2.shellType);
console.log("limited:", proj2.limited);
console.log("color:", proj2.color);
console.log("");
// Collision still works because penetration is correct
const target = { armor: 80, hp: 100, active: true, x: 0, y: 0, takeDamage: function(d) { this.hp -= d; }, maxHp: 100 };
const hitResult = proj.onHit(target);
console.log("=== onHit() with fireResult-originated projectile ===");
console.log("penetrated:", hitResult.penetrated, "(expected true for pen 100 vs armor 80)");
console.log("damage:", hitResult.damage);
console.log("splashRadius:", hitResult.splashRadius);