#!/usr/bin/env bash
# Human-playable cross-pod kill (task #48): A beelines toward B (BT_GOTO) and
# autofires (BT_AUTOFIRE) -- i.e. a human walking up and shooting.  The test:
# does A's boresight world-pick RESOLVE B's replicant (mechPicks>0), and does
# the REAL beam path (not the FORCE_DMG hook) deliver cross-pod damage/kill?
set -x
cd /c/git/bt411/content || exit 1
rm -f mp_a.log mp_b.log

# B first + stationary, so its spawn is fixed at ~(1874,663)
BT_LOG=mp_b.log BT_AFFINITY=0x2 BT_MP_LOG=1 BT_MP_NET=1 \
  ../build/Debug/btl4.exe -egg MP.EGG -net 1601 &
sleep 2
BT_LOG=mp_a.log BT_AFFINITY=0x1 BT_GOTO="enemy" BT_AUTOFIRE=1 BT_MP_LOG=1 BT_GOTO_LOG=1 \
  ../build/Debug/btl4.exe -egg MP.EGG -net 1501 &
sleep 4
python ../tools/btconsole.py MP.EGG 127.0.0.1:1501 127.0.0.1:1601 &
PC=$!
sleep 70
kill $PC 2>/dev/null
taskkill //F //IM btl4.exe 2>/dev/null
taskkill //F //IM python.exe 2>/dev/null
echo "=== DONE ==="
