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:
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.
1) Play as WX-78. 2) Get wet while there's no rain. 3) Guess I'll not die.
- 1
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