landsandboat/scripts/items/maple_cake.lua
claywar 6e4fa2af25
[type] Add type annotations to Item scripts
rename to reflect type definition

Annotate xi.itemUtils.foodOnItemCheck

Make TItemFood functions optional, since the definition does not include types
2024-08-24 18:25:26 -04:00

31 lines
816 B
Lua

-----------------------------------
-- ID: 5625
-- Item: Maple Cake
-- Food Effect: 3 Hrs, All Races
-----------------------------------
-- TODO: Group Effect
-- HP Recoverd while healing 1
-- MP Recovered while healing 4
-----------------------------------
---@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, 10800, 5625)
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.HPHEAL, 1)
target:addMod(xi.mod.MPHEAL, 4)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.HPHEAL, 1)
target:delMod(xi.mod.MPHEAL, 4)
end
return itemObject