98 lines
2.7 KiB
Plaintext
98 lines
2.7 KiB
Plaintext
meta {
|
|
name: Get combat health after elite attack
|
|
type: http
|
|
seq: 2
|
|
}
|
|
|
|
docs {
|
|
E5M2-09 AC smoke: lock prototype_npc_elite, damaging cast, poll npc-runtime-snapshot through
|
|
attackCooldownSeconds (5.0s) + telegraphWindupSeconds (2.5s), then GET combat-health.
|
|
Lazy AdvanceAll caps at 5.0s per poll — need two snapshot GETs after cast (same as FakeClock integration test).
|
|
}
|
|
|
|
script:pre-request {
|
|
const axios = require("axios");
|
|
const { resetPrototypeCombatTargets } = require("./scripts/combat-targets-reset-helper.js");
|
|
const {
|
|
moveNearPrototypeNpc,
|
|
sleep,
|
|
} = require("./scripts/prototype-npc-bruno-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" } };
|
|
const slotIndex = 4;
|
|
|
|
await resetPrototypeCombatTargets(bru);
|
|
|
|
await moveNearPrototypeNpc(
|
|
baseUrl,
|
|
playerId,
|
|
"prototype_npc_elite",
|
|
jsonHeaders,
|
|
);
|
|
|
|
await axios.post(
|
|
`${baseUrl}/game/players/${playerId}/hotbar-loadout`,
|
|
{
|
|
schemaVersion: 1,
|
|
slots: [{ slotIndex, abilityId: "prototype_pulse" }],
|
|
},
|
|
jsonHeaders,
|
|
);
|
|
|
|
await axios.post(
|
|
`${baseUrl}/game/players/${playerId}/target/select`,
|
|
{ schemaVersion: 1, targetId: "prototype_npc_elite" },
|
|
jsonHeaders,
|
|
);
|
|
|
|
const castResponse = await axios.post(
|
|
`${baseUrl}/game/players/${playerId}/ability-cast`,
|
|
{
|
|
schemaVersion: 1,
|
|
slotIndex,
|
|
abilityId: "prototype_pulse",
|
|
targetId: "prototype_npc_elite",
|
|
},
|
|
jsonHeaders,
|
|
);
|
|
|
|
const castBody = castResponse.data;
|
|
if (!castBody?.accepted || !castBody?.combatResolution) {
|
|
throw new Error(`neo95 cast failed: ${JSON.stringify(castBody)}`);
|
|
}
|
|
|
|
await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`);
|
|
|
|
await sleep(bru, 5000);
|
|
await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`);
|
|
|
|
await sleep(bru, 2500);
|
|
await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`);
|
|
|
|
bru.setVar("neo95CastBody", JSON.stringify(castBody));
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/game/players/dev-local-1/combat-health
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
tests {
|
|
test("cast body shows accepted damaging pulse on elite", function () {
|
|
const castBody = JSON.parse(bru.getVar("neo95CastBody"));
|
|
expect(castBody.accepted).to.equal(true);
|
|
expect(castBody.combatResolution.targetRemainingHp).to.equal(175);
|
|
});
|
|
|
|
test("player HP decreased by elite attackDamage (25)", function () {
|
|
const body = res.getBody();
|
|
expect(body.schemaVersion).to.equal(1);
|
|
expect(body.playerId).to.equal("dev-local-1");
|
|
expect(body.maxHp).to.equal(100);
|
|
expect(body.currentHp).to.equal(75);
|
|
expect(body.defeated).to.equal(false);
|
|
});
|
|
}
|