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
|
||||
}
|
||||
|
||||
script:pre-request {
|
||||
const { resetPrototypeCombatTargets } = require("./scripts/combat-targets-reset-helper.js");
|
||||
await resetPrototypeCombatTargets(bru);
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/game/players/dev-local-1/combat-health
|
||||
body: none
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ script:pre-request {
|
|||
const {
|
||||
moveNearPrototypeNpc,
|
||||
PULSE_COOLDOWN_MS,
|
||||
MAX_PULSE_DEFEAT_ATTEMPTS,
|
||||
sleep,
|
||||
} = require("./scripts/prototype-npc-bruno-helper.js");
|
||||
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
|
||||
|
|
@ -54,7 +55,7 @@ script:pre-request {
|
|||
abilityId: "prototype_pulse",
|
||||
targetId,
|
||||
};
|
||||
for (let i = 0; i < 4; i++) {
|
||||
for (let i = 0; i < MAX_PULSE_DEFEAT_ATTEMPTS; i++) {
|
||||
const response = await axios.post(
|
||||
`${baseUrl}/game/players/${playerId}/ability-cast`,
|
||||
castBody,
|
||||
|
|
@ -69,11 +70,13 @@ script:pre-request {
|
|||
if (body.combatResolution.targetDefeated) {
|
||||
return;
|
||||
}
|
||||
if (i < 3) {
|
||||
if (i < MAX_PULSE_DEFEAT_ATTEMPTS - 1) {
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ const PROTOTYPE_NPC_ANCHORS = {
|
|||
/** <c>prototype_pulse</c> catalog cooldown (seconds) — real-time Bruno waits. */
|
||||
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>. */
|
||||
async function sleep(bru, ms) {
|
||||
await bru.sleep(ms);
|
||||
|
|
@ -34,6 +37,7 @@ async function moveNearPrototypeNpc(baseUrl, playerId, targetId, jsonHeaders) {
|
|||
module.exports = {
|
||||
PROTOTYPE_NPC_ANCHORS,
|
||||
PULSE_COOLDOWN_MS,
|
||||
MAX_PULSE_DEFEAT_ATTEMPTS,
|
||||
moveNearPrototypeNpc,
|
||||
sleep,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue