
clear

def parameters
nb_of_resource_types 2 ; gold and wood



; resource deposits

def goldmine
class deposit
resource_type 0 ; gold
extraction_time 3
extraction_qty 1

def wood
class deposit
resource_type 1 ; wood
extraction_time 20
extraction_qty 2



; races

def tang_empire
class race

townhall county_government
keep government_office
castle governor's_house
farm village
barracks drillground
stables drillground
blacksmith foundry_bureau
blacksmith tang_leathershop
wall tang_wall
gate tang_gate
massive_wall tang_massive_wall
massive_gate tang_massive_gate
scouttower tang_scouttower
guardtower watchtower
cannontower crossbowtower
workshop ordnance_supervisor
workshop carriage_shop
dragonslair carriage_shop
magestower taoist_temple
temple taoist_temple
necropolis taoist_temple
peasant villagers
footman modao_footman
footman horizontal_knife_footman
archer tang_archer
darkarcher marksman
skeleton tang_archer
zombie horizontal_knife_footman
knight light_cavalry
knight tang_cavalry_archer
knight black_cavalry
catapult marching_vehicle
catapult tang_siege_vehicle
catapult ballista
dragon golden_dragon
mage taoist_priest
priest taoist_priest
necromancer taoist_priest
new_flyingmachine wood_bird
flyingmachine golden_dragon
boat yacht
destroyer fightingship
destroyer stickship
battleship buildingship
submarine walkship
submarine dash
easy tang_empire_easy
aggressive tang_empire_hard


def turkic_hanate
class race

townhall archim_tent
keep hakemu_tent
castle pasha_tent
farm turk_pasture
barracks turk_barracks
stables turk_barracks
blacksmith turk_blacksmith
blacksmith turk_leathershop
magestower turk_shaman_temple
temple turk_shaman_temple
necropolis turk_shaman_temple
stables turk_shaman_temple
scouttower turk_scouttower
wall turk_wall
massive_wall turk_massive_wall
gate turk_gate
massive_gate tang_massive_gate
workshop arms_workshop
dragonslair birdhouse
shipyard turk_shipyard
peasant turk_herdsmen
footman turk_spearmen
archer turk_archer
darkarcher turk_whistlinger
zombie turk_spearmen
skeleton turk_archer
mage turk_shaman
priest turk_shaman
necromancer turk_shaman
knight turk_archer_cavalry
knight turk_sword_cavalry
knight turk_blade_cavalry
knight saber_cavalry
knight turk_spear_cavalry
catapult turk_trebuchet
new_flyingmachine turkic_finch
flyingmachine golden_wolf
dragon golden_wolf
boat raft
destroyer fishingship
battleship riprapship
submarine riprapship
easy turkic_hanate_easy
aggressive turkic_hanate_hard


def byzantine_empire
class race

townhall town_center
keep governor's_palace
castle constantinople
farm fruit_estate
barracks b_barracks
stables b_barracks
blacksmith b_blacksmith
blacksmith mine
blacksmith b_leathershop
workshop armament_institute
dragonslair church
magestower church
temple church
necropolis church
shipyard dock
wall b_wall
gate b_gate
massive_wall b_massive_wall
massive_gate b_massive_gate
scouttower guard_tower
guardtower fortress
cannontower catapulttower
peasant serf
footman pikemen
footman axemen
footman sword_shield_men
archer b_archer
darkarcher b_archer
zombie pikemen
skeleton archer
knight pike_cavalry
knight b_cavalry_archer
knight iron_paladin
mage b_priest
priest b_priest
necromancer b_priest
catapult b_catapult
new_flyingmachine b_catapult
flyingmachine double_headed_eagle
dragon double_headed_eagle
boat dromon
destroyer heavy_dromon
battleship royal_dromon
submarine royal_dromon
easy byzantine_empire_easy
aggressive byzantine_empire_hard


; upgrades (research)

;public_upgrade_research


def leather_armor
class upgrade
cost 8 10
time_cost 60
effect bonus armor 0.5

def archer_weapon
class upgrade
cost 8 10
time_cost 60
effect apply_bonus damage

def archer_range
class upgrade
cost 8 10
time_cost 60
effect bonus range 1

def ridingbow
class upgrade
cost 10 15
time_cost 60
effect bonus damage 2

def ridingbow_range
class upgrade
cost 10 15
time_cost 60
effect bonus range 1

def saber
class upgrade
cost 8 10
time_cost 60
effect bonus damage 2

def horse_speed
class upgrade
cost 15 5
time_cost 60
effect apply_bonus speed

def improvement
class upgrade
cost 8 10
time_cost 60
effect bonus armor -3

def improvement2
class upgrade
cost 8 10
time_cost 60
effect bonus armor 3

def lv1attackspeed
class upgrade
cost 8 10
time_cost 60
effect bonus cooldown -0.1

def lv2attackspeed
class upgrade
cost 8 10
time_cost 60
effect bonus cooldown -0.1

def lv3attackspeed
class upgrade
cost 8 10
time_cost 60
effect bonus cooldown -0.1

def lv1sightrange
class upgrade
time_cost 10
effect bonus sight_range 1

def lv2sightrange
class upgrade
effect bonus sight_range 2

def lv3sightrange
class upgrade
effect bonus sight_range 2



;tang_upgrade research

def the_art_of_qi_huang
class upgrade
cost 80 0
time_cost 60
effect bonus heal_level 5
requirements governor's_house

def u_teleportation
class upgrade
cost 50 0
time_cost 60

def u_protection_law
class upgrade
cost 50 0
time_cost 60

def u_summon_golden_dragon
class upgrade
cost 50 0
time_cost 60

def u_thunder
class upgrade
cost 50 0
time_cost 60
effect bonus damage 2.66

def u_come_back_to_life
class upgrade
cost 50 0
time_cost 60
requirements governor's_house

def horizontal_knife
class upgrade
cost 8 10
time_cost 60
effect bonus damage 2.5

