update_ai_combat_bonus = {
    if = {
        limit = { check_variable = { vnr_ai_difficulty = 1 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad
					vnr_hard
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_normal
		}
    }
    else_if = {
        limit = { check_variable = { vnr_ai_difficulty = 2 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad
					vnr_normal
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_hard
		}
    }
    else_if = {
        limit = { check_variable = { vnr_ai_difficulty = 3 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_normal
					vnr_hard
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_mad
		}
    }
    else = {
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad
					vnr_hard
					vnr_normal
				}
			}
		}
    }
}

update_ai_production_bonus = {
    if = {
        limit = { check_variable = { vnr_ai_production = 1 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad_production
					vnr_hard_production
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_normal_production
		}
    }
    else_if = {
        limit = { check_variable = { vnr_ai_production = 2 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad_production
					vnr_normal_production
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_hard_production
		}
    }
    else_if = {
        limit = { check_variable = { vnr_ai_production = 3 } }
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_normal_production
					vnr_hard_production
				}
			}
		}
        every_country = {
			limit = { 
                is_ai = yes
                is_major = yes
                NOT = { is_ally_with = ROOT }
            }
			add_ideas = vnr_mad_production
		}
    }
    else = {
        hidden_effect = {
			every_country = {
				remove_ideas = {
					vnr_mad_production
					vnr_hard_production
					vnr_normal_production
				}
			}
		}
    }
}

ai_get_navy_experience = {
	if = {
		limit = {
			expert_ai_style = yes
		}
		navy_experience = 500
	}
	else = {
		navy_experience = 250
	}
}

ai_get_mio_upgrade = {
	every_military_industrial_organization = {
		limit = {
			OR = {
				has_mio_equipment_type = mio_cat_eq_all_carrier
				has_mio_equipment_type = mio_cat_eq_all_battleship
				has_mio_equipment_type = mio_cat_eq_all_cruiser
				has_mio_equipment_type = mio_cat_eq_all_destroyer
			}
		}
		if = {
			limit = { expert_ai_style = yes }
			add_mio_size = 2
		}
		else = {
			add_mio_size = 1
		}
	}
}

set_shipyard_output_boost = {
	if = {
		limit = {
			has_game_rule = { rule = shipyard_output_boost_player option = BUFF_60 }
		}
		every_country = {
			limit = { is_ai = no }
			add_ideas = vnr_shipyard_output_boost
		}
	}
	else_if = {
		limit = {
			has_game_rule = { rule = shipyard_output_boost_player option = BUFF_30 }
		}
		every_country = {
			limit = { is_ai = no }
			add_ideas = vnr_shipyard_output_boost_half
		}
	}
	
	if = {
		limit = {
			has_game_rule = { rule = shipyard_output_boost_ai option = BUFF_60 }
		}
		every_country = {
			limit = { is_ai = yes }
			add_ideas = vnr_shipyard_output_boost
		}
	}
	else_if = {
		limit = {
			has_game_rule = { rule = shipyard_output_boost_ai option = BUFF_30 }
		}
		every_country = {
			limit = { is_ai = yes }
			add_ideas = vnr_shipyard_output_boost_half
		}
	}

	if = {
		limit = {
			has_game_rule = { rule = ai_ship_design_style option = EXPERT }
		}
		every_country = {
			limit = { is_ai_naval_major = yes }
			add_ideas = vnr_ai_dd_output_boost_1
		}
	}
	else = {
		every_country = {
			limit = { is_ai_naval_major = yes }
			add_ideas = vnr_ai_dd_output_boost_2
		}
	}
	
	### expert country treaty workaround
	ENG = {
		if = {
			limit = { allow_to_use_expert_navy = yes }
			add_timed_idea = {
				idea = vnr_expert_navy_treaty_workaround
				days = 730
			}
		}
	}
	USA = {
		if = {
			limit = { allow_to_use_expert_navy = yes }
			add_timed_idea = {
				idea = vnr_expert_navy_treaty_workaround
				days = 730
			}
		}
	}
	JAP = {
		if = {
			limit = { allow_to_use_expert_navy = yes }
			add_timed_idea = {
				idea = vnr_expert_navy_treaty_workaround
				days = 730
			}
		}
	}
}