namespace = sws_groundcannon

### Hypervelocity Gun

planet_event = {
	id = sws_groundcannon.101
	hide_window = yes
	is_triggered_only = yes
	trigger = { has_building = sws_building_hypervelocity_gun }

	immediate = {
		solar_system = {

			random_fleet_in_system = {
				limit = {
					exists = controller
					exists = orbit
					controller = { is_same_value = root.from }
					orbit = { is_same_value = root }
				}

				save_event_target_as = hypervelocity_return_fire
				random_owned_ship = {
					random_list = {
						1 = { reduce_hp = 100 }
						2 = { reduce_hp = 200 }
						3 = { reduce_hp = 300 }
						4 = { reduce_hp = 400 }
						5 = { reduce_hp = 500 }
						6 = { reduce_hp = 600 }
						7 = { reduce_hp = 700 }
						8 = { reduce_hp = 800 }
						9 = { reduce_hp = 900 }
					}
					random_list = {
						1 = { reduce_hp = 10 }
						2 = { reduce_hp = 20 }
						3 = { reduce_hp = 30 }
						4 = { reduce_hp = 40 }
						5 = { reduce_hp = 50 }
						6 = { reduce_hp = 60 }
						7 = { reduce_hp = 70 }
						8 = { reduce_hp = 80 }
						9 = { reduce_hp = 90 }
					}
					random_list = {
						1 = { reduce_hp = 1 }
						2 = { reduce_hp = 2 }
						3 = { reduce_hp = 3 }
						4 = { reduce_hp = 4 }
						5 = { reduce_hp = 5 }
						6 = { reduce_hp = 6 }
						7 = { reduce_hp = 7 }
						8 = { reduce_hp = 8 }
						9 = { reduce_hp = 9 }
					}
				}
			}
		}
	}
}