def mo_knife
class upgrade
cost 8 10
time_cost 60
effect bonus damage 3

def footman_armor
class upgrade
cost 10 12
time_cost 60
effect apply_bonus damage
requirements government_office

def bright_light_armor
class upgrade
cost 10 12
time_cost 60
effect apply_bonus armor
requirements government_office


def tang_lv1attackspeed
is_a lv1attackspeed
requirements county_government

def tang_lv2attackspeed
is_a lv2attackspeed
requirements government_office

def tang_lv3attackspeed
is_a lv3attackspeed
requirements governor's_house

def tang_lv1sightrange
is_a lv1sightrange
requirements county_government

def tang_lv2sightrange
is_a lv2sightrange
requirements government_office

def tang_lv3sightrange
is_a lv3sightrange
requirements governor's_house

def tang_improvement
is_a improvement
requirements footman_armor

def tang_improvement2
is_a improvement2
requirements minus_speed

def add_speed
class upgrade
effect bonus speed 0.5
requirements tang_improvement

def minus_speed
class upgrade
effect bonus speed -0.5
requirements add_speed

def horselance
class upgrade
cost 14 16
time_cost 60
effect bonus damage 3
requirements governor's_house

def mysterious_armor
class upgrade
cost 14 16
time_cost 60
effect bonus armor 2
requirements governor's_house

def crossbow
class upgrade
cost 20 30
time_cost 60
effect apply_bonus damage
requirements lumbermill governor's_house foundry_bureau


;turk_upgrade_research

def sword
class upgrade
cost 8 10
time_cost 60
effect apply_bonus damage

def blade
class upgrade
cost 8 10
time_cost 60
effect apply_bonus damage

def spear
class upgrade
cost 15 15
time_cost_60
effect apply_bonus damage

def whistling
class upgrade
cost 8 10
time_cost 60
effect bonus damage 1
requirements pasha_tent

def ring_armor
class upgrade
cost 13 16
time_cost 60
effect bonus damage 2
requirements pasha_tent

def tk_lv1attackspeed
is_a lv1attackspeed
requirements archim_tent

def tk_lv2attackspeed
is_a lv2attackspeed
requirements hakemu_tent

def tk_lv3attackspeed
is_a lv3attackspeed
requirements pasha_tent

def tk_lv1sightrange
is_a lv1sightrange
requirements archim_tent

def tk_lv2sightrange
is_a lv2sightrange
requirements hakemu_tent

def tk_lv3sightrange
is_a lv3sightrange
requirements pasha_tent

def u_curse
class upgrade
cost 50 0
time_cost 60
effect bonus damage 1.5

def improve_your_diet
class upgrade
cost 30 30
time_cost 60
effect bonus hp_max 10
requirement pasha_tent

def u_appreciation_of_sirius
class upgrade
cost 100 0
time_cost 60


;b_upgrade_research

def pike
class upgrade
cost 8 10
time_cost 100
effect apply_bonus damage

def axe
class upgrade
cost 8 10
time_cost 100
effect apply_bonus damage

def light_shield
class upgrade
cost 8 10
time_cost 100
effect bonus armor 0.5

def heavy_sword
class upgrade
cost 8 10
time_cost 60
effect apply_bonus damage

def buckler
class upgrade
cost 10 12
time_cost 60
effect bonus armor 0.5
requirements governor's_palace

def heavy_shield
class upgrade
cost 10 12
time_cost 120
effect bonus armor 1
requirements governor's_palace

def scale_armor
class upgrade
cost 14 16
time_cost 140
effect bonus armor 1
requirements constantinople

def chain_mail
class upgrade
cost 14 16
time_cost 140
effect bonus armor 1
requirements constantinople

def traction_power
class upgrade
cost 15 5
time_cost 100
effect bonus range 2

def a_javelin
class upgrade
cost 20 30
time_cost 160
effect bonus damage 2
requirements constantinople

def speed_up_slash
class upgrade
effect bonus cooldown -0.5
requirements b_improvement

def slow_slash
class upgrade
effect bonus cooldown 0.5
requirements speed_up_slash

def b_superhealer
class upgrade
cost 80 0
time_cost 120
effect bonus heal_level 5
requirements constantinople

def c_conversion
class upgrade
cost 50 0
time_cost 120
requirements constantinople

def c_resurrection
class upgrade
cost 50 0
time_cost 120
requirements constantinople

def b_lv1attackspeed
is_a lv1attackspeed
requirements town_center

def b_lv2attackspeed
is_a lv2attackspeed
requirements governor's_palace

def b_lv3attackspeed
is_a lv3attackspeed
requirements constantinople

def b_lv1sightrange
is_a lv1sightrange
requirements town_center

def b_lv2sightrange
is_a lv2sightrange
effect bonus sight_range 1
requirements governor's_palace

def b_lv3sightrange
is_a lv3sightrange
effect bonus sight_range 1
requirements constantinople

def b_improvement
is_a improvement
requirements heavy_shield scale_armor chain_mail

def b_improvement2
is_a improvement2
requirements slow_slash


;tang_skill

def summon_errand
class ability
mana_cost 100
effect summon 20 3 errand

def a_protection_law
class ability
requirements u_protection_law
mana_cost 100
effect recall
effect_target ask
effect_range inf
universal_notification 1

def a_lobby
class ability
mana_cost 50
effect conversion
effect_target ask

def a_summon_golden_dragon
class ability
requirements u_summon_golden_dragon
mana_cost 200
effect summon 120 2 golden_dragon

def a_eyesight
class ability
mana_cost 30
effect summon 10 eyesight
effect_target ask
effect_range inf

def a_come_back_to_life
class ability
requirements u_come_back_to_life
mana_cost 100
effect resurrection 6

def a_thunder
class ability
mana_cost 100
effect summon 2 thunder
effect_target ask
effect_range 12
universal_notification 1

def projectile_rocks
class ability
mana_cost 50
effect summon 1 rocks
effect_target ask
effect_range 12
universal_notification 1

