Jump to content

WX-78 takes no damage from Ice Hat, Water Balloons, Drowning, etc.


Mobbstar
  • Pending

No mods.

WX-78's "dorainsparks" code only toggles on when it starts raining. As a consequence, it can safely wear Icecube Hats, get splashed by Water Balloons, and even jump plank, and not start sparking. If rain starts, the wetness causes spark damage until rain stops and WX-78 fully dries, after which the dorainsparks code stops updating and WX-78 magically becomes waterproof again.

looksie.jpg.860e020c82efd9d04136907f9917

 

SUGGESTED SOLUTION: have inst.spark_task running at all times, and increase the period if lag is a concern:

Spoiler

--[[ --Don't need this anymore #sparkfix
local function onisraining(inst, israining)
    if israining then
        if inst.spark_task == nil then
            inst.spark_task = inst:DoPeriodicTask(.1, dorainsparks, nil, .1)
        end
    elseif inst.spark_task ~= nil then
        inst.spark_task:Cancel()
        inst.spark_task = nil
    end
end
]]--

local function onbecamerobot(inst)
    --[[ --Don't need this anymore #sparkfix
    if not inst.watchingrain then
        inst.watchingrain = true
        inst:WatchWorldState("israining", onisraining)
        onisraining(inst, TheWorld.state.israining)
    end
    ]]--

    --Need this now  #sparkfix
    if inst.spark_task == nil then
        inst.spark_task = inst:DoPeriodicTask(.1, dorainsparks, nil, .1)
    end

    --Override with overcharge light values
    inst.Light:Enable(false)
    inst.Light:SetRadius(2)
    inst.Light:SetFalloff(0.75)
    inst.Light:SetIntensity(.9)
    inst.Light:SetColour(235 / 255, 121 / 255, 12 / 255)
end

That's all the changes needed.

 


Steps to Reproduce
1) Play as WX-78. 2) Get wet while there's no rain. 3) Guess I'll not die.
  • Thanks 1



User Feedback


I would wait till WX's rework comes out, since that's when it's most likely gonna to get fixed (I had Woodie specific bugs from a few months ago that only got fixed at his rework).

Share this comment


Link to comment
Share on other sites



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...