diff --git a/scripts/actions/abilities/pets/attachments/reactive_shield.lua b/scripts/actions/abilities/pets/attachments/reactive_shield.lua index 1ce639782ae..35d603807f3 100644 --- a/scripts/actions/abilities/pets/attachments/reactive_shield.lua +++ b/scripts/actions/abilities/pets/attachments/reactive_shield.lua @@ -1,19 +1,30 @@ ----------------------------------- --- Attachment: Reactive Shield +-- Reactive Shield +-- Grants Blaze Spikes to the automaton for 60 seconds. +-- https://wiki.ffo.jp/html/10431.html ----------------------------------- ---@type TAttachment local attachmentObject = {} attachmentObject.onEquip = function(pet) pet:addListener('AUTOMATON_ATTACHMENT_CHECK', 'ATTACHMENT_REACTIVE_SHIELD', function(automaton, target) + if automaton:hasRecast(xi.recast.ABILITY, xi.automaton.abilities.REACTIVE_SHIELD) then + return + end + local master = automaton:getMaster() - if - not automaton:hasRecast(xi.recast.ABILITY, xi.automaton.abilities.REACTIVE_SHIELD) and - master and - master:countEffect(xi.effect.FIRE_MANEUVER) > 0 - then - automaton:useMobAbility(xi.automaton.abilities.REACTIVE_SHIELD, automaton) + + if not master then + return end + + local fireManeuvers = master:countEffect(xi.effect.FIRE_MANEUVER) + + if fireManeuvers == 0 then + return + end + + automaton:useMobAbility(xi.automaton.abilities.REACTIVE_SHIELD, automaton) end) end diff --git a/scripts/actions/abilities/pets/automaton/reactive_shield.lua b/scripts/actions/abilities/pets/automaton/reactive_shield.lua index cdf4d278ddd..66d84df73bc 100644 --- a/scripts/actions/abilities/pets/automaton/reactive_shield.lua +++ b/scripts/actions/abilities/pets/automaton/reactive_shield.lua @@ -1,5 +1,8 @@ ----------------------------------- -- Reactive Shield +-- Grants Blaze Spikes to the automaton for 60 seconds. +-- https://wiki.ffo.jp/html/10431.html +-- Power formula derived from brief testing. TODO: Gather more data and refine formula. ----------------------------------- ---@type TAbilityAutomaton local abilityObject = {} @@ -9,12 +12,14 @@ abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill) end abilityObject.onAutomatonAbility = function(target, automaton, skill, master, action) - automaton:addRecast(xi.recast.ABILITY, skill:getID(), 65) - local pMod = automaton:getSkillLevel(xi.skill.AUTOMATON_MAGIC) - local duration = 60 - local power = math.floor((pMod / 56)^3 / 8) + 4 -- No idea how the actual formula used Automaton skill level, so heres a placeholder (4 @ lvl 1, 10 @ lvl 61, 20 @ lvl 75, 62 @ lvl 99) + automaton:addRecast(xi.recast.ABILITY, skill:getID(), 60) - if target:addStatusEffect(xi.effect.BLAZE_SPIKES, { power = power, duration = duration, origin = automaton }) then + local skillLevel = math.max(automaton:getSkillLevel(xi.skill.AUTOMATON_MELEE), automaton:getSkillLevel(xi.skill.AUTOMATON_RANGED), automaton:getSkillLevel(xi.skill.AUTOMATON_MAGIC)) + local intelligence = automaton:getStat(xi.mod.INT) + + local power = math.floor(skillLevel / 16) + math.floor(intelligence / 8) + + if target:addStatusEffect(xi.effect.BLAZE_SPIKES, { power = power, duration = 60, origin = automaton }) then skill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT) else skill:setMsg(xi.msg.basic.SKILL_NO_EFFECT)