def shoot_arrows
class ability
mana_cost 50
effect summon 1 arrows
effect_target ask
effect_range 4
universal_notification 1


;turk_skill

def trip_lock
class building
provides_survival 0
hp_max 1
range 6
cooldown 6
damage 15
is_invisible 1
splash 1
damage_radius 0.5
is_buildable_anywhere 1

def set_stumbling_blocks
class ability
mana_cost 100
requirements pasha_tent
effect summon 0 trip_lock
effect_target ask
effect_range square

def divination
class effect
is_invisible 1
is_a_detector 1
airground_type air

def a_divination
class ability
mana_cost 30
effect summon 10 divination
effect_target random
effect_range anywhere


def curse
class effect
harm_level 2
harm_target_type healable

def a_curse
class ability
mana_cost 100
effect summon 15 curse
effect_target ask
effect_range 12


def summon_sirius
class ability
requirements u_appreciation_of_sirius
mana_cost 200
effect summon 120 2 golden_wolf

def rain
class soldier
food_cost 0
corpse 0
heal_level 9
is_vulnerable 0
range 12
airground_type air
speed 0
transport_volume 99

def a_rain
class ability
mana_cost 150
effect summon 120 rain
effect_target ask
effect_range 24

def bewitched
class ability
mana_cost 150
effect conversion
effect_target ask

def summon_turkic_finch
class ability
requirements birdhouse
mana_cost 200
effect summon 120 4 turkic_finch


;b_skill

def javelin
is_a nonedamager
cooldown 2
damage 20
can_use a_javelin

def throwing_javelin
class ability
mana_cost 100
effect summon 1 javelin
effect_target ask
effect_range 12

def summon_double_headed_eagle
class ability
mana_cost 200
effect summon 120 2 double_headed_eagle

def summon_mercenaries
class ability
mana_cost 100
effect summon 20 4 native_hussars 4 turkic_mercenary_cavalry 4 varangian_guard

def greek_fire
class effect
harm_level 30
harm_target_type

def fire_greek_fire
class ability
mana_cost 200
time_cost 10
effect summon 5 2 greek_fire
effect_target ask
effect_range 12
universal_notification 1

def b_resurrection
class ability
requirements c_resurrection
mana_cost 150
effect resurrection 6

def b_conversion
class ability
requirements c_conversion
mana_cost 150
effect conversion
effect_target ask

def holy_vision
class effect
is_invisible 1
is_a_detector 1
airground_type air

def b_holy_vision
class ability
mana_cost 30
effect summon 10 holy_vision
effect_target ask
effect_range inf





; units

;worker


def workman
class worker
cost 4 0
food_cost 1
time_cost 10
hp_max 25
speed 1.5
range 0.8
sight_range 3
cooldown 1
damage 1
;can_use a_improved_wood_gathering

def villagers
is_a workman
can_build village drillground carriage_shop tang_leathershop lumbermill foundry_bureau tang_wall tang_gate tang_scouttower county_government tang_stables ordnance_supervisor tang_shipyard taoist_temple

def turk_herdsmen
is_a workman
hp_max 20
damage 1.5
can_build turk_pasture turk_barracks lumbermill turk_blacksmith turk_leathershop turk_wall turk_gate turk_scouttower archim_tent turk_stables turk_arms_workshop birdhouse turk_shaman_temple turk_shipyard
can_use improve_your_diet


def serf
is_a workman
can_build fruit_estate b_barracks b_leathershop lumbermill mine b_blacksmith town_center b_stables armament_institute dock church b_wall b_gate guard_tower 


;soldiers

def light_infantry
class soldier
cost 5 1
time_cost 12
food_cost 1
hp_max 40
speed 1.5
armor 0
armor_bonus 1
range 1
sight_range 3
cooldown 1.4
damage 8

def tang_archer
is_a light_infantry
hp_max 30
sight_range 6
requirements lumbermill
can_use archer_weapon leather_armor archer_range tang_lv1attackspeed tang_lv2attackspeed tang_lv3attackspeed
armor_bonus 0.5
cooldown 1.5
target_types ground air
range 4
is_ballistic 1
damage 4
damage_bonus 1
can_upgrade_to horizontal_knife_footman marksman

def horizontal_knife_footman
is_a light_infantry
can_use horizontal_knife leather_armor
can_upgrade_to tang_archer

def errand
is_a light_infantry
cooldown 1.5
damage 8
can_use horizontal_knife leather_armor
corpse 0

def tang_archer2
is_a modao_footman
hp_max 30
sight_range 6
requirements lumbermill
cooldown 2.5
target_types ground air
range 4
is_ballistic 1
damage 4
damage_bonus 1
can_use archer_weapon footman_armor archer_range tang_lv1attackspeed tang_lv2attackspeed tang_lv3attackspeed
speed 1
can_research add_speed minus_speed
can_upgrade_to modao_footman marksman

def marksman
is_a light_infantry
cost 10 5
food_cost 1
time_cost 75
hp_max 32
sight_range 7
speed 1.5
requirements lumbermill taoist_temple
can_use archer_weapon leather_armor archer_range
cooldown 3.5
target_types ground air
range 6
minimal_range 4
is_ballistic 1
damage 10
damage_bonus 1
is_invisible 1

def turk_archer
is_a light_infantry
hp_max 30
requirements lumbermill
can_use archer_weapon leather_armor archer_range improve_your_diet tk_lv1attackspeed tk_lv2attackspeed tk_lv3attackspeed
cooldown 1.8
target_types ground air
range 4
range_bonus 1
sight_range 6
is_ballistic 1
damage 4.8
damage_bonus 1
can_upgrade_to turk_spearmen turk_whistlinger

def turk_spearmen
is_a light_infantry
speed 1
range 1.2
sight_range 3.2
cooldown 2.1
damage 14.25
damage_bonus 2
can_use spear leather_armor improve_your_diet
can_upgrade_to turk_archer

