Advertisement
Dekita

$D13x - PFSL v1.0

Mar 13th, 2014
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Pokemon 'Flash' Style Lights
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:PFSL]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 1o/o3/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This is a simple script to replicate the pokemon move flash's 'light' effect.
  26. # It does nothing more && nothing less.
  27. #
  28. # Remember to copy the Graphics/$D13x/Lights folder/images into your project.
  29. #
  30. #===============================================================================
  31. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  32. #===============================================================================
  33. # 1. You MUST give credit to "Dekita" !!
  34. # 2. You are NOT allowed to repost this script.(or modified versions)
  35. # 3. You are NOT allowed to convert this script.
  36. # 4. You are NOT allowed to use this script for Commercial games.
  37. # 5. ENJOY!
  38. #
  39. # "FINE PRINT"
  40. # By using this script you hereby agree to the above terms and conditions,
  41. # if any violation of the above terms occurs "legal action" may be taken.
  42. # Not understanding the above terms and conditions does NOT mean that
  43. # they do not apply to you.
  44. # If you wish to discuss the terms and conditions in further detail you can
  45. # contact me at http://dekitarpg.wordpress.com/
  46. #
  47. #===============================================================================
  48. # ☆ Instructions
  49. #-------------------------------------------------------------------------------
  50. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  51. #
  52. #===============================================================================
  53. # ☆ Script Calls
  54. #-------------------------------------------------------------------------------
  55. # $game_map.pfsl_opac = X
  56. # X = an integer value that sets the 'image' opacity
  57. #
  58. #-------------------------------------------------------------------------------
  59. # $game_map.pfsl_event = event
  60. # event = $game_player OR $game_map.events[EVENT_ID] OR this_event
  61. #
  62. # NOTE: this_event can only be used if you have my core script (v2.3+)
  63. # this_event will gain the id of the event using the script call.
  64. #
  65. #-------------------------------------------------------------------------------
  66. # $game_map.pfsl_light = ['image_name', hue]
  67. #
  68. #===============================================================================
  69. # ☆ HELP
  70. #-------------------------------------------------------------------------------
  71. # N/A
  72. #
  73. #===============================================================================
  74. module PFSL
  75. #===============================================================================
  76. #-----------------------------------------------------------------------------
  77. # The folder your light graphics are stored in
  78. #-----------------------------------------------------------------------------
  79. Folder = "Graphics/$D13x/Lights/"
  80. Light = ["Flash_Layer", 0] # ["image",hue]
  81.  
  82. #####################
  83. # CUSTOMISATION END #
  84. end #####################
  85. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  86. # #
  87. # http://dekitarpg.wordpress.com/ #
  88. # #
  89. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  90. #===============================================================================#
  91. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  92. # YES?\.\. #
  93. # OMG, REALLY? \| #
  94. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  95. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  96. #===============================================================================#
  97. module Cache
  98. #===============================================================================
  99. #-----------------------------------------------------------------------------
  100. #
  101. #-----------------------------------------------------------------------------
  102. def self.pfsl(filename, hue = 0)
  103. load_bitmap(PFSL::Folder, filename, hue)
  104. end
  105.  
  106. end
  107.  
  108. #===============================================================================
  109. class Game_Map
  110. #===============================================================================
  111. #-----------------------------------------------------------------------------
  112. #
  113. #-----------------------------------------------------------------------------
  114. alias :init_pfsl :initialize
  115. #-----------------------------------------------------------------------------
  116. #
  117. #-----------------------------------------------------------------------------
  118. attr_accessor :pfsl_opac
  119. attr_accessor :pfsl_event
  120. attr_accessor :pfsl_light
  121. #-----------------------------------------------------------------------------
  122. #
  123. #-----------------------------------------------------------------------------
  124. def initialize
  125. @pfsl_opac = 0
  126. @pfsl_event = $game_player
  127. @pfsl_light = PFSL::Light
  128. init_pfsl
  129. end
  130.  
  131. end
  132.  
  133. #===============================================================================
  134. class Sprite_Pfsl < Sprite
  135. #===============================================================================
  136. #-----------------------------------------------------------------------------
  137. #
  138. #-----------------------------------------------------------------------------
  139. attr_reader :light
  140. #-----------------------------------------------------------------------------
  141. #
  142. #-----------------------------------------------------------------------------
  143. def initialize(viewport,image)
  144. super(viewport)
  145. @light = image
  146. self.bitmap = Cache.pfsl(@light[0],@light[1])
  147. self.ox = (self.bitmap.width/2)
  148. self.oy = (self.bitmap.height/2)+12
  149. superupd
  150. end
  151. #-----------------------------------------------------------------------------
  152. #
  153. #-----------------------------------------------------------------------------
  154. def dispose
  155. super
  156. end
  157. #-----------------------------------------------------------------------------
  158. #
  159. #-----------------------------------------------------------------------------
  160. def update
  161. superupd
  162. super
  163. end
  164. #-----------------------------------------------------------------------------
  165. #
  166. #-----------------------------------------------------------------------------
  167. def superupd
  168. self.opacity = $game_map.pfsl_opac
  169. self.x = $game_map.pfsl_event.screen_x
  170. self.y = $game_map.pfsl_event.screen_y
  171. self.z = $game_map.pfsl_event.screen_z-1
  172. end
  173.  
  174. end
  175.  
  176. #===============================================================================
  177. class Spriteset_Map
  178. #===============================================================================
  179. #-----------------------------------------------------------------------------
  180. #
  181. #-----------------------------------------------------------------------------
  182. alias :init_pfsl_ssmap :initialize
  183. alias :disp_pfsl_ssmap :dispose
  184. alias :updt_pfsl_ssmap :update
  185. #-----------------------------------------------------------------------------
  186. #
  187. #-----------------------------------------------------------------------------
  188. def initialize
  189. init_pfsl
  190. init_pfsl_ssmap
  191. end
  192. #-----------------------------------------------------------------------------
  193. #
  194. #-----------------------------------------------------------------------------
  195. def dispose
  196. disp_pfsl
  197. disp_pfsl_ssmap
  198. end
  199. #-----------------------------------------------------------------------------
  200. #
  201. #-----------------------------------------------------------------------------
  202. def update
  203. updt_pfsl
  204. updt_pfsl_ssmap
  205. end
  206. #-----------------------------------------------------------------------------
  207. #
  208. #-----------------------------------------------------------------------------
  209. def init_pfsl
  210. return unless PFSL::Light[0]
  211. return unless $game_map.pfsl_opac > 0
  212. light = $game_map.pfsl_light
  213. @pfsl = Sprite_Pfsl.new(@viewport2,light)
  214. @pfsl.x = $game_map.pfsl_event.screen_x
  215. @pfsl.y = $game_map.pfsl_event.screen_y
  216. updt_pfsl
  217. end
  218. #-----------------------------------------------------------------------------
  219. #
  220. #-----------------------------------------------------------------------------
  221. def disp_pfsl
  222. return unless @pfsl
  223. @pfsl.dispose
  224. @pfsl = nil
  225. end
  226. #-----------------------------------------------------------------------------
  227. #
  228. #-----------------------------------------------------------------------------
  229. def updt_pfsl
  230. return init_pfsl unless @pfsl
  231. @pfsl.x = $game_map.pfsl_event.screen_x
  232. @pfsl.y = $game_map.pfsl_event.screen_y
  233. if $game_map.pfsl_light[0] != @pfsl.light[0]
  234. disp_pfsl
  235. init_pfsl
  236. end
  237. @pfsl.update
  238. end
  239.  
  240. end
  241.  
  242. #==============================================================================#
  243. # http://dekitarpg.wordpress.com/ #
  244. #==============================================================================#
  245. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement