Ruby:
module TLB
HEALSKILL_ID = 26
end
class Scene_Battle < Scene_Base
def use_item
intended_item = @subject.current_action.item
should_replace = @subject.hp_rate <= 0.75 && intended_item.magical?
item = should_replace ? $data_skills[TLB::HEALSKILL_ID] : intended_item
@log_window.display_use_item(@subject, item)
@subject.use_item(item)
refresh_status
if should_replace
$game_message.face_name = $game_party.leader.face_name
$game_message.face_index = $game_party.leader.face_index
$game_message.add("Screw that order, I'm gonna heal myself.")
BattleManager.wait_for_message
end
targets = should_replace ? [@subject] : @subject.current_action.make_targets.compact
show_animation(targets, item.animation_id)
targets.each {|target| item.repeats.times { invoke_item(target, item) } }
end
end