def turk_whistlinger
is_a light_infantry
cost 10 5
food_cost 1
time_cost 75
hp_max 34
sight_range 7
speed 1.5
requirements lumbermill turk_shaman_temple pasha_tent
can_use whistling leather_armor archer_range improve_your_diet
cooldown 4.5
target_types ground air
range 5
range_bonus 1
minimal_range 4
is_ballistic 1
damage 10.5
is_invisible 1

def pikemen
is_a light_infantry
cost 5 0
mana_max 200
speed 1
range 1.2
sight_range 3.2
cooldown 2.1
damage 15
damage_bonus 2
can_use pike leather_armor light_shield throwing_javelin

def b_archer
is_a light_infantry
hp_max 30
sight_range 6
requirements lumbermill
cooldown 2.4
target_types ground air
range 4
is_ballistic 1
damage 6.4
damage_bonus 1
can_use archer_weapon archer_range light_shield b_lv1attackspeed b_lv2attackspeed b_lv3attackspeed
can_upgrade_to axemen

def axemen
is_a light_infantry
cooldown 2.1
damage 14
damage_bonus 2
can_use axe light_shield
requirements b_blacksmith
can_upgrade_to b_archer


def heavy_infantry
class soldier
cost 8 1
food_cost 1
time_cost 15
hp_max 50
speed 1
armor 0
armor_bonus 3
range 1
sight_range 3
cooldown 1.4
damage 10

def modao_footman
is_a heavy_infantry
can_use mo_knife footman_armor tang_improvement add_speed tang_improvement2 minus_speed
can_upgrade_to tang_archer2
can_research add_speed minus_speed
requirements foundry_bureau

def sword_shield_men
is_a heavy_infantry
cost 8 0
cooldown 3
damage 20
damage_bonus 3
can_use heavy_sword heavy_shield scale_armor chain_mail b_improvement b_improvement2 speed_up_slash slow_slash
can_research speed_up_slash slow_slash
requirements b_blacksmith

def varangian_guard
is_a heavy_infantry
cooldown 2.4
damage 16
damage_bonus 3
can_use axe buckler chain_mail
corpse 0

def hussar
class soldier
cost 8 1
food_cost 2
time_cost 15
hp_max 45
speed 2.5
speed_bonus 2.5
armor 0
armor_bonus 1
cooldown 1.8
damage 9
transport_volume 2

def light_cavalry
is_a hussar
cost 10 1
armor_bonus 1.5
can_use saber bright_light_armor horse_speed tang_lv1sightrange tang_lv2sightrange tang_lv3sightrange
requirements tang_stables
can_upgrade_to tang_cavalry_archer

def tang_cavalry_archer
is_a light_cavalry
hp_max 35
can_use ridingbow bright_light_armor ridingbow_range horse_speed
speed_bonus 2.5
requirements lumbermill government_office stables
range 4
sight_range 6
range_bonus 1
target_types ground air
cooldown 1.5
damage 2.5
damage_bonus 1
can_upgrade_to light_cavalry

def turk_archer_cavalry
is_a hussar
hp_max 35
mana_max 200
mana_regen 1
requirements lumbermill stables
can_use ridingbow leather_armor ridingbow_range horse_speed summon_turkic_finch improve_your_diet tk_lv1sightrange tk_lv2sightrange tk_lv3sightrange
speed_bonus 2.5
range 4
sight_range 6
range_bonus 1
cooldown 1.8
damage 3.6
damage_bonus 1
target_types ground air
can_upgrade_to turk_sword_cavalry

def turk_sword_cavalry
is_a hussar
mana_max 200
mana_regen 1
can_use sword leather_armor horse_speed summon_turkic_finch improve_your_diet tk_lv1sightrange tk_lv2sightrange tk_lv3sightrange
requirements turk_stables
cooldown 1.4
damage 7
damage_bonus 2
can_upgrade_to turk_archer_cavalry

def saber_cavalry
is_a hussar
cost 8 1
requirements hakemu_tent stables
mana_max 200
mana_regen 1
can_use saber leather_armor horse_speed summon_turkic_finch improve_your_diet tk_lv1sightrange tk_lv2sightrange tk_lv3sightrange
cooldown 1.8
damage 9
damage_bonus 2
can_upgrade_to turk_archer_cavalry2

def turk_archer_cavalry2
is_a turk_archer_cavalry
can_upgrade_to saber_cavalry

def turk_blade_cavalry
is_a hussar
cost 8 1
mana_max 200
mana_regen 1
can_use blade leather_armor horse_speed summon_turkic_finch improve_your_diet tk_lv1sightrange tk_lv2sightrange tk_lv3sightrange
speed 2.8
speed_bonus 2.2
requirements turk_stables
range 0.8
sight_range 3
cooldown 1.4
damage 8.5
damage_bonus 2.5
can_upgrade_to turk_archer_cavalry3

def turk_archer_cavalry3
is_a turk_archer_cavalry
can_upgrade_to turk_blade_cavalry

def native_hussars
is_a hussar
mana_max 200
can_use pike light_shield throwing_javelin horse_speed
cooldown 2
damage 10
damage_bonus 2
transport_volume 2
corpse 0

def turkic_mercenary_cavalry
is_a turk_archer_cavalry
corpse 0
can_upgrade_to turkic_cavalry_melee_mode

def turkic_cavalry_melee_mode
is_a hussar
cooldown 1.4
damage 7
damage_bonus 2
can_use pike leather_armor buckler horse_speed throwing_javelin
 can_upgrade_to turkic_mercenary_cavalry
corpse 0


def middle_cavalry
class soldier
cost 14 1
food_cost 2
time_cost 30
hp_max 60
can_use pike heavy_shield scale_armor chain_mail horse_speed b_lv1sightrange b_lv2sightrange b_lv3sightrange
speed 2.5
armor 0
range 1
sight_range 3
cooldown 2.8
damage 14
speed_bonus 1.5
transport_volume 2

