﻿
create_artifact_fake_relic_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	hidden_effect_new_artifact = {
		# Get artifact quality, wealth, and materials
		set_artifact_rarity_common = yes

		root.faith.religious_head = {
			save_scope_as = religious_head
		}

		scope:owner = {
			# Create the artifact
			create_artifact = {	
				name = placeholder  # Will be regenerated in the post-creation effects
				description = placeholder # Will be regenerated in the post-creation effects
				visuals = fake_relic
				type = pedestal
				modifier = artifact_placeholder_modifier
				save_scope_as = newly_created_artifact
				wealth = scope:wealth
				quality = scope:quality
				decaying = no
			}
		}

		scope:newly_created_artifact = {
                  save_scope_as = fake_relic
			set_variable = fake_relic
		}
	}	
}

get_fake_relic_feature_references_effect = {
	set_artifact_feature_group = saint_name
	set_artifact_feature_group = saint_description
	set_artifact_feature_group = provenance
}

add_female_saint_name_variable_effect = {
	random_list = {
		10 = {
			set_variable = anna
		}
		10 = {
			set_variable = beatrice
		}
		10 = {
			set_variable = benedicta
		}
		10 = {
			set_variable = brigid
		}
		10 = {
			set_variable = catherine
		}
		10 = {
			set_variable = cecilia
		}
		10 = {
			set_variable = christina
		}
		10 = {
			set_variable = clementia
		}
		10 = {
			set_variable = constance
		}
		10 = {
			set_variable = dorothy
		}
		10 = {
			set_variable = elisabeth
		}
		10 = {
			set_variable = joan
		}
		10 = {
			set_variable = judith
		}
		10 = {
			set_variable = juliana
		}
		10 = {
			set_variable = helen
		}
		10 = {
			set_variable = magdalena
		}
		10 = {
			set_variable = margaret
		}
		10 = {
			set_variable = maria
		}
		10 = {
			set_variable = marine
		}
		10 = {
			set_variable = patricia
		}
		10 = {
			set_variable = philippa
		}
		10 = {
			set_variable = rachel
		}
		10 = {
			set_variable = sarah
		}
		10 = {
			set_variable = sophia
		}
		10 = {
			set_variable = stephania
		}
	}
}

add_male_saint_name_variable_effect = {
	random_list = {
		10 = {
			set_variable = abraham
		}
		10 = {
			set_variable = alexander
		}
		10 = {
			set_variable = andrew
		}
		10 = {
			set_variable = antoninus
		}
		10 = {
			set_variable = bartolomeus
		}
		10 = {
			set_variable = benedict
		}
		10 = {
			set_variable = christian
		}
		10 = {
			set_variable = christopher
		}
		10 = {
			set_variable = clement
		}
		10 = {
			set_variable = constantine
		}
		10 = {
			set_variable = cyrus
		}
		10 = {
			set_variable = daniel
		}
		10 = {
			set_variable = david
		}
		10 = {
			set_variable = demetrius
		}
		10 = {
			set_variable = eustace
		}
		10 = {
			set_variable = george
		}
		10 = {
			set_variable = gregory
		}
		10 = {
			set_variable = hans
		}
		10 = {
			set_variable = isaac
		}
		10 = {
			set_variable = jacob
		}
		10 = {
			set_variable = joakim
		}
		10 = {
			set_variable = job
		}
		10 = {
			set_variable = john
		}
		10 = {
			set_variable = jordan
		}
		10 = {
			set_variable = joseph
		}
		10 = {
			set_variable = joshua
		}
		10 = {
			set_variable = laurence
		}
		10 = {
			set_variable = luke
		}
		10 = {
			set_variable = magnus
		}
		10 = {
			set_variable = malte #Little Easteregg
		}
		10 = {
			set_variable = marcus
		}
		10 = {
			set_variable = martin
		}
		10 = {
			set_variable = matthew
		}
		10 = {
			set_variable = michael
		}
		10 = {
			set_variable = nicholas
		}
		10 = {
			set_variable = patrick
		}
		10 = {
			set_variable = paul
		}
		10 = {
			set_variable = peter
		}
		10 = {
			set_variable = philip
		}
		10 = {
			set_variable = salvador
		}
		10 = {
			set_variable = samuel
		}
		10 = {
			set_variable = sebastian
		}
		10 = {
			set_variable = simon
		}
		10 = {
			set_variable = stephen
		}
		10 = {
			set_variable = thomas
		}
		10 = {
			set_variable = zachariah
		}
	}
}

add_female_saint_description_variable_effect = {
	random_list = {
		10 = {
			set_variable = female_consecrated_virgin
		}
		10 = {
			set_variable = female_devoted_monastery_founder
		}
		10 = {
			set_variable = female_devoted_mystic
		}
		10 = {
			if = {
				limit = {	
					scope:faker = {
						faith = {
							OR = {
								this = faith:catholic
								this = faith:conversos
                        				this = faith:insular_celtic
                        				this = faith:mozarabic_church
							}
						}
					}
				}
				set_variable = female_devoted_order_founder
			}
			else = {
				set_variable = female_martyr #Fallback
			}
		}
		10 = {
			set_variable = female_martyr
		}
		10 = {
			set_variable = female_noble
		}
		10 = {
			set_variable = female_patron
		}
	}
}

add_male_saint_description_variable_effect = {
	random_list = {
		10 = {
			set_variable = male_devoted_bishop
		}
		10 = {
			if = {
				limit = {	
					scope:faker = {
						faith = {
							OR = {
								this = faith:catholic
								this = faith:conversos
                        				this = faith:insular_celtic
                        				this = faith:mozarabic_church
							}
						}
					}
				}
				set_variable = male_devoted_dogmatic
			}
			else = {
				set_variable = male_martyr #Fallback
			}
		}
		10 = {
			set_variable = male_devoted_missionary
		}
		10 = {
			set_variable = male_devoted_monastery_founder
		}
		10 = {
			set_variable = male_devoted_mystic
		}
		10 = {
			if = {
				limit = {	
					scope:faker = {
						faith = {
							OR = {
								this = faith:catholic
								this = faith:conversos
                        				this = faith:insular_celtic
                        				this = faith:mozarabic_church
							}
						}
					}
				}
				set_variable = male_devoted_order_founder
			}
			else = {
				set_variable = male_martyr #Fallback
			}
		}
		10 = {
			set_variable = male_devoted_preacher
		}
		10 = {
			set_variable = male_devoted_reclusive
		}
		10 = {
			if = {
				limit = {
					current_date > 1200.1.1 #Beginning of the Early Scholastic Era 
				}
				set_variable = male_devoted_scholastic
			}
			else = {
				set_variable = male_martyr #Fallback
			}
		}
		10 = {
			set_variable = male_martyr
		}
		10 = {
			set_variable = male_military_saint
		}
		10 = {
			set_variable = male_noble
		}
		10 = {
			set_variable = male_patron
		}
		10 = {
			if = {
				limit = {	
					scope:faker = {
						faith = {
							OR = {
								this = faith:catholic
								this = faith:conversos
                        				this = faith:insular_celtic
                        				this = faith:mozarabic_church
							}
						}
					}
				}
				set_variable = male_pope
			}
			else = {
				set_variable = male_martyr #Fallback
			}
		}
		10 = {
			if = {
				limit = {	
					scope:faker = {
						faith = { this = faith:orthodox }
					}
				}
				set_variable = male_stylite
			}
			else = {
				set_variable = male_martyr #Fallback
			}
		}
	}
}