# Arkship Technologies

tech_arkship_construction = {
	area = engineering
	category = { voidcraft }
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1

	potential = {
		is_nomadic = yes
	}

	prerequisites = {
		OR = {
			"tech_destroyers"
			"tech_weavers"
		}
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_ARKSHIP_1_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_ARKSHIP_1_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		factor = 1000
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

tech_arkship_tier_2 = {
	area = engineering
	category = { voidcraft }
	tier = 3
	cost = @tier3cost2
	weight = @tier3weight2

	potential = {
		is_nomadic = yes
	}

	prerequisites = {
		OR = {
			"tech_cruisers"
			"tech_harbingers"
		}
		"tech_arkship_construction"
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_ARKSHIP_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_ARKSHIP_2_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 5
			has_technology = tech_arkship_construction
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

tech_arkship_tier_3 = {
	area = engineering
	category = { voidcraft }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2

	prerequisites = {
		OR = {
			"tech_stingers"
			"tech_battleships"
		}
		"tech_arkship_tier_2"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_ARKSHIP_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_ARKSHIP_3_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 5
			has_technology = tech_arkship_construction
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_finish
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

tech_civilian_arkship = {
	area = society
	category = { new_worlds }
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1

	prerequisites = {
		"tech_planetary_engineering"
		"tech_arkship_construction"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_CIVILIAN_ARKSHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_CIVILIAN_ARKSHIP_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_2
		}
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_3
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

tech_science_arkship = {
	area = physics
	category = { computing }
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1

	prerequisites = {
		"tech_sensors_2"
		"tech_arkship_construction"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_SCIENCE_ARKSHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_SCIENCE_ARKSHIP_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_2
		}
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_3
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

tech_military_arkship = {
	area = engineering
	category = { voidcraft }
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1

	prerequisites = {
		OR = {
			"tech_destroyers"
			"tech_mauler_growth_2"
		}
		"tech_arkship_construction"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_MILITARY_ARKSHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_MILITARY_ARKSHIP_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_2
		}
		modifier = {
			factor = 5
			has_technology = tech_arkship_tier_3
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			is_nomadic = yes
		}
	}
}

# Arkship Spinal Mount Technologies
tech_arkship_planetary_refinery = {
	area = engineering
	category = { industry }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	is_rare = yes

	prerequisites = {
		"tech_arkship_tier_3"
		"tech_planetary_engineering"
	}

	potential = {
		is_nomadic = yes
	}

	weight_modifier = {
		modifier = {
			factor = 2
			OR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = 2
			has_technology = tech_space_mining_3
		}
		modifier = {
			factor = 2
			has_technology = tech_space_mining_4
		}
		modifier = {
			factor = 2
			has_technology = tech_space_mining_5
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_arkship_planetary_refinery
		}
	}

	ai_weight = {

	}
}

tech_arkship_stellar_igniter = {
	area = physics
	category = { field_manipulation }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	is_rare = yes

	prerequisites = {
		"tech_arkship_tier_3"
		"tech_mine_dark_matter"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_STELLAR_IGNITION_CONTRACT_TITLE"
			desc = "TECH_UNLOCK_STELLAR_IGNITION_CONTRACT_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 2
			OR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_arkship_stellar_igniter
		}
	}

	ai_weight = {

	}
}

tech_arkship_system_scanner = {
	area = physics
	category = { computing }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	is_rare = yes

	prerequisites = {
		"tech_arkship_tier_3"
		"tech_sensors_2"
		"tech_automated_exploration"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_TITLE"
			desc = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 2
			OR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = 2
			has_technology = tech_sensors_3
		}
		modifier = {
			factor = 2
			has_technology = tech_sensors_4
		}
		modifier = {
			factor = 5
			has_technology = tech_curator_lab
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_arkship_system_scanner
		}
	}

	ai_weight = {

	}
}

tech_arkship_exodus_jump = {
	area = physics
	category = { particles }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	is_rare = yes

	prerequisites = {
		"tech_arkship_tier_3"
		"tech_jump_drive_1"
	}

	potential = {
		is_nomadic = yes
	}

	weight_modifier = {
		modifier = {
			factor = 2
			OR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_arkship_exodus_jump
		}
	}

	ai_weight = {

	}
}

# Waystation Technologies

tech_nomads_mechanized_mining = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { industry }
	tier = 0
	icon = "tech_mechanized_mining"

	# unlocks strategic resources

	potential = {
		is_nomadic = yes
	}

	starting_potential = {
		is_nomadic = yes
	}
}

tech_waystation_1 = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { voidcraft }
	prerequisites = { "tech_space_construction" }
	tier = 0

	prereqfor_desc = {
		ship = {
			title = "allow_waystations"
			desc = "waystation_megastructure_MEGASTRUCTURE_DETAILS"
		}
	}

	potential = {
		is_nomadic = yes
	}

	starting_potential = {
		is_nomadic = yes
	}

	modifier = {
		country_starbase_capacity_add = 2
	}

	ai_weight = {
		factor = @ai_starbase_types_factor
	}
}

tech_waystation_2 = {
	area = engineering
	category = { voidcraft }
	tier = 2
	cost = @tier2cost2
	weight = @tier2weight2
	prerequisites = { "tech_waystation_1" }

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		hide_prereq_for_desc = ship
		custom = {
			title = "TECH_UNLOCK_WAYSTATION_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_WAYSTATION_2_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		country_starbase_capacity_add = 4
		nomadic_constructor_limit_add = 2
		shipsize_nomads_constructor_stockpile_capacity_mult = 0.25
	}

	technology_swap = {
		name = tech_waystation_2
		inherit_icon = yes
		inherit_effects = no

		trigger = {
			is_eager_explorer_empire = yes
		}
		modifier = {
			country_starbase_capacity_add = 4
			nomadic_constructor_limit_add = 2
			shipsize_nomads_constructor_stockpile_capacity_mult = 0.25
			shipsize_nomads_engineer_vessel_stockpile_capacity_mult = 0.25
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 20 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_starbase_3
			}
		}
		modifier = {
			factor = 2
			years_passed > 30
		}
		modifier = {
			factor = 3
			years_passed > 35
		}
		modifier = {
			factor = 4
			years_passed > 40
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_waystation_1
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
	}

	ai_weight = {
		factor = @ai_starbase_types_factor
	}
}

tech_waystation_3 = {
	area = engineering
	category = { voidcraft }
	tier = 3
	cost = @tier3cost2
	weight = @tier3weight2
	prerequisites = { "tech_waystation_2" }

	potential = {
		is_nomadic = yes
	}

	modifier = {
		country_starbase_capacity_add = 6
		nomadic_constructor_limit_add = 2
		shipsize_nomads_constructor_stockpile_capacity_mult = 0.25
	}

	technology_swap = {
		name = tech_waystation_3
		inherit_icon = yes
		inherit_effects = no

		trigger = {
			is_eager_explorer_empire = yes
		}
		modifier = {
			country_starbase_capacity_add = 6
			nomadic_constructor_limit_add = 2
			shipsize_nomads_constructor_stockpile_capacity_mult = 0.25
			shipsize_nomads_engineer_vessel_stockpile_capacity_mult = 0.25
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 2
			years_passed > 60
		}
		modifier = {
			factor = 3
			years_passed > 65
		}
		modifier = {
			factor = 4
			years_passed > 70
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_waystation_2
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_finish
		}
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_WAYSTATION_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_WAYSTATION_3_CONSTRUCTION_DESC"
		}
	}

	ai_weight = {
		factor = @ai_starbase_types_factor
	}
}

# Planetary Engineering

tech_planetary_engineering = {
	area = engineering
	category = { industry }
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1

	prerequisites = {
		"tech_space_exploration"
		"tech_space_mining_2"
	}

	potential = {
		is_nomadic = yes
	}

	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_CLEAR_BLOCKER_CONTRACT_TITLE"
			desc = "TECH_UNLOCK_CLEAR_BLOCKER_CONTRACT_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 2
			has_technology = tech_space_mining_3
		}
		modifier = {
			factor = 2
			has_technology = tech_space_mining_4
		}
		modifier = {
			factor = 2
			has_technology = tech_space_mining_5
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
	}

	ai_weight = {
	}
}

tech_dyson_gun = {
    area = engineering
    cost = @tier3cost3
    tier = 3
    category = { materials }
    weight = 0
    is_rare = yes
    is_reverse_engineerable = no
    weight = @tier3weight3
    prerequisites = { "tech_wormhole_stabilization" "tech_lasers_3" }

    potential = {
        has_nomads_dlc = yes
        is_nomadic = no
    }

    weight_modifier = {
        modifier = {
            factor = 0.5
        }

        modifier = {
            factor = 0.2
            NOR = {
                has_trait_in_council = { TRAIT = leader_trait_expertise_materials }
                has_trait_in_council = { TRAIT = leader_trait_curator }
                has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
                has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
                has_trait_in_council = { TRAIT = leader_trait_maniacal }
                has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
                has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
            }
        }
        modifier = {
            factor = 2
            OR = {
                has_megastructure = dyson_gun_0
                has_megastructure = dyson_gun_1
                has_megastructure = dyson_gun_2
                has_megastructure = dyson_gun_3
            }
        }
        inline_script = {
            script = technologies/rare_technologies_weight_modifiers
            TECHNOLOGY = tech_dyson_gun
        }
    }
    prereqfor_desc = {
        ship = {
            title = "allow_dyson_gun"
            desc = "dyson_gun_0_MEGASTRUCTURE_DETAILS"
        }
    }
}