def pike_cavalry
is_a middle_cavalry
can_use pike heavy_shield scale_armor chain_mail horse_speed b_lv1sightrange b_lv2sightrange b_lv3sightrange
damage_bonus 2
requirements b_stables
can_upgrade_to b_cavalry_archer

def b_cavalry_archer
is_a middle_cavalry
hp_max 35
can_use ridingbow bright_light_armor ridingbow_range horse_speed
requirements lumbermill governor's_palace stables
range 4
sight_range 6
range_bonus 1
target_types ground air
cooldown 3.5
damage 7
damage_bonus 1
transport_volume 2
can_use ridingbow ridingbow_range buckler heavy_shield scale_armor chain_mail horse_speed
can_upgrade_to pike_cavalry

def heavy_cavalry
class soldier
cost 25 15
food_cost 3
time_cost 40
hp_max 100
speed 2
speed_bonus 1
armor 1
range 1
sight_range 3
cooldown 1.8
damage 12
transport_volume 3


def black_cavalry
is_a heavy_cavalry
requirements tang_stables governor's_house
can_use horselance mysterious_armor horse_speed
can_upgrade_to horsecrossbowmen

def horsecrossbowmen
is_a heavy_cavalry
hp_max 80
requirements lumbermill stables governor's_house
range 5
sight_range 7
cooldown 4
damage 8
damage_bonus 1
armor 0
transport_volume 3
can_use crossbow mysterious_armor horse_speed
can_upgrade_to black_cavalry


def turk_spear_cavalry
is_a heavy_cavalry
hp_max 90
mana_max 200
mana_regen 1 ; mana / second
requirements turk_stables pasha_tent
can_use spear ring_armor horse_speed set_stumbling_blocks improve_your_diet
range 1.2
sight_range 3.2
cooldown 2
damage 13
damage_bonus 3
can_upgrade_to turk_whistlinger_cavalry

def turk_whistlinger_cavalry
is_a heavy_cavalry
requirements lumbermill stables pasha_tent
hp_max 70
mana_max 200
mana_regen 1
sight_range 6
can_use whistling leather_armor ridingbow_range horse_speed set_stumbling_blocks improve_your_diet
armor 0
cooldown 3.5
target_types ground air
range 4
range_bonus 1
is_ballistic 1
damage 7.5
can_upgrade_to turk_spear_cavalry

def iron_paladin
is_a heavy_cavalry
hp_max 110
mana_max 200
requirements b_stables constantinople
cooldown 3
damage 20
damage_bonus 3
can_use heavy_sword buckler scale_armor chain_mail horse_speed summon_double_headed_eagle


def instrument
class soldier
cost 15 10
food_cost 2
time_cost 30
hp_max 30
speed 0.75
is_repairable 1
is_healable 0
transport_volume 4
corpse 0

def tang_siege_vehicle
is_a instrument
range 10
sight_range 12
minimal_range 4
is_ballistic 1
cooldown 4
damage 15
damage_radius 0.25
splash 1
requirements government_office

def ballista
is_a instrument
cost 30 40
requirements governor's_house
hp_max 60
range 12
sight_range 14
is_ballistic 1
cooldown 4
damage 20
damage_bonus 3
damage_radius 0.25
splash 1
minimal_range 4
can_use crossbow

def turk_trebuchet
is_a instrument
cooldown 4
damage 14
minimal_range 4
splash 1


def b_catapult
is_a instrument
range 10
sight_range 12
minimal_range 4
is_ballistic 1
cooldown 4
damage 15
damage_radius 0.25
splash 1
can_use traction_power


def woodbird
is_a instrument
cost 5 5
food_cost 1
time_cost 10
airground_type air
speed 2
sight_range 10
is_a_detector 1
transport_volume 99


def marching_vehicle
is_a instrument
cost 5 5
food_cost 1
time_cost 10
hp_max 500
speed 2
speed_bonus 0.5
sight_range 6
can_use horse_speed
transport_capacity 70
transport_volume 99

def flying
class soldier
food_cost 3
airground_type air
hp_max 40
;hp_regen 0.15
speed 3
range 4
sight_range 6
cooldown 4
damage 8
target_types ground air
damage_radius 1
transport_volume 99
corpse 0


def golden_dragon
is_a flying
splash 1


def golden_wolf
is_a flying
hp_max 45
;hp_regen 0.15
range 1
sight_range 6
cooldown 1.5
damage 6
is_a_detector 1


def turkic_finch
is_a flying
food_cost 1
hp_max 20
;hp_regen 0.15
range 0.8
cooldown 1
damage 1
target_types air


def double_headed_eagle
is_a flying
;hp_regen 0.15
range 1
cooldown 1.5
damage 8
is_a_detector 1


def auxiliary_class
class soldier
cost 20 10
food_cost 3
time_cost 30
hp_max 60
mana_max 200
mana_regen 1 ; mana / second
speed 1
range 6
sight_range 8
cooldown 1.5
damage 5.5
transport_volume 2

def taoist_priest
is_a auxiliary_class
can_use a_protection_law a_summon_golden_dragon a_thunder the_art_of_qi_huang a_eyesight a_lobby a_come_back_to_life
heal_level 5
target_types ground air

def turk_shaman
is_a auxiliary_class
can_use a_rain summon_sirius a_divination a_curse bewitched improve_your_diet
cooldown 1.5
damage 5.5
target_types ground air

def b_priest
is_a auxiliary_class
cooldown 0
damage 0
can_use b_superhealer b_holy_vision b_conversion b_resurrection
heal_level 5

def ship
class soldier
cost 10 15
food_cost 1
time_cost 10
airground_type water
hp_max 500
armor 1
speed 1.5
sight_range 6
is_repairable 1
is_healable 0
transport_volume 99
corpse 0

def yacht
is_a ship
transport_capacity 70

