neon-sprawl/bruno/neon-sprawl-server/ability-cast/Post cast lock pulse defeat...

97 lines
2.4 KiB
Plaintext

meta {
name: POST cast lock pulse defeat spine (NEO-82)
type: http
seq: 23
}
docs {
NEO-82 spine: pre-request moves, locks alpha, casts prototype_pulse four times (3s catalog cooldown between), then this request is the fifth cast expecting target_defeated deny.
}
script:pre-request {
const axios = require("axios");
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 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: 0, abilityId: "prototype_pulse" }],
},
jsonHeaders,
);
await axios.post(
`${baseUrl}/game/players/${playerId}/target/select`,
{ schemaVersion: 1, targetId: "prototype_target_alpha" },
jsonHeaders,
);
const castBody = {
schemaVersion: 1,
slotIndex: 0,
abilityId: "prototype_pulse",
targetId: "prototype_target_alpha",
};
for (let i = 0; i < 4; i++) {
const response = await axios.post(
`${baseUrl}/game/players/${playerId}/ability-cast`,
castBody,
jsonHeaders,
);
if (i < 3) {
await sleep(3100);
}
if (i === 3) {
bru.setVar("neo82FourthCast", JSON.stringify(response.data));
}
}
await sleep(3100);
}
post {
url: {{baseUrl}}/game/players/dev-local-1/ability-cast
body: json
auth: none
}
body:json {
{
"schemaVersion": 1,
"slotIndex": 0,
"abilityId": "prototype_pulse",
"targetId": "prototype_target_alpha"
}
}
tests {
test("fourth cast defeated target", function () {
const fourth = JSON.parse(bru.getVar("neo82FourthCast"));
expect(fourth.accepted).to.equal(true);
expect(fourth.combatResolution.targetRemainingHp).to.equal(0);
expect(fourth.combatResolution.targetDefeated).to.equal(true);
});
test("fifth cast denies target_defeated", function () {
const body = res.getBody();
expect(res.getStatus()).to.equal(200);
expect(body.accepted).to.equal(false);
expect(body.reasonCode).to.equal("target_defeated");
expect(body.combatResolution).to.equal(undefined);
});
}