# Scripted cost modifiers for peace actions.
# See documentation.info file for more detailed scripting information.

peace_action_modifiers = {

    ### Yalta Conference

    yalta_pls_poland_into_space = {
        category = treaties_or_conferences
        peace_action_type = { take_states } #TODO PWN
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { tag = POL }
            FROM.FROM.FROM = { has_state_flag = yalta_pol }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 0.1
    }


    yalta_pls_leave_poland_alone = {
        category = treaties_or_conferences
        peace_action_type = { take_states puppet liberate force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = {
                NOT = { tag = POL }
                OR = {
                    tag = SOV
                    is_in_faction_with = SOV
                    OR = {
                        has_country_flag = yalta_signatory_faction_leader
                        any_allied_country = {
                            has_country_flag = yalta_signatory_faction_leader
                        }
                    }
                }
            }
            FROM.FROM.FROM = { has_state_flag = yalta_pol }
            POL = {
                pc_is_puppeted = no
                is_subject = no
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 3.0
    }


    yalta_pls_leave_wgr_alone = {
        category = treaties_or_conferences
        peace_action_type = { take_states puppet liberate force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = {
                OR = {
                    tag = SOV
                    is_in_faction_with = SOV
                    AND = {
                        NOT = { has_country_flag = yalta_signatory_faction_leader }
                        NOT = { any_allied_country = {
                                has_country_flag = yalta_signatory_faction_leader
                            }
                        }
                    }
                }
            }
            FROM.FROM.FROM = {
                OR = { 
                    has_state_flag = yalta_wgr
                    # is_core_of = AUS # Austria in Western 
                }
                NOT = {
                    OR = {
                        has_state_flag = yalta_pol
                        has_state_flag = yalta_ddr
                        has_state_flag = yalta_aus
                    }
                }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 4.0
    }


    yalta_pls_leave_ddr_alone = {
        category = treaties_or_conferences
        peace_action_type = { take_states puppet liberate force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = {
                OR = {
                    AND = {
                        NOT = { tag = SOV }
                        is_in_faction_with = SOV
                    }
                    OR = {
                        has_country_flag = yalta_signatory_faction_leader
                        any_allied_country = {
                            has_country_flag = yalta_signatory_faction_leader
                        }
                    }
                }
            }
            FROM.FROM.FROM = {
                has_state_flag = yalta_ddr
                NOT = {
                    OR = {
                        has_state_flag = yalta_pol
                        has_state_flag = yalta_wgr
                        has_state_flag = yalta_aus
                    }
                }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 4.0
    }


    yalta_wgr = {
        category = treaties_or_conferences
        peace_action_type = { puppet }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { has_country_flag = yalta_signatory_faction_leader }
            FROM.FROM.FROM = {
                has_state_flag = yalta_wgr
                NOT = { has_state_flag = yalta_pol }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 0.5
    }

    yalta_wgr_other_majors = {
        category = treaties_or_conferences
        peace_action_type = { puppet }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { 
                any_allied_country = { has_country_flag = yalta_signatory_faction_leader }
                is_major = yes
            }
            FROM.FROM.FROM = {
                has_state_flag = yalta_wgr
                NOT = { has_state_flag = yalta_pol }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 0.5
    }

    yalta_wgr_force_government = {
        category = treaties_or_conferences
        peace_action_type = { force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { 
                OR = {
                    any_allied_country = { has_country_flag = yalta_signatory_faction_leader }
                    has_country_flag = yalta_signatory_faction_leader
                }       
            }
            FROM.FROM.FROM = {
                has_state_flag = yalta_wgr
                NOT = { has_state_flag = yalta_pol }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 2
    }


    yalta_ddr = {
        category = treaties_or_conferences
        peace_action_type = { puppet }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { tag = SOV }
            FROM.FROM.FROM = {
                has_state_flag = yalta_ddr
                NOT = { has_state_flag = yalta_pol }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 0.5
    }

    yalta_ddr_force_government = {
        category = treaties_or_conferences
        peace_action_type = { force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { tag = SOV }
            FROM.FROM.FROM = {
                has_state_flag = yalta_ddr
                NOT = { has_state_flag = yalta_pol }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
            }
        }
        cost_multiplier = 2
    }

    yalta_reinstate_austria = {
        category = treaties_or_conferences
        peace_action_type = { liberate }
        enable = {
            has_global_flag = yalta_agreed_flag
            ROOT = { 
                OR = {
                    has_country_flag = yalta_signatory_faction_leader
                    any_allied_country = {
                        has_country_flag = yalta_signatory_faction_leader
                    }
                }       
            }
            FROM = { tag = AUS }
            FROM.FROM.FROM = {
                has_state_flag = yalta_aus
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism 
                OR = {
                    has_country_flag = AUS_annexed
                    is_in_faction_with = AUS
                    has_war_together_with = AUS
                    AND = {
                        controls_state = 848
                        controls_state = 153
                        controls_state = 152
                        controls_state = 976
                        controls_state = 4
                        controls_state = 975
                    }
                } 
            }
        }
        cost_multiplier = 0.5
    }

    yalta_aus_force_government = {
        category = treaties_or_conferences
        peace_action_type = { force_government }
        enable = {
            has_global_flag = yalta_agreed_flag
            
            FROM.FROM.FROM = {
                has_state_flag = yalta_aus
            }

            AUS = {
                NOT = {
                    has_government = democratic
                }
            }
            GER = {
                pc_is_loser = yes
                has_government = fascism
                OR = {
                    has_country_flag = AUS_annexed
                    is_in_faction_with = AUS
                    has_war_together_with = AUS
                    AND = {
                        controls_state = 848
                        controls_state = 153
                        controls_state = 152
                        controls_state = 976
                        controls_state = 4
                        controls_state = 975
                    }
                }
            }
        }
        cost_multiplier = 0.5
    }
}
