Guest User

Untitled

a guest
Mar 2nd, 2016
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <Custom Confirm Effect>
  2. // Registers the HP value of the user.
  3. user._confirmHp = user.hp;
  4. </Custom Confirm Effect>
  5.  
  6. <Custom Establish Effect>
  7. // Check to see if the effect deals damage to HP and is a physical attack.
  8. if (value > 0 && this.isHpEffect() && this.isPhysical()) {
  9. // Check to see if the user is at full HP.
  10. if (user.hp === user.mhp) {
  11. // Get the user's Life Steal results.
  12. var result = user.result();
  13. // Get the overheal amount.
  14. var overheal = -1 * result.hpDamage + user._confirmHp - user.mhp;
  15. // Check if the overheal amount is above 0.
  16. if (overheal > 0) {
  17. // Adds a barrier to the user based on the overheal amount.
  18. user.gainBarrier(overheal, 2);
  19. }
  20. }
  21. }
  22. </Custom Establish Effect>
Advertisement
Add Comment
Please, Sign In to add comment