TheoAllen

RGSS3 Core Damage Result

May 5th, 2013
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.67 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Core Damage Result
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com
  5. # =============================================================================
  6. $imported = {} if $imported.nil?
  7. $imported[:Theo_CoreResult] = true
  8. # =============================================================================
  9. =begin
  10.  
  11.   NOTE :
  12.   Script ini ngerubah def item apply dengan menggabungkan beberapa eksekusi
  13.   @result ke beberapa method agar memudahkan aliasing
  14.  
  15.   TERMS OF USE :
  16.   No special condition. Feel free buat diapa-apain
  17.  
  18. =end
  19. # =============================================================================
  20. # Tidak ada konfigurasi
  21. # =============================================================================
  22. class Game_Battler < Game_BattlerBase
  23.  
  24.   def item_apply(user, item)
  25.     make_base_result(user, item)
  26.     apply_hit(user, item) if @result.hit?
  27.   end
  28.  
  29.   def make_base_result(user, item)
  30.     @result.clear
  31.     @result.used = item_test(user, item)
  32.     @result.missed = (@result.used && rand >= item_hit(user, item))
  33.     @result.evaded = (!@result.missed && rand < item_eva(user, item))
  34.   end
  35.  
  36.   def apply_hit(user, item)  
  37.     unless item.damage.none?
  38.       determine_critical(user, item)
  39.       make_damage_value(user, item)
  40.       execute_damage(user)
  41.     end
  42.     apply_item_effects(user, item)
  43.   end
  44.  
  45.   def determine_critical(user, item)
  46.     @result.critical = (rand < item_cri(user, item))
  47.   end
  48.  
  49.   def apply_item_effects(user, item)
  50.     item.effects.each {|effect| item_effect_apply(user, item, effect) }
  51.     item_user_effect(user, item)
  52.   end
  53.  
  54. end
Advertisement
Add Comment
Please, Sign In to add comment