def fightingship
is_a ship
cost 20 25
food_cost 2
time_cost 20
requirements lumbermill
hp_max 400 ;  130/33
armor 1
speed 1.5
range 6
sight_range 8
range_bonus 1
is_ballistic 1
cooldown 1.5
damage 5
damage_bonus 3
target_types ground air
can_use archer_weapon archer_range
can_upgrade_to stickship

def stickship
is_a fightingship
range 1
sight_range 3
cooldown 1.5
damage 9.5
armor 1
can_use
corpse 0
can_upgrade_to fightingship

def walkship
is_a ship
cost 15 18
time_cost 20
food_cost 2
hp_max 300 ;  130/33
mana_max 50
mana_regen 10.25 ; mana / second
speed 2.5
is_repairable 1
is_healable 0
airground_type water
range 1
	sight_range 3
cooldown 1.5
damage 10
armor 2
transport_volume 99
corpse 0
can_use projectile_rocks

def buildingship
is_a ship
cost 40 60
food_cost 3
time_cost 30
requirements lumbermill ordnance_supervisor
hp_max 800
armor 2
speed 0.75
range 12
sight_range 14
minimal_range 4
is_ballistic 1
cooldown 6
damage 18
damage_bonus 2
damage_radius 0.25
splash 1
is_repairable 1
is_healable 0
airground_type water
transport_volume 99
corpse 0
can_use crossbow

def dash
is_a ship
cost 20 34
food_cost 1
time_cost 20
hp_max 250
mana_max 50
mana_regen 33 ; mana / second
armor 0
speed 2.5
is_repairable 1
is_healable 0
airground_type water
sight_range 6
requirements lumbermill taoist_temple
can_use shoot_arrows
transport_volume 99
corpse 0
is_invisible 1
is_a_detector 1

def raft
is_a ship
cost 5 5
food_cost 1
time_cost 10
airground_type water
hp_max 200
armor 2
speed 1.5
sight_range 6
is_repairable 1
is_healable 0
transport_capacity 30
transport_volume 99
corpse 0

def fishingship
is_a ship
cost 5 5
food_cost 1
requirements lumbermill
time_cost 10
airground_type water
hp_max 100
armor 0
speed 1.5
sight_range 8
range 6
range_bonus 1
cooldown 2
damage 7.5
damage_bonus 2
can_use archer_weapon archer_range
is_repairable 1
is_healable 0
transport_volume 99
corpse 0

def riprapship
is_a ship
cost 15 10
food_cost 3
time_cost 20
requirements lumbermill turk_arms_workshop
hp_max 250
speed 0.75
range 10
sight_range 12
minimal_range 4
is_ballistic 1
cooldown 4
damage 14
damage_radius 0.25
splash 1
is_repairable 1
is_healable 0
airground_type water
transport_volume 99
corpse 0

def dromon
is_a ship
cost 10 15
food_cost 1
time_cost 20
airground_type water
hp_max 400
mana_max 200
mana_regen 1 ; mana / second
armor 1
speed 2.3
is_repairable 1
is_healable 0
is_a_detector 1
range 6
sight_range 8
cooldown 1.5
damage 6
target_types ground air
can_use archer_weapon archer_range fire_greek_fire
transport_capacity 40
transport_volume 99
corpse 0
requirements lumbermill

def heavy_dromon
is_a ship
cost 15 20
food_cost 2
time_cost 30
airground_type water
hp_max 600
armor 2
speed 1
is_repairable 1
is_healable 0
range 10
sight_range 12
minimal_range 4
cooldown 4
damage 10
damage_radius 0.25
is_ballistic 1
splash 1
transport_volume 99
corpse 0
can_upgrade_to dromon_melee_mode
requirements governor's_palace

def dromon_melee_mode
is_a heavy_dromon
range 1
cooldown 2
damage 10
damage_radius 0
minimal_range 0
is_ballistic 0
splash 0
can_upgrade_to heavy_dromon
requirements governor's_palace

def royal_dromon
is_a ship
cost 20 30
food_cost 3
time_cost 30
airground_type water
hp_max 800
armor 3
speed 1
is_repairable 1
is_healable 0
range 1
sight_range 3
cooldown 2
damage 15
transport_volume 99
corpse 0
can_upgrade_to dromon_remote_mode
requirements constantinople

def dromon_remote_mode
is_a royal_dromon
range 10
sight_range 12
minimal_range 4
cooldown 4
damage 16
is_ballistic 1
splash 1
damage_radius 0.5
can_use traction_power
requirements constantinople
can_upgrade_to royal_dromon

; buildings


def food_source
class building
cost 5 5
food_provided 12
hp_max 500
time_cost 60

def village
is_a food_source

def turk_pasture
is_a food_source
food_provided 9
hp_max 400
	requirements archim_tent

def fruit_estate
is_a food_source
requirements town_center


def barracks
class building
cost 7 9
food_provided 0
hp_max 266.7;  800/3
time_cost 60
requirements townhall

def drillground
is_a barracks
hp_max 600
requirements county_government
can_train tang_archer modao_footman light_cavalry black_cavalry

def turk_barracks
is_a barracks
hp_max 450
requirements archim_tent
can_train turk_archer turk_archer_cavalry turk_blade_cavalry saber_cavalry turk_spear_cavalry

def b_barracks
is_a barracks
hp_max 600
requirements town_center
can_train pikemen b_archer sword_shield_men pike_cavalry iron_paladin

def blacksmith
class building
cost 8 10
food_provided 0
hp_max 266.7;  800/3
time_cost 90
requirements townhall
can_research melee_weapon melee_armor

def foundry_bureau
is_a blacksmith
hp_max 600
time_cost 60
requirements county_government
can_research horizontal_knife mo_knife saber footman_armor tang_improvement tang_improvement2 bright_light_armor horselance mysterious_armor

def turk_blacksmith
is_a blacksmith
hp_max 400
time_cost 60
requirements hakemu_tent
can_research spear sword blade saber ring_armor

