Hey there! I'm looking for a conversion of a smallscript I had used during a VX Ace project. Small script, can be found below:
The goal is to have a variable, in this case HEALTH_GATING_PERCENT, and if the targets health is more than that value as a percentage, then the blow cannot kill them, and will instead deal enough damage to leave them with 1 HP. The HEALTH_GATING_SWITCH is a.. well, switch/boolean, whatever you prefer terminology-wise, that determines whether or not it should be active. A reason for this might be a boss mechanic that one-shots the player, or something akin to that. Additionally, as per the original script, it should only be active for party members-- enemy battlers can be one-shot all day.
If something like this already exists for MV, then I apologize and humbly request to be directed towards it 🙂
Code:
HEALTH_GATING_PERCENT = 60
HEALTH_GATING_SWITCH = 487
class Game_Actor < Game_Battler
def make_damage_value(user, item)
super(user, item)
# If a skill that deals HP damage, check gating
if item.is_a?(RPG::Skill) && @result.hp_damage > 0
if !$game_switches[HEALTH_GATING_SWITCH] && hp_rate * 100 > HEALTH_GATING_PERCENT && @result.hp_damage >= hp
@result.make_damage(hp - 1, item)
end
end
end
end
The goal is to have a variable, in this case HEALTH_GATING_PERCENT, and if the targets health is more than that value as a percentage, then the blow cannot kill them, and will instead deal enough damage to leave them with 1 HP. The HEALTH_GATING_SWITCH is a.. well, switch/boolean, whatever you prefer terminology-wise, that determines whether or not it should be active. A reason for this might be a boss mechanic that one-shots the player, or something akin to that. Additionally, as per the original script, it should only be active for party members-- enemy battlers can be one-shot all day.
If something like this already exists for MV, then I apologize and humbly request to be directed towards it 🙂