rename to reflect type definition Annotate xi.itemUtils.foodOnItemCheck Make TItemFood functions optional, since the definition does not include types
36 lines
972 B
Lua
36 lines
972 B
Lua
-----------------------------------
|
|
-- ID: 5922
|
|
-- Item: Walnut Cookie
|
|
-- Food Effect: 3 Min, All Races
|
|
-----------------------------------
|
|
-- HP Healing 3
|
|
-- MP Healing 6
|
|
-- Bird Killer 10
|
|
-- Resist Paralyze 10
|
|
-----------------------------------
|
|
---@type TItemFood
|
|
local itemObject = {}
|
|
|
|
itemObject.onItemCheck = function(target, item, param, caster)
|
|
return xi.itemUtils.foodOnItemCheck(target, xi.foodType.BASIC)
|
|
end
|
|
|
|
itemObject.onItemUse = function(target)
|
|
target:addStatusEffect(xi.effect.FOOD, 0, 0, 180, 5922)
|
|
end
|
|
|
|
itemObject.onEffectGain = function(target, effect)
|
|
target:addMod(xi.mod.HPHEAL, 3)
|
|
target:addMod(xi.mod.MPHEAL, 6)
|
|
target:addMod(xi.mod.BIRD_KILLER, 10)
|
|
target:addMod(xi.mod.PARALYZERES, 10)
|
|
end
|
|
|
|
itemObject.onEffectLose = function(target, effect)
|
|
target:delMod(xi.mod.HPHEAL, 3)
|
|
target:delMod(xi.mod.MPHEAL, 6)
|
|
target:delMod(xi.mod.BIRD_KILLER, 10)
|
|
target:delMod(xi.mod.PARALYZERES, 10)
|
|
end
|
|
|
|
return itemObject
|