Skip to content

Commit

Permalink
Start on synergy animations
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Sep 1, 2024
1 parent faf9926 commit 4371f3d
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
20 changes: 20 additions & 0 deletions scripts/enum/animation_strings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,24 @@ xi.animationString =
SPECIAL_10 = 'sp10', -- Zdei vertical barriers off, etc...
SPECIAL_20 = 'sp20', -- Zdei horizontal barriers on, etc...
SPECIAL_30 = 'sp30', -- Zdei horizontal barriers off, etc...

-- Synergy
SYNERGY_COMPLETE = 'ef40',
SYNERGY_FIRE_LEAK = 'ef81',
SYNERGY_ICE_LEAK = 'ef82',
SYNERGY_WIND_LEAK = 'ef83',
SYNERGY_EARTH_LEAK = 'ef84',
SYNERGY_LIGHTNING_LEAK = 'ef85',
SYNERGY_WATER_LEAK = 'ef86',
SYNERGY_LIGHT_LEAK = 'ef87',
SYNERGY_DARK_LEAK = 'ef88',
SYNERGY_FIRE_FEWELL = 'ef91',
SYNERGY_ICE_FEWELL = 'ef92',
SYNERGY_WIND_FEWELL = 'ef93',
SYNERGY_EARTH_FEWELL = 'ef94',
SYNERGY_LIGHTNING_FEWELL = 'ef95',
SYNERGY_WATER_FEWELL = 'ef96',
SYNERGY_LIGHT_FEWELL = 'ef97',
SYNERGY_DARK_FEWELL = 'ef98',
SYNERGY_STEAM = 'efa0',
}
46 changes: 45 additions & 1 deletion scripts/globals/synergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -333,35 +333,76 @@ xi.synergy.synergyFurnaceOnEventUpdate = function(player, csid, option, npc)
local updateOperations =
{
[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
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
setFurnaceVeryActive(npc)
npc:entityAnimationPacket(xi.animationString.SYNERGY_STEAM)
-- TODO: How do we turn off the animation for leaks once they've begun?
end,

[123] = function() -- Operate furnace: Operate safety lever
Expand Down Expand Up @@ -506,6 +547,9 @@ xi.synergy.synergyFurnaceOnEventFinish = function(player, csid, option, npc)
end

setFurnaceClosed(furnaceNpc)
npc:timer(2000, function(furnaceNpcArg)
furnaceNpcArg:entityAnimationPacket(xi.animationString.SYNERGY_STEAM)
end)

furnaceNpc:setLocalVar(vars.SYNERGY_FURNACE_STATE, furnaceStates.ACTIVE)
elseif csid == 4521 and option == 151 then -- Cancel after trade
Expand Down

0 comments on commit 4371f3d

Please sign in to comment.