Due to inst.components.health.redirect, Pugalisk cannot heal itself.
The following are related code:
local function redirecthealth(inst, amount, overtime, cause, ignore_invincible) local originalinst = inst if inst.startpt then inst = inst.startpt end if amount < 0 and( (inst.components.segmented and inst.components.segmented.vulnerablesegments == 0) or inst:HasTag("tail") or inst:HasTag("head") ) then print("invulnerable",cause,GetPlayer().prefab) if cause == GetPlayer().prefab then GetPlayer().components.talker:Say(GetString(GetPlayer().prefab, "ANNOUNCE_PUGALISK_INVULNERABLE")) end inst.SoundEmitter:PlaySound("dontstarve/common/destroy_metal",nil,.25) inst.SoundEmitter:PlaySound("dontstarve/wilson/hit_metal") elseif amount and inst.host then local fx = SpawnPrefab("snake_scales_fx") fx.Transform:SetScale(1.5,1.5,1.5) local pt= Vector3(originalinst.Transform:GetWorldPosition()) fx.Transform:SetPosition(pt.x,pt.y + 2 + math.random()*2,pt.z) inst:PushEvent("dohitanim") inst.host.components.health:DoDelta(amount, overtime, cause, ignore_invincible, true) inst.host:PushEvent("attacked") end end
I suggest adding the following code above the if amount < 0... :
if amount > 0 and cause == "regen" then inst.components.health:DoDelta(amount, overtime, cause, ignore_invincible, true) end
Steps to Reproduce
1. Damage a Pugalisk
2. Wait for a few seconds, its health will not be regen
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 accountSign in
Already have an account? Sign in here.
Sign In Now