# Events, delivery contracts and bounties (design 15.2, 10.5 and 15.3, step 34c). Read by the
# server and the game (src/sim/events/Events.cpp, src/server/world/ServerEvents.cpp).
#
# Events perturb the markets and lanes of a system for a while. Each has a cause a player can find
# (a farm, a mining camp, a pirate band, a hauler lost), and the board posts the job that fixes it.
#
# [events Rules]
#   roll         s of world time between the server's rolls for a new event in each live system
#   chance       the odds a roll brings one
#   most         events under way at once in a system, at most
#
# [event KEY]
#   name         as the board and the news say it
#   weight       odds of this one against the others when a roll comes up
#   last         s of world time it lasts, fewest and most
#   where        station (its market), world (a world's markets and the station's), lane (a trade lane)
#   needs        what the system must have: farm (a farmstead on a living world), camp (a mining camp),
#                lane (a trade lane)
#   goods        commodity keys it acts on; `food`, `ore` for a whole group of them (a world's ores
#                for `ore`), `any` for one of the shortage list
#   rest         its goods' rest at the markets it touches, times this (below 1: scarce, dear)
#   safety       the lane's safety, plus this while it lasts (pirate surge)
#   leader       yes: a named pirate leader works the lane while it lasts (a bounty on them)
#   job          the board job that fixes it: contract (deliver its goods to the station), bounty
#   cause        what the board says caused it: {place} the farm, camp or lane, {world}, {good}
#
# [contracts Rules]  delivery contracts (15.3), posted from shortages at the station:
#   shortage     a commodity whose price is this many times its base or more is short
#   most         contracts posted at once
#   amount       how many to bring, fewest and most (at most what makes the stock its target)
#   premium      pay per unit, as a share of the station's price for it now
#   risk         more pay per unit of unsafety on the lane the goods come down (1 - safety)
#   deadline     s of world time to bring them, fewest and most
#   list         what a station shortage may be of
#
# [bounties Rules]   named pirate targets (10.5), posted when pirates hurt a lane:
#   unsafe       a lane at or below this safety gets a bounty on a named leader
#   pay          credits for the leader, times (2 - the lane's safety)
#   skill        the leader's pilot skill
#   lift         the lane's safety once the leader is dead, plus this at once
#   scatter      and plus this to its base, for `scatter time` s of world time: the band scatters
#   scatter time
#   names        leaders' names, one picked by the seed

[events Rules]
roll = 600
chance = 0.35
most = 2

[event Surge]
name = Pirate surge
weight = 3
last = 2400, 4800
where = lane
needs = lane
safety = -0.3
leader = yes
job = bounty
cause = A pirate band has moved onto the {place} lane

[event Blight]
name = Crop blight
weight = 2
last = 2400, 5400
where = world
needs = farm
goods = food
rest = 0.25
job = contract
cause = Blight at {place} on {world} has ruined its crops

[event Boom]
name = Mining boom
weight = 2
last = 2400, 5400
where = world
needs = camp
goods = ore
rest = 3
cause = {place} on {world} struck a rich seam: its ore is cheap

[event Shortage]
name = Station shortage
weight = 3
last = 1800, 3600
where = station
goods = any
rest = 0.15
job = contract
cause = A freighter carrying {good} was lost on its way to the station

[contracts Rules]
shortage = 1.6
most = 2
amount = 12, 40
premium = 1.3
risk = 1.5
deadline = 2400, 3600
list = fuel_canister, iron_plate, copper_wire, circuit_board, power_cell, glass_pane, emergency_ration, crop, meat, ice, iron_ore, copper_ore

[bounties Rules]
unsafe = 0.5
pay = 600
skill = 0.85
lift = 0.25
scatter = 0.25
scatter time = 2400
names = Vesk the Red, Old Marrow, Kaila Dun, the Gannet, Brask Ironjaw, Sill Varro, Ash Mirren, Corvo Tal
