# AsteriskCraft — enemy Zerg build order.
#
# Lines run top-to-bottom. Edit this file (or override it from your own datapack at
# data/<namespace>/build_scripts/zerg.txt) and run /reload to change how the enemy plays.
#
# Commands:
#   Workers: N            keep at least N drones 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 Zergling, 1 Hydralisk". Qty may be a range "3-5".
#   Units: Zergling (melee), Hydralisk (ranged), Mutalisk (air), Ultralisk (heavy melee),
#          Lurker (burrowing ambusher, ground only), Overlord (air, no attack — a flying
#          detector), Drone (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.
#
# Overlord is legal here but deliberately unused below: every Hive is handed one at world start
# (see RaceProfile.baseEscort), and the Spore Colony beside it detects too, so buying more would
# only slow the economy down. Add one to a Wave if you want detection travelling with the army.
#
# The AI waits until it can afford each unit, so a wave only leaves once fully trained. Each unit
# also takes its own build time — an Ultralisk alone is a minute — so adding one lengthens a wave.

Workers: 9

# Opening: post a few defenders while the economy ramps up.
Defence: 3 Zergling
Wait 165

Wave: 1 Zergling

Workers: 15

# Escalating pushes.
Wave: 2 Zergling
Wait 160
Wave: 2 Zergling, 1 Hydralisk
Wait 200
Wave: 4 Zergling, 2 Hydralisk
Wait 200
# First air: a lone Mutalisk. Melee units can't touch it — answer it with Dragoons or a Cannon.
Wave: 5-6 Zergling, 1-3 Hydralisk, 1 Mutalisk

# Lurkers are defence, not wave material: one digs in near the Hive that made it and waits, and it
# cannot be shot at until a Cannon reveals it. Sending them out would waste them — a Lurker walking
# with a wave spends the whole approach surfaced, visible and unable to fire.
Defence: 2 Lurker

Defence: 1 Ultralisk
Defence: 1 Ultralisk
Defence: 1 Ultralisk

Wait 50
Wave: 1 Zergling

Wait 50
Wave: 1 Hydralisk

Wait 60
Wave: 1 Ultralisk

Wait 60
Wave: 1 Mutalisk

# Endless heavy waves from here on, each led by an Ultralisk: 200 HP behind a swarm, and the point
# at which massed Zealots stop being an answer on their own.
Wave: 6-12 Zergling, 2-4 Hydralisk, 1-2 Mutalisk, 0-1 Ultralisk

Wait 50
Wave: 1 Zergling

Wait 50
Wave: 1 Hydralisk

Wait 60
Wave: 1 Ultralisk

Wait 60
Wave: 1 Mutalisk

Wave: 7-12 Zergling, 2-4 Hydralisk, 1-2 Mutalisk, 1 Ultralisk

Wait 50
Wave: 1 Zergling

Wait 50
Wave: 1 Hydralisk

Wait 60
Wave: 1 Ultralisk

Wait 60
Wave: 1 Mutalisk


Defence: 1-2 Lurker

Wave: 2-12 Zergling, 3-6 Hydralisk, 1-6 Mutalisk, 0-4 Ultralisk
Wait 50
Wave: 1-3 Zergling

Wait 50
Wave: 1-2 Hydralisk

Wait 60
Wave: 1-2 Ultralisk

Wait 60
Wave: 1-2 Mutalisk
Repeat 12
