Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Core Damage Result
- # Version : 1.0
- # Contact : www.rpgmakerid.com
- # =============================================================================
- $imported = {} if $imported.nil?
- $imported[:Theo_CoreResult] = true
- # =============================================================================
- =begin
- NOTE :
- Script ini ngerubah def item apply dengan menggabungkan beberapa eksekusi
- @result ke beberapa method agar memudahkan aliasing
- TERMS OF USE :
- No special condition. Feel free buat diapa-apain
- =end
- # =============================================================================
- # Tidak ada konfigurasi
- # =============================================================================
- class Game_Battler < Game_BattlerBase
- def item_apply(user, item)
- make_base_result(user, item)
- apply_hit(user, item) if @result.hit?
- end
- def make_base_result(user, item)
- @result.clear
- @result.used = item_test(user, item)
- @result.missed = (@result.used && rand >= item_hit(user, item))
- @result.evaded = (!@result.missed && rand < item_eva(user, item))
- end
- def apply_hit(user, item)
- unless item.damage.none?
- determine_critical(user, item)
- make_damage_value(user, item)
- execute_damage(user)
- end
- apply_item_effects(user, item)
- end
- def determine_critical(user, item)
- @result.critical = (rand < item_cri(user, item))
- end
- def apply_item_effects(user, item)
- item.effects.each {|effect| item_effect_apply(user, item, effect) }
- item_user_effect(user, item)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment