Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Damage Limits
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Damage_Limits]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o4/o4/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script modifys the apply_guard method to allow for each item or skill
- # to have a damage limit (can be different for each skill) as well as allowing
- # Actors / Classes / Equipment / Enemies / States / Skills to be given notetags
- # that allow for the damage limit to be broken.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # <DLIM: VALUE>
- # For Skills / Items. Replace VALUE with that items damage limit.
- # ie. 9999
- #
- # <break damage>
- # For Skills (passive), Enemies, Actors, Classes, Weapons, Armors, States
- # if this notetag is used then an actor / enemy will be able to break all skills
- # damage limits.
- # ie, if an actor has a weapon that has <break damage> that actor will be able
- # to deal damage above the limit.
- #
- #===============================================================================
- module Damage_Limits
- #===============================================================================
- # Default limit for all skills and items
- Default_Limit = 9999
- Notetags=[ /<break damage>/i , /<DLIM:(.*)>/i ]
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- if !$D13x[:CORE]
- #===============================================================================
- module DataManager
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :lbd_unique_damlim :load_database
- end
- #---------------------------------------------------------------------------
- # Load Database (alias)
- #---------------------------------------------------------------------------
- def self.load_database
- lbd_unique_damlim
- loa_unique_damlim
- end
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def self.loa_unique_damlim
- classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
- $data_actors , $data_classes, $data_enemies, $data_states ]
- for g in classes
- for o in g
- next if o == nil
- o.load_unique_damlim
- end
- end
- end
- end # DataManager
- end # if !$D13x[:CORE]
- #===============================================================================
- class RPG::BaseItem
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- alias :deki_damlim :load_unique_shit if $D13x[:CORE]
- #---------------------------------------------------------------------------
- # Pi Variables
- #---------------------------------------------------------------------------
- attr_accessor :break_damlim
- attr_accessor :damage_limit
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def load_unique_shit
- deki_damlim if $D13x[:CORE]
- load_unique_damlim
- end
- #---------------------------------------------------------------------------
- # Load Unique Notes
- #---------------------------------------------------------------------------
- def load_unique_damlim
- @break_damlim = false
- @damage_limit = Damage_Limits::Default_Limit
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Damage_Limits::Notetags[0] then @break_damlim = true
- when Damage_Limits::Notetags[1] then @damage_limit = $1.to_i
- end
- end
- end
- end
- #===============================================================================
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #--------------------------------------------------------------------------
- # Alias List
- #--------------------------------------------------------------------------
- alias :_MDV__damlim :make_damage_value
- alias :_APG__damlim :apply_guard
- #--------------------------------------------------------------------------
- # M.D.V
- #--------------------------------------------------------------------------
- def make_damage_value(user, item)
- @damlim_user = user
- @damlim_item = item
- _MDV__damlim(user, item)
- end
- #--------------------------------------------------------------------------
- # Applying Guard Adjustment
- #--------------------------------------------------------------------------
- def apply_guard(damage)
- user = @damlim_user
- item = @damlim_item
- orig = _APG__damlim(damage)
- orig = apply_damlim(orig,damage,item,user)
- orig
- end
- #--------------------------------------------------------------------------
- # Apply Damage Limits.
- #--------------------------------------------------------------------------
- def apply_damlim(orig,damage,item,user)
- dam = orig
- if orig.to_i > item.damage_limit
- dam = item.damage_limit unless user.can_break_damage
- end
- return dam
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #--------------------------------------------------------------------------
- # Can Break Damage Limit ?
- #--------------------------------------------------------------------------
- def can_break_damage
- result = false
- result = true if actor.break_damlim
- result = true if self.class.break_damlim
- equips.each do |eq|
- next if eq == nil
- next unless eq.break_damlim
- result = true
- end
- states.each do |st|
- next if st == nil
- next unless st.break_damlim
- result = true
- end
- skills.each do |sk|
- next if sk == nil
- next unless sk.break_damlim
- result = true
- end
- return result
- end
- end
- #===============================================================================
- class Game_Enemy < Game_Battler
- #===============================================================================
- #--------------------------------------------------------------------------
- # Can Break Damage Limit ?
- #--------------------------------------------------------------------------
- def can_break_damage
- result = false
- result = true if enemy.break_damlim
- states.each do |sk|
- next if sk == nil
- next unless sk.break_damlim
- result = true
- end
- return result
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement