Advertisement
Dekita

Advanced Battle Weather v1.0

Mar 12th, 2014
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.63 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Advanced Battle Weather
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x Core && Various other $D13x Scripts (Check - Help).
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Adv_Battle_Weather]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 13/o3/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This script was requested by wrigty12 @ the web address below:
  26. # http://forums.rpgmakerweb.com/index.php?/topic/24917-damage-during-battle-from-weather/
  27. #
  28. # This script allows for all stats - such as; params, xparams, sparams,
  29. # atk elements, def elements, parent stats (created with my ISPDS), atk level,
  30. # def level && max tp.
  31. # You can also change an actors skills and states by the current weather...
  32. # And guess what!! It also affects enemies (everything except skills).
  33. # Nifty little feature, dont you agree?
  34. #
  35. #===============================================================================
  36. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  37. #===============================================================================
  38. # 1. You MUST give credit to "Dekita" !!
  39. # 2. You are NOT allowed to repost this script.(or modified versions)
  40. # 3. You are NOT allowed to convert this script.
  41. # 4. You are NOT allowed to use this script for Commercial games.
  42. # 5. ENJOY!
  43. #
  44. # "FINE PRINT"
  45. # By using this script you hereby agree to the above terms and conditions,
  46. # if any violation of the above terms occurs "legal action" may be taken.
  47. # Not understanding the above terms and conditions does NOT mean that
  48. # they do not apply to you.
  49. # If you wish to discuss the terms and conditions in further detail you can
  50. # contact me at http://dekitarpg.wordpress.com/
  51. #
  52. #===============================================================================
  53. # ☆ Instructions
  54. #-------------------------------------------------------------------------------
  55. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  56. # Place Below ALL Stat Modifying $D13x Scripts!
  57. #
  58. #===============================================================================
  59. # ☆ HELP
  60. #-------------------------------------------------------------------------------
  61. # Certain Scripts are required to make this script function, details below:
  62. # Params - Only requires $D13x - Core Script
  63. # xParams - Requires Statistic Control
  64. # sParams - Requires Statistic Control
  65. # Atk Ele - Requires Elements Control
  66. # Def Ele - Requires Elements Control
  67. # Parent stats - Requires ISPDS
  68. # Atk Lvl - Requires Atk | Def Levels
  69. # Def Lvl - Requires Atk | Def Levels
  70. # Max TP - Requires Max TP Control
  71. # Skills - No Additional Requirements
  72. # States - No Additional Requirements
  73. #
  74. #===============================================================================
  75. module Adv_Battle_Weather
  76. #===============================================================================
  77. #-----------------------------------------------------------------------------
  78. # Show Weather In Battle ?
  79. #-----------------------------------------------------------------------------
  80. Show = true
  81. #-----------------------------------------------------------------------------
  82. # ☆ Weather Effect Settings
  83. #-----------------------------------------------------------------------------
  84. # This is a fixed stat increase setting.
  85. # can be any of the following stat types :
  86. # [:param , id, change],
  87. # [:x_param , id, change],
  88. # [:s_param , id, change],
  89. # [:atk_ele , id, change],
  90. # [:def_ele , id, change],
  91. # [:spds_stat , id, change]
  92. # [:atk_lvl , change],
  93. # [:def_lvl , change],
  94. # [:max_tp , change],
  95. # [:skill, skill_id],
  96. # [:state, state id],
  97. Weather_Effects={
  98. :none => [],
  99. :rain => [
  100. [:param , 0, 20],
  101. [:param , 1, 20],
  102. [:param , 2, 2],
  103. [:param , 3, 2],
  104. [:param , 4, 2],
  105. [:param , 5, 2],
  106. [:param , 6, 2],
  107. [:param , 7, 2],
  108. [:x_param , 0, 0.01],
  109. [:x_param , 1, 0.01],
  110. [:x_param , 2, 0.01],
  111. [:atk_ele , 4, 0.01],
  112. [:def_ele , 4, -0.01],
  113. [:spds_stat, 0, 1],
  114. [:spds_stat, 1, 1],
  115. [:spds_stat, 2, 1],
  116. [:spds_stat, 3, 1],
  117. [:atk_lvl , 10],
  118. [:def_lvl , 10],
  119. [:max_tp , 10],
  120. ],# << END :rain effects
  121. :storm => [],
  122. :snow => [],
  123. }# << END Weather Effects
  124.  
  125. #####################
  126. # CUSTOMISATION END #
  127. end #####################
  128. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  129. # #
  130. # http://dekitarpg.wordpress.com/ #
  131. # #
  132. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  133. #===============================================================================#
  134. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  135. # YES?\.\. #
  136. # OMG, REALLY? \| #
  137. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  138. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  139. #===============================================================================#
  140. class Game_Battler < Game_BattlerBase
  141. #===============================================================================
  142. #-----------------------------------------------------------------------------
  143. # Alias List
  144. #-----------------------------------------------------------------------------
  145. alias :init_battle_weather :initialize
  146. alias :refr_battle_weather :refresh
  147. alias :parp_battle_weather :param_plus
  148. alias :xpar_battle_weather :xparam_plus if $D13x[:Stats_Control]
  149. alias :spar_battle_weather :sparam_plus if $D13x[:Stats_Control]
  150. alias :atke_battle_weather :atk_ele_plus if $D13x[:Elems_Control]
  151. alias :defe_battle_weather :def_ele_plus if $D13x[:Elems_Control]
  152. alias :atdf_battle_weather :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
  153. alias :spds_battle_weather :spds_plus if $D13x[:ISPDS]
  154. alias :skil_battle_weather :skills if self.is_a?(Game_Actor)
  155. alias :stat_battle_weather :states
  156. #-----------------------------------------------------------------------------
  157. # Initialize
  158. #-----------------------------------------------------------------------------
  159. def initialize
  160. reset_weather_params
  161. init_battle_weather
  162. end
  163. #-----------------------------------------------------------------------------
  164. # Refresh
  165. #-----------------------------------------------------------------------------
  166. def refresh
  167. set_weather_bonuses
  168. refr_battle_weather
  169. end
  170. #-----------------------------------------------------------------------------
  171. # Reset Set Params
  172. #-----------------------------------------------------------------------------
  173. def reset_weather_params
  174. @battleweather_atl_dfl = [0] * 2
  175. @battleweather_param = [0] * 8
  176. @battleweather_xparam = [0] * 10
  177. @battleweather_sparam = [0] * 10
  178. @battleweather_atk_ele = [0] * $data_system.elements.size
  179. @battleweather_def_ele = [0] * $data_system.elements.size
  180. @battleweather_spds_stats = [0] * 8
  181. @battleweather_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
  182. @battleweather_max_tp = 0
  183. @battleweather_set_skills = Array.new
  184. @battleweather_set_states = Array.new
  185. end
  186. #-----------------------------------------------------------------------------
  187. # Get Added Value of Parameter
  188. #-----------------------------------------------------------------------------
  189. def param_plus(param_id)
  190. parp_battle_weather(param_id) + @battleweather_param[param_id]
  191. end
  192. if $D13x[:Stats_Control]
  193. #---------------------------------------------------------------------------
  194. # Get Added Value of x-Parameter
  195. #---------------------------------------------------------------------------
  196. def xparam_plus(xparam_id)
  197. xpar_battle_weather(xparam_id) + @battleweather_xparam[xparam_id]
  198. end
  199. #---------------------------------------------------------------------------
  200. # Get Added Value of s-Parameter
  201. #---------------------------------------------------------------------------
  202. def sparam_plus(sparam_id)
  203. spar_battle_weather(sparam_id) + @battleweather_sparam[sparam_id]
  204. end
  205. end # if $D13x[:Stats_Control]
  206. if $D13x[:Elems_Control]
  207. #---------------------------------------------------------------------------
  208. # Get Added Value of def-Element
  209. #---------------------------------------------------------------------------
  210. def def_ele_plus(element_id)
  211. defe_battle_weather(element_id) + @battleweather_def_ele[element_id]
  212. end
  213. #---------------------------------------------------------------------------
  214. # Get Added Value of atk-Element
  215. #---------------------------------------------------------------------------
  216. def atk_ele_plus(element_id)
  217. atke_battle_weather(element_id) + @battleweather_atk_ele[element_id]
  218. end
  219. end # if $D13x[:Elems_Control]
  220. if $D13x[:Atk_Def_Lvs]
  221. #---------------------------------------------------------------------------
  222. # Atk Lv | Def Lv ++
  223. #---------------------------------------------------------------------------
  224. def atl_dfl_plus(id)
  225. atdf_battle_weather(id) + @battleweather_atl_dfl[id]
  226. end
  227. end # if $D13x[:Atk_Def_Lvs]
  228. if $D13x[:ISPDS]
  229. #---------------------------------------------------------------------------
  230. # Get SPDS Stats Plus
  231. #---------------------------------------------------------------------------
  232. def spds_plus(id)
  233. spds_battle_weather(id) + @battleweather_spds_stats[id]
  234. end
  235. end # if $D13x[:ISPDS]
  236. if $D13x[:TP_Control]
  237. #---------------------------------------------------------------------------
  238. # Atk Lv | Def Lv ++
  239. #---------------------------------------------------------------------------
  240. def max_tp_plus
  241. @max_tp_plus[0]
  242. end
  243. end # if $D13x[:TP_Control]
  244. #-----------------------------------------------------------------------------
  245. # Get Skill Object Array
  246. #-----------------------------------------------------------------------------
  247. if self.is_a?(Game_Actor)
  248. def skills
  249. skil_battle_weather + weather_skills
  250. end
  251. end
  252. #-----------------------------------------------------------------------------
  253. # Get Weather Effect Skill Object Array
  254. #-----------------------------------------------------------------------------
  255. def weather_skills
  256. @battleweather_set_skills.sort.collect { |id| $data_skills[id] }
  257. end
  258. #-----------------------------------------------------------------------------
  259. # Get Weather Effect Skill Object Array
  260. #-----------------------------------------------------------------------------
  261. def states
  262. stat_battle_weather + weather_states
  263. end
  264. #-----------------------------------------------------------------------------
  265. # Get Weather Effect Skill Object Array
  266. #-----------------------------------------------------------------------------
  267. def weather_states
  268. @battleweather_set_states.collect {|id| $data_states[id] }
  269. end
  270. #-----------------------------------------------------------------------------
  271. # Check Weather Bonuses
  272. #-----------------------------------------------------------------------------
  273. def set_weather_bonuses
  274. reset_weather_params
  275. mod = Adv_Battle_Weather::Weather_Effects
  276. mod[$game_map.screen.weather_type].each do |i|
  277. case i[0]
  278. when :param
  279. @battleweather_param [i[1]] = i[2] if $D13x[:Stats_Control]
  280. when :x_param
  281. @battleweather_xparam [i[1]] = i[2] if $D13x[:Stats_Control]
  282. when :s_param
  283. @battleweather_sparam [i[1]] = i[2] if $D13x[:Stats_Control]
  284. when :atk_ele
  285. @battleweather_atk_ele[i[1]] = i[2] if $D13x[:Elems_Control]
  286. when :def_ele
  287. @battleweather_def_ele[i[1]] = i[2] if $D13x[:Elems_Control]
  288. when :atk_lvl
  289. @battleweather_atl_dfl[0] = i[1] if $D13x[:Atk_Def_Lvs]
  290. when :def_lvl
  291. @battleweather_atl_dfl[1] = i[1] if $D13x[:Atk_Def_Lvs]
  292. when :spds_stat
  293. @battleweather_spds_stats[i[1]] = i[2] if $D13x[:ISPDS]
  294. when :max_tp
  295. @battleweather_max_tp = i[1] if $D13x[:TP_Control]
  296. when :skill
  297. @battleweather_set_skills << i[1] if self.is_a?(Game_Actor)
  298. when :state
  299. @battleweather_set_states << i[1]
  300. end
  301. end
  302. end
  303.  
  304. end
  305.  
  306. #===============================================================================
  307. class Spriteset_Battle
  308. #===============================================================================
  309. #-----------------------------------------------------------------------------
  310. # Alias List
  311. #-----------------------------------------------------------------------------
  312. alias :i_battle_weather :create_viewports
  313. alias :d_battle_weather :dispose
  314. alias :u_battle_weather :update
  315. #-----------------------------------------------------------------------------
  316. # Create Viewports
  317. #-----------------------------------------------------------------------------
  318. def create_viewports
  319. i_battle_weather
  320. create_weather if Adv_Battle_Weather::Show
  321. end
  322. #-----------------------------------------------------------------------------
  323. # Dispose
  324. #-----------------------------------------------------------------------------
  325. def dispose
  326. d_battle_weather
  327. dispose_weather if @weather != nil
  328. end
  329. #-----------------------------------------------------------------------------
  330. # Update
  331. #-----------------------------------------------------------------------------
  332. def update
  333. u_battle_weather
  334. update_weather if @weather != nil
  335. end
  336. #-----------------------------------------------------------------------------
  337. # Create Weather
  338. #-----------------------------------------------------------------------------
  339. def create_weather
  340. return if $game_map.screen.weather_type == :none
  341. @weather = Spriteset_Weather.new(@viewport2)
  342. @weather.type = $game_map.screen.weather_type
  343. @weather.power = $game_map.screen.weather_power
  344. @weather.ox = $game_map.display_x * 32
  345. @weather.oy = $game_map.display_y * 32
  346. end
  347. #-----------------------------------------------------------------------------
  348. # Update Weather
  349. #-----------------------------------------------------------------------------
  350. def update_weather
  351. @weather.update
  352. end
  353. #-----------------------------------------------------------------------------
  354. # Dispose Weather
  355. #-----------------------------------------------------------------------------
  356. def dispose_weather
  357. @weather.dispose
  358. end
  359.  
  360. end
  361.  
  362. #==============================================================================#
  363. # http://dekitarpg.wordpress.com/ #
  364. #==============================================================================#
  365. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement