# Encounters and interdiction (design 10.1, "Meeting pirates", step 33b). Read at startup by the
# game and the server (src/sim/events/Encounters.cpp).
#
# Space is big: pirates on the lanes (traffic.txt) will almost never cross a player's path, so the
# server's encounter director brings fights to players. Every `check` seconds, for each player
# flying a ship, it rolls each encounter whose trigger holds against its odds. A staged encounter
# brings real AI ships of the traffic (the system's own records of that kind when it has spare
# ones, else newcomers that leave again afterwards), run by that player's game like any other.
#
# [director Settings]
#   check            s between the director's rolls for each player
#   chance           an encounter's odds per minute, before the factors below
#   cargo per        credits of cargo in the player's hold that double the odds
#   cargo most       the most cargo raises the odds, times
#   quiet            s since the player's last fight at which the odds are what they are; less
#                    lowers them in proportion (0 just after a fight), more raises them, up to
#   quiet most       times
#   station keep out m: no encounter while the player is this close to the station
#   start hours      no encounter in the start system before the world has been played this long
#                    (hours); staged ones (a quest, a bounty, a flag) still come
#   off pad          s after flying off a pad that a pack may still follow
#   gate exit        s after coming out of a gate that an ambush may still wait
#   belt reach       m from a belt's middle within which raiders may wait there
#   hail seconds     how long a hailing ship holds fire
#
# [danger HOLDER]    each gate holder's danger (gates.txt's holders): times the odds
#   danger
#
# [encounter KEY]
#   name             as the player's log shows it
#   trigger          gate (just out of a gate), belt (near a belt), pad (just off a pad), any (open
#                    space), staged (only on request: a quest, a bounty, a flag), cruise (an
#                    interdiction: only while in quantum cruise)
#   weight           its share among those whose trigger holds (0: staged only)
#   ships            what comes: KIND or KIND*N, comma separated (Pirate, Patrol, Hauler)
#   distance         m from the player they come in at
#   spread           m between them
#   hail             the line they hail with (empty: no hail); the speaker is the first ship
#   hold             s they hold fire while the hail runs (default: hail seconds)
#   victim           yes: the first ship (a hauler) is under attack and calls for help
#   site             an event site made around its ships (sites.txt: Distress, Convoy): saved by
#                    staying with them until no pirates are near, and paid (step 34d)
#   skill            the pirates' skill, lowest and highest (default: their kind's)
#   damage           times a cannon's damage per bolt for its pirates (default: their kind's)
#   layouts          the layouts its ships fly, one picked for each, or with as many as it has ships
#                    one each in order (default: their kind's); each must be among their kind's
#                    layouts in traffic.txt
#
# [interdiction Settings]
#   seconds          how long the pull lasts before it decides
#   pull per         an Interdictor block's pull
#   wobble           how far the pull swings, a share of it
#   drive            a ship's drive against the pull: fighter (a cockpit) and corvette (a core)
#   power per        how much each bar of the ship's power adds to the drive while it burns
#   idle             the share of its drive a ship holds without burning power into it
#   align            the share of the drive kept with the nose 30 degrees off its heading
#   rate             how fast the struggle swings per point between drive and pull
#   tether turn      rad/s the tether drags the nose toward it
#   hot              s the drive stays hot after breaking free (no spooling it again)
#   cooling          s the drive cools after a hard drop (no spooling it again)
#   fail range       m from the player the pirates arrive after a hard drop
#   let go range     m from the player they arrive after letting go
#   wingmen          pirates that come with the interdictor

[director Settings]
check = 20
chance = 0.12
cargo per = 2000
cargo most = 3
quiet = 600
quiet most = 2.5
station keep out = 15000
start hours = 2
off pad = 240
gate exit = 90
belt reach = 30000
hail seconds = 8

[danger Charter]
danger = 0.6

[danger Authority]
danger = 0.7

[danger Company]
danger = 1

[danger Frontier]
danger = 1.6

[danger Contested]
danger = 2

[encounter Raiders]
name = Raiders in orbit
trigger = staged
weight = 0
ships = Pirate*2
distance = 1600
spread = 1600
hail = Survey ship, cut your engines and dump your hold, or we take it off your hull
skill = 0.45, 0.45
damage = 0.5
# Lasers only: a new player's first fight, so no missiles (each must be one of the Pirate kind's
# layouts in traffic.txt).
layouts = dart, raider

# The pirate scenario's pirates (--pirates): as above, in missile boats, shown as the pirates they are.
[encounter MissileRaiders]
name = Pirates with missiles
trigger = staged
weight = 0
ships = Pirate*2
distance = 2200
spread = 1600
hail = Nice ship. Hold still while we lock on, or run and see how far you get
skill = 0.5, 0.6
damage = 0.5
layouts = striker

# The corvette scenario's welcome out of the air (--orbit-encounter OrbitPack).
[encounter CorvettePack]
name = A pirate corvette and its escorts
trigger = staged
weight = 0
ships = Pirate*3
distance = 2400
spread = 700
hail = Heave to. Our gunners have had a long, dull week
layouts = pirate_corvette, dart, dart

[encounter OrbitPack]
name = A pack in orbit, led by a corvette
trigger = staged
weight = 0
ships = Pirate*4
distance = 2600
spread = 900
hail = Nice corvette. Ours is uglier but it shoots back. Strip yours down and fly home in your suit
layouts = pirate_corvette, brute, striker, dart

[encounter Ambush]
name = Ambush at the gate
trigger = gate
weight = 3
ships = Pirate*3
distance = 1400
spread = 500
hail = Fresh out of the gate and already lost? Hold still, this won't take long

[encounter BeltRaiders]
name = Raiders at the belt
trigger = belt
weight = 3
ships = Pirate*2
distance = 2200
spread = 700

[encounter PadPack]
name = A pack off the pad
trigger = pad
weight = 2
ships = Pirate*3
distance = 2500
spread = 400
hail = Saw you leave the station heavy. We'll lighten the load

[encounter Mayday]
name = A hauler under attack
trigger = any
weight = 2
ships = Hauler, Pirate*2
distance = 2000
spread = 600
victim = yes
site = Distress
hail = Mayday, mayday, raiders on us, anyone on this channel, help us

[encounter ConvoyCall]
name = A refugee convoy under attack
trigger = any
weight = 1
ships = Hauler*3, Pirate*2
distance = 2500
spread = 700
victim = yes
site = Convoy
hail = This is the convoy, we have families aboard and raiders closing, please, anyone

[encounter LoneHail]
name = A lone pirate
trigger = any
weight = 2
ships = Pirate
distance = 1800
spread = 0
hail = That's a nice ship. Pay up and you keep it, or I take it in pieces

[encounter Interdiction]
name = Pulled out of cruise
trigger = cruise
weight = 2
ships = Pirate
distance = 600
spread = 400
hail = Nowhere to run out here. Hold still

[interdiction Settings]
seconds = 7
pull per = 1
wobble = 0.35
drive = fighter 0.75, corvette 1.2
power per = 0.08
idle = 0.35
align = 0.5
rate = 0.22
tether turn = 0.35
hot = 30
cooling = 20
fail range = 600
let go range = 3000
wingmen = 1
