on_actions = {

	on_puppet = {
		effect = {
			#Tech for all
			if = {
				limit = {
					FROM = {
						has_country_flag = give_star_wars_tech_flag
					}
				}
				ROOT = {
					set_country_flag = star_wars_tech_flag
				}
			}
			#Flag for puppets
			if = {
				limit = {
					FROM = {
						has_government = imperialism
					}
				}
				ROOT = {
					set_cosmetic_tag = ALL
				}
			}
			#Tech bonus on major capitulation
			if = {
				limit = {
					ROOT = {
						is_major = yes
					}
					IMP = {
						has_country_flag = remove_major_research_bonus_flag
					}
				}
				IMP = {
					add_tech_bonus = {
						bonus = 1.0
						ahead_reduction = 1.0
						uses = 1
						category = imperial_tech
					}
				}
			}
		}
	}

	on_release_as_puppet = {
		effect = {
			if = {
				limit = {
					FROM = {
						has_country_flag = give_star_wars_tech_flag
					}
				}

				ROOT = {
					set_country_flag = star_wars_tech_flag
				}
			}

			if = {
				limit = {
					FROM = {
						has_government = imperialism
					}
				}
				ROOT = {
					set_cosmetic_tag = ALL
				}
			}

		}

	}

	on_capitulation = {
		effect = {
			#integration enabling

			if = {
				limit = {
					ROOT = {
						tag = TUR
					}
				}
				IMP = { set_country_flag = enable_integration_turkey }
			}

			if = {
				limit = {
					ROOT = {
						tag = AFG
					}
				}
				IMP = { set_country_flag = enable_integration_afghanistan }
			}

			if = {
				limit = {
					ROOT = {
						tag = PER
					}
				}
				IMP = { set_country_flag = enable_integration_persia }
			}

			if = {
				limit = {
					ROOT = {
						tag = IMP
					}
				}
				FROM = { set_country_flag = star_wars_tech_flag }
			}


			#tech for whoever capitulates EMPIRE

			#tech bonus for major capitulation
			if = {
				limit = {
					ROOT = {
						is_major = yes
					}
					IMP = {
						has_country_flag = remove_major_research_bonus_flag
					}
				}
				IMP = {
					add_tech_bonus = {
						bonus = 1.0
						ahead_reduction = 1.0
						uses = 1
						category = imperial_tech
					}
				}
			}

		}
	}
	on_startup = {
		effect = {
			IMP = {
			#	country_event = {
			#		id = info.0
			#	}
				country_event = {
					id = imperial_story.0
				}
			}
		}
	}

	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 656 }
				}
				ROOT = {
					set_country_flag = star_wars_tech_flag
				}
			}
		}
	}
}
