﻿# Raid Effects
# Assume we are in character scope of the Magister, in a raid event
# This effect gives any Enslaver accolade knights in our army minor glory
regula_enslaver_gain_minor_glory = {
    every_knight = {
        limit = {
            is_acclaimed = yes
            is_in_army = yes
            knight_army ?= root.commanding_army
        }
        accolade = {
            if = {
                limit ={
                    has_accolade_type = regula_enslaver_attribute
                }
                add_glory = minor_glory_gain
            }
        }
    }
}

# Medium Glory add
regula_enslaver_gain_medium_glory = {
    every_knight = {
        limit = {
            is_acclaimed = yes
            is_in_army = yes
            knight_army ?= root.commanding_army
        }
        accolade = {
            if = {
                limit ={
                    has_accolade_type = regula_enslaver_attribute
                }
                add_glory = medium_glory_gain
            }
        }
    }
}

# Major Glory add
regula_enslaver_gain_major_glory = {
    every_knight = {
        limit = {
            is_acclaimed = yes
            is_in_army = yes
            knight_army ?= root.commanding_army
        }
        accolade = {
            if = {
                limit ={
                    has_accolade_type = regula_enslaver_attribute
                }
                add_glory = major_glory_gain
            }
        }
    }
}

# Adoption effect
# This is a less damaging version of the adopt effect
# Allows you to adopt without opinion debuffs
# Also adds memory
regula_adopt_effect = {
	$ADOPTER$ = {
		adopt = $CHILD$
        create_character_memory = {
            type = adopted_a_child
            participants = {
                child = $CHILD$
            }
        }

		$CHILD$ = {
			set_house = $ADOPTER$.house
            create_character_memory = {
                type = was_adopted
                participants = {
                    parent = $ADOPTER$
                }
            }
			# Remove bastard traits
			if = {
				limit = {
					has_any_bastard_trait_trigger = yes
				}
				remove_all_bastard_traits = yes
			}
		}
	}
}