When I used TONS' "Item requirement skill", I think I found a bug... I don't think it was supposed to be this way º¬º
For example, the default: 1 potion to use heal. If the HP is full, you can't use the skill, but you lose 1 potion anyway.
Unfortunatly, the code is too complicated for me to figure it out by myself.
This stuff:
class Game_Battler
alias skill_effect_item_reqs_later skill_effect
def skill_effect(user, skill)
result = skill_effect_item_reqs_later(user, skill)
if $game_system.ITEM_REQUIREMENT
data = BlizzCFG.item_reqs(skill.id)
if user.is_a?(Game_Actor) && data.all? {|i| i > 0}
$game_party.lose_item(data[0], data[1])
end
end
return result
end
alias skill_can_use_item_reqs_later? skill_can_use?
def skill_can_use?(skill_id)
if $game_system.ITEM_REQUIREMENT
data = BlizzCFG.item_reqs(skill_id)
if self.is_a?(Game_Actor) && $game_party.item_number(data[0]) < data[1]
return false
end
end
return skill_can_use_item_reqs_later?(skill_id)
end
end
Somebody help me? Thanks in advance <3