@base_tradition_agenda_cost = 7000
@ascension_agenda_cost = 3500		# Same as short_agenda_cost from traditions
@ascension_agenda_cooldown = 1080	# 3 Years

@ascension_tech_agenda_weight = 200
@ascension_agenda_weight = 100
@ascension_agenda_pending_multiplier = 2

agenda_mind_over_matter = {
	agenda_cost = value:agenda_mind_over_matter_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
        has_psionic_ascension = yes
	}
	potential = {
        if = {
            limit = { has_shroud_dlc = no }
            is_gestalt = no
            is_individual_machine = no
        }
        NOR = {
            is_natural_design_empire = yes
        }
		NAND = {
			has_technology = tech_psionic_theory
			has_technology = tech_telepathy
			has_technology = tech_thought_enforcement
		}
        if = {
            limit = { has_origin = origin_endbringers }
            has_country_flag = has_completed_reckoning_dig_site
        }
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_psionic_theory = {
				add_tech_progress = {
					tech = tech_psionic_theory
					progress = @agenda_award_tech_progress
				}
			}
			tech_telepathy = {
				add_tech_progress = {
					tech = tech_telepathy
					progress = @agenda_award_tech_progress
				}
			}
			tech_thought_enforcement = {
				add_tech_progress = {
					tech = tech_thought_enforcement
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = society_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
    }
}

agenda_psionic_supremacy = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_psionics_adopt
	}
	potential = {
        has_shroud_dlc = no
		is_gestalt = no
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
		NOR = {
			has_country_flag = composer_covenant_confirmed
			has_country_flag = instrument_covenant_confirmed
			has_country_flag = eater_covenant_confirmed
			has_country_flag = whisperers_covenant_confirmed
		}
	}
    modifier = {
        category_psionics_research_speed_mult = 0.1
        psionic_pop_bonus_workforce_mult = 0.05
    }
    finish_modifier = agenda_psionic_supremacy_finish_no_covenant
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_psionic_supremacy_shroud = {
    agenda_cost = @base_tradition_agenda_cost
    allow = {
        has_tradition = tr_psionics_shroud_adopt
    }
    potential = {
        has_shroud_dlc = yes
        NOR = {
            is_natural_design_empire = yes
        }
    }
    modifier = {
        category_psionics_research_speed_mult = 0.1
        psionic_pop_bonus_workforce_mult = 0.05
        attunement_mult = 0.1
    }
    finish_modifier = agenda_psionic_supremacy_shroud_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_engineered_evolution = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
		has_ascension_perk = ap_engineered_evolution
	}
	potential = {
		is_machine_empire = no
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
		NAND = {
			has_technology = tech_genome_mapping
			has_technology = tech_gene_tailoring
			has_technology = tech_glandular_acclimation
			has_technology = tech_gene_expressions
			has_technology = tech_gene_seed_purification
		}
	}
	effect = {
		if = {
			limit = {
				is_wilderness_empire = no
			}
			inverted_switch = {
				trigger = has_technology
				tech_genome_mapping = {
					add_tech_progress = {
						tech = tech_genome_mapping
						progress = @agenda_award_tech_progress
					}
				}
				tech_gene_tailoring = {
					add_tech_progress = {
						tech = tech_gene_tailoring
						progress = @agenda_award_tech_progress
					}
				}
				tech_glandular_acclimation = {
					add_tech_progress = {
						tech = tech_glandular_acclimation
						progress = @agenda_award_tech_progress
					}
				}
				tech_gene_expressions = {
					add_tech_progress = {
						tech = tech_gene_expressions
						progress = @agenda_award_tech_progress
					}
				}
				tech_gene_seed_purification = {
					add_tech_progress = {
						tech = tech_gene_seed_purification
						progress = @agenda_award_tech_progress
					}
				}
				default = {
					add_monthly_resource_mult = {
						resource = society_research
						value = @tier3researchreward
						min = @tier3researchmin
						max = @tier3researchmax
					}
				}
			}
		}
		# Wilderness can't get Gene Seed Purification, so it gets swapped out for them
		else = {
			inverted_switch = {
				trigger = has_technology
				tech_genome_mapping = {
					add_tech_progress = {
						tech = tech_genome_mapping
						progress = @agenda_award_tech_progress
					}
				}
				tech_gene_tailoring = {
					add_tech_progress = {
						tech = tech_gene_tailoring
						progress = @agenda_award_tech_progress
					}
				}
				tech_glandular_acclimation = {
					add_tech_progress = {
						tech = tech_glandular_acclimation
						progress = @agenda_award_tech_progress
					}
				}
				tech_gene_expressions = {
					add_tech_progress = {
						tech = tech_gene_expressions
						progress = @agenda_award_tech_progress
					}
				}
				default = {
					add_monthly_resource_mult = {
						resource = society_research
						value = @tier3researchreward
						min = @tier3researchmin
						max = @tier3researchmax
					}
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
        modifier = {
            factor = @ascension_agenda_pending_multiplier
            has_ap_pending = yes
        }
    }
}

agenda_genetic_pursuit = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_genetics_adopt
	}
	potential = {
		has_biogenesis_dlc = no
		is_machine_empire = no
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
	}
	modifier = {
		category_biology_research_speed_mult = 0.05
		logistic_growth_mult = 0.025
		bonus_pop_growth_mult = 0.025
	}
	finish_modifier = agenda_genetic_pursuit_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_cybernetic_advantage = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_cybernetics_adopt
	}
	potential = {
		is_machine_empire = no
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
	}
	modifier = {
		planet_pops_cyborgs_upkeep_mult = -0.05
		logistic_growth_mult = 0.025
	}
	finish_modifier = agenda_cybernetic_advantage_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_flesh_is_weak = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
		OR = {
			has_ascension_perk = ap_the_flesh_is_weak
			has_origin = origin_cybernetic_creed
		}
	}
	potential = {
		is_gestalt = no
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
		NAND = {
			has_technology = tech_powered_exoskeletons
			has_technology = tech_integrated_cybernetics
			has_technology = tech_neuro_quantum_links
		}
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_powered_exoskeletons = {
				add_tech_progress = {
					tech = tech_powered_exoskeletons
					progress = @agenda_award_tech_progress
				}
			}
			tech_integrated_cybernetics = {
				add_tech_progress = {
					tech = tech_integrated_cybernetics
					progress = @agenda_award_tech_progress
				}
			}
			tech_neuro_quantum_links = {
				add_tech_progress = {
					tech = tech_neuro_quantum_links
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = engineering_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
        modifier = {
            factor = @ascension_agenda_pending_multiplier
            has_ap_pending = yes
        }
    }
}

agenda_organo_machine_interfacing = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
		has_ascension_perk = ap_organo_machine_interfacing
	}
	potential = {
		is_hive_empire = yes
		NOR = {
			is_natural_design_empire = yes
			is_individual_machine = yes
		}
		NAND = {
			has_technology = tech_powered_exoskeletons
			has_technology = tech_integrated_cybernetics
			has_technology = tech_neuro_quantum_links
		}
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_powered_exoskeletons = {
				add_tech_progress = {
					tech = tech_powered_exoskeletons
					progress = @agenda_award_tech_progress
				}
			}
			tech_integrated_cybernetics = {
				add_tech_progress = {
					tech = tech_integrated_cybernetics
					progress = @agenda_award_tech_progress
				}
			}
			tech_neuro_quantum_links = {
				add_tech_progress = {
					tech = tech_neuro_quantum_links
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = engineering_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
        modifier = {
            factor = @ascension_agenda_pending_multiplier
            has_ap_pending = yes
        }
    }
}

agenda_cybernetic_advantage_assimilator = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_cybernetics_assimilator_adopt
	}
	potential = {
		has_civic = civic_machine_assimilator
	}
	modifier = {
		planet_pops_cyborgs_upkeep_mult = -0.05
		logistic_growth_mult = 0.05
	}
	finish_modifier = agenda_cybernetic_advantage_assimilator_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_organo_machine_interfacing_assimilator = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
		has_ascension_perk = ap_organo_machine_interfacing_assimilator
	}
	potential = {
		has_civic = civic_machine_assimilator
		NAND = {
			has_technology = tech_powered_exoskeletons
			has_technology = tech_integrated_cybernetics
			has_technology = tech_neuro_quantum_links
		}
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_powered_exoskeletons = {
				add_tech_progress = {
					tech = tech_powered_exoskeletons
					progress = @agenda_award_tech_progress
				}
			}
			tech_integrated_cybernetics = {
				add_tech_progress = {
					tech = tech_integrated_cybernetics
					progress = @agenda_award_tech_progress
				}
			}
			tech_neuro_quantum_links = {
				add_tech_progress = {
					tech = tech_neuro_quantum_links
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = engineering_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
        modifier = {
            factor = @ascension_agenda_pending_multiplier
            has_ap_pending = yes
        }
    }
}

agenda_synthetic_evolution = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
        OR = {
			has_ascension_perk = ap_synthetic_evolution
            has_origin = origin_synthetic_fertility
        }
	}
	potential = {
		is_regular_empire = yes
		is_individual_machine = no
		NOR = {
			is_natural_design_empire = yes
		}
		NAND = {
			has_technology = tech_powered_exoskeletons
			has_technology = tech_robotic_workers
			has_technology = tech_droid_workers
			has_technology = tech_synthetic_workers
		}
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_powered_exoskeletons = {
				add_tech_progress = {
					tech = tech_powered_exoskeletons
					progress = @agenda_award_tech_progress
				}
			}
			tech_robotic_workers = {
				add_tech_progress = {
					tech = tech_robotic_workers
					progress = @agenda_award_tech_progress
				}
			}
			tech_droid_workers = {
				add_tech_progress = {
					tech = tech_droid_workers
					progress = @agenda_award_tech_progress
				}
			}
			tech_synthetic_workers = {
				add_tech_progress = {
					tech = tech_synthetic_workers
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = engineering_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
        modifier = {
            factor = @ascension_agenda_pending_multiplier
            has_ap_pending = yes
        }
    }
}

agenda_synthetic_yield = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_synthetics_adopt
	}
	potential = {
		OR = {
			AND = {
				is_regular_empire = yes
				is_individual_machine = no
			}
			AND = {
				is_machine_empire = yes
				has_machine_age_dlc = no
			}
		}
		NOR = {
			is_natural_design_empire = yes
		}
	}
	modifier = {
		planet_pop_assembly_add = 0.5
	}
	finish_modifier = agenda_synthetic_yield_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_synthetic_age = {
	agenda_cost = @ascension_agenda_cost
	agenda_cooldown = @ascension_agenda_cooldown
	allow = {
		has_ascension_perk = ap_synthetic_age
	}
	potential = {
		OR = {
			is_machine_empire = yes
			is_individual_machine = yes
		}
		NAND = {
			has_technology = tech_powered_exoskeletons
			has_technology = tech_robomodding_m
			has_technology = tech_binary_motivators
			has_technology = tech_nanite_assemblers
			has_technology = tech_mega_assembly
		}
	}
	effect = {
		inverted_switch = {
			trigger = has_technology
			tech_powered_exoskeletons = {
				add_tech_progress = {
					tech = tech_powered_exoskeletons
					progress = @agenda_award_tech_progress
				}
			}
			tech_robomodding_m = {
				add_tech_progress = {
					tech = tech_robomodding_m
					progress = @agenda_award_tech_progress
				}
			}
			tech_binary_motivators = {
				add_tech_progress = {
					tech = tech_binary_motivators
					progress = @agenda_award_tech_progress
				}
			}
			tech_nanite_assemblers = {
				add_tech_progress = {
					tech = tech_nanite_assemblers
					progress = @agenda_award_tech_progress
				}
			}
			tech_mega_assembly = {
				add_tech_progress = {
					tech = tech_mega_assembly
					progress = @agenda_award_tech_progress
				}
			}
			default = {
				add_monthly_resource_mult = {
					resource = engineering_research
					value = @tier3researchreward
					min = @tier3researchmin
					max = @tier3researchmax
				}
			}
		}
	}
    ai_weight = {
        base = @ascension_tech_agenda_weight
		modifier = {
			factor = @ascension_agenda_pending_multiplier
			has_ap_pending = yes
		}
    }
}


