<commit_before>NPC.HullType = HULL_HUMAN
NPC.SolidType = SOLID_BBOX
NPC.MoveType = MOVETYPE_STEP
NPC.BloodColor = BLOOD_COLOR_RED

NPC.SpawnFlags = bit.bor(SF_NPC_ALWAYSTHINK, SF_NPC_LONG_RANGE)
NPC.Capabilities = CAP_FRIENDLY_DMG_IMMUNE

function NPC:OnSpawned(npc)
	npc:SetBloodColor(self.BloodColor)
	
	if self.Capabilities then
		if self.ClearCapabilities then npc:CapabilitiesClear() end
		npc:CapabilitiesAdd(self.Capabilities)
	end
	
	if self.HullType then
		npc:SetHullType(self.HullType)
	end
	
	if self.HullSizeMins and self.HullSizeMaxs then
		timer.Simple(0.1, function()
			if not IsValid(npc) then return end
			npc:SetCollisionBounds(self.HullSizeMins, self.HullSizeMaxs)
		end)
	end
	
	if self.IsEngineNPC ~= nil then 
		npc.IsEngineNPC = self.IsEngineNPC 
	end 
  
	npc.NextBreakableScan = CurTime()
	
	npc:SetSolid(self.SolidType)
	npc:SetMoveType(self.MoveType)
	npc:SetNW2Bool("selected", false)
	
	if self.Health and self.Health ~= 0 then
		npc:SetHealth(self.Health)
	end
	
	if self.MaxYawSpeed then
		npc:SetMaxYawSpeed(self.MaxYawSpeed)
	end

	npc:UpdateEnemy(npc:FindEnemy())
end

function NPC:OnScaledDamage(npc, hitgroup, dmginfo)
	local damagetype = dmginfo:GetDamageType()
	if damagetype ~= DMG_CLUB then
		if hitgroup == HITGROUP_HEAD then
			if bit.band(damagetype, DMG_BUCKSHOT) ~= 0 then
				local flDist = 1024
				if IsValid(dmginfo:GetAttacker()) then
					flDist = (npc:GetPos() - dmginfo:GetAttacker():GetPos()):Length()
				end

				if flDist <= ZOMBIE_BUCKSHOT_TRIPLE_DAMAGE_DIST then
					dmginfo:ScaleDamage(3)
				end
			else
				dmginfo:ScaleDamage(2)
			end
		elseif hitgroup == HITGROUP_LEFTLEG or hitgroup == HITGROUP_RIGHTLEG then
			dmginfo:ScaleDamage(0.25)
		end
	end
end

function NPC:OnTakeDamage(npc, attacker, inflictor, dmginfo)
	local damage = dmginfo:GetDamage()
	if damage > 0 and bit.band(dmginfo:GetDamageType(), DMG_BULLET) ~= 0 then
		local effect = EffectData()
			effect:SetOrigin(dmginfo:GetDamagePosition())
			effect:SetMagnitude(math.Rand(damage * 0.25, damage * 0.6))
			effect:SetScale(math.max(128, math.Rand(damage, damage * 4)))
		util.Effect("bloodstream", effect)
	end
	
	if IsValid(attacker) then
		local entteam = attacker.OwnerTeam
		if IsValid(attacker) and attacker:GetClass() == "env_fire" and entteam == TEAM_ZOMBIEMASTER then
			dmginfo:SetDamageType(DMG_BULLET)<commit_msg>Added a few more hitgroups for damage to zombies<commit_after>NPC.HullType = HULL_HUMAN
NPC.SolidType = SOLID_BBOX
NPC.MoveType = MOVETYPE_STEP
NPC.BloodColor = BLOOD_COLOR_RED

NPC.SpawnFlags = bit.bor(SF_NPC_ALWAYSTHINK, SF_NPC_LONG_RANGE)
NPC.Capabilities = CAP_FRIENDLY_DMG_IMMUNE

function NPC:OnSpawned(npc)
	npc:SetBloodColor(self.BloodColor)
	
	if self.Capabilities then
		if self.ClearCapabilities then npc:CapabilitiesClear() end
		npc:CapabilitiesAdd(self.Capabilities)
	end
	
	if self.HullType then
		npc:SetHullType(self.HullType)
	end
	
	if self.HullSizeMins and self.HullSizeMaxs then
		timer.Simple(0.1, function()
			if not IsValid(npc) then return end
			npc:SetCollisionBounds(self.HullSizeMins, self.HullSizeMaxs)
		end)
	end
	
	if self.IsEngineNPC ~= nil then 
		npc.IsEngineNPC = self.IsEngineNPC 
	end 
  
	npc.NextBreakableScan = CurTime()
	
	npc:SetSolid(self.SolidType)
	npc:SetMoveType(self.MoveType)
	npc:SetNW2Bool("selected", false)
	
	if self.Health and self.Health ~= 0 then
		npc:SetHealth(self.Health)
	end
	
	if self.MaxYawSpeed then
		npc:SetMaxYawSpeed(self.MaxYawSpeed)
	end

	npc:UpdateEnemy(npc:FindEnemy())
end

function NPC:OnScaledDamage(npc, hitgroup, dmginfo)
	local damagetype = dmginfo:GetDamageType()
	if damagetype ~= DMG_CLUB then
		if hitgroup == HITGROUP_HEAD then
			if bit.band(damagetype, DMG_BUCKSHOT) ~= 0 then
				local flDist = 1024
				if IsValid(dmginfo:GetAttacker()) then
					flDist = (npc:GetPos() - dmginfo:GetAttacker():GetPos()):Length()
				end

				if flDist <= ZOMBIE_BUCKSHOT_TRIPLE_DAMAGE_DIST then
					dmginfo:ScaleDamage(3)
				end
			else
				dmginfo:ScaleDamage(2)
			end
		elseif hitgroup == HITGROUP_LEFTARM or hitgroup == HITGROUP_RIGHTARM or hitgroup == HITGROUP_LEFTLEG or hitgroup == HITGROUP_RIGHTLEG or hitgroup == HITGROUP_GEAR then
			dmginfo:ScaleDamage(0.25)
		end
	end
end

function NPC:OnTakeDamage(npc, attacker, inflictor, dmginfo)
	local damage = dmginfo:GetDamage()
	if damage > 0 and bit.band(dmginfo:GetDamageType(), DMG_BULLET) ~= 0 then
		local effect = EffectData()
			effect:SetOrigin(dmginfo:GetDamagePosition())
			effect:SetMagnitude(math.Rand(damage * 0.25, damage * 0.6))
			effect:SetScale(math.max(128, math.Rand(damage, damage * 4)))
		util.Effect("bloodstream", effect)
	end
	
	if IsValid(attacker) then
		local entteam = attacker.OwnerTeam
		if IsValid(attacker) and attacker:GetClass() == "env_fire" and entteam == TEAM_ZOMBIEMASTER then
			dmginfo:SetDamageType(DMG_BULLET)
{'fraction_non_alphanumeric': 0.09742002063983488, 'fraction_numerical': 0.010319917440660475, 'mean_word_length': 5.049937578027466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4809549', 'n_tokens_mistral': 2121, 'n_tokens_neox': 1901, 'n_words': 362}