{
 "source": "clashcode/data/*.toml",
 "troops": [
  {
   "name": "brute",
   "note": "melee all-rounder",
   "cost": 60,
   "health": 480,
   "damage": 28,
   "wall_damage": 34,
   "action_radius_sq": 2,
   "movement_cooldown": 2,
   "action_cooldown": 1,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "ranger",
   "note": "ranged, fragile",
   "cost": 40,
   "health": 110,
   "damage": 14,
   "wall_damage": 14,
   "action_radius_sq": 16,
   "movement_cooldown": 1,
   "action_cooldown": 2,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "sapper",
   "note": "explode() only, cannot attack",
   "cost": 50,
   "health": 120,
   "damage": 60,
   "wall_damage": 450,
   "action_radius_sq": 2,
   "movement_cooldown": 1,
   "action_cooldown": 1,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "drake",
   "note": "air bruiser",
   "cost": 150,
   "health": 450,
   "damage": 22,
   "wall_damage": 22,
   "action_radius_sq": 4,
   "movement_cooldown": 2,
   "action_cooldown": 2,
   "is_air": true,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "runner",
   "note": "cheap and fast",
   "cost": 25,
   "health": 150,
   "damage": 16,
   "wall_damage": 16,
   "action_radius_sq": 2,
   "movement_cooldown": 1,
   "action_cooldown": 1,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "colossus",
   "note": "tank",
   "cost": 220,
   "health": 1600,
   "damage": 56,
   "wall_damage": 100,
   "action_radius_sq": 2,
   "movement_cooldown": 1,
   "action_cooldown": 2,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "catapult",
   "note": "siege, outranges most towers",
   "cost": 130,
   "health": 180,
   "damage": 60,
   "wall_damage": 120,
   "action_radius_sq": 36,
   "movement_cooldown": 3,
   "action_cooldown": 4,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 0
  },
  {
   "name": "mage",
   "note": "splash on buildings",
   "cost": 110,
   "health": 220,
   "damage": 30,
   "wall_damage": 30,
   "action_radius_sq": 18,
   "movement_cooldown": 2,
   "action_cooldown": 2,
   "is_air": false,
   "splash_radius_sq": 2,
   "mend": 0
  },
  {
   "name": "mender",
   "note": "mend() only, cannot attack",
   "cost": 100,
   "health": 220,
   "damage": 0,
   "wall_damage": 0,
   "action_radius_sq": 8,
   "movement_cooldown": 2,
   "action_cooldown": 2,
   "is_air": false,
   "splash_radius_sq": 0,
   "mend": 25
  },
  {
   "name": "glider",
   "note": "tiny flyer, buy many",
   "cost": 16,
   "health": 45,
   "damage": 6,
   "wall_damage": 6,
   "action_radius_sq": 2,
   "movement_cooldown": 1,
   "action_cooldown": 1,
   "is_air": true,
   "splash_radius_sq": 0,
   "mend": 0
  }
 ],
 "spells": [
  {
   "name": "scorch",
   "note": "damages buildings",
   "cost": 100,
   "radius_sq": 3,
   "damage": 120,
   "stun": 0,
   "mend": 0,
   "fury": false
  },
  {
   "name": "bolt",
   "note": "damages buildings, defenses miss 3 rounds",
   "cost": 60,
   "radius_sq": 2,
   "damage": 80,
   "stun": 3,
   "mend": 0,
   "fury": false
  },
  {
   "name": "stasis",
   "note": "defenses in the area miss 5 rounds",
   "cost": 70,
   "radius_sq": 9,
   "damage": 0,
   "stun": 5,
   "mend": 0,
   "fury": false
  },
  {
   "name": "mend",
   "note": "mends your troops",
   "cost": 70,
   "radius_sq": 9,
   "damage": 0,
   "stun": 0,
   "mend": 150,
   "fury": false
  },
  {
   "name": "fury",
   "note": "your troops: half cooldowns, +30% damage for fury_rounds",
   "cost": 60,
   "radius_sq": 9,
   "damage": 0,
   "stun": 0,
   "mend": 0,
   "fury": true
  }
 ],
 "defenses": [
  {
   "name": "bombard",
   "size": 1,
   "health": 480,
   "count": 6,
   "action_radius_sq": 25,
   "min_radius_sq": 0,
   "damage": 24,
   "cooldown": 3,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "longbow_post",
   "size": 1,
   "health": 360,
   "count": 6,
   "action_radius_sq": 36,
   "min_radius_sq": 0,
   "damage": 10,
   "cooldown": 1,
   "hits_air": true,
   "hits_ground": true,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "lobber",
   "size": 1,
   "health": 400,
   "count": 2,
   "action_radius_sq": 81,
   "min_radius_sq": 9,
   "damage": 22,
   "cooldown": 6,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 2,
   "loot": 0
  },
  {
   "name": "spire",
   "note": "air splash: stacked flyers beware",
   "size": 1,
   "health": 400,
   "count": 3,
   "action_radius_sq": 49,
   "min_radius_sq": 0,
   "damage": 45,
   "cooldown": 3,
   "hits_air": true,
   "hits_ground": false,
   "splash_radius_sq": 1,
   "loot": 0
  },
  {
   "name": "arc_pylon",
   "size": 1,
   "health": 320,
   "count": 2,
   "action_radius_sq": 16,
   "min_radius_sq": 0,
   "damage": 20,
   "cooldown": 1,
   "hits_air": true,
   "hits_ground": true,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "ballista",
   "size": 1,
   "health": 440,
   "count": 2,
   "action_radius_sq": 64,
   "min_radius_sq": 4,
   "damage": 48,
   "cooldown": 4,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "flame_tower",
   "size": 1,
   "health": 360,
   "count": 2,
   "action_radius_sq": 9,
   "min_radius_sq": 0,
   "damage": 12,
   "cooldown": 1,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 2,
   "loot": 0
  }
 ],
 "buildings": [
  {
   "name": "keep",
   "size": 2,
   "health": 2000,
   "count": 1,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "vault",
   "size": 2,
   "health": 720,
   "count": 4,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 150
  },
  {
   "name": "storehouse",
   "size": 2,
   "health": 560,
   "count": 2,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 100
  },
  {
   "name": "shack",
   "size": 1,
   "health": 200,
   "count": 12,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "wall",
   "size": 1,
   "health": 220,
   "count": 140,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 0
  }
 ],
 "traps": [
  {
   "name": "spike_trap",
   "note": "ground, fires once",
   "size": 1,
   "health": 1,
   "count": 8,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 120,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 2,
   "loot": 0
  },
  {
   "name": "blast_charge",
   "note": "ground, fires once",
   "size": 1,
   "health": 1,
   "count": 2,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 300,
   "cooldown": 0,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 5,
   "loot": 0
  },
  {
   "name": "sky_mine",
   "note": "first flyer within r2 2",
   "size": 1,
   "health": 1,
   "count": 4,
   "action_radius_sq": 2,
   "min_radius_sq": 0,
   "damage": 250,
   "cooldown": 0,
   "hits_air": true,
   "hits_ground": false,
   "splash_radius_sq": 0,
   "loot": 0
  },
  {
   "name": "tar_pit",
   "note": "+3 move cooldown, stays",
   "size": 1,
   "health": 1,
   "count": 4,
   "action_radius_sq": 0,
   "min_radius_sq": 0,
   "damage": 0,
   "cooldown": 3,
   "hits_air": false,
   "hits_ground": true,
   "splash_radius_sq": 0,
   "loot": 0
  }
 ],
 "constants": {
  "deploy_border": 2,
  "scout_depth": 4,
  "gold": 4200,
  "spells_per_round": 1,
  "fury_rounds": 8,
  "fury_damage_percent": 130,
  "spell_idle_rounds": 3,
  "max_rounds": 450,
  "deploys_per_round": 3,
  "shared_array_length": 64,
  "shared_array_max": 65535,
  "troop_vision_radius_sq": 20,
  "build_bytecode_limit": 400000,
  "draft_bytecode_limit": 20000,
  "commander_bytecode_limit": 10000,
  "unit_bytecode_limit": 2500,
  "fury_cooldown_divisor": 2,
  "one_star_destruction_pm": 500,
  "three_star_destruction_pm": 1000,
  "reinforce_markup_percent": 175
 },
 "constant_notes": {
  "deploy_border": "outer ring of the map: no buildings, attackers deploy here",
  "scout_depth": "fog: the attacker starts with every tile less than deploy_border + this from the edge explored",
  "gold": "troop and spell budget per team; what the draft leaves is the raid's war chest",
  "fury_rounds": "a FURY spell lasts this many rounds",
  "fury_damage_percent": "furious troops deal damage * this // 100",
  "spell_idle_rounds": "army spent: the raid ends after this many rounds in a row without a cast",
  "shared_array_length": "per team per battle",
  "build_bytecode_limit": "once, for build()",
  "draft_bytecode_limit": "once, for draft()",
  "unit_bytecode_limit": "each troop and each defense, every round",
  "fury_cooldown_divisor": "furious troops: cooldown max(1, ceil(base / this))",
  "one_star_destruction_pm": "destruction (per-mille) for the first star",
  "three_star_destruction_pm": "destruction (per-mille) for the third star",
  "reinforce_markup_percent": "war chest purchases in the raid cost cost * this // 100; was 125: troops bought with loot trickled in and kept raids going to 450 rounds"
 },
 "bytecode_costs": {
  "place": 5,
  "buy": 2,
  "deploy": 10,
  "move": 5,
  "attack": 5,
  "explode": 5,
  "mend": 5,
  "cast": 10,
  "sense": 10,
  "sense_at": 2,
  "shared": 1
 },
 "bytecode_cost_notes": {
  "sense": "sense_nearby_buildings, sense_nearby_robots",
  "sense_at": "sense_building_at",
  "shared": "read_shared_array, write_shared_array"
 }
}
