# AsteriskCraft — Protoss build order, run when the computer player is Protoss.
#
# Lines run top-to-bottom. Edit this file (or override it from your own datapack at
# data/<namespace>/build_scripts/protoss.txt) and run /reload to change how that side plays.
#
# Commands:
#   Workers: N            keep at least N probes 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 Zealot, 1 Dragoon". Qty may be a range "3-5".
#   Units: Zealot (melee), Dragoon (ranged), Scout (air), Dark Templar (permanently cloaked
#          melee — nothing without a detector can shoot back), Observer (air, no attack and
#          permanently cloaked — a flying detector that nothing without a detector of its own can
#          shoot at), Archon (short-ranged, splashes onto everything standing near what it hits and
#          sets that target alight — the answer to a clump, and the priciest thing the race
#          trains), Probe (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 AI waits until it can afford each unit, so a wave only leaves once fully trained. Each unit
# also takes its own build time, so adding one lengthens a wave.
#
# Paced to mirror the Zerg script's escalation: the Protoss trade numbers for durability, so the
# counts are lower and the shields make up the difference.

Workers: 9

# Opening: post a couple of defenders while the economy ramps up.
Defence: 2 Zealot
Wait 65

# Escalating pushes.
Wave: 2 Zealot
Wait 160
Wave: 2 Zealot, 1 Dragoon
Wait 200
Wave: 3 Zealot, 2 Dragoon
Wait 200
# First air: a lone Scout. Melee units can't touch it — answer it with Hydralisks or a Spore Colony.
Wave: 3-4 Zealot, 1-2 Dragoon, 1 Scout

# Dark Templar are an ambush, not wave material: without a detector on the field nothing can shoot
# back at them, so they are worth far more sitting on the base than walking into one.
Defence: 2 Dark Templar

Defence: 1 Dragoon
Defence: 1 Dragoon

Wait 50
Wave: 1 Zealot
Wait 50
Wave: 1 Dragoon
Wait 60
Wave: 1 Zealot, 1 Dragoon
Wait 60

Wave: 2-7 Zealot, 1-3 Dragoon, 1-2 Scout, 1 Observer

Wait 50
Wave: 1-2 Zealot
Wait 50
Wave: 1-2 Dragoon
Wait 60
Wave: 1-2 Scout
Wait 60

Wave: 3-7 Zealot, 2-3 Dragoon, 1-2 Scout, 0-2 Dark Templar

Wait 50
Wave: 1-2 Archon
Wait 50
Wave: 1-2 Dragoon
Wait 60
Wave: 1-2 Scout
Wait 60

Defence: 1 Dark Templar

Wave: 2-8 Zealot, 2-5 Dragoon, 1-4 Scout, 1-2 Dark Templar, 0-3 Archon, 1 Observer
Wait 50
Wave: 1-2 Zealot
Wait 50
Wave: 1-2 Dragoon
Wait 60
Wave: 1-2 Scout
Wait 60
Repeat 8