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 - Equipment - Weapon DMG Range
- # -- Author : Dekita
- # -- Version : 1.4
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Weapon_Range]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 17/o5/2o13 - Small Update,
- # 23/o3/2o13 - Compatibility, ($D13x - Equip Scene)
- # - Bugfix, (no longer requires $D13x Core)
- # 18/o3/2o13 - Changed formula slightly,
- # 1o/o3/2o13 - Changed import code,
- # o8/o3/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows for weapons to have a variance, very similar to the
- # variance used in skills/items.
- # The main difference being, its for weapons, not items/skills.
- # eg.
- # axe = high variance, this would make some hits very high and some very low.
- # hammer = low variance, this means the damage is more steady.
- #
- # in short, using this script means different weapon types actually have
- # different damage ranges...
- #
- # you can have different variances for physical/magical/certain hits
- #
- # v1.2+ changes the way the formula calculates the damage variance.
- # instead of it being higher or lower (increasing or decreasing the damage)
- # the variance is just extra damage added onto the current damage value.
- # damage value will no longer be reduced due to this script.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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.
- # Place Under My $D13x Equipment - Individualize Script (if used)
- #
- #===============================================================================
- # ☆ Notetags ( default )
- # For use with Weapons
- #-------------------------------------------------------------------------------
- # <p range: X>
- # <m range: X>
- # <c range: X>
- # Replace X with an integer value, ie 1/2/3/4/5/6...
- #
- #===============================================================================
- module Weapon_Range
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Main Settings
- #--------------------------------------------------------------------------
- # These are the default settings given to weapons (based on weapon type)
- # if they have not been notetagged otherwise.
- # id => [ phys , magi , cert ]
- Type ={
- 1 => [ 40 , 10 , 0 ], # Default = Axe
- 2 => [ 20 , 10 , 0 ], # Default = Claw
- 3 => [ 25 , 10 , 0 ], # Default = Spear
- 4 => [ 20 , 10 , 0 ], # Default = Sword
- 5 => [ 15 , 15 , 0 ], # Default = Katana
- 6 => [ 50 , 20 , 0 ], # Default = Bow
- 7 => [ 10 , 10 , 0 ], # Default = Dagger
- 8 => [ 30 , 10 , 0 ], # Default = Hammer
- 9 => [ 30 , 30 , 0 ], # Default = Staff
- 10 => [ 10 , 10 , 0 ], # Default = Gun
- # << Add more lines here if you have more than 10 weapon types :)
- }# << Keep
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Notetag Settings
- #--------------------------------------------------------------------------
- # These are the default notetags used in the weapon notebox
- # only modify these if you know what your doing.
- # type => /<note vocab:(.*)>/i ,
- Notetags={
- :atk => /<p range:(.*)>/i ,
- :mat => /<m range:(.*)>/i ,
- :cert => /<c range:(.*)>/i ,
- }# << Keep
- end #####################
- # CUSTOMISATION 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.\..\.. #
- #===============================================================================#
- module DataManager
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :lbd_unique_wepran :load_database
- end
- #---------------------------------------------------------------------------
- # Load Database (alias)
- #---------------------------------------------------------------------------
- def self.load_database
- lbd_unique_wepran
- loa_unique_wepran
- end
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def self.loa_unique_wepran
- for wep in $data_weapons
- next if wep == nil
- wep.load_unique_wepran
- end
- end
- end # DataManager
- #===============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #===============================================================================
- #---------------------------------------------------------------------------
- # Pi Variables
- #---------------------------------------------------------------------------
- attr_accessor :par_range
- #---------------------------------------------------------------------------
- # Load Unique Notes
- #---------------------------------------------------------------------------
- def load_unique_wepran
- @par_range = {:atk=>0,:mat=>0,:cert=>0}
- load_weapon_ranges
- end
- #---------------------------------------------------------------------------
- # Load Weapon Ranges
- #---------------------------------------------------------------------------
- def load_weapon_ranges
- return unless self.is_a?(RPG::Weapon)
- @par_range[:atk] = Weapon_Range::Type[self.wtype_id][0] rescue nil
- @par_range[:mat] = Weapon_Range::Type[self.wtype_id][1] rescue nil
- @par_range[:cert] = Weapon_Range::Type[self.wtype_id][2] rescue nil
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Weapon_Range::Notetags[:atk] then @par_range[:atk] = $1.to_i
- when Weapon_Range::Notetags[:mat] then @par_range[:mat] = $1.to_i
- when Weapon_Range::Notetags[:cert] then @par_range[:cert] = $1.to_i
- end
- end
- end
- end
- #===============================================================================
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #--------------------------------------------------------------------------
- # Alias List
- #--------------------------------------------------------------------------
- alias :_MDV__Range :make_damage_value
- alias :_APV__Range :apply_variance
- #--------------------------------------------------------------------------
- # M.D.V
- #--------------------------------------------------------------------------
- def make_damage_value(user, item)
- @wep_range_user = user
- @wep_range_item = item
- _MDV__Range(user, item)
- end
- #--------------------------------------------------------------------------
- # Apply Variance Mod
- #--------------------------------------------------------------------------
- def apply_variance(damage, variance)
- user = @wep_range_user
- item = @wep_range_item
- orig = _APV__Range(damage, variance)
- orig += apply_weapon_variance(orig,damage,item,user)
- orig
- end
- #--------------------------------------------------------------------------
- # Apply Variance Mod
- #--------------------------------------------------------------------------
- def apply_weapon_variance(orig,damage,item,user)
- return 0 unless user.is_a?(Game_Actor)
- dam = orig
- user.weapons.each do |e|
- next if e == nil
- varii = e.par_range[:atk] if item.physical?
- varii = e.par_range[:mat] if item.magical?
- varii = e.par_range[:cert] if item.certain?
- amp = [damage.abs * varii / 100, 0].max.to_i
- var = rand(amp + 1) #+ rand(amp + 1) - amp
- dam = dam >= 0 ? dam + var : dam - var
- end
- dam
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #--------------------------------------------------------------------------
- # ATK Param Range
- #--------------------------------------------------------------------------
- def atk_par_range
- range = param(2)
- weapons.each do |w|
- next if w == nil
- range *= (1+(w.par_range[:atk].to_f/100))
- end
- return range.to_i
- end
- #--------------------------------------------------------------------------
- # MAT Param Range
- #--------------------------------------------------------------------------
- def mat_par_range
- range = param(4)
- weapons.each do |w|
- next if w == nil
- range *= (1+(w.par_range[:mat].to_f/100))
- end
- return range.to_i
- 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