ggsm_order_sacred_magdalene = {
    primary_attribute = diplomacy
    is_religious = yes
    opinion_to_other_members = +10
    opinion_per_rank_above = +5
	society_rank_up_decision = request_to_rank_up_within_society #this is the default decision, triggered by the rank-up button
    sound = benedictine_order_interface
    society_ranks_gfx = ggsm_order_sacred_magdalene_society_ranks
    society_influence = no

    non_interference = {
        always = yes
    }

    active = {
        has_dlc = "Mystics"
    }

    indestructible = yes

    can_join_society = {
        hidden_trigger = {
            NAND = {
                ai = yes
                is_society_rank_full = {
                    society = ggsm_order_sacred_magdalene
                    rank = 1
                }
            }
        }

        ggsm_adult_catholic_woman_trigger = yes

        NOT = {
            trait = excommunicated
        }

        custom_tooltip = {
            text = did_not_betray_society

            NOT = {
                has_character_flag = betrayed_ggsm_order_sacred_magdalene
            }
        }

        hidden_trigger = {
            NOT = {
                has_character_flag = society_join_block
            }
        }

        trigger_if = {
            limit = {
                prisoner = yes
            }

            prisoner = no
        }
    }

    show_society = {
        OR = {
            AND = {
                is_female = yes
                religion = catholic
            }

            society_member_of = ggsm_order_sacred_magdalene
        }
    }

    potential = {
        is_female = yes
        religion = catholic
    }

    society_rank = {
        level = 1
        limit = 100
        startup_limit = 10

        modifier = {
            monthly_character_piety = 0.05
            fertility = 0.1
        }

        decisions = {
            ggsm_take_sacred_prostitution
            ggsm_vow_nymphomania
        }
    }

    society_rank = {
        level = 2
        limit = 50
        startup_limit = 6

        modifier = {
            monthly_character_piety = 0.1
            diplomacy = 1
            fertility = 0.1
        }

        decisions = {
            ggsm_carnal_confession
            ggsm_study_sacred_scripture
            ggsm_cleanse_lovers_pox_self
            ggsm_teach_carnal_charity
        }
    }

    society_rank = {
        level = 3
        limit = 25
        startup_limit = 3

        modifier = {
            monthly_character_piety = 0.2
            diplomacy = 2
            learning = 1
            fertility = 0.1
        }

        decisions = {
            ggsm_minister_lovers_pox
            ggsm_teach_virtue
        }
    }

    society_rank = {
        level = 4
        limit = 5
        startup_limit = 1

        modifier = {
            monthly_character_piety = 0.5
            diplomacy = 3
            learning = 2
            fertility = 0.15
        }

        decisions = {
            ggsm_public_altar_rite
        }
    }

    monthly_currency_gain = {
        name = currency_name_ggsm_order_sacred_magdalene

        per_attribute = {
            name = diplomacy
            value = 0.5
        }

        has_trait = {
            trait = nymphomaniac
            value = 5
        }

        has_trait = {
            trait = lustful
            value = 3
        }

        has_trait = {
            trait = seductress
            value = 3
        }

        has_trait = {
            trait = cheap_whore
            value = 4
        }

        has_trait = {
            trait = experienced_whore
            value = 6
        }

        has_trait = {
            trait = exclusive_whore
            value = 8
        }

        has_trait = {
            trait = charitable
            value = 2
        }

        has_trait = {
            trait = kind
            value = 2
        }

        has_trait = {
            trait = zealous
            value = 2
        }

        has_trait = {
            trait = erudite
            value = 2
        }

        has_trait = {
            trait = theologian
            value = 2
        }

        society_rank = {
            rank = 4
            value = 10
        }

        has_trait = {
            trait = chaste
            value = -10
        }

        has_trait = {
            trait = celibate
            value = -10
        }
    }

    member_score_per_attribute = 3
    member_score_per_rank = 100

    member_score = {
        value = 10

        modifier = {
            trait = nymphomaniac
            factor = 3
        }

        modifier = {
            trait = lustful
            factor = 1.5
        }

        modifier = {
            trait = seductress
            factor = 1.5
        }

        modifier = {
            trait = cheap_whore
            factor = 1.5
        }

        modifier = {
            trait = experienced_whore
            factor = 2
        }

        modifier = {
            trait = exclusive_whore
            factor = 3
        }

        modifier = {
            trait = chaste
            factor = 0.1
        }

        modifier = {
            trait = celibate
            factor = 0.1
        }

        modifier = {
            is_priest = yes
            factor = 2
        }

        modifier = {
            trait = theologian
            factor = 1.3
        }

        modifier = {
            trait = erudite
            factor = 1.3
        }

        modifier = {
            trait = charitable
            factor = 1.2
        }

        modifier = {
            trait = kind
            factor = 1.2
        }
    }

    startup_populate = {
        trigger = {
            ai = yes
            controls_religion = no
            religion = catholic
            is_female = yes
            is_adult = yes
            is_in_society = no

            NOT = {
                higher_tier_than = DUKE
            }

            NOR = {
                mercenary = yes
                holy_order = yes
                trait = excommunicated
                trait = incapable
                trait = cynical
                trait = harelip
            }

            OR = {
                trait = lustful
                trait = nymphomaniac
                trait = seductress
                trait = cheap_whore
                trait = experienced_whore
                trait = exclusive_whore
                trait = theologian
                trait = erudite
                is_priest = yes
                diplomacy = 14
                learning = 14
            }
        }
    }
}