meta { name: GET combat targets after cast spine (NEO-83) type: http seq: 3 } docs { NEO-83 AC spine: slot 1 (seq 2 one-pulse uses slot 0 and leaves cooldown). Pre-request locks prototype_npc_melee, casts pulse four times (3.2s between), then GET asserts melee defeated. } script:pre-request { const axios = require("axios"); const { resetPrototypeCombatTargets } = require("./scripts/combat-targets-reset-helper.js"); const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl"); const playerId = bru.getEnvVar("playerId") || bru.getVar("playerId"); const jsonHeaders = { headers: { "Content-Type": "application/json" } }; function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } await resetPrototypeCombatTargets(bru); await axios.post( `${baseUrl}/game/players/${playerId}/move`, { schemaVersion: 1, target: { x: -5, y: 0.9, z: -5 } }, jsonHeaders, ); await axios.post( `${baseUrl}/game/players/${playerId}/hotbar-loadout`, { schemaVersion: 1, slots: [{ slotIndex: 1, abilityId: "prototype_pulse" }], }, jsonHeaders, ); await axios.post( `${baseUrl}/game/players/${playerId}/target/select`, { schemaVersion: 1, targetId: "prototype_npc_melee" }, jsonHeaders, ); const castBody = { schemaVersion: 1, slotIndex: 1, abilityId: "prototype_pulse", targetId: "prototype_npc_melee", }; const castResults = []; for (let i = 0; i < 4; i++) { const response = await axios.post( `${baseUrl}/game/players/${playerId}/ability-cast`, castBody, jsonHeaders, ); const body = response.data; if (!body?.accepted || !body?.combatResolution) { throw new Error( `neo83 cast ${i + 1} failed: ${JSON.stringify(body)}`, ); } castResults.push(body); if (i < 3) { await sleep(3200); } } bru.setVar("neo83CastResults", JSON.stringify(castResults)); } get { url: {{baseUrl}}/game/world/combat-targets body: none auth: none } tests { test("returns 200 JSON with schema v1", function () { expect(res.getStatus()).to.equal(200); const body = res.getBody(); expect(body.schemaVersion).to.equal(1); expect(body.targets.length).to.equal(3); }); test("cast results stepped HP before GET", function () { const castResults = JSON.parse(bru.getVar("neo83CastResults")); expect(castResults.length).to.equal(4); expect(castResults[0].combatResolution.targetRemainingHp).to.equal(75); expect(castResults[1].combatResolution.targetRemainingHp).to.equal(50); expect(castResults[2].combatResolution.targetRemainingHp).to.equal(25); expect(castResults[3].combatResolution.targetRemainingHp).to.equal(0); expect(castResults[3].combatResolution.targetDefeated).to.equal(true); }); test("melee reflects cast damage authoritatively", function () { const body = res.getBody(); const melee = body.targets.find( (x) => x.targetId === "prototype_npc_melee", ); expect(melee).to.be.an("object"); expect(melee.currentHp).to.equal(0); expect(melee.maxHp).to.equal(100); expect(melee.defeated).to.equal(true); }); test("ranged unchanged after melee-only casts", function () { const body = res.getBody(); const ranged = body.targets.find( (x) => x.targetId === "prototype_npc_ranged", ); expect(ranged).to.be.an("object"); expect(ranged.currentHp).to.equal(80); expect(ranged.defeated).to.equal(false); }); }