just this little snippet:
#-------------------------------------------------------------------------- # * Evaluate Skill/Item (Target Specification) #-------------------------------------------------------------------------- def evaluate_item_with_target(target) target.result.clear target.make_damage_value(subject, item) if item.for_opponent? return target.result.hp_damage.to_f / [target.hp, 1].max else recovery = [-target.result.hp_damage, target.mhp - target.hp].min return recovery.to_f / target.mhp end endend Here's what I'm looking for:
1. BOOST the return result for healing. I think it's this line: return recovery.to_f / target.mhp
But I'm not sure what ranges of numbers I'm looking at here... it looks like the recovery amount / max hp - so, it'll be a 2-decimal percentage type number? (ie: 0.24) ??
What I'm basically looking to do is to value healing over doing damage.
2. Put an IF..THEN in that same "else" segment where recovery == 0 (it's not a healing skill/effect) and allow me to put in my own code snippet. I'm just not sure what the value for "recovery" will be (I'm still shaky on ruby). Will it be a negative number? (I don't think so) Will it be the amount healed, capped by the target's maxhp? what's the .min doing there?
THANKS in advance!
#-------------------------------------------------------------------------- # * Evaluate Skill/Item (Target Specification) #-------------------------------------------------------------------------- def evaluate_item_with_target(target) target.result.clear target.make_damage_value(subject, item) if item.for_opponent? return target.result.hp_damage.to_f / [target.hp, 1].max else recovery = [-target.result.hp_damage, target.mhp - target.hp].min return recovery.to_f / target.mhp end endend Here's what I'm looking for:
1. BOOST the return result for healing. I think it's this line: return recovery.to_f / target.mhp
But I'm not sure what ranges of numbers I'm looking at here... it looks like the recovery amount / max hp - so, it'll be a 2-decimal percentage type number? (ie: 0.24) ??
What I'm basically looking to do is to value healing over doing damage.
2. Put an IF..THEN in that same "else" segment where recovery == 0 (it's not a healing skill/effect) and allow me to put in my own code snippet. I'm just not sure what the value for "recovery" will be (I'm still shaky on ruby). Will it be a negative number? (I don't think so) Will it be the amount healed, capped by the target's maxhp? what's the .min doing there?
THANKS in advance!