﻿# DRAGONBLOOD LEGACIES

dragonblood_legacy_1 = { # Chosen by the Gods
	legacy = dragonblood_legacy_track

	can_be_picked = {
			has_trait = dragonborn
	}
	character_modifier = {
		theocracy_government_opinion_same_faith = 5
		monthly_prestige_gain_mult = 0.05
		monthly_piety_gain_mult = 0.05
	}
	
	ai_chance = {
		value = 11
		if = { 
			limit = {
				can_start_new_legacy_track_trigger = no
			}
			multiply = 0
		}
	}
}

dragonblood_legacy_2 = { # The Flames of Youth
	legacy = dragonblood_legacy_track

	character_modifier = {
		men_at_arms_cap = 1
		knight_effectiveness_mult = 0.10
		counter_efficiency = 0.10
		advantage = 5
	}
}

dragonblood_legacy_3 = { # Right to Rule
	legacy = dragonblood_legacy_track

	character_modifier = {
		domain_limit = 1
		vassal_opinion = 10
		monthly_piety = 0.1
	}
}

dragonblood_legacy_4 = { # Soul of a Dragon, body of a Dragon
	legacy = dragonblood_legacy_track

	character_modifier = {
		monthly_lifestyle_xp_gain_mult = 0.10
		life_expectancy = 10
		diplomacy = 1
		martial = 1
		stewardship = 1
		intrigue = 1
		learning = 1
		prowess = 2
	}
}

dragonblood_legacy_5 = { # Earth, Mind, Dragon
	legacy = dragonblood_legacy_track

	character_modifier = {
		men_at_arms_limit = 2
	}
	effect = {
		trigger_event = emperor_guard.0001
		custom_description_no_bullet = {
			text = dragonblood_legacy_5_effect
		}
	}
}

# HEGEMON LEGACIES

hegemon_legacy_1 = {
	legacy = hegemon_legacy_track
	
	effect = {
		custom_description_no_bullet = {
			text = hegemon_legacy_1_effect
		}
	}

	can_be_picked = {
		dynasty = {
			exists = var:can_get_hegemon_legacy_track
		}
	}
	
	ai_chance = {
		value = 11
		if = {
			limit = {
				can_start_new_legacy_track_trigger = no
			}
			multiply = 0
		}
	}
}

hegemon_legacy_2 = {
	legacy = hegemon_legacy_track

	effect = {
		custom_description_no_bullet = {
			text = hegemon_legacy_2_effect
		}
	}
}

hegemon_legacy_3 = {
	legacy = hegemon_legacy_track

	effect = {
		hidden_effect = {
			# Setting up the modifiers for the first time
			dynasty = { save_scope_as = current_dynasty }
			add_to_global_variable_list = { name = dynasties_with_legacies_modifiers_to_update target = scope:current_dynasty }
			dynasty_update_legacies_modifiers_effect = { DYNASTY = scope:current_dynasty }
		}
		
		custom_description_no_bullet = {
			text = hegemon_legacy_3_a_effect
		}
		custom_description_no_bullet = {
			text = hegemon_legacy_3_b_effect
		}
	}
}

hegemon_legacy_4 = {
	legacy = hegemon_legacy_track
	
	character_modifier = {
		dynasty_house_opinion = 5
	}

	effect = {
		hidden_effect = {
			# Setting up the modifiers for the first time
			dynasty = { save_scope_as = current_dynasty }
			add_to_global_variable_list = { name = dynasties_with_legacies_modifiers_to_update target = scope:current_dynasty }
			dynasty_update_legacies_modifiers_effect = { DYNASTY = scope:current_dynasty }
		}
		
		custom_description_no_bullet = {
			text = hegemon_legacy_4_a_effect
		}
		# custom_description_no_bullet = { # We'll see about that later
			# text = hegemon_legacy_4_b_effect
		# }
		custom_description_no_bullet = {
			text = hegemon_legacy_4_c_effect
		}
	}
}

hegemon_legacy_5 = {
	legacy = hegemon_legacy_track
	
	character_modifier = {
		dynasty_opinion = 5
	}

	effect = {
		hidden_effect = {
			# Setting up the modifiers for the first time
			dynasty = { save_scope_as = current_dynasty }
			add_to_global_variable_list = { name = dynasties_with_legacies_modifiers_to_update target = scope:current_dynasty }
			dynasty_update_legacies_modifiers_effect = { DYNASTY = scope:current_dynasty }
		}
		
		custom_description_no_bullet = {
			text = hegemon_legacy_5_a_effect
		}
		custom_description_no_bullet = {
			text = hegemon_legacy_5_b_effect
		}
	}
}

# MAGICKA LEGACIES
# Arcana boost
# Magical arts lifestyle exp
# Educate yo kids even without the inno, boost if you have the inno
# Mage troops effectiveness
# Free ritual
# Boost chance of arcana traits
magicka_legacy_1 = {
	legacy = magicka_legacy_track

	can_be_picked = {
		can_magic_trigger = yes
	}
	#EK NOTE: magic code is _actual_ magic. so these effects are not applied here, but in the magic code itself. magic!
	effect = {
		custom_description_no_bullet = { # Arcana boost
			text = magicka_legacy_1_a_effect
		}
		custom_description_no_bullet = { # Magicka regeneration boost
			text = magicka_legacy_1_b_effect
		}
		custom_description_no_bullet = { # 20% chance of getting positive arcana congenital traits upon birth
			text = magicka_legacy_1_c_effect
		}
		custom_description_no_bullet = {
			text = magicka_legacy_trigger
		}
	}
	
	ai_chance = {
		value = 11
		if = {
			limit = {
				can_start_new_legacy_track_trigger = no
			}
			multiply = 0
		}
	}
}

magicka_legacy_2 = {
	legacy = magicka_legacy_track

	character_modifier = {
		mages_max_size_add = 1
		mages_damage_add = 5
		mages_pursuit_add = 5
		mages_toughness_add = 5
		mages_screen_add = 5
		mages_siege_value_add = 0.1
		
		spellblades_max_size_add = 1
		spellblades_damage_add = 5
		spellblades_pursuit_add = 5
		spellblades_toughness_add = 5
		spellblades_screen_add = 5
	}
}

magicka_legacy_3 = {
	legacy = magicka_legacy_track

	effect = {
		custom_description_no_bullet = { # Can educate kids in magical arts even without the inno
			text = magicka_legacy_3_a_effect
		}
		custom_description_no_bullet = { # If you have the inno, magical arts education is a bit more effective
			text = magicka_legacy_3_b_effect
		}
		custom_description_no_bullet = { # Can select magic specialization
			text = magicka_legacy_3_c_effect
		}
		trigger_event = ek_dynasty_events.0001
	}
	
	character_modifier = {
		monthly_magic_lifestyle_xp_gain_mult = 0.1
	}
}

### EK TODO: Implement the Court Grandeur boost (monthly event to refresh it? Dirty solution but should work for now)
# Court Grandeur boost for Arcanic Court, unlocks it
magicka_legacy_4 = {
	legacy = magicka_legacy_track

	effect = {
		custom_description_no_bullet = { # Unlocks Arcanic Court Type, Court Grandeur boost for Arcanic
			text = magicka_legacy_4_a_effect
		}
	}
}

magicka_legacy_5 = {
	legacy = magicka_legacy_track

	effect = {
		custom_description_no_bullet = { # Free ritual
			text = magicka_legacy_5_a_effect
		}
		custom_description_no_bullet = { # Tier 5 education
			text = magicka_legacy_5_b_effect
		}
	}
}
