Skip to content

Commit

Permalink
Hack to fix leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Sep 1, 2024
1 parent 4371f3d commit e8862eb
Showing 1 changed file with 12 additions and 38 deletions.
50 changes: 12 additions & 38 deletions scripts/globals/synergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8862eb

Please sign in to comment.