﻿-- chunkname: @scripts/settings/projectile_locomotion/templates/grenade_projectile_locomotion_templates.lua

local ProjectileLocomotionSettings = require("scripts/settings/projectile_locomotion/projectile_locomotion_settings")
local TrueFlightTemplates = require("scripts/settings/projectile/true_flight_templates")
local locomotion_states = ProjectileLocomotionSettings.states
local grenade_projectile_locomotion_templates = {
	grenade = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 15,
				speed_maximal = 30,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 8,
				speed_maximal = 8,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 12.5,
			mass = 0.8,
			max_hit_count = 10,
			radius = 0.07,
			use_actor_mass_radius = false,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	krak_grenade = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 15,
				speed_maximal = 30,
				locomotion_state = locomotion_states.true_flight,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 8,
				speed_maximal = 8,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 12.5,
			mass = 0.8,
			max_hit_count = 10,
			radius = 0.07,
			use_actor_mass_radius = false,
			true_flight_template = TrueFlightTemplates.krak_grenade,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	ogryn_grenade_box = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 1,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.7,
				speed_initial = 30,
				speed_maximal = 60,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 4.4,
					y = math.pi * 2.2,
					z = math.pi * 4.4,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 1,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.3,
				speed_initial = 25,
				speed_maximal = 50,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 4.4,
					y = math.pi * 2.2,
					z = math.pi * 4.4,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.05,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 10.5,
			hit_zone_priority = "shield",
			mass = 24,
			max_hit_count = 10,
			radius = 0.07,
			use_actor_mass_radius = false,
			use_generous_bouncing = true,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	ogryn_friendly_rock = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 1,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.7,
				speed_initial = 30,
				speed_maximal = 60,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 4.4,
					y = math.pi * 2.2,
					z = math.pi * 4.4,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 1,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.3,
				speed_initial = 25,
				speed_maximal = 50,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 4.4,
					y = math.pi * 2.2,
					z = math.pi * 4.4,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.05,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 10.5,
			hit_zone_priority = "shield",
			mass = 24,
			max_hit_count = 10,
			radius = 0.15,
			use_actor_mass_radius = false,
			use_generous_bouncing = true,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	ogryn_frag_grenade = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 30,
				speed_maximal = 32,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.4,
				speed_initial = 9.5,
				speed_maximal = 10,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.9,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.3,
			gravity = 12.5,
			mass = 0.9,
			max_hit_count = 10,
			radius = 0.07,
			use_actor_mass_radius = false,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	zealot_throwing_knife_projectile = {
		trajectory_parameters = {
			spawn = {
				locomotion_state = locomotion_states.manual_physics,
			},
		},
		spawn_projectile_parameters = {
			initial_speed = 75,
			skip_spread = true,
			spawn_offset = Vector3Box(0, 0.2, 0),
			rotation = Vector3Box(-90, 0, 0),
			yaw_offset = {
				max = 0.25,
				min = 0.1,
			},
			pitch_offset = {
				max = 0.8,
				min = 0.25,
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 17.5,
			mass = 0.8,
			radius = 0.2,
			statics_raycast = true,
			use_actor_mass_radius = false,
		},
	},
	psyker_throwing_knife_projectile = {
		trajectory_parameters = {
			spawn = {
				locomotion_state = locomotion_states.true_flight,
			},
		},
		spawn_projectile_parameters = {
			initial_speed = 20,
			spawn_offset = Vector3Box(0.1, 0.4, 0.12),
			rotation = Vector3Box(-90, 0, 0),
			has_target_yaw_offset = {
				max = 10,
				min = -10,
			},
			has_target_pitch_offset = {
				max = 8,
				min = -3,
			},
			pitch_offset = {
				max = 5,
				min = -5,
			},
			yaw_offset = {
				max = 3,
				min = -3,
			},
		},
		integrator_parameters = {
			coefficient_of_restitution = 1,
			collision_filter = "filter_player_character_shooting_magic_projectile",
			collision_types = "both",
			mass = 0.8,
			radius = 0.1,
			statics_raycast = true,
			use_actor_mass_radius = false,
			true_flight_template = TrueFlightTemplates.throwing_knives,
		},
	},
	psyker_throwing_knife_projectile_aimed = {
		trajectory_parameters = {
			spawn = {
				locomotion_state = locomotion_states.true_flight,
			},
		},
		spawn_projectile_parameters = {
			initial_speed = 40,
			spawn_offset = Vector3Box(0.1, 0.4, 0.12),
			rotation = Vector3Box(-90, 0, 0),
			has_target_yaw_offset = {
				max = 1,
				min = 0.5,
			},
			has_target_pitch_offset = {
				max = 0.8,
				min = 0.25,
			},
			pitch_offset = {
				max = 0,
				min = 0,
			},
		},
		integrator_parameters = {
			coefficient_of_restitution = 1,
			collision_filter = "filter_player_character_shooting_magic_projectile",
			collision_types = "both",
			mass = 0.8,
			radius = 0.1,
			statics_raycast = true,
			use_actor_mass_radius = false,
			true_flight_template = TrueFlightTemplates.throwing_knives_aimed,
		},
	},
	adamant_grenade = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				rotation_charge_duration = 0,
				speed_charge_duration = 0,
				speed_initial = 15,
				speed_maximal = 30,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0,
				speed_initial = 8,
				speed_maximal = 8,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = math.pi * 2.2,
					y = math.pi * 1.1,
					z = math.pi * 2.2,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 12.5,
			mass = 0.8,
			max_hit_count = 10,
			radius = 0.07,
			use_actor_mass_radius = false,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	shock_mine = {
		trajectory_parameters = {
			throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 8,
				speed_maximal = 12,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = 0,
					y = 0,
					z = math.pi * 10,
				},
			},
			underhand_throw = {
				aim_max_iterations = 40,
				aim_max_number_of_bounces = 2,
				aim_time_step_multiplier = 3,
				inherit_owner_velocity_percentage = 1,
				offset_forward = 1,
				offset_right = 0,
				offset_up = -0.3,
				rotation_charge_duration = 0,
				speed_charge_duration = 0.5,
				speed_initial = 6,
				speed_maximal = 6,
				locomotion_state = locomotion_states.manual_physics,
				rotation_offset_initial = Vector3Box(0, 0, 0),
				rotation_offset_maximal = Vector3Box(0, 0, 0),
				randomized_angular_velocity = {
					x = 0,
					y = 0,
					z = math.pi * 2.7,
				},
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 12.5,
			mass = 0.8,
			max_hit_count = 10,
			radius = 0.18,
			use_actor_mass_radius = false,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
	area_buff_drone = {
		trajectory_parameters = {
			spawn = {
				locomotion_state = locomotion_states.true_flight,
			},
		},
		spawn_projectile_parameters = {
			initial_speed = 5,
			spawn_offset = Vector3Box(0.1, 0.4, 0.12),
			rotation = Vector3Box(0, 0, 0),
			has_target_yaw_offset = {
				max = 2,
				min = -2,
			},
			has_target_pitch_offset = {
				max = 2,
				min = -1,
			},
			pitch_offset = {
				max = 1,
				min = -1,
			},
			yaw_offset = {
				max = 1,
				min = -1,
			},
		},
		integrator_parameters = {
			air_density = 0.7,
			coefficient_of_restitution = 0.2,
			collision_filter = "filter_player_character_shooting_projectile",
			collision_types = "both",
			drag_coefficient = 0.2,
			gravity = 12.5,
			mass = 0.8,
			max_hit_count = 10,
			radius = 0.35,
			use_actor_mass_radius = false,
			true_flight_template = TrueFlightTemplates.drone,
		},
		vfx = {
			trajectory = {
				material_name = "content/fx/materials/master/trajectory",
			},
		},
	},
}

return grenade_projectile_locomotion_templates
