NEO-108: Bruno elite defeat uses 12 pulses; reset HP baseline.
Elite has 200 HP (8 pulses at 25 damage); defeat loop matches C# tests. Combat-health seq 1 resets dev fixture so currentHp is 100 after prior smokes.pull/147/head
parent
05beec9644
commit
40d948ff2c
|
|
@ -4,6 +4,11 @@ meta {
|
||||||
seq: 1
|
seq: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
script:pre-request {
|
||||||
|
const { resetPrototypeCombatTargets } = require("./scripts/combat-targets-reset-helper.js");
|
||||||
|
await resetPrototypeCombatTargets(bru);
|
||||||
|
}
|
||||||
|
|
||||||
get {
|
get {
|
||||||
url: {{baseUrl}}/game/players/dev-local-1/combat-health
|
url: {{baseUrl}}/game/players/dev-local-1/combat-health
|
||||||
body: none
|
body: none
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ script:pre-request {
|
||||||
const {
|
const {
|
||||||
moveNearPrototypeNpc,
|
moveNearPrototypeNpc,
|
||||||
PULSE_COOLDOWN_MS,
|
PULSE_COOLDOWN_MS,
|
||||||
|
MAX_PULSE_DEFEAT_ATTEMPTS,
|
||||||
sleep,
|
sleep,
|
||||||
} = require("./scripts/prototype-npc-bruno-helper.js");
|
} = require("./scripts/prototype-npc-bruno-helper.js");
|
||||||
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
|
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
|
||||||
|
|
@ -54,7 +55,7 @@ script:pre-request {
|
||||||
abilityId: "prototype_pulse",
|
abilityId: "prototype_pulse",
|
||||||
targetId,
|
targetId,
|
||||||
};
|
};
|
||||||
for (let i = 0; i < 4; i++) {
|
for (let i = 0; i < MAX_PULSE_DEFEAT_ATTEMPTS; i++) {
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
`${baseUrl}/game/players/${playerId}/ability-cast`,
|
`${baseUrl}/game/players/${playerId}/ability-cast`,
|
||||||
castBody,
|
castBody,
|
||||||
|
|
@ -69,11 +70,13 @@ script:pre-request {
|
||||||
if (body.combatResolution.targetDefeated) {
|
if (body.combatResolution.targetDefeated) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (i < 3) {
|
if (i < MAX_PULSE_DEFEAT_ATTEMPTS - 1) {
|
||||||
await sleep(bru, PULSE_COOLDOWN_MS);
|
await sleep(bru, PULSE_COOLDOWN_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Error(`did not defeat ${targetId} within 4 pulses`);
|
throw new Error(
|
||||||
|
`did not defeat ${targetId} within ${MAX_PULSE_DEFEAT_ATTEMPTS} pulses`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await resetPrototypeCombatTargets(bru);
|
await resetPrototypeCombatTargets(bru);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ const PROTOTYPE_NPC_ANCHORS = {
|
||||||
/** <c>prototype_pulse</c> catalog cooldown (seconds) — real-time Bruno waits. */
|
/** <c>prototype_pulse</c> catalog cooldown (seconds) — real-time Bruno waits. */
|
||||||
const PULSE_COOLDOWN_MS = 3200;
|
const PULSE_COOLDOWN_MS = 3200;
|
||||||
|
|
||||||
|
/** Matches <c>AbilityCastApiTests</c> defeat loop (elite 200 HP needs 8×25 damage). */
|
||||||
|
const MAX_PULSE_DEFEAT_ATTEMPTS = 12;
|
||||||
|
|
||||||
/** Bruno sandbox has no <c>setTimeout</c> — use <c>bru.sleep</c>. */
|
/** Bruno sandbox has no <c>setTimeout</c> — use <c>bru.sleep</c>. */
|
||||||
async function sleep(bru, ms) {
|
async function sleep(bru, ms) {
|
||||||
await bru.sleep(ms);
|
await bru.sleep(ms);
|
||||||
|
|
@ -34,6 +37,7 @@ async function moveNearPrototypeNpc(baseUrl, playerId, targetId, jsonHeaders) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
PROTOTYPE_NPC_ANCHORS,
|
PROTOTYPE_NPC_ANCHORS,
|
||||||
PULSE_COOLDOWN_MS,
|
PULSE_COOLDOWN_MS,
|
||||||
|
MAX_PULSE_DEFEAT_ATTEMPTS,
|
||||||
moveNearPrototypeNpc,
|
moveNearPrototypeNpc,
|
||||||
sleep,
|
sleep,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue