landsandboat/scripts/items/eggplant.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

30 lines
744 B
Lua

-----------------------------------
-- ID: 4388
-- Item: eggplant
-- Food Effect: 5Min, All Races
-----------------------------------
-- Agility 3
-- Vitality -5
-----------------------------------
---@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, 300, 4388)
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.AGI, 3)
target:addMod(xi.mod.VIT, -5)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.AGI, 3)
target:delMod(xi.mod.VIT, -5)
end
return itemObject