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 - Pokemon 'Flash' Style Lights
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:PFSL]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 1o/o3/2o14 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This is a simple script to replicate the pokemon move flash's 'light' effect.
- # It does nothing more && nothing less.
- #
- # Remember to copy the Graphics/$D13x/Lights folder/images into your project.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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
- #-------------------------------------------------------------------------------
- # $game_map.pfsl_opac = X
- # X = an integer value that sets the 'image' opacity
- #
- #-------------------------------------------------------------------------------
- # $game_map.pfsl_event = event
- # event = $game_player OR $game_map.events[EVENT_ID] OR this_event
- #
- # NOTE: this_event can only be used if you have my core script (v2.3+)
- # this_event will gain the id of the event using the script call.
- #
- #-------------------------------------------------------------------------------
- # $game_map.pfsl_light = ['image_name', hue]
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- module PFSL
- #===============================================================================
- #-----------------------------------------------------------------------------
- # The folder your light graphics are stored in
- #-----------------------------------------------------------------------------
- Folder = "Graphics/$D13x/Lights/"
- Light = ["Flash_Layer", 0] # ["image",hue]
- #####################
- # 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 Cache
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.pfsl(filename, hue = 0)
- load_bitmap(PFSL::Folder, filename, hue)
- end
- end
- #===============================================================================
- class Game_Map
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :init_pfsl :initialize
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :pfsl_opac
- attr_accessor :pfsl_event
- attr_accessor :pfsl_light
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @pfsl_opac = 0
- @pfsl_event = $game_player
- @pfsl_light = PFSL::Light
- init_pfsl
- end
- end
- #===============================================================================
- class Sprite_Pfsl < Sprite
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_reader :light
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(viewport,image)
- super(viewport)
- @light = image
- self.bitmap = Cache.pfsl(@light[0],@light[1])
- self.ox = (self.bitmap.width/2)
- self.oy = (self.bitmap.height/2)+12
- superupd
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def dispose
- super
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update
- superupd
- super
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def superupd
- self.opacity = $game_map.pfsl_opac
- self.x = $game_map.pfsl_event.screen_x
- self.y = $game_map.pfsl_event.screen_y
- self.z = $game_map.pfsl_event.screen_z-1
- end
- end
- #===============================================================================
- class Spriteset_Map
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :init_pfsl_ssmap :initialize
- alias :disp_pfsl_ssmap :dispose
- alias :updt_pfsl_ssmap :update
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- init_pfsl
- init_pfsl_ssmap
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def dispose
- disp_pfsl
- disp_pfsl_ssmap
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def update
- updt_pfsl
- updt_pfsl_ssmap
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_pfsl
- return unless PFSL::Light[0]
- return unless $game_map.pfsl_opac > 0
- light = $game_map.pfsl_light
- @pfsl = Sprite_Pfsl.new(@viewport2,light)
- @pfsl.x = $game_map.pfsl_event.screen_x
- @pfsl.y = $game_map.pfsl_event.screen_y
- updt_pfsl
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def disp_pfsl
- return unless @pfsl
- @pfsl.dispose
- @pfsl = nil
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def updt_pfsl
- return init_pfsl unless @pfsl
- @pfsl.x = $game_map.pfsl_event.screen_x
- @pfsl.y = $game_map.pfsl_event.screen_y
- if $game_map.pfsl_light[0] != @pfsl.light[0]
- disp_pfsl
- init_pfsl
- end
- @pfsl.update
- 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