# AsteriskCraft — enemy Terran build order.
#
# Lines run top-to-bottom. Edit this file (or override it from your own datapack at
# data/<namespace>/build_scripts/terran.txt) and run /reload to change how the enemy plays.
#
# Commands:
#   Workers: N            keep at least N SCVs alive from here on (trains more when short)
#   Defence: <units>      train these units; they patrol and defend the base
#   Wave: <units>         train these units, then send the whole group to attack once complete
#   Wait S                pause S seconds before the next command
#   Repeat N              loop the previous N commands endlessly (put it last)
#
#   <units> = comma list of "Qty Unit", e.g. "3 Marine". Qty may be a range "3-5".
#   Units: Marine (ranged infantry), Firebat (short-range flamethrower), Ghost (long-range
#          marksman that cloaks when hit), Wraith (cloaking fighter, needs a Starport standing),
#          Goliath (walking mech, hits air hard, also needs a Starport), Science Vessel (unarmed
#          flying detector that poisons and shields, also needs a Starport), Medic (unarmed, throws
#          healing potions at nearby infantry), SCV (worker).
#
# Watching it play: the computer narrates this script to logs/latest.log, every line prefixed
# "[AI]" — which command it is on, what quantities it rolled, what it trained, what it cannot
# afford, and where each wave was sent. The #N in those lines is a command number, and the whole
# numbered program is listed on load, so a trace line maps straight back to a line below. Add
# -Dasteriskcraft.ailog=false to the game JVM arguments to silence it.
#
# The Terran open with counts and close with a mix. A Marine is the cheapest combat unit in the mod,
# comes out in 24 seconds, and dies to almost anything on its own — so the early waves below grow in
# size. A Firebat costs twice as much, in both resources rather than either, and burns everything in
# a cone two blocks in front of it: it is worthless alone and vicious against a wall of Zerglings, so
# it arrives once the waves are big enough for a human to be massing something to meet them with.
#
# Two Marines are already standing on every Command Center at world start (RaceProfile.baseDefences),
# so the opening Defence below is reinforcement, not the first guard.
#
# The AI waits until it can afford each unit, so a wave only leaves once fully trained.

Workers: 9

# Opening: post a squad while the economy ramps up. Rifles only — a Firebat this early is two
# Marines' worth of resources that cannot shoot back at anything holding its ground.
Defence: 3 Marine
Wait 70

# Escalating pushes. The first one is small enough to be turned away by a Zealot or a Sunken; by the
# third, massed rifles out-range anything melee and the answer has to be static defence or numbers.
Wave: 1 Marine
Wait 50
Wave: 1-2 Marine
Wait 60
Wave: 1-2 Firebat
Wait 60
Wave: 2 Marine
Wait 60

Defence: 2 Marine, 1 Firebat
Wave: 5-10 Marine, 2 Firebat

Workers: 15

Wait 60
Wave: 1 Marine
Wait 50
Wave: 1-2 Marine
Wait 60
Wave: 1-2 Firebat
Wait 60

Wave: 4-10 Marine, 1-2 Firebat, 1 Ghost

Wait 60
Wave: 1-3 Marine
Wait 50
Wave: 1-2 Firebat
Wait 50
Wave: 1-2 Ghost
Wait 50

Wave: 4-10 Marine, 1-2 Firebat, 1 Ghost, 2 Wraith, 0-1 Medic

Wait 60
Wave: 1-3 Marine, 0-1 Medic
Wait 50
Wave: 1-2 Firebat, 0-1 Medic
Wait 50
Wave: 1-2 Ghost
Wait 50

Defence: 1 Medic

Wave: 5-10 Marine, 2 Firebat, 1 Ghost, 2 Wraith, 2 Goliath

Wait 60
Wave: 1-3 Marine, 0-1 Medic
Wait 50
Wave: 1-2 Firebat, 0-1 Medic
Wait 50
Wave: 1-2 Ghost
Wait 50

Wave: 5-10 Marine, 2 Firebat, 1 Ghost, 2 Wraith, 2 Goliath, 1 Science Vessel

Defence: 2 Science Vessel

Wait 60
Wave: 1-3 Marine, 0-1 Medic
Wait 50
Wave: 1-2 Firebat, 0-1 Medic
Wait 50
Wave: 1-2 Goliath
Wait 50

Wave: 5-10 Marine, 2 Firebat, 1 Ghost, 2 Medic, 2 Wraith, 2 Goliath, 1 Science Vessel

Wait 60
Wave: 1-3 Marine, 0-1 Medic
Wait 50
Wave: 1-2 Firebat, 0-1 Medic
Wait 50
Wave: 1-2 Goliath
Wait 50

Wave: 10-14 Marine, 3-4 Firebat, 1-2 Ghost, 2-3 Medic, 2-3 Wraith, 2-3 Goliath, 1-2 Science Vessel
Wait 60
Wave: 1-3 Marine, 0-1 Medic
Wait 50
Wave: 1-2 Firebat, 0-1 Medic
Wait 50
Wave: 0-2 Wraith
Wait 50
Repeat 8
