Advertisement
Dekita

Untitled

Apr 19th, 2014
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. #===============================================================================
  2. # Random code creating a unique skill /item damage formula.
  3. # not really used within my game, feel free to adjust and use or whatever..
  4. # No credit is required.
  5. #
  6. #===============================================================================
  7. class Game_Battler < Game_BattlerBase
  8. #===============================================================================
  9. #-----------------------------------------------------------------------------
  10. # In the formula box, put
  11. # a.custom_skill(b,true)
  12. # or
  13. # a.custom_skill(b)
  14. # or
  15. # b.custom_skill(a,true)
  16. # or
  17. # b.custom_skill(a)
  18. # - Depending on who is attacking / Skill type / Whatever.
  19. #-----------------------------------------------------------------------------
  20. def custom_skill(enemy,magic = false)
  21. # / Checks if skill is magic
  22. if magic
  23. # // Gets simple damage formula
  24. x = [[self.mat*1.6 - enemy.mdf].min,1].max
  25. else
  26. # // Repeats process but for non magic attack
  27. x = [[self.atk*1.6 - enemy.def].min,1].max
  28. end
  29. # // Gets value of variable id 25
  30. y = $game_variables[25]
  31. # // Gets multiplier.. If game switch 50 is on, mult is 10, else, 1
  32. z = $game_switches[50] ? 10 : 1
  33. # // Perform another damage calculation
  34. dmg = state?(12) ? x + y * z : x * z
  35. # // Returns damage output
  36. return dmg
  37. end
  38.  
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement