Advertisement
Dekita

Untitled

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