def b_blacksmith
is_a blacksmith
hp_max 600
time_cost 60
requirements town_center
can_research pike axe light_shield heavy_sword heavy_shield buckler a_javelin scale_armor chain_mail b_improvement b_improvement2

def lumbermill
class building
cost 6 9
food_provided 0
hp_max 500
time_cost 60
storable_resource_types 1
can_research archer_weapon archer_range ridingbow ridingbow_range
storage_bonus 0 1 ; gold bonus is +0, wood bonus is +1

def mine
class building
cost 6 9
food_provided 0
hp_max 500
time_cost 60
storable_resource_types 0
storage_bonus 1 0
requirements governor's_palace

def leathershop
class building
cost 5 5
food_provided 0
hp_max 500
time_cost 60
can_research leather_armor

def tang_leathershop
is_a leathershop
requirements county_government

def turk_leathershop
is_a leathershop
requirements archim_tent

def b_leathershop
is_a leathershop
requirements town_center

def stables
class building
cost 10 15
food_provided 0
hp_max 550
time_cost 60
can_research horse_speed

def tang_stables
is_a stables
requirements government_office

def turk_stables
is_a stables
requirements archim_tent

def b_stables
is_a stables
requirements governor's_palace

def townhall
class building
cost 12 16
food_provided 1
hp_max 800;  1200/3
time_cost 135
heal_level 1
storable_resource_types 0 1

def county_government
is_a townhall
mana_max 200
can_train villagers
can_use summon_errand
can_research tang_lv1sightrange tang_lv1attackspeed
can_upgrade_to government_office

def government_office
is_a county_government
cost 22 31 ; this is the total cost
time_cost 315 ; this is the total cost
hp_max 1600
heal_level 2
requirements drillground
can_research tang_lv2sightrange tang_lv2attackspeed
can_upgrade_to governor's_house

def governor's_house
is_a government_office
cost 42 61 ; this is the total cost
time_cost 435 ; this is the total cost
hp_max 3200
heal_level 4
requirements drillground lumbermill foundry_bureau tang_stables
can_research tang_lv3sightrange tang_lv3attackspeed
can_upgrade_to

def archim_tent
is_a townhall
cost 10 14
hp_max 400
time_cost 100
heal_level 0
can_research tk_lv1sightrange tk_lv1attackspeed
can_train turk_herdsmen
can_upgrade_to movearchim_tent hakemu_tent 

def hakemu_tent
is_a archim_tent
cost 22 35
time_cost 250 ; this is the total cost
hp_max 800
requirements turk_stables turk_barracks
can_research tk_lv2sightrange tk_lv2attackspeed
can_upgrade_to pasha_tent

def pasha_tent
is_a hakemu_tent
cost 44 67
time_cost 525
hp_max 1200
requirements turk_arms_workshop
can_research tk_lv3sightrange tk_lv3attackspeed improve_your_diet
can_upgrade_to

def movearchim_tent
is_a instrument
cost 10 14
food_provided 1
time_cost 100
hp_max 400
can_upgrade_to archim_tent
food_cost 0
speed 1.5
damage 0
is_repairable 1
is_healable 0
transport_volume 99
corpse 0

def town_center
is_a townhall
mana_max 200
can_train serf
can_use summon_mercenaries
can_research b_lv1sightrange b_lv1attackspeed
can_upgrade_to governor's_palace

def governor's_palace
is_a town_center
cost 22 31
time_cost 315
hp_max 1600
heal_level 2
requirements b_barracks
can_research b_lv2sightrange b_lv2attackspeed
can_upgrade_to constantinople

def constantinople
is_a governor's_palace
cost 42 61
time_cost 435
hp_max 3200
heal_level 4
requirements lumbermill b_blacksmith b_stables
can_research b_lv3sightrange b_lv3attackspeed
can_upgrade_to

def factory
class building
cost 10 15
food_provided 0
hp_max 600
time_cost 60

def ordnance_supervisor
is_a factory
requirements government_office
can_train woodbird tang_siege_vehicle ballista
can_research crossbow

def turk_arms_workshop
is_a factory
hp_max 400
requirements hakemu_tent
can_train turk_trebuchet
can_research whistling

def armament_institute
is_a factory
requirements governor's_palace
can_train b_catapult
can_research traction_power

def carriage_shop
class building
cost 6 9
time_cost 45
requirements county_government
can_train marching_vehicle 
food_provided 0
hp_max 600

def taoist_temple
class building
cost 15 20
food_provided 0
hp_max 600
time_cost 60
requirements governor's_house
can_train taoist_priest
can_research u_protection_law u_summon_golden_dragon u_thunder the_art_of_qi_huang u_come_back_to_life

def turk_shaman_temple
class building
cost 15 20
food_provided 0
hp_max 450
time_cost 90
requirements pasha_tent
can_train turk_shaman
can_research u_curse u_appreciation_of_sirius

def church
class building
cost 10 30
food_provided 0
hp_max 600
time_cost 60
requirements constantinople
can_train b_priest
can_research b_superhealer c_conversion c_resurrection

def birdhouse
class building
food_provided 1
cost 2 2
time_cost 20
hp_max 80

def tang_scouttower
class building
cost 6 2
hp_max 100
time_cost 60
bonus_height 1
sight_range 6
can_upgrade_to watchtower crossbowtower
is_buildable_anywhere 1
provides_survival 0
is_a_detector 1

def watchtower
class building
cost 20 30
hp_max 500
armor 0
time_cost 60
bonus_height 1
sight_range 6
is_buildable_anywhere 1
provides_survival 1
is_a_detector 1
transport_capacity 70
transport_volume 99

def crossbowtower
class building
cost 40 30
requirements lumbermill ordnance_supervisor governor's_house
hp_max 100;  130/3
time_cost 60
bonus_height 1
range 10
range_bonus 2
sight_range 6
minimal_range 4
is_ballistic 1
cooldown 6
damage 30
damage_bonus 2
armor 1
can_use archer_weapon archer_range
is_buildable_anywhere 1
provides_survival 0

