-- welcome to holdout frenzy
function SkirmishTweakData:_init_wave_phase_durations(tweak_data)
	local skirmish_data = tweak_data.group_ai.skirmish
	-- shorten from 15 to 10 seconds
	skirmish_data.assault.anticipation_duration = {
		{
			10,
			1
		}
	}
	-- shorten from 15 to 10 seconds
	skirmish_data.assault.build_duration = 10
	-- shorten assaults from 2 minutes to 1 minute
	skirmish_data.assault.sustain_duration_min = {
		60,
		60,
		60
	}
	skirmish_data.assault.sustain_duration_max = {
		60,
		60,
		60
	}
	skirmish_data.assault.sustain_duration_balance_mul = {
		1,
		1,
		1,
		1
	}
	-- fade untouched, assaults only end when most units are dead anyway
	skirmish_data.assault.fade_duration = 5
	-- shortened delay between assault end and new anticipation phase from 25 to 10 seconds
	skirmish_data.assault.delay = {
		10,
		10,
		10
	}
	-- as a result, instead of half an hour a session lasts about 15-16 minutes
end

function SkirmishTweakData:_init_wave_modifiers()
	self.wave_modifiers = {}
	local health_damage_multipliers = {
	-- wave 1, start with default death wish values
		{
			damage = 1,
			health = 1
		},
	-- wave 2, slight damage increase
		{
			damage = 1.25,
			health = 1
		},
	-- wave 3, first health increase, noticable damage increase
		{
			damage = 1.5,
			health = 1.25
		},
	-- wave 4, now using old one down health, keep damage the same
		{
			damage = 1.5,
			health = 1.5
		},
	-- wave 5
		{
			damage = 1.5,
			health = 1.5
		},
	-- wave 6, further increase damage
		{
			damage = 1.75,
			health = 1.5
		},
	-- wave 7, by this point the difficulty is increased mostly through modifiers instead
		{
			damage = 1.75,
			health = 1.5
		},
	-- wave 8, gets spicy, double the death wish damage
		{
			damage = 2,
			health = 1.5
		},
	-- wave 9, the final shootout, gets very spicy even though damage is the same as previous wave.
		{
			damage = 2,
			health = 1.5
		},
		-- modifiers beyond this point are not used
		{
			damage = 6,
			health = 7.5
		},
		{
			damage = 6.5,
			health = 8.25
		},
		{
			damage = 7,
			health = 9
		},
		{
			damage = 1.9,
			health = 1.9
		},
		{
			damage = 1.975,
			health = 1.975
		},
		{
			damage = 2.05,
			health = 2.05
		},
		{
			damage = 2.125,
			health = 2.125
		},
		{
			damage = 2.2,
			health = 2.2
		},
		{
			damage = 2.275,
			health = 2.275
		},
		{
			damage = 2.35,
			health = 2.35
		},
		{
			damage = 2.425,
			health = 2.425
		},
		{
			damage = 2.5,
			health = 2.5
		}
	}
	-- i wanted to include other modifiers below but most of them crashed the game and i can't be bothered with figuring out the proper data entries so this is merely a quick and hasty concept.
	-- it is possible to include them but i'm lazy
	-- more specials, taser overcharge, teargas cloakers and, as a last resort, phalanx shields were something i considered.
	-- phalanx shields probably should NOT be added unless you also exclude them from the health and damage by wave modifier and fix them ignoring the shield spawn cap. they're virtually unlimited in how many can spawn in base game
	-- the phalanx shield quirk described above results in annoying gameplay.
	-- removed skulldozer and minigun dozer modifiers from the list below because death wish already spawns them
	self.wave_modifiers[1] = {
		{
			class = "ModifierEnemyHealthAndDamageByWave",
			data = {
				waves = health_damage_multipliers,
				excluded_enemies = {
					damage = {
						"sniper",
						"heavy_swat_sniper",
						"shield" --shields already deal 70 damage at all ranges, increasing their damage isn't very fun especially with how perfectly they can track a player and move at the same time. shields get a reflection modifier at later waves anyway.
					},
					health = {
					"tank_medic" -- medic dozers don't need all that health
					}
				}
			}
		},
		{
			class = "ModifierCloakerArrest"
		}
	}
	self.wave_modifiers[4] = {
		{
			class = "ModifierDozerMedic" -- early medic dozers
		}
	}
	self.wave_modifiers[5] = {
		{
			class = "ModifierHeavies" --enjoy heavy gensec shotgunners. doesn't work on san martin though, would have to edit the modifier itself and it sounds too risky
		}
	}
	self.wave_modifiers[6] = {
		{
			class = "ModifierNoHurtAnims" --more time spent firing at players instead of being knocked around
		}
	}
	self.wave_modifiers[8] = {
		{
			class = "ModifierShieldReflect" --explosives are less effective at dispatching shields on wave 8 and 9, makes them a bigger threat without directly buffing their damage
		}
	}
end

-- borrowed code from dr newbie's "choose holdout difficulty" mod, forced holdout to always use death wish. all changes above were made with death wish in mind.
-- a side effect includes earning up to 7 million XP from a full holdout run
Hooks:PostHook(MenuCallbackHandler, "accept_skirmish_contract", "dwsm", function(self)
	Global.game_settings.difficulty = "overkill_290"
	local matchmake_attributes = self:get_matchmake_attributes()
	local job_id_index = tweak_data.narrative:get_index_from_job_id(managers.job:current_job_id())
	local level_id_index = tweak_data.levels:get_index_from_level_id(Global.game_settings.level_id)
	local difficulty_index = tweak_data:difficulty_to_index(Global.game_settings.difficulty)
	local one_down = Global.game_settings.one_down
	if not Global.game_settings.single_player then
		if Network:is_server() then
			managers.network:session():send_to_peers("sync_game_settings", job_id_index, level_id_index, difficulty_index, one_down)
			managers.network.matchmake:set_server_attributes(matchmake_attributes)
			managers.mutators:update_lobby_info()
			managers.menu_component:on_job_updated()
			managers.menu:open_node("lobby")
			managers.menu:active_menu().logic:refresh_node("lobby", true)
		else
			managers.network.matchmake:create_lobby(matchmake_attributes)
		end
	end
end)

--idk if needed but it's here anyway, doesn't seem to break anything.
Hooks:PostHook(MenuCallbackHandler, "accept_skirmish_weekly_contract", "dwsmw", function(self)
	Global.game_settings.difficulty = "overkill_290"
	local matchmake_attributes = self:get_matchmake_attributes()
	local job_id_index = tweak_data.narrative:get_index_from_job_id(managers.job:current_job_id())
	local level_id_index = tweak_data.levels:get_index_from_level_id(Global.game_settings.level_id)
	local difficulty_index = tweak_data:difficulty_to_index(Global.game_settings.difficulty)
	local one_down = Global.game_settings.one_down
	if not Global.game_settings.single_player then
		if Network:is_server() then
			managers.network:session():send_to_peers("sync_game_settings", job_id_index, level_id_index, difficulty_index, one_down)
			managers.network.matchmake:set_server_attributes(matchmake_attributes)
			managers.mutators:update_lobby_info()
			managers.menu_component:on_job_updated()
			managers.menu:open_node("lobby")
			managers.menu:active_menu().logic:refresh_node("lobby", true)
		else
			managers.network.matchmake:create_lobby(matchmake_attributes)
		end
	end
end)