Advertisement
Dekita

$D13x - Advanced Battle Weather 1.1

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