def turk_scouttower
class building
cost 6 2
hp_max 100
time_cost 60
bonus_height 1
sight_range 6
is_buildable_anywhere 1
provides_survival 0
is_a_detector 1

def guard_tower
class building
cost 6 2
hp_max 100
time_cost 60
bonus_height 1
sight_range 6
can_upgrade_to fortress catapulttower
is_buildable_anywhere 1
provides_survival 0
is_a_detector 1

def fortress
class building
cost 20 30
hp_max 500
armor 10
time_cost 60
bonus_height 1
sight_range 6
is_buildable_anywhere 1
provides_survival 1
is_a_detector 1
transport_capacity 70
requirements governor's_palace
transport_volume 99

def catapulttower
class building
cost 40 30
requirements lumbermill armament_institute constantinople
hp_max 100;  130/3
time_cost 60
bonus_height 1
range 10
range_bonus 2
sight_range 6
minimal_range 4
is_ballistic 1
cooldown 4
damage 35
damage_radius 0.5
can_use traction_power
armor 1
is_buildable_anywhere 1
provides_survival 0


def tang_wall
class building
cost 7 9
food_provided 0
hp_max 500
time_cost 60
is_buildable_on_exits_only 1
provides_survival 0
can_upgrade_to tang_massive_wall

def tang_massive_wall
class building
cost 21 27
food_provided 0
hp_max 1600
time_cost 90
is_buildable_on_exits_only 1
provides_survival 0
requirements government_office

def tang_gate
class building
cost 10 10
food_provided 0
hp_max 400
time_cost 60
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
can_upgrade_to tang_massive_gate

def tang_massive_gate
class building
cost 30 30
food_provided 0
hp_max 1000
time_cost 90
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
requirements government_office

def turk_wall
class building
cost 7 9
food_provided 0
hp_max 300
time_cost 60
is_buildable_on_exits_only 1
provides_survival 0
can_upgrade_to turk_massive_wall

def turk_massive_wall
class building
cost 21 27
food_provided 0
hp_max 800
time_cost 90
is_buildable_on_exits_only 1
provides_survival 0
requirements hakemu_tent

def turk_gate
class building
cost 10 10
food_provided 0
hp_max 100
time_cost 60
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
can_upgrade_to turk_massive_gate

def turk_massive_gate
class building
cost 30 30
food_provided 0
hp_max 500
time_cost 90
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
requirements hakemu_tent

def b_wall
class building
cost 7 9
food_provided 0
hp_max 500
time_cost 60
is_buildable_on_exits_only 1
provides_survival 0
can_upgrade_to b_massive_wall

def b_massive_wall
class building
cost 21 27
food_provided 0
hp_max 1600
time_cost 90
is_buildable_on_exits_only 1
provides_survival 0
requirements governor's_palace

def b_gate
class building
cost 10 10
food_provided 0
hp_max 400
time_cost 60
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
can_upgrade_to b_massive_gate

def b_massive_gate
class building
cost 30 30
food_provided 0
hp_max 1000
time_cost 90
is_buildable_on_exits_only 1
is_a_gate 1
provides_survival 0
requirements governor's_palace

def tang_shipyard
class building
cost 10 15
food_provided 0
hp_max 600
time_cost 180
is_buildable_near_water_only 1
requirements county_government lumbermill
can_train yacht fightingship walkship buildingship dash

def turk_shipyard
class building
cost 6 8
food_provided 0
hp_max 350
time_cost 60
is_buildable_near_water_only 1
requirements archim_tent lumbermill
can_train raft fishingship riprapship

def dock
class building
cost 10 15
food_provided 0
hp_max 600
time_cost 60
is_buildable_near_water_only 1
requirements town_center lumbermill
can_train dromon heavy_dromon royal_dromon

; abilities (passive or active)






;def a_improved_wood_gathering
;effect bonus stored_wood --
;requirements lumbermill





; other units

def instant_death ; used by some maps to create dead units
class effect
harm_level 10000
harm_target_type
decay 1

def thunder
is_a nonedamager
range 12
cooldown 2
damage 5
damage_radius 0.75
splash 1
target_types ground air
can_use u_thunder

def rocks
is_a nonedamager
range 12
cooldown 2
damage 20
damage_radius 0.25
splash 1
corpse 0

def arrows
is_a nonedamager
range 12
cooldown 2
damage 18
damage_bonus 20.5
target_types ground air
is_ballistic 1
can_use archer_weapon archer_armor_archer_range

def earthquake
class effect
harm_level 1
harm_target_type building

def quicksand ; or surface
class effect
harm_level 1
harm_target_type ground unit

def eyesight
class effect
is_invisible 1
is_a_detector 1
airground_type air


def nonedamager
class soldier
food_cost 0
is_healable 0
corpse 0
transport_volume 99
is_teleportable 0
is_vulnerable 0

def 

def keep
class building
decay 1

def castle
class building
decay 1

def farm
class building
decay 1

def scouttower
class building
decay 1

def guardtower
class building
decay 1

def cannontower
class building
decay 1

def scouttower
class building
decay 1

def temple
class building
decay 1

def workshop
class building
decay 1

def shipyard
class building
decay 1

def dragonslair
class building
decay 1

def magestower
class building
decay 1

def necropolis
class building
decay 1

def peasant
class soldier
decay 1

def footman
class soldier
decay 1

def archer
class soldier
decay 1

def darkarcher
class soldier
decay 1

def knight
class soldier
decay 1

def dragon
class soldier
decay 1

def catapult
class soldier
decay 1

def flyingmachine
class soldier
decay 1

def new_flyingmachine
class soldier
decay 1

def mage
class soldier
decay 1
def priest
class soldier
decay 1

def necromancer
class soldier
decay 1

def skeleton
class soldier
decay 1

def zombie
class soldier
decay 1

def boat
decay 1

def destroyer
class soldier
decay 1

def battleship
class soldier
decay 1

def submarine
class soldier
decay 1
