Skip to content

Commit

Permalink
add: Frozen Mist and Hydro Wave mobskills
Browse files Browse the repository at this point in the history
  • Loading branch information
ampitere committed May 15, 2024
1 parent 26a2fb0 commit 6712cfe
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 3 deletions.
44 changes: 44 additions & 0 deletions scripts/actions/mobskills/frozen_mist.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-----------------------------------
-- Frozen Mist
-- Description: Deals ice damage to enemies around the caster. Additional effect: Terror
-- Type: Magical (Ice)
-----------------------------------
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = 30
local resist = xi.mobskills.applyPlayerResistance(mob, xi.effect.TERROR, target, mob:getStat(xi.mod.INT) - target:getStat(xi.mod.INT), 0, 0)
local duration = 30 * resist

xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.TERROR, power, 0, duration)

local dmgmod = 1.5
local info = xi.mobskills.mobMagicalMove(mob, target, skill, mob:getWeaponDmg(), xi.element.ICE, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.ICE, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(dmg, mob, xi.attackType.MAGICAL, xi.damageType.ICE)

-- remove water aura absorb from Hydro Wave if effect is already active
local effect = mob:getStatusEffect(xi.effect.STONESKIN)
if effect then
if effect:gubPower() == 2 then
mob:delMod(xi.mod.WATER_ABSORB, 100)
end
end

mob:addStatusEffect(xi.effect.STONESKIN, 0, 0, 180, 1, 1000)

local effect = mob:getStatusEffect(xi.effect.STONESKIN)
if effect then
mob:addMod(xi.mod.ICE_ABSORB, 100)
effect:addMod(xi.mod.ICE_ABSORB, 100)
end

return dmg
end

return mobskillObject
4 changes: 2 additions & 2 deletions scripts/actions/mobskills/fuscous_ooze.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------
-- Fuscous Ooze
-- Family: Slugs
-- Description: A dusky slime inflicts encumberance and weight.
-- Description: A dusky slime inflicts encumbrance and weight.
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Range: Cone
Expand All @@ -13,7 +13,7 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
-- TODO: Encumberance seems to do nothing?
-- TODO: Encumbrance seems to do nothing?
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.WEIGHT, 50, 0, 45)

local dmgmod = 1
Expand Down
44 changes: 44 additions & 0 deletions scripts/actions/mobskills/hydro_wave.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-----------------------------------
-- Hydro Wave
-- Description: Deals water damage to enemies around the caster.
-- Type: Magical (Water)
-----------------------------------
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = math.random(1, 16)
local resist = xi.mobskills.applyPlayerResistance(mob, xi.effect.ENCUMBRANCE_II, target, mob:getStat(xi.mod.INT) - target:getStat(xi.mod.INT), 0, 0)
local duration = 30 * resist

xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.ENCUMBRANCE_II, power, 0, duration)

local dmgmod = 2.5
local info = xi.mobskills.mobMagicalMove(mob, target, skill, mob:getWeaponDmg(), xi.element.WATER, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.WATER, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(dmg, mob, xi.attackType.MAGICAL, xi.damageType.WATER)

-- remove ice aura absorb from Frozen Mist if effect is already active
local effect = mob:getStatusEffect(xi.effect.STONESKIN)
if effect then
if effect:getSubPower() == 1 then
mob:delMod(xi.mod.ICE_ABSORB, 100)
end
end

mob:addStatusEffect(xi.effect.STONESKIN, 0, 0, 180, 2, 1500)

local effect = mob:getStatusEffect(xi.effect.STONESKIN)
if effect then
mob:addMod(xi.mod.WATER_ABSORB, 100)
effect:addMod(xi.mod.WATER_ABSORB, 100)
end

return dmg
end

return mobskillObject
2 changes: 1 addition & 1 deletion scripts/effects/encumbrance.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-----------------------------------
-- xi.effect.ENCUMBERANCE
-- xi.effect.ENCUMBRANCE
-----------------------------------
local effectObject = {}

Expand Down
13 changes: 13 additions & 0 deletions scripts/mixins/families/ruszor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ require('scripts/globals/mixins')
g_mixins = g_mixins or {}

g_mixins.ruszor = function(ruszorMob)
ruszorMob:addListener('WEAPONSKILL_USE', 'AURA', function(mobArg, target, actionId, tp, action)
local frozenMist = 2438
local hydroWave = 2439

-- Ruszor gain a temporary icy aura following the use of Frozen Mist.
if actionId == frozenMist then
mobArg:setAnimationSub(1)
-- Ruszor gain a temporary water aura following the use of Hydro Wave.
elseif actionId == hydroWave then
mobArg:setAnimationSub(2)
end
end)

ruszorMob:addListener('EFFECT_LOSE', 'STONESKIN', function(mob, effect)
if effect:getEffectType() == xi.effect.STONESKIN then
mob:setAnimationSub(0)
Expand Down

0 comments on commit 6712cfe

Please sign in to comment.