Hooks:PostHook(CopBase, "post_init", "postinithooksex", function(self)
	-- log("downright damn sexy")
	self:random_mat_seq_initialization()
end)

function CopBase:random_mat_seq_initialization()
	-- log("sick! this is initialized!")
	local unit_name = self._unit:name()
	
	local fbis = unit_name == Idstring("units/payday2/characters/ene_fbi_1/ene_fbi_1")
	or unit_name == Idstring("units/payday2/characters/ene_fbi_1/ene_fbi_1_husk")	
	or unit_name == Idstring("units/payday2/characters/ene_fbi_2/ene_fbi_2")
	or unit_name == Idstring("units/payday2/characters/ene_fbi_2/ene_fbi_2_husk")
	or unit_name == Idstring("units/payday2/characters/ene_fbi_3/ene_fbi_3")
	or unit_name == Idstring("units/payday2/characters/ene_fbi_3/ene_fbi_3_husk")
	
	local cops = unit_name == Idstring("units/payday2/characters/ene_cop_1/ene_cop_1") 
	or unit_name == Idstring("units/payday2/characters/ene_cop_1/ene_cop_1_husk")	
	or unit_name == Idstring("units/payday2/characters/ene_cop_2/ene_cop_2")
	or unit_name == Idstring("units/payday2/characters/ene_cop_2/ene_cop_2_husk")
	or unit_name == Idstring("units/payday2/characters/ene_cop_3/ene_cop_3")
	or unit_name == Idstring("units/payday2/characters/ene_cop_3/ene_cop_3_husk")	
	or unit_name == Idstring("units/payday2/characters/ene_cop_4/ene_cop_4")
	or unit_name == Idstring("units/payday2/characters/ene_cop_4/ene_cop_4_husk")
	
	local secs = unit_name == Idstring("units/payday2/characters/ene_security_1/ene_security_1")
	or unit_name == Idstring("units/payday2/characters/ene_security_1/ene_security_1_husk")	
	or unit_name == Idstring("units/payday2/characters/ene_security_2/ene_security_2")
	or unit_name == Idstring("units/payday2/characters/ene_security_2/ene_security_2_husk")
	or unit_name == Idstring("units/payday2/characters/ene_security_3/ene_security_3")
	or unit_name == Idstring("units/payday2/characters/ene_security_3/ene_security_3_husk")
	
	local lacops = unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_1/ene_la_cop_1")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_1/ene_la_cop_1_husk")	
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_2/ene_la_cop_2")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_2/ene_la_cop_2_husk")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_3/ene_la_cop_3")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_3/ene_la_cop_3_husk")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_4/ene_la_cop_4")
	or unit_name == Idstring("units/pd2_dlc_rvd/characters/ene_la_cop_4/ene_la_cop_4_husk")
	
	local murky = unit_name == Idstring("units/payday2/characters/ene_murkywater_1/ene_murkywater_1")
	or unit_name == Idstring("units/payday2/characters/ene_murkywater_1/ene_murkywater_1_husk")	
	or unit_name == Idstring("units/payday2/characters/ene_murkywater_2/ene_murkywater_2")
	or unit_name == Idstring("units/payday2/characters/ene_murkywater_2/ene_murkywater_2_husk")	
	
	local fbimurky = unit_name == Idstring("units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_1/ene_hoxton_breakout_guard_1")
	or unit_name == Idstring("units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_1/ene_hoxton_breakout_guard_1_husk")	
	or unit_name == Idstring("units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_2/ene_hoxton_breakout_guard_2")
	or unit_name == Idstring("units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_2/ene_hoxton_breakout_guard_2_husk")
	
	local secsred = unit_name == Idstring("units/pd2_dlc1/characters/ene_security_gensec_1/ene_security_gensec_1")
	or unit_name == Idstring("units/pd2_dlc1/characters/ene_security_gensec_1/ene_security_gensec_1_husk")	
	or unit_name == Idstring("units/pd2_dlc1/characters/ene_security_gensec_2/ene_security_gensec_2")
	or unit_name == Idstring("units/pd2_dlc1/characters/ene_security_gensec_2/ene_security_gensec_2_husk")
	
	if self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_cops") and cops then
		 -- log("sweet! run the cop sequence!")	
		self._unit:damage():run_sequence_simple("pick_mats_for_cops")
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_fbis") and fbis then
		 -- log("radical! run the fbi sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_fbis")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_secs") and secs then
		 -- log("cool! run the sec sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_secs")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_lacops") and lacops then
		 -- log("swell! run the lacops sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_lacops")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_murky") and murky then
		 -- log("oscar mike! run the murky sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_murky")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_fbimurky") and fbimurky then
		 -- log("victor charlie! run the fbimurky sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_fbimurky")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pick_mats_for_secsred") and secsred then
		 -- log("modelling a giant secsred sequence!")
		self._unit:damage():run_sequence_simple("pick_mats_for_secsred") 
	end	
end

local material_config_paths = {
-- FOR WEKK: ADD IN ANY NEW MATERIAL CONFIGS HERE. YOU'LL ONLY NEED TO ADD IN A FILEPATH AND MAKE SURE
-- THERE'S COMMAS AT THE END OF EACH ENTRY HERE IN THIS TABLE EXCEPT THE LAST ENTRY
  "units/payday2/characters/ene_cop_vars/ene_cop_var1",
  "units/payday2/characters/ene_cop_vars/ene_cop_var2",
  "units/payday2/characters/ene_cop_vars/ene_cop_var3",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var1",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var2",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var3",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var4",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var5",
  "units/payday2/characters/ene_fbi_vars/ene_fbi_var6",
  "units/payday2/characters/ene_security_vars/ene_security_var1",
  "units/payday2/characters/ene_security_vars/ene_security_var2",
  "units/payday2/characters/ene_security_vars/ene_security_var3",
  "units/payday2/characters/ene_security_vars/ene_security_var4",
  "units/payday2/characters/ene_security_vars/ene_security_var5",
  "units/payday2/characters/ene_security_vars/ene_security_var6",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var1",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var2",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var3",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var4",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var5",
  "units/pd2_dlc_rvd/characters/ene_la_cop_vars/ene_la_cop_var6",
  "units/payday2/characters/ene_murkywater_vars/ene_murkywater_var1",
  "units/payday2/characters/ene_murkywater_vars/ene_murkywater_var2",
  "units/payday2/characters/ene_murkywater_vars/ene_murkywater_var3",
  "units/payday2/characters/ene_murkywater_vars/ene_murkywater_var4",
  "units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_vars/ene_hoxton_breakout_guard_var1",
  "units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_vars/ene_hoxton_breakout_guard_var2",
  "units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_vars/ene_hoxton_breakout_guard_var3",
  "units/pd2_mcmansion/characters/ene_hoxton_breakout_guard_vars/ene_hoxton_breakout_guard_var4",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var1",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var2",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var3",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var4",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var5",
  "units/pd2_dlc1/characters/ene_security_gensec_vars/ene_security_gensec_var6"
}

for i, material_config_path in pairs(material_config_paths) do
  local normal_ids = Idstring(material_config_path)
  local contour_ids = Idstring(material_config_path .. "_contour")

  CopBase._material_translation_map[tostring(normal_ids:key())] = contour_ids
  CopBase._material_translation_map[tostring(contour_ids:key())] = normal_ids 
end