namespace = riotportupgradeevent

#Removes Spaceport Removal Module
planet_event = {
	id = riotportupgradeevent.99
	hide_window = yes
	
	trigger = {
		AND = { has_spaceport = yes has_spaceport_module = "remove_module" }
	}
	
	immediate = {
		remove_spaceport_module = "remove_module"
	}
}

planet_event = {
	id = riotportupgradeevent.1
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 1
		

	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_1"
			}
		}
		
		
	}
}

planet_event = {
	id = riotportupgradeevent.2
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
		

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 2
			
		has_spaceport_module = "spaceport_upgrade_1"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_2"
			}
		}
		
		#save_global_event_target_as = spaceport_selected
		#planet_event = { id = riotevent.1 days = 1} #Smugglers on station
	}
}

planet_event = {
	id = riotportupgradeevent.3
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 3
			
		has_spaceport_module = "spaceport_upgrade_2"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_3"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.4
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
		

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 4
			
		has_spaceport_module = "spaceport_upgrade_3"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_4"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.5
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 5
		
		has_spaceport_module = "spaceport_upgrade_4"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_5"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.6
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 6
			
		has_spaceport_module = "spaceport_upgrade_5"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_6"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.7
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 7
			
		has_spaceport_module = "spaceport_upgrade_6"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_7"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.8
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 8
			
		has_spaceport_module = "spaceport_upgrade_7"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_8"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.9
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 9
			
		has_spaceport_module = "spaceport_upgrade_8"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_9"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.10
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 10
			
		has_spaceport_module = "spaceport_upgrade_9"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_10"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.11
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 11
			
		has_spaceport_module = "spaceport_upgrade_10"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_11"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.12
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 12
			
		has_spaceport_module = "spaceport_upgrade_11"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_12"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.13
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 13
			
		has_spaceport_module = "spaceport_upgrade_12"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_13"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.14
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 14
			
		has_spaceport_module = "spaceport_upgrade_13"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_14"
			}
		}
	}
}

planet_event = {
	id = riotportupgradeevent.15
	hide_window = yes
	#fire_only_once = yes
	#is_triggered_only = yes
	
	trigger = {
	

			has_spaceport = yes
		
		
		is_spaceport_module_slot_free = 15
			
		has_spaceport_module = "spaceport_upgrade_14"
		
	}
	
	immediate = {
		ROOT = {
			set_spaceport_module = {
				slot = 1
				module = "spaceport_upgrade_15"
			}
		}
	}
}
