# ## Engineering - Weapon Technologies

# ##################
# Mass Drivers
# ##################

# Mass Drivers
tech_mass_drivers_1 = {
	tier = 0
	cost = @tier0cost1
	area = engineering
	start_tech = yes
	category = { propulsion }
	start_tech = yes

	technology_swap = {
		name = tech_bio_mass_drivers_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}
}

# Coilguns
tech_mass_drivers_2 = {
	area = engineering
	cost = @tier1cost2
	tier = 1
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_1" }
	weight = @tier1weight2

	gateway = kinetic_weapons
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_mass_drivers_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

# Railguns
tech_mass_drivers_3 = {
	area = engineering
	cost = @tier2cost1
	tier = 2
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_2" }
	weight = @tier2weight1

	gateway = kinetic_weapons
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_mass_drivers_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

# Advanced Railguns
tech_mass_drivers_4 = {
	area = engineering
	cost = @tier3cost1
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_3" }
	weight = @tier3weight1

	gateway = kinetic_weapons
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_mass_drivers_4
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

# Gauss Cannons
tech_mass_drivers_5 = {
	area = engineering
	cost = @tier4cost1
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_4" }
	weight = @tier4weight1

	gateway = kinetic_weapons
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_mass_drivers_5
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_kinetic_artillery_1 = {
	area = engineering
	cost = @tier3cost3
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_4" }
	weight = @tier3weight3

	technology_swap = {
		name = tech_bio_kinetic_artillery_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_kinetic_artillery_2 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_5" "tech_kinetic_artillery_1" }
	weight = @tier4weight2

	technology_swap = {
		name = tech_bio_kinetic_artillery_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_mass_accelerator_1 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { propulsion }
	prerequisites = {
		tech_mass_drivers_4
		OR = {
			tech_battleships
			tech_stingers
		}
	}
	weight = @tier4weight2

	technology_swap = {
		name = tech_bio_mass_accelerator_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_mass_accelerator_2 = {
	area = engineering
	cost = @tier4cost3
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_mass_drivers_5" "tech_mass_accelerator_1" }
	weight = @tier4weight3

	technology_swap = {
		name = tech_bio_mass_accelerator_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}


# ##################
# Auto-Cannons
# ##################

tech_autocannons_1 = {
	area = engineering
	cost = @tier2cost2
	tier = 2
	category = { propulsion }
	prerequisites = {
		tech_mass_drivers_2
	}
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_autocannons_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight = @tier2weight2

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
		modifier = {
			factor = 0.5
			NOT = {
				has_technology = "tech_mass_drivers_1"
			}
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_autocannons_2 = {
	area = engineering
	cost = @tier3cost1
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_autocannons_1" }
	weight = @tier3weight1
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_autocannons_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_autocannons_3 = {
	area = engineering
	cost = @tier4cost1
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_autocannons_2" }
	weight = @tier4weight1
	
	modifier = {
		army_damage_mult = 0.05
	}

	technology_swap = {
		name = tech_bio_autocannons_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_flak_batteries_1 = {
	area = engineering
	tier = 0
	category = { propulsion }
	start_tech = yes

	technology_swap = {
		name = tech_bio_flak_batteries_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}
}

tech_flak_batteries_2 = {
	area = engineering
	cost = @tier2cost3
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_flak_batteries_1" }
	weight = @tier2weight3

	technology_swap = {
		name = tech_bio_flak_batteries_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

tech_flak_batteries_3 = {
	area = engineering
	cost = @tier4cost1
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_flak_batteries_2" }
	weight = @tier4weight1

	technology_swap = {
		name = tech_bio_flak_batteries_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_kinetic
		}
	}
}

# ##################
# Missiles
# ##################

# Nuclear Missiles
tech_missiles_1 = {
	area = engineering
	tier = 0
	category = { propulsion }
	start_tech = yes

	potential = {
		OR = {
			country_uses_bio_ships = no
			# Ascension / Crisis ships can equip missiles
			has_tradition = tr_nanotech_4
			has_crisis_level = crisis_level_2
			has_technology = tech_cosmogenesis_escort
		}
	}
}

# Fusion Missiles
tech_missiles_2 = {
	area = engineering
	cost = @tier1cost2
	tier = 1
	category = { propulsion }
	prerequisites = { "tech_missiles_1" "tech_fusion_power" }
	weight = @tier1weight2

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
	potential = {
		country_uses_bio_ships = no
	}
}

# Antimatter Missiles
tech_missiles_3 = {
	area = engineering
	cost = @tier2cost1
	tier = 2
	category = { propulsion }
	prerequisites = { "tech_missiles_2" }
	weight = @tier2weight1

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
	potential = {
		country_uses_bio_ships = no
	}
}

# Heavy Missiles
tech_missiles_4 = {
	area = engineering
	cost = @tier3cost1
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_missiles_3" }
	weight = @tier3weight1

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
	potential = {
		country_uses_bio_ships = no
	}
}

# Marauder Missiles
tech_missiles_5 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_missiles_4" }
	weight = @tier4weight2

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
	potential = {
		country_uses_bio_ships = no
	}
}

#Swarmer Missiles
tech_swarmer_missiles_1 = {
	area = engineering
	cost = @tier2cost2
	tier = 2
	category = { propulsion }
	prerequisites = {
		OR = {
			tech_harbingers
			tech_stingers
			tech_missiles_2
		}
	}
	weight = @tier2weight2

	technology_swap = {
		name = tech_bio_swarmer_missiles_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}

#Whirlwind Missiles
tech_swarmer_missiles_2 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_swarmer_missiles_1" }
	weight = @tier4weight2

	technology_swap = {
		name = tech_bio_swarmer_missiles_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}

# ##################
# Torpedo Weapons
# ##################

#Space Torpedoes
tech_torpedoes_1 = {
	area = engineering
	cost = @tier1cost2
	tier = 1
	category = { propulsion }
	prerequisites = { "tech_corvettes" }
	weight = @tier1weight2

	potential = {
		OR = {
			country_uses_bio_ships = no
			# Ascension / Crisis ships can equip torpedoes
			has_tradition = tr_nanotech_4
			has_crisis_level = crisis_level_2
			has_technology = tech_cosmogenesis_escort
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}

#Armored Torpedoes
tech_torpedoes_2 = {
	area = engineering
	cost = @tier3cost2
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_torpedoes_1" }
	weight = @tier3weight2

	potential = {
		country_uses_bio_ships = no
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}

#Devastator Torpedoes
tech_torpedoes_3 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_torpedoes_2" }
	weight = @tier4weight2

	potential = {
		country_uses_bio_ships = no
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_explosive
		}
	}
}