agenda_purity_perfection = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_purity_adopt
	}
	potential = {
		has_biogenesis_dlc = yes
		is_machine_empire = no
		is_wilderness_empire = no
	}
	modifier = {
		logistic_growth_mult = 0.025
	}
	effect = {
		custom_tooltip = agenda_purity_perfection_unity_effect_tt
		add_resource = {
			unity = @perfection_protocols_base_reward
			mult = value:purity_perfection_posneg_value|POSNEG|positive|
		}
		custom_tooltip = agenda_purity_perfection_society_effect_tt
		add_resource = {
			society_research = @perfection_protocols_base_reward
			mult = value:purity_perfection_posneg_value|POSNEG|negative|
		}
	}
	finish_modifier = agenda_purity_perfection_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_purity_perfection_wilderness = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_purity_adopt
	}
	potential = {
		has_biogenesis_dlc = yes
		is_wilderness_empire = yes
	}
	modifier = {
		planet_building_build_speed_mult = 0.1
	}
	finish_modifier = agenda_purity_perfection_wilderness_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_cloning_replication = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_cloning_adopt
	}
	potential = {
		has_biogenesis_dlc = yes
		is_machine_empire = no
	}
	modifier = {
		bonus_pop_growth_mult = 0.25
	}
	finish_modifier = agenda_cloning_replication_finish
    ai_weight = {
        base = @ascension_agenda_weight
    }
}

