landsandboat/scripts/items/hamsi.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: 5449
-- Item: Hamsi
-- Food Effect: 5Min, Mithra only
-----------------------------------
-- Dexterity 1
-- Mind -3
-----------------------------------
---@type TItemFood
local itemObject = {}
itemObject.onItemCheck = function(target, item, param, caster)
return xi.itemUtils.foodOnItemCheck(target, xi.foodType.RAW_FISH)
end
itemObject.onItemUse = function(target)
target:addStatusEffect(xi.effect.FOOD, 0, 0, 300, 5449)
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.DEX, 1)
target:addMod(xi.mod.MND, -3)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.DEX, 1)
target:delMod(xi.mod.MND, -3)
end
return itemObject