Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- - Critical Damage Feature v1.1
- - Made by: Sixth
- - Description
- Just a short script to allow setting up different critical damage for different
- skills and items.
- - Note-tag:
- Use this note-tag on your skills/items to set a new critical damage for them:
- <cri_dmg: value>
- The default value is 3, but in case you want to change the default to something
- else, you just change the only number 3 in this little script to any value you
- want (although it should be a positive number or weird things will happen :D).
- Note that you can use float values too if you want (1.5, 2.45, etc).
- - Installation:
- Place this script between Materials and Main!
- - Compatibility:
- This script overwrites a method that is very often used in many different types
- of custom scripts, so the possibility of a compatibility issue is kinda high.
- You will need a patch if you run into these issues to make the scripts work
- together.
- - Terms of use:
- Credit me (Sixth) in your game, pretty please! :P
- =end
- class RPG::UsableItem < RPG::BaseItem
- attr_accessor :cri_dmg
- def cri_dmg
- init_cri_dmg if @cri_dmg.nil?
- return @cri_dmg
- end
- def init_cri_dmg
- @cri_dmg = @note =~ /<cri_dmg:(?:\s*)(.*)>/i ? $1.to_f : 3
- end
- end
- class Game_Battler < Game_BattlerBase
- alias add_new_cri_dmg6192 item_element_rate
- def item_element_rate(user, item)
- val = add_new_cri_dmg6192(user, item)
- val *= item.cri_dmg if @result.critical
- return val
- end
- def apply_critical(val) # Overwrite!
- return val
- end
- end
- # End of script! O_O
Add Comment
Please, Sign In to add comment