Jump to content

Scrappy Werepig doesn't have armor impact sounds


hoxi
  • Pending

Despite having some inherent damage reduction due to the scrap armor (it just happens to not be actual armor):

inst.components.combat.externaldamagetakenmultipliers:SetModifier(inst, TUNING.DAYWALKER2_DAMAGE_TAKEN_MULT, "junkarmor")

It's not communicated to the player and the more generic fleshy impact sounds play instead. I think that would be a neat detail to difference him from his Nightmare version where he has no armor, especially since there's no indication otherwise that damage is reduced.

 

I got reminded of this because the newest update added a check for inst.override_combat_impact_sound in Combat:GetImpactSound, but it wouldn't be ideal to just use that for this, as there's sharp and blunt sounds that can play against metal (what player scrap armor uses). That is, unless there's proper non-armor variants of the sounds that can play and are determined like most other sounds.

 

I personally just made a mod script like this, to mimic as if he had player metal armor:

MODENV.AddClassPostConstruct("components/combat", function(obj)
	-- HACK: force metal armor impact sounds against scrappy werepig, he has damage resistance because of his inherent junk armor!
	local _GetImpactSound = obj.GetImpactSound
	obj.GetImpactSound = function(self, ...)
		local target = select(1, ...)

		if target ~= nil and not self.noimpactsound and target:HasTag("junkmob") then
			local weapon = select(2, ...)
			local weaponmod = weapon ~= nil and weapon:HasTag("sharp") and "sharp" or "dull"
			return "dontstarve/impacts/impact_metal_armour_"..weaponmod
		end

		return _GetImpactSound(self, ...)
	end
end)

 

Obviously, as I said earlier, you could implement more cleanly and even add more variants to the sounds potentially, or could add a check right after the inventory armor tag checks, to check for special cases like this in some way that can be defined through the inst or some variable set in the combat component.


Steps to Reproduce
  • Hit Scrappy Werepig.
  • Notice how fleshy impact sounds play, despite him wearing metal armor that protects him.
  • Like 1



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...