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 - Particle Weather
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : $D13x - Particle Core
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Weather]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 15/o4/2o14 - Finished,
- # 28/o3/2o14 - Started
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script creates a simple particle weather system.
- # More features may be added in the future, but for now, that is all it does.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # $weather.add( :type )
- # $weather.remove( :type )
- # $weather.set_power( power )
- # $weather.stop_all
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #===============================================================================
- module Weather
- #===============================================================================
- Viewport_z = 50 #####################
- # 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.\..\.. #
- #===============================================================================#
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- class << self ;
- alias :cgo_weather :create_game_objects
- alias :msc_weather :make_save_contents
- alias :esc_weather :extract_save_contents
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.create_game_objects
- cgo_weather
- $weather = Game_Weather.new
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.make_save_contents
- contents = msc_weather
- contents[:weather] = $weather
- contents
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.extract_save_contents(contents)
- esc_weather(contents)
- extract_weather(contents)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.extract_weather(w)
- $weather = w[:weather].nil? ?
- Game_Weather.new :
- w[:weather]
- end
- end
- #==============================================================================
- class Game_Weather
- #==============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Weather
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_reader :current_types
- attr_reader :current_power
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @current_types = []
- @current_power = 1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def change_to(type,power=10)
- return unless type.is_a?(Symbol)
- @current_types = type
- @current_power = power
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def stop_all
- @current_types = []
- @current_power = 1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_power(power)
- @current_power = power
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def add(type)
- @current_types << type
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def remove(type)
- @current_types.delete(type)
- end
- end
- #===============================================================================
- class Map_Particle < Particle_Core
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_move
- @gmpx = $game_map.particle_x
- @gmpy = $game_map.particle_y
- super
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_move
- super
- update_scrollx
- update_scrolly
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_scrollx
- if @gmpx != $game_map.particle_x
- self.x -= ($game_map.particle_x-@gmpx)*32
- self.x = (@mx+10-self.x) if self.x < -10
- self.x = -(10+self.x) if self.x > @mx+10
- @gmpx = $game_map.particle_x
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_scrolly
- if @gmpy != $game_map.particle_y
- self.y -= ($game_map.particle_y-@gmpy)*32
- self.y = (@my+10-self.y) if self.y < -10
- self.y = -(10+self.y) if self.y > @my+10
- @gmpy = $game_map.particle_y
- end
- end
- end
- #===============================================================================
- class Map_Particles < Particle_Spriteset
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def scene_particles
- return $weather.current_types
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def particle_count(particle)
- (@module::Type[particle]['amnt'] * $weather.current_power)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_particles
- @particle_types = scene_particles.clone
- @old_particle_types = @particle_types.clone
- @old_weather_power = $weather.current_power
- super
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_partvp
- @particlevp = Viewport.new
- @particlevp.z = Weather::Viewport_z
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def updt_particles
- super
- update_ptcl_type
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update_ptcl_type
- type_diff = @old_particle_types != $weather.current_types
- amnt_diff = @old_weather_power != $weather.current_power
- if type_diff || amnt_diff
- disp_particles
- init_particles
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def add_particle_to_arr(particle)
- return unless @particles
- @particles << Map_Particle.new(@module::Type[particle],@particlevp,particle)
- end
- end
- #===============================================================================
- class Scene_Map < Scene_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def create_scene_particles
- dispose_scene_particles
- @particle_spriteset = Map_Particles.new
- end
- end
- #===============================================================================
- class Scene_Battle < Scene_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def create_scene_particles
- dispose_scene_particles
- @particle_spriteset = Map_Particles.new
- 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