Advertisement
Dekita

Untitled

Apr 19th, 2014
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.98 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Particle Weather
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x - Particle Core
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Weather]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 15/o4/2o14 - Finished,
  21. # 28/o3/2o14 - Started
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script creates a simple particle weather system.
  27. # More features may be added in the future, but for now, that is all it does.
  28. #
  29. #===============================================================================
  30. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  31. #===============================================================================
  32. # 1. You MUST give credit to "Dekita" !!
  33. # 2. You are NOT allowed to repost this script.(or modified versions)
  34. # 3. You are NOT allowed to convert this script.
  35. # 4. You are NOT allowed to use this script for Commercial games.
  36. # 5. ENJOY!
  37. #
  38. # "FINE PRINT"
  39. # By using this script you hereby agree to the above terms and conditions,
  40. # if any violation of the above terms occurs "legal action" may be taken.
  41. # Not understanding the above terms and conditions does NOT mean that
  42. # they do not apply to you.
  43. # If you wish to discuss the terms and conditions in further detail you can
  44. # contact me at http://dekitarpg.wordpress.com/
  45. #
  46. #===============================================================================
  47. # ☆ Instructions
  48. #-------------------------------------------------------------------------------
  49. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  50. #
  51. #===============================================================================
  52. # ☆ Script Calls
  53. #-------------------------------------------------------------------------------
  54. # $weather.add( :type )
  55. # $weather.remove( :type )
  56. # $weather.set_power( power )
  57. # $weather.stop_all
  58. #
  59. #===============================================================================
  60. # ☆ Notetags ( default )
  61. #-------------------------------------------------------------------------------
  62. # N/A
  63. #
  64. #===============================================================================
  65. # ☆ HELP
  66. #-------------------------------------------------------------------------------
  67. # N/A
  68. #===============================================================================
  69. module Weather
  70. #===============================================================================
  71. Viewport_z = 50 #####################
  72. # CUSTOMISATION END #
  73. end #####################
  74. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  75. # #
  76. # http://dekitarpg.wordpress.com/ #
  77. # #
  78. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  79. #===============================================================================#
  80. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  81. # YES?\.\. #
  82. # OMG, REALLY? \| #
  83. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  84. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  85. #===============================================================================#
  86. module DataManager
  87. #===============================================================================
  88. #-----------------------------------------------------------------------------
  89. #
  90. #-----------------------------------------------------------------------------
  91. class << self ;
  92. alias :cgo_weather :create_game_objects
  93. alias :msc_weather :make_save_contents
  94. alias :esc_weather :extract_save_contents
  95. end
  96. #-----------------------------------------------------------------------------
  97. #
  98. #-----------------------------------------------------------------------------
  99. def self.create_game_objects
  100. cgo_weather
  101. $weather = Game_Weather.new
  102. end
  103. #-----------------------------------------------------------------------------
  104. #
  105. #-----------------------------------------------------------------------------
  106. def self.make_save_contents
  107. contents = msc_weather
  108. contents[:weather] = $weather
  109. contents
  110. end
  111. #-----------------------------------------------------------------------------
  112. #
  113. #-----------------------------------------------------------------------------
  114. def self.extract_save_contents(contents)
  115. esc_weather(contents)
  116. extract_weather(contents)
  117. end
  118. #-----------------------------------------------------------------------------
  119. #
  120. #-----------------------------------------------------------------------------
  121. def self.extract_weather(w)
  122. $weather = w[:weather].nil? ?
  123. Game_Weather.new :
  124. w[:weather]
  125. end
  126. end
  127. #==============================================================================
  128. class Game_Weather
  129. #==============================================================================
  130. #-----------------------------------------------------------------------------
  131. #
  132. #-----------------------------------------------------------------------------
  133. include Weather
  134. #-----------------------------------------------------------------------------
  135. #
  136. #-----------------------------------------------------------------------------
  137. attr_reader :current_types
  138. attr_reader :current_power
  139. #-----------------------------------------------------------------------------
  140. #
  141. #-----------------------------------------------------------------------------
  142. def initialize
  143. @current_types = []
  144. @current_power = 1
  145. end
  146. #-----------------------------------------------------------------------------
  147. #
  148. #-----------------------------------------------------------------------------
  149. def change_to(type,power=10)
  150. return unless type.is_a?(Symbol)
  151. @current_types = type
  152. @current_power = power
  153. end
  154. #-----------------------------------------------------------------------------
  155. #
  156. #-----------------------------------------------------------------------------
  157. def stop_all
  158. @current_types = []
  159. @current_power = 1
  160. end
  161. #-----------------------------------------------------------------------------
  162. #
  163. #-----------------------------------------------------------------------------
  164. def set_power(power)
  165. @current_power = power
  166. end
  167. #-----------------------------------------------------------------------------
  168. #
  169. #-----------------------------------------------------------------------------
  170. def add(type)
  171. @current_types << type
  172. end
  173. #-----------------------------------------------------------------------------
  174. #
  175. #-----------------------------------------------------------------------------
  176. def remove(type)
  177. @current_types.delete(type)
  178. end
  179. end
  180. #===============================================================================
  181. class Map_Particle < Particle_Core
  182. #===============================================================================
  183. #-----------------------------------------------------------------------------
  184. #
  185. #-----------------------------------------------------------------------------
  186. def init_move
  187. @gmpx = $game_map.particle_x
  188. @gmpy = $game_map.particle_y
  189. super
  190. end
  191. #-----------------------------------------------------------------------------
  192. #
  193. #-----------------------------------------------------------------------------
  194. def update_move
  195. super
  196. update_scrollx
  197. update_scrolly
  198. end
  199. #-----------------------------------------------------------------------------
  200. #
  201. #-----------------------------------------------------------------------------
  202. def update_scrollx
  203. if @gmpx != $game_map.particle_x
  204. self.x -= ($game_map.particle_x-@gmpx)*32
  205. self.x = (@mx+10-self.x) if self.x < -10
  206. self.x = -(10+self.x) if self.x > @mx+10
  207. @gmpx = $game_map.particle_x
  208. end
  209. end
  210. #-----------------------------------------------------------------------------
  211. #
  212. #-----------------------------------------------------------------------------
  213. def update_scrolly
  214. if @gmpy != $game_map.particle_y
  215. self.y -= ($game_map.particle_y-@gmpy)*32
  216. self.y = (@my+10-self.y) if self.y < -10
  217. self.y = -(10+self.y) if self.y > @my+10
  218. @gmpy = $game_map.particle_y
  219. end
  220. end
  221. end
  222. #===============================================================================
  223. class Map_Particles < Particle_Spriteset
  224. #===============================================================================
  225. #-----------------------------------------------------------------------------
  226. #
  227. #-----------------------------------------------------------------------------
  228. def scene_particles
  229. return $weather.current_types
  230. end
  231. #-----------------------------------------------------------------------------
  232. #
  233. #-----------------------------------------------------------------------------
  234. def particle_count(particle)
  235. (@module::Type[particle]['amnt'] * $weather.current_power)
  236. end
  237. #-----------------------------------------------------------------------------
  238. #
  239. #-----------------------------------------------------------------------------
  240. def init_particles
  241. @particle_types = scene_particles.clone
  242. @old_particle_types = @particle_types.clone
  243. @old_weather_power = $weather.current_power
  244. super
  245. end
  246. #-----------------------------------------------------------------------------
  247. #
  248. #-----------------------------------------------------------------------------
  249. def init_partvp
  250. @particlevp = Viewport.new
  251. @particlevp.z = Weather::Viewport_z
  252. end
  253. #-----------------------------------------------------------------------------
  254. #
  255. #-----------------------------------------------------------------------------
  256. def updt_particles
  257. super
  258. update_ptcl_type
  259. end
  260. #-----------------------------------------------------------------------------
  261. #
  262. #-----------------------------------------------------------------------------
  263. def update_ptcl_type
  264. type_diff = @old_particle_types != $weather.current_types
  265. amnt_diff = @old_weather_power != $weather.current_power
  266. if type_diff || amnt_diff
  267. disp_particles
  268. init_particles
  269. end
  270. end
  271. #-----------------------------------------------------------------------------
  272. #
  273. #-----------------------------------------------------------------------------
  274. def add_particle_to_arr(particle)
  275. return unless @particles
  276. @particles << Map_Particle.new(@module::Type[particle],@particlevp,particle)
  277. end
  278. end
  279. #===============================================================================
  280. class Scene_Map < Scene_Base
  281. #===============================================================================
  282. #-----------------------------------------------------------------------------
  283. #
  284. #-----------------------------------------------------------------------------
  285. def create_scene_particles
  286. dispose_scene_particles
  287. @particle_spriteset = Map_Particles.new
  288. end
  289. end
  290. #===============================================================================
  291. class Scene_Battle < Scene_Base
  292. #===============================================================================
  293. #-----------------------------------------------------------------------------
  294. #
  295. #-----------------------------------------------------------------------------
  296. def create_scene_particles
  297. dispose_scene_particles
  298. @particle_spriteset = Map_Particles.new
  299. end
  300. end
  301. #==============================================================================#
  302. # http://dekitarpg.wordpress.com/ #
  303. #==============================================================================#
  304. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement