// Mono-space font required
{
"porcupine": {
	//        0              1                2             3                   4
	"unit": ["turretlaser", "turretmissile", "turretriot", "turretheavylaser", "turrettorp",
	//        5              6                7             8                 9
		"turretaalaser", "staticcon", "turretheavy", "staticshield", "turretemp",
	//       10             11               12            13                14
		"turretantiheavy", "staticarty", "turretaafar", "turretaaheavy", "turretgauss",
	//       15		        16
		"staticantinuke", "staticheavyradar"
	],
	// Actual number of defences per cluster bounded by income
	"land":  [0, 0, 1, 3, 5, 1, 2, 14, 1, 9, 5, 6, 2, 3, 5, 0, 8, 9, 14, 1, 3, 6, 16, 12, 11, 13],
	"water": [4, 1, 6, 4, 4, 3, 5, 9, 16],
	"prevent": 1,  // number of preventive defences
	"amount": {  // income bound factor
		"offset": [-0.15, 0.4],
		// Amount factor: 4x4 ~ 1.85, 20x20 ~ 1.45
		"factor": [1.55, 1.30],
		"map": [4, 20]
	},


	// Base defence and time to build it, in seconds
	"base": [[0, 10], [1, 300], [0, 310], [1, 400], [6, 450], [0, 500], [16, 600], [5, 660], [1, 990], [5, 1160], [1, 1380], [2, 1680], [13, 1800], [15, 1850]],

	"superweapon": {
		"unit":   ["raveparty", "staticnuke", "staticheavyarty", "zenith", "mahlazer", "staticantinuke"],  // FIXME: last aren't superweapon
		"weight": [ 0.10,         0.20,        0.20,              0.10,     0.10,    0.10],

		"condition": [16, 20000]  // [<Minimum income>, <maximum seconds to build>]
	},

	// Fallback defence
	"default": "turretmissile"
},

// Actions on building finished event
"build_chain": {
	// WARNING: Avoid recursion
	// <category>: factory, nano, store, pylon, energy, defence, bunker, big_gun, radar, sonar, mex, repair
	"energy": {
		// <UnitDef>: {<elements>}
		"energysingu": {
			// Available elements:
			// "energy": [max energy income, <"mex"|true>]
			// "pylon": <boolean>
			// "porc": <boolean>
			// "terra": <boolean>
			// "hub": [
			//     // chain1
			//     [{<unit1>, <category>, <offset>, <condition>}, {<unit2>, <category>, <offset>, <condition>}, ...],
			//     // chain2
			//     [{...}, {...}, ...],
			//     ...
			// ]
			// <unit>: UnitDef
			// <offset>:
			//     1) [x, z] in South facing, elmos
			//     2) {<direction>: <delta>} - left, right, front, back
			// <condition>: air, no_air, maybe

			// Build pylon in direction of nearby mex cluster
//			"pylon": true,

			// Build chain of units
			"hub": [
				[  // chain1
					{"unit": "turretlaser", "category": "defence", "offset": [-80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-70, 70]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, 80]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretaafar", "category": "defence", "offset": {"front": 120}, "condition": "air"},
					{"unit": "turretaaflak", "category": "defence", "offset": {"front": 120}, "condition": "no_air"}
				],
				[  // chain2
					{"unit": "turretlaser", "category": "defence", "offset": [80, 80]},
					{"unit": "turretemp", "category": "defence", "offset": {"right": 80}},
					{"unit": "turretmissile", "category": "defence", "offset": [70, -70]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, -80]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretaafar", "category": "defence", "offset": {"front": 120}, "condition": "air"},
					{"unit": "turretaaflak", "category": "defence", "offset": {"front": 120}, "condition": "no_air"}
				]
			]
		},
		"energyfusion": {
//			"pylon": true,
			"hub": [[
					{"unit": "turretlaser", "category": "defence", "offset": [80, -80]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretriot", "category": "defence", "offset": [-80, 80]}
				]]
		}
	},
	"factory": {
		"factoryplane": {
			"hub": [[{"unit": "staticrearm", "category": "nano", "offset": {"front": 150}}]]
		},
		"factorygunship": {
			"hub": [[{"unit": "staticcon", "category": "nano", "offset": {"front": 150}}]]
		},
		"striderhub": {
			"pylon": true
		}
	},
	"mex": {
		"staticmex": {
//			"terra": true,
			"energy": [20, "mex"],
			"porc": true
		}
	},
	"big_gun": {
		"staticheavyarty": {
			"hub": [[
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretaafar", "category": "defence", "offset": {"left": 120}, "condition": "air"},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretemp", "category": "defence", "offset": {"front": 60}},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretriot", "category": "defence", "offset": [80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"raveparty": {
			"hub": [[
					{"unit": "energypylon", "category": "defence", "offset": [250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, 250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [250, 250]},
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretaafar", "category": "defence", "offset": {"left": 120}, "condition": "air"},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretemp", "category": "defence", "offset": {"front": 60}},
					{"unit": "turretlaser", "category": "defence", "offset": [80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "turretriot", "category": "defence", "offset": [80, 80]},
					{"unit": "turretriot", "category": "defence", "offset": [-80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"mahlazer": {
			"hub": [[
					{"unit": "energypylon", "category": "defence", "offset": [250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, 250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [250, 250]},
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretaafar", "category": "defence", "offset": {"left": 120}, "condition": "air"},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretlaser", "category": "defence", "offset": [80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "turretriot", "category": "defence", "offset": [80, 80]},
					{"unit": "turretriot", "category": "defence", "offset": [-80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"zenith": {
			"hub": [[
					{"unit": "energypylon", "category": "defence", "offset": [250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, 250]},
					{"unit": "energypylon", "category": "defence", "offset": [-250, -250]},
					{"unit": "energypylon", "category": "defence", "offset": [250, 250]},
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretaafar", "category": "defence", "offset": {"left": 120}, "condition": "air"},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretlaser", "category": "defence", "offset": [80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "staticshield", "category": "defence", "offset": [-10, -10]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "turretriot", "category": "defence", "offset": [80, 80]},
					{"unit": "turretriot", "category": "defence", "offset": [-80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"staticheavyradar": {
			"hub": [[
					{"unit": "turretlaser", "category": "defence", "offset": [80, -80]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, 80]}
				]]
		},
		"staticnuke": {
			"hub": [[
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretaafar", "category": "defence", "offset": {"left": 120}, "condition": "air"},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "turretriot", "category": "defence", "offset": [80, -80]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"staticantinuke": {
			"hub": [[
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretlaser", "category": "defence", "offset": {"left": 40}},
					{"unit": "turretemp", "category": "defence", "offset": {"back": 60}},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "turretlaser", "category": "defence", "offset": {"right": 40}},
					{"unit": "turretlaser", "category": "defence", "offset": {"front": 40}},
					{"unit": "turretemp", "category": "defence", "offset": {"front": 60}},
					{"unit": "turretriot", "category": "defence", "offset": [80, -80]},
					{"unit": "turretlaser", "category": "defence", "offset": {"back": 40}},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "turretemp", "category": "defence", "offset": {"left": 60}},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretemp", "category": "defence", "offset": {"right": 60}},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		},
		"turretaaheavy": {
			"pylon": true,
			"hub": [
					[
					{"unit": "staticradar", "category": "radar", "offset": {"back": 40}},
					{"unit": "turretlaser", "category": "defence", "offset": [-80, 80]},
					{"unit": "turretmissile", "category": "defence", "offset": [80, 80]},
					{"unit": "turretriot", "category": "defence", "offset": [80, -80]},
					{"unit": "staticshield", "category": "defence", "offset": [10, 10]},
					{"unit": "staticstorage", "category": "defence", "offset": [-10, -10]},
					{"unit": "turretmissile", "category": "defence", "offset": [-80, -80]}
				]]
		}
	}
}
}