agenda_mutation_divergence = {
	agenda_cost = @base_tradition_agenda_cost
	allow = {
		has_tradition = tr_mutation_adopt
	}
	potential = {
		has_biogenesis_dlc = yes
		is_machine_empire = no
		NOR = {
			has_origin = origin_evolutionary_predators
		}
	}
	modifier = {
		auto_mod_monthly_add = 200
	}
	effect = {
		custom_tooltip = agenda_mutation_divergence_tt
		hidden_effect = {
			every_owned_species = {
				limit = {
					NOR = {
						has_trait = trait_adaptive_mutations
						has_trait = trait_malleable_genes
					}
					OR = {
						is_archetype = BIOLOGICAL
						is_archetype = LITHOID
					}
				}
				change_species_characteristics = {
					add_trait = trait_adaptive_mutations
					add_traits_at_start_of_list = yes
				}
			}
		}
		if = {
			limit = {
				has_mutation_environmental_integration_tradition = yes
			}
			custom_tooltip = agenda_mutation_divergence_2_tt
			hidden_effect = {
				every_owned_species = {
					limit = {
						NOT = {
							has_trait = trait_auto_hab_preference
						}
                        is_robotic = no
					}
					set_habitability_trait = { trait = trait_auto_hab_preference }
				}
			}
		}
		hidden_effect = {
			update_node_portraits_if_gestalt_effect = yes
		}
	}
	finish_modifier = agenda_mutation_divergence_finish
    ai_weight = {
        base = @ascension_agenda_weight
        modifier = {
            factor = 2
            any_owned_species = {
                is_robotic = no
                NOT = {
                    has_trait = trait_auto_hab_preference
                }
            }
        }
    }
}
