From e8862eb93cd977e715b8245ed8ce895cc9aa7100 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 1 Sep 2024 16:37:03 +0100 Subject: [PATCH] Hack to fix leaks --- scripts/globals/synergy.lua | 50 +++++++++---------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/scripts/globals/synergy.lua b/scripts/globals/synergy.lua index 474ae815362..676f1bd3803 100644 --- a/scripts/globals/synergy.lua +++ b/scripts/globals/synergy.lua @@ -63,17 +63,16 @@ local vars = -- : 1 (or 5) = open -- : 2 (or 6) = closed, active -- : 3 (or 7) = closed, very active - local setFurnaceOpen = function(npc) - npc:setAnimationSub(1) + npc:setAnimationSub(5) end local setFurnaceClosed = function(npc) - npc:setAnimationSub(2) + npc:setAnimationSub(6) end local setFurnaceVeryActive = function(npc) - npc:setAnimationSub(3) + npc:setAnimationSub(7) -- TODO: What are the conditions for 'very active'? npc:timer(1000, function(npcArg) @@ -334,75 +333,50 @@ xi.synergy.synergyFurnaceOnEventUpdate = function(player, csid, option, npc) { [100] = function() -- Feed fewell: Fire npc:entityAnimationPacket(xi.animationString.SYNERGY_FIRE_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_FIRE_LEAK) - end + + player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING, 0) + npc:entityAnimationPacket(xi.animationString.SYNERGY_FIRE_LEAK) end, [101] = function() -- Feed fewell: Ice npc:entityAnimationPacket(xi.animationString.SYNERGY_ICE_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_ICE_LEAK) - end end, [102] = function() -- Feed fewell: Wind npc:entityAnimationPacket(xi.animationString.SYNERGY_WIND_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_WIND_LEAK) - end end, [103] = function() -- Feed fewell: Earth npc:entityAnimationPacket(xi.animationString.SYNERGY_EARTH_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_EARTH_LEAK) - end end, [104] = function() -- Feed fewell: Lightning npc:entityAnimationPacket(xi.animationString.SYNERGY_LIGHTNING_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_LIGHTNING_LEAK) - end end, [105] = function() -- Feed fewell: Water npc:entityAnimationPacket(xi.animationString.SYNERGY_WATER_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_WATER_LEAK) - end end, [106] = function() -- Feed fewell: Light npc:entityAnimationPacket(xi.animationString.SYNERGY_LIGHT_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_LIGHT_LEAK) - end end, [107] = function() -- Feed fewell: Dark npc:entityAnimationPacket(xi.animationString.SYNERGY_DARK_FEWELL) - if math.random(1, 5) == 5 then - player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING) - npc:entityAnimationPacket(xi.animationString.SYNERGY_DARK_LEAK) - end end, [120] = function() -- Operate furnace: Thwack furnace - setFurnaceVeryActive(npc) end, [121] = function() -- Operate furnace: Operate pressure handle npc:entityAnimationPacket(xi.animationString.SYNERGY_STEAM) - -- TODO: How do we turn off the animation for leaks once they've begun? + setFurnaceVeryActive(npc) + npc:timer(500, function(npcArg) + -- TODO: Look up what kind of leak we've just fixed + player:messageSpecial(synergyMessages.ELEMENTAL_POWER_LEAKING + 1, 0) + setFurnaceClosed(npcArg) + end) end, [123] = function() -- Operate furnace: Operate safety lever