rename to reflect type definition Annotate xi.itemUtils.foodOnItemCheck Make TItemFood functions optional, since the definition does not include types
24 lines
692 B
Lua
24 lines
692 B
Lua
-----------------------------------
|
|
-- ID: 5255
|
|
-- Item: Hyper-Ether
|
|
-- Item Effect: Restores 125 MP
|
|
-----------------------------------
|
|
---@type TItem
|
|
local itemObject = {}
|
|
|
|
itemObject.onItemCheck = function(target, item, param, caster)
|
|
if target:getMP() == target:getMaxMP() then
|
|
return xi.msg.basic.ITEM_UNABLE_TO_USE
|
|
elseif target:hasStatusEffect(xi.effect.MEDICINE) then
|
|
return xi.msg.basic.ITEM_NO_USE_MEDICATED
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
itemObject.onItemUse = function(target)
|
|
target:messageBasic(xi.msg.basic.RECOVERS_MP, 0, target:addMP(125 * xi.settings.main.ITEM_POWER))
|
|
target:addStatusEffect(xi.effect.MEDICINE, 0, 0, 300)
|
|
end
|
|
|
|
return itemObject
|