on_actions = {
	on_startup = {
		effect = {
			# Startup Event
			every_country = {
				limit = {
					NOT = { has_global_flag = rt56rp_gr_historical_gflag }
					is_ai = no
				}
				country_event = { id = rt56rp_startup_event.1 }
			}

			28 = {
				add_dynamic_modifier = {
					modifier = rt56rp_maginot_modifier
					scope = FRA
				}
			}

			#generate characters - remove generic silent workhorse
			every_possible_country = {
				every_character = {
					limit = { has_trait = silent_workhorse }
					retire = yes
				}
			}
			GER = {
				every_character = {
					limit = { has_trait = amateur_aviator_hess }
					retire = yes
				}
			}

			#set country-specific eco laws
			SOV = {
				swap_ideas = {
					remove_idea = civilian_economy
					add_idea = low_economic_mobilisation
				}
			}

			#set country-specific ideas
			JAP = {
				swap_ideas = {
					remove_idea = JAP_hirohito
					add_idea = JAP_hirohito_rt56rp
				}
			}
			# CHI = {
				# add_ideas = { rt56rp_china1 }
			# }
			# PRC = {
				# add_ideas = { rt56rp_china2 }
			# }
			# SHX = {
				# add_ideas = { rt56rp_china2 }
			# }
			# XSM = {
				# add_ideas = { rt56rp_china2 }
			# }
			# SIK = {
				# add_ideas = { rt56rp_china2 }
			# }
			# YUN = {
				# add_ideas = { rt56rp_china2 }
			# }
			# GXC = {
				# add_ideas = { rt56rp_china2 }
			# }

			# Mercenary Company
			set_variable = { global.rt56rp_merc_vol_limit = 3 }
			set_variable = { global.rt56rp_merc_air_limit = 100 }
			set_variable = { global.rt56rp_merc_vol_inc = 1 }
			set_variable = { global.rt56rp_merc_air_inc = 100 }
			
			# Non-mercs
			set_variable = { global.rt56rp_nonmerc_vol_limit = 2 }
			set_variable = { global.rt56rp_nonmerc_air_limit = 100 }
			set_variable = { global.rt56rp_nonmerc_vol_inc = 1 }
			set_variable = { global.rt56rp_nonmerc_air_inc = 100 }
			
			# Start at 1 so updates happen 1st Jan not 1st Feb
			set_variable = { global.rt56rp_merc_tick1 = 1 }
			set_variable = { global.rt56rp_merc_tick2 = 1 }

		}
	}
	# on_monthly = {
		# effect = {
			# if = {
				# limit = {
					# date > 1938.12.01
					# PRC = {
						# OR = {
							# has_idea = PRC_initiative_idea
							# has_idea = PRC_swift_victory_idea
							# has_idea = PRC_swift_victory_idea_mp
							# has_idea = PRC_swift_victory_idea_ng
							# has_idea = PRC_swift_victory_idea_all
						# }
					# }
				# }
				# if = {
					# limit = {
						# PRC = { NOT = { has_idea = rt56rp_prc1 } }
					# }
					# PRC = { add_ideas = { rt56rp_prc1 } }
				# }
				# if = {
					# limit = {
						# PRC = { has_idea = PRC_initiative_idea }
					# }
					# PRC = { remove_ideas = { PRC_initiative_idea } }
				# }
				# if = {
					# limit = {
						# PRC = { has_idea = PRC_swift_victory_idea }
					# }
					# PRC = { remove_ideas = { PRC_swift_victory_idea } }
				# }
				# if = {
					# limit = {
						# PRC = { has_idea = PRC_swift_victory_idea_mp }
					# }
					# PRC = { remove_ideas = { PRC_swift_victory_idea_mp } }
				# }
				# if = {
					# limit = {
						# PRC = { has_idea = PRC_swift_victory_idea_ng }
					# }
					# PRC = { remove_ideas = { PRC_swift_victory_idea_ng } }
				# }
				# if = {
					# limit = {
						# PRC = { has_idea = PRC_swift_victory_idea_all }
					# }
					# PRC = { remove_ideas = { PRC_swift_victory_idea_all } }
				# }
			# }
		# }
	# }
	
	on_war_relation_added = {
		effect = {
			if = {
				limit = {
					ROOT = {
						has_relation_modifier = {
							target = FROM
							modifier = defense_treaty2_opmod
						}
					}
				}
				custom_effect_tooltip = defense_treaty_war_dec_on_action_tt
				hidden_effect = {
					ROOT = {
						remove_relation_modifier = {
							target = FROM
							modifier = defense_treaty2_opmod
						}
						remove_opinion_modifier = {
							target = FROM
							modifier = defense_treaty1_opmod
						}
						add_opinion_modifier = {
							target = FROM
							modifier = defense_treaty_break1_opmod
						}
						diplomatic_relation = {
							country = FROM
							relation = non_aggression_pact
							active = no
						}
						diplomatic_relation = {
							country = FROM
							relation = military_access
							active = no
						}
						diplomatic_relation = {
							country = FROM
							relation = guarantee
							active = no
						}
					}
					FROM = {
						remove_relation_modifier = {
							target = ROOT
							modifier = defense_treaty2_opmod
						}
						remove_opinion_modifier = {
							target = ROOT
							modifier = defense_treaty1_opmod
						}
						add_opinion_modifier = {
							target = ROOT
							modifier = defense_treaty_break2_opmod
						}
						diplomatic_relation = {
							country = ROOT
							relation = non_aggression_pact
							active = no
						}
						diplomatic_relation = {
							country = ROOT
							relation = military_access
							active = no
						}
						diplomatic_relation = {
							country = ROOT
							relation = guarantee
							active = no
						}
					}
				}
			}
			if = {
				limit = {
					ROOT = {
						has_relation_modifier = {
							target = FROM
							modifier = trade_agreement3_opmod
						}
					}
				}
				custom_effect_tooltip = trade_agreement_war_dec_on_action_tt
				hidden_effect = {
					ROOT = {
						remove_relation_modifier = {
							target = FROM
							modifier = trade_agreement3_opmod
						}
						remove_opinion_modifier = {
							target = FROM
							modifier = trade_agreement1_opmod
						}
						remove_opinion_modifier = {
							target = FROM
							modifier = trade_agreement2_opmod
						}
						add_opinion_modifier = {
							target = FROM
							modifier = trade_agreement_break1_opmod
						}
					}
					FROM = {
						remove_relation_modifier = {
							target = ROOT
							modifier = trade_agreement3_opmod
						}
						remove_opinion_modifier = {
							target = ROOT
							modifier = trade_agreement1_opmod
						}
						remove_opinion_modifier = {
							target = ROOT
							modifier = trade_agreement2_opmod
						}
						add_opinion_modifier = {
							target = ROOT
							modifier = trade_agreement_break1_opmod
						}
					}
				}
			}
		}
	}

	on_puppet = {
		effect = {
			if = {
				limit = {
					tag = MAL
					FROM = {
						tag = GER
					}
				}
				set_cosmetic_tag = MAL_GER
			}
		}
	}
}