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 - Advanced Battle Weather
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : $D13x Core && Various other $D13x Scripts (Check - Help).
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Adv_Battle_Weather]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 13/o3/2o14 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script was requested by wrigty12 @ the web address below:
- # http://forums.rpgmakerweb.com/index.php?/topic/24917-damage-during-battle-from-weather/
- #
- # This script allows for all stats - such as; params, xparams, sparams,
- # atk elements, def elements, parent stats (created with my ISPDS), atk level,
- # def level && max tp.
- # You can also change an actors skills and states by the current weather...
- # And guess what!! It also affects enemies (everything except skills).
- # Nifty little feature, dont you agree?
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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 Below ALL Stat Modifying $D13x Scripts!
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # Certain Scripts are required to make this script function, details below:
- # Params - Only requires $D13x - Core Script
- # xParams - Requires Statistic Control
- # sParams - Requires Statistic Control
- # Atk Ele - Requires Elements Control
- # Def Ele - Requires Elements Control
- # Parent stats - Requires ISPDS
- # Atk Lvl - Requires Atk | Def Levels
- # Def Lvl - Requires Atk | Def Levels
- # Max TP - Requires Max TP Control
- # Skills - No Additional Requirements
- # States - No Additional Requirements
- #
- #===============================================================================
- module Adv_Battle_Weather
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Show Weather In Battle ?
- #-----------------------------------------------------------------------------
- Show = true
- #-----------------------------------------------------------------------------
- # ☆ Weather Effect Settings
- #-----------------------------------------------------------------------------
- # This is a fixed stat increase setting.
- # can be any of the following stat types :
- # [:param , id, change],
- # [:x_param , id, change],
- # [:s_param , id, change],
- # [:atk_ele , id, change],
- # [:def_ele , id, change],
- # [:spds_stat , id, change]
- # [:atk_lvl , change],
- # [:def_lvl , change],
- # [:max_tp , change],
- # [:skill, skill_id],
- # [:state, state id],
- Weather_Effects={
- :none => [],
- :rain => [
- [:param , 0, 20],
- [:param , 1, 20],
- [:param , 2, 2],
- [:param , 3, 2],
- [:param , 4, 2],
- [:param , 5, 2],
- [:param , 6, 2],
- [:param , 7, 2],
- [:x_param , 0, 0.01],
- [:x_param , 1, 0.01],
- [:x_param , 2, 0.01],
- [:atk_ele , 4, 0.01],
- [:def_ele , 4, -0.01],
- [:spds_stat, 0, 1],
- [:spds_stat, 1, 1],
- [:spds_stat, 2, 1],
- [:spds_stat, 3, 1],
- [:atk_lvl , 10],
- [:def_lvl , 10],
- [:max_tp , 10],
- ],# << END :rain effects
- :storm => [],
- :snow => [],
- }# << END Weather Effects
- #####################
- # 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.\..\.. #
- #===============================================================================#
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :init_battle_weather :initialize
- alias :refr_battle_weather :refresh
- alias :parp_battle_weather :param_plus
- alias :xpar_battle_weather :xparam_plus if $D13x[:Stats_Control]
- alias :spar_battle_weather :sparam_plus if $D13x[:Stats_Control]
- alias :atke_battle_weather :atk_ele_plus if $D13x[:Elems_Control]
- alias :defe_battle_weather :def_ele_plus if $D13x[:Elems_Control]
- alias :atdf_battle_weather :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
- alias :spds_battle_weather :spds_plus if $D13x[:ISPDS]
- alias :skil_battle_weather :skills if self.is_a?(Game_Actor)
- alias :stat_battle_weather :states
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def initialize
- reset_weather_params
- init_battle_weather
- end
- #-----------------------------------------------------------------------------
- # Refresh
- #-----------------------------------------------------------------------------
- def refresh
- set_weather_bonuses
- refr_battle_weather
- end
- #-----------------------------------------------------------------------------
- # Reset Set Params
- #-----------------------------------------------------------------------------
- def reset_weather_params
- @battleweather_atl_dfl = [0] * 2
- @battleweather_param = [0] * 8
- @battleweather_xparam = [0] * 10
- @battleweather_sparam = [0] * 10
- @battleweather_atk_ele = [0] * $data_system.elements.size
- @battleweather_def_ele = [0] * $data_system.elements.size
- @battleweather_spds_stats = [0] * 8
- @battleweather_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @battleweather_max_tp = 0
- @battleweather_set_skills = Array.new
- @battleweather_set_states = Array.new
- end
- #-----------------------------------------------------------------------------
- # Get Added Value of Parameter
- #-----------------------------------------------------------------------------
- def param_plus(param_id)
- parp_battle_weather(param_id) + @battleweather_param[param_id]
- end
- if $D13x[:Stats_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of x-Parameter
- #---------------------------------------------------------------------------
- def xparam_plus(xparam_id)
- xpar_battle_weather(xparam_id) + @battleweather_xparam[xparam_id]
- end
- #---------------------------------------------------------------------------
- # Get Added Value of s-Parameter
- #---------------------------------------------------------------------------
- def sparam_plus(sparam_id)
- spar_battle_weather(sparam_id) + @battleweather_sparam[sparam_id]
- end
- end # if $D13x[:Stats_Control]
- if $D13x[:Elems_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of def-Element
- #---------------------------------------------------------------------------
- def def_ele_plus(element_id)
- defe_battle_weather(element_id) + @battleweather_def_ele[element_id]
- end
- #---------------------------------------------------------------------------
- # Get Added Value of atk-Element
- #---------------------------------------------------------------------------
- def atk_ele_plus(element_id)
- atke_battle_weather(element_id) + @battleweather_atk_ele[element_id]
- end
- end # if $D13x[:Elems_Control]
- if $D13x[:Atk_Def_Lvs]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def atl_dfl_plus(id)
- atdf_battle_weather(id) + @battleweather_atl_dfl[id]
- end
- end # if $D13x[:Atk_Def_Lvs]
- if $D13x[:ISPDS]
- #---------------------------------------------------------------------------
- # Get SPDS Stats Plus
- #---------------------------------------------------------------------------
- def spds_plus(id)
- spds_battle_weather(id) + @battleweather_spds_stats[id]
- end
- end # if $D13x[:ISPDS]
- if $D13x[:TP_Control]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def max_tp_plus
- @max_tp_plus[0]
- end
- end # if $D13x[:TP_Control]
- #-----------------------------------------------------------------------------
- # Get Skill Object Array
- #-----------------------------------------------------------------------------
- if self.is_a?(Game_Actor)
- def skills
- skil_battle_weather + weather_skills
- end
- end
- #-----------------------------------------------------------------------------
- # Get Weather Effect Skill Object Array
- #-----------------------------------------------------------------------------
- def weather_skills
- @battleweather_set_skills.sort.collect { |id| $data_skills[id] }
- end
- #-----------------------------------------------------------------------------
- # Get Weather Effect Skill Object Array
- #-----------------------------------------------------------------------------
- def states
- stat_battle_weather + weather_states
- end
- #-----------------------------------------------------------------------------
- # Get Weather Effect Skill Object Array
- #-----------------------------------------------------------------------------
- def weather_states
- @battleweather_set_states.collect {|id| $data_states[id] }
- end
- #-----------------------------------------------------------------------------
- # Check Weather Bonuses
- #-----------------------------------------------------------------------------
- def set_weather_bonuses
- reset_weather_params
- mod = Adv_Battle_Weather::Weather_Effects
- mod[$game_map.screen.weather_type].each do |i|
- case i[0]
- when :param
- @battleweather_param [i[1]] = i[2] if $D13x[:Stats_Control]
- when :x_param
- @battleweather_xparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :s_param
- @battleweather_sparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :atk_ele
- @battleweather_atk_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :def_ele
- @battleweather_def_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :atk_lvl
- @battleweather_atl_dfl[0] = i[1] if $D13x[:Atk_Def_Lvs]
- when :def_lvl
- @battleweather_atl_dfl[1] = i[1] if $D13x[:Atk_Def_Lvs]
- when :spds_stat
- @battleweather_spds_stats[i[1]] = i[2] if $D13x[:ISPDS]
- when :max_tp
- @battleweather_max_tp = i[1] if $D13x[:TP_Control]
- when :skill
- @battleweather_set_skills << i[1] if self.is_a?(Game_Actor)
- when :state
- @battleweather_set_states << i[1]
- end
- end
- end
- end
- #===============================================================================
- class Spriteset_Battle
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :i_battle_weather :create_viewports
- alias :d_battle_weather :dispose
- alias :u_battle_weather :update
- #-----------------------------------------------------------------------------
- # Create Viewports
- #-----------------------------------------------------------------------------
- def create_viewports
- i_battle_weather
- create_weather if Adv_Battle_Weather::Show
- end
- #-----------------------------------------------------------------------------
- # Dispose
- #-----------------------------------------------------------------------------
- def dispose
- d_battle_weather
- dispose_weather if @weather != nil
- end
- #-----------------------------------------------------------------------------
- # Update
- #-----------------------------------------------------------------------------
- def update
- u_battle_weather
- update_weather if @weather != nil
- end
- #-----------------------------------------------------------------------------
- # Create Weather
- #-----------------------------------------------------------------------------
- def create_weather
- return if $game_map.screen.weather_type == :none
- @weather = Spriteset_Weather.new(@viewport2)
- @weather.type = $game_map.screen.weather_type
- @weather.power = $game_map.screen.weather_power
- @weather.ox = $game_map.display_x * 32
- @weather.oy = $game_map.display_y * 32
- end
- #-----------------------------------------------------------------------------
- # Update Weather
- #-----------------------------------------------------------------------------
- def update_weather
- @weather.update
- end
- #-----------------------------------------------------------------------------
- # Dispose Weather
- #-----------------------------------------------------------------------------
- def dispose_weather
- @weather.dispose
- 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