Advertisement
Dekita

avdanved battle weather 1.2

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