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

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



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


--[[ --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)
    elseif inst.spark_task ~= nil then
        inst.spark_task = nil

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)

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

    --Override with overcharge light values
    inst.Light:SetColour(235 / 255, 121 / 255, 12 / 255)

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