Files
BT411/scratchpad/night8/leaklamp.sh
T

44 lines
1.8 KiB
Bash

#!/usr/bin/env bash
# #98: which leaking components actually FLASH their panel button?
#
# Players: "the display buttons aren't always flashing or lighting up on leaking
# components" (Oracle), "I'm getting leaks but no indicators" (Lynx), "I am
# getting indicators sometimes" (Sauron). Intermittent, not simply unwired.
#
# The chain is: HeatSink::GetStatusFlags raises bit 0x4 (CoolantLeaking) when
# coolantActive && HeatModelActive -> MechTech::TechnicalAssistance sees the bit
# CHANGE and calls ReportStatusSet -> GaugeAlarmManager::Activate -> the
# per-item lamp resolve in btl4galm.cpp.
#
# BT_LAMP_LOG prints all three stages:
# [techstat] <sub> condition 2 SET / CLEARED -- the edge the alarm rides
# [galarm] ... -> lamp 0x.. FLASH -- resolved and flashing
# [galarm] ... -> NO LAMP RESOLVED (...) -- matched but no lamp (NEW)
#
# Damage the mech steadily so heat subsystems take crits and start leaking.
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 2
sed "s/^map=.*/map=grass/; s/^time=.*/time=day/" MP.EGG > LEAK.EGG
LOG=leaklamp_${1:-post}.log
rm -f "$LOG"
# Self-damage keeps crits landing on the heat family; autofire keeps heat LOAD
# up, which is what coolantDraw (= zoneDamage x heatLoad) scales with.
BT_LAMP_LOG=1 BT_COOL_LOG=1 BT_DMG_LOG=1 \
BT_SPAWN_ENEMY=1 BT_AUTOFIRE=1 BT_AF_PERIOD=2 \
BT_SELF_DAMAGE=4 BT_SELF_DAMAGE_ZONE=${2:-dz_rarm} \
bt_launch "$LOG" LEAK.EGG 0x03
sleep 90
taskkill //F //IM btl4.exe > /dev/null 2>&1
sleep 2
echo "=== coolant-leak status edges (condition 2) ==="
grep -E "^\[techstat\].*condition 2" "$LOG" | sort | uniq -c | sort -rn | head -15
echo "=== lamp resolution ==="
grep -E "^\[galarm\]" "$LOG" | sed 's/[0-9a-fx]\{3,\}/N/g' | sort | uniq -c | sort -rn | head -12