Files
BT411/scratchpad/night15/xfire_bench.sh
T

52 lines
2.5 KiB
Bash

#!/usr/bin/env bash
# #165: do crit-DESTROYED energy weapons still fire? Rajel's field case: live
# arm cascade destroyed ERPPC_1+ERSLaser_1, he reports they still fired with
# X's showing. Rig: vulture, BT_AUTOFIRE holds the trigger, BT_KILL_SUBSYS
# destroys both left-arm weapons at frame 900 (~15s, ForceCriticalFailure --
# the same call the cascade makes). Receipts: [emitter] '<name>' fire REFUSED
# vs FIRED lines (BT_DMG_LOG).
# PASS: ERPPC_1 fires BEFORE the kill, only REFUSED after; a surviving weapon
# keeps firing after. FAIL: any post-kill FIRED from a destroyed weapon.
set -x
. /c/git/bt411/scratchpad/night6/bench_common.sh
cd /c/git/bt411/content || exit 1
taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 3
rm -f xfire.log
bt_expert_egg MP.EGG XF.EGG
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=vulture/" XF.EGG
( export BT_AUTOFIRE=1 BT_FIRE_AT_ICON=1 BT_KILL_SUBSYS=ERPPC_1,ERSLaser_1
export BT_DMG_LOG=1 BT_FIRE_LOG=1
bt_launch xfire.log XF.EGG 0x03 -egg XF.EGG )
sleep 100
bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe >/dev/null 2>&1
python - <<'PY'
import io, re
txt = io.open("xfire.log", encoding="latin-1", errors="replace").read()
lines = txt.splitlines()
kill = next((i for i,l in enumerate(lines) if "ForceCriticalFailure" in l or "KILL_SUBSYS" in l or "kill-subsys" in l.lower()), None)
# fall back: first REFUSED line marks the post-kill era
if kill is None:
kill = next((i for i,l in enumerate(lines) if "fire REFUSED" in l), None)
print("=== #165 X'D-WEAPON FIRE ===")
print("kill marker line:", kill)
def count(era, name, what):
if kill is None: return -1
seg = lines[:kill] if era=="pre" else lines[kill:]
return sum(1 for l in seg if name in l and what in l)
for w in ("ERPPC_1", "ERSLaser_1", "ERMLaser_1"):
print("%-11s pre-kill FIRED=%3d | post-kill FIRED=%3d REFUSED=%3d"
% (w, count("pre", w, "FIRED"), count("post", w, "FIRED"), count("post", w, "REFUSED")))
leak = (count("post","ERPPC_1","FIRED") or 0) + (count("post","ERSLaser_1","FIRED") or 0)
alive = count("post","ERMLaser_1","FIRED")
if kill is None:
print("VERDICT: INCONCLUSIVE -- no kill/refusal marker found (did the kill hook fire?)")
elif leak > 0:
print("VERDICT: FAIL(=field confirmed) -- destroyed weapons fired %d times post-kill" % leak)
elif alive == 0:
print("VERDICT: INCONCLUSIVE -- nothing fired post-kill (autofire/lock problem)")
else:
print("VERDICT: PASS -- destroyed weapons refuse, survivor keeps firing (port gate holds)")
PY