bgillisp

Yanfly Lunatic States - Edited to fix a bug

Feb 11th, 2015
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Lunatic States v1.02
  4. # -- Last Updated: 2012.01.30
  5. # -- Level: Lunatic
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10.  
  11. $imported = {} if $imported.nil?
  12. $imported["YEA-LunaticStates"] = true
  13.  
  14.  
  15. #==============================================================================
  16. # ▼ Updates
  17. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  18. # 2012.01.30 - Compatibility Update: Ace Battle Engine
  19. # 2011.12.19 - Fixed Death State stacking error.
  20. # 2011.12.15 - Started Script and Finished.
  21. #
  22. #==============================================================================
  23. # ▼ Introduction
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # Lunatic mode effects have always been a core part of Yanfly Engine scripts.
  26. # They exist to provide more effects for those who want more power and control
  27. # for their items, skills, status effects, etc., but the users must be able to
  28. # add them in themselves.
  29. #
  30. # This script provides the base setup for state lunatic effects. These effects
  31. # will occur under certain conditions, which can include when a state is
  32. # applied, erased, leaves naturally, before taking damage, after taking damage,
  33. # at the start of a turn, while an action finishes, and at the end of a turn.
  34. #
  35. #==============================================================================
  36. # ▼ Instructions
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # To install this script, open up your script editor and copy/paste this script
  39. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  40. #
  41. #==============================================================================
  42. # ▼ Compatibility
  43. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  44. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  45. # it will run with RPG Maker VX without adjusting.
  46. #
  47. #==============================================================================
  48.  
  49.  
  50. class Game_BattlerBase
  51.  
  52. #--------------------------------------------------------------------------
  53. # ● Welcome to Lunatic Mode
  54. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  55. # Lunatic States allow allow states to trigger various scripted functions
  56. # throughout certain set periods of times or when certain conditions
  57. # trigger. These effects can occur when a state is applied, when a state is
  58. # erased, when a state leaves naturally, before damage is taken, after
  59. # damage is taken, at the beginning of a turn, while the turn is occuring,
  60. # and at the closing of a turn. These effects are separated by these eight
  61. # different notetags.
  62. #
  63. # <apply effect: string> - Occurs when state is applied.
  64. # <erase effect: string> - Occurs when state is removed.
  65. # <leave effect: string> - Occurs when state timer hits 0.
  66. # <react effect: string> - Occurs before taking damage.
  67. # <shock effect: string> - Occurs after taking damage.
  68. # <begin effect: string> - Occurs at the start of each turn.
  69. # <while effect: string> - Occurs after performing an action.
  70. # <close effect: string> - Occurs at the end of a turn.
  71. #
  72. # If multiple tags of the same type are used in the same skill/item's
  73. # notebox, then the effects will occur in that order. Replace "string" in
  74. # the tags with the appropriate flag for the method below to search for.
  75. # Note that unlike the previous versions, these are all upcase.
  76. #
  77. # Should you choose to use multiple lunatic effects for a single state, you
  78. # may use these notetags in place of the ones shown above.
  79. #
  80. # <apply effect> <erase effect> <leave effect>
  81. # string string string
  82. # string string string
  83. # </apply effect> </erase effect> </leave effect>
  84. #
  85. # <react effect> <shock effect>
  86. # string string
  87. # string string
  88. # </react effect> </shock effect>
  89. #
  90. # <begin effect> <while effect> <close effect>
  91. # string string string
  92. # string string string
  93. # </begin effect> </while effect> </close effect>
  94. #
  95. # All of the string information in between those two notetags will be
  96. # stored the same way as the notetags shown before those. There is no
  97. # difference between using either.
  98. #--------------------------------------------------------------------------
  99. def lunatic_state_effect(type, state, user)
  100. return unless SceneManager.scene_is?(Scene_Battle)
  101. return if state.nil?
  102. case type
  103. when :apply; effects = state.apply_effects
  104. when :erase; effects = state.erase_effects
  105. when :leave; effects = state.leave_effects
  106. when :react; effects = state.react_effects
  107. when :shock; effects = state.shock_effects
  108. when :begin; effects = state.begin_effects
  109. when :while; effects = state.while_effects
  110. when :close; effects = state.close_effects
  111. else; return
  112. end
  113. log_window = SceneManager.scene.log_window
  114. state_origin = state_origin?(state.id)
  115. for effect in effects
  116. case effect.upcase
  117. #----------------------------------------------------------------------
  118. # Common Effect: Apply
  119. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  120. # This is a common effect that runs whenever a state is refreshly added
  121. # to the battler's state pool. There is no need to modify this unless
  122. # you see fit.
  123. #----------------------------------------------------------------------
  124. when /COMMON APPLY/i
  125. # No common apply effects added.
  126.  
  127. #----------------------------------------------------------------------
  128. # Common Effect: Erase
  129. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  130. # This is a common effect that runs whenever a state is removed from
  131. # the battler's state pool. There is no need to modify this unless you
  132. # see fit.
  133. #----------------------------------------------------------------------
  134. when /COMMON ERASE/i
  135. # No common erase effects added.
  136.  
  137. #----------------------------------------------------------------------
  138. # Common Effect: Leave
  139. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  140. # This is a common effect that runs whenever a state's turns reach 0
  141. # and leaves the battler's state pool. There is no need to modify this
  142. # unless you see fit.
  143. #----------------------------------------------------------------------
  144. when /COMMON LEAVE/i
  145.  
  146. #Runs the first line of a custom condition on leave. Useful for adding
  147. #another state as a state is removed due to time running out
  148. #Remove the pound signs below if you wish it to eval more lines when
  149. #the state leaves.
  150.  
  151. eval(state.leave_effects[1]) rescue ""
  152. #eval(state.leave_effects[2]) resuce ""
  153. #eval(state.leave_effects[3]) rescue ""
  154.  
  155.  
  156. #----------------------------------------------------------------------
  157. # Common Effect: React
  158. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  159. # This is a common effect that runs right before the battler is about
  160. # to take damage. There is no need to modify this unless you see fit.
  161. #----------------------------------------------------------------------
  162. when /COMMON REACT/i
  163. # No common react effects added.
  164.  
  165. #----------------------------------------------------------------------
  166. # Common Effect: Shock
  167. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  168. # This is a common effect that runs right after the battler has taken
  169. # damage. There is no need to modify this unless you see fit.
  170. #----------------------------------------------------------------------
  171. when /COMMON SHOCK/i
  172. # No common shock effects added.
  173.  
  174. #----------------------------------------------------------------------
  175. # Common Effect: Begin
  176. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  177. # This is a common effect that runs at the start of the party's turn.
  178. # There is no need to modify this unless you see fit.
  179. #----------------------------------------------------------------------
  180. when /COMMON BEGIN/i
  181. #Eval the first line of any custom conditions. Does nothing if no
  182. #Custom condition exists.
  183.  
  184. eval(state.begin_effects[1]) rescue ""
  185.  
  186.  
  187. #----------------------------------------------------------------------
  188. # Common Effect: While
  189. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  190. # This is a common effect that runs at the end of the battler's turn.
  191. # There is no need to modify this unless you see fit.
  192. #----------------------------------------------------------------------
  193. when /COMMON WHILE/i
  194. #Eval the first line of any custom conditions. Does nothing if no
  195. #Custom condition exists.
  196.  
  197. eval(state.while_effects[1]) rescue ""
  198.  
  199. #----------------------------------------------------------------------
  200. # Common Effect: Close
  201. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  202. # This is a common effect that runs at the end of the party's turn.
  203. # There is no need to modify this unless you see fit.
  204. #----------------------------------------------------------------------
  205. when /COMMON CLOSE/i
  206. # No common close effects added.
  207.  
  208. #----------------------------------------------------------------------
  209. # Stop editting past this point.
  210. #----------------------------------------------------------------------
  211. else
  212. lunatic_state_extension(effect, state, user, state_origin, log_window)
  213. end
  214. end # for effect in effects
  215. end # lunatic_object_effect
  216.  
  217. end # Game_BattlerBase
  218.  
  219.  
  220. #==============================================================================
  221. # ▼ Editting anything past this point may potentially result in causing
  222. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  223. # halitosis so edit at your own risk.
  224. #==============================================================================
  225.  
  226.  
  227. module YEA
  228. module REGEXP
  229. module STATE
  230.  
  231. APPLY_EFFECT_STR = /<(?:APPLY_EFFECT|apply effect):[ ](.*)>/i
  232. APPLY_EFFECT_ON = /<(?:APPLY_EFFECT|apply effect)>/i
  233. APPLY_EFFECT_OFF = /<\/(?:APPLY_EFFECT|apply effect)>/i
  234.  
  235. ERASE_EFFECT_STR = /<(?:ERASE_EFFECT|erase effect):[ ](.*)>/i
  236. ERASE_EFFECT_ON = /<(?:ERASE_EFFECT|erase effect)>/i
  237. ERASE_EFFECT_OFF = /<\/(?:ERASE_EFFECT|erase effect)>/i
  238.  
  239. LEAVE_EFFECT_STR = /<(?:LEAVE_EFFECT|leave effect):[ ](.*)>/i
  240. LEAVE_EFFECT_ON = /<(?:LEAVE_EFFECT|leave effect)>/i
  241. LEAVE_EFFECT_OFF = /<\/(?:LEAVE_EFFECT|leave effect)>/i
  242.  
  243. REACT_EFFECT_STR = /<(?:REACT_EFFECT|react effect):[ ](.*)>/i
  244. REACT_EFFECT_ON = /<(?:REACT_EFFECT|react effect)>/i
  245. REACT_EFFECT_OFF = /<\/(?:REACT_EFFECT|react effect)>/i
  246.  
  247. SHOCK_EFFECT_STR = /<(?:SHOCK_EFFECT|shock effect):[ ](.*)>/i
  248. SHOCK_EFFECT_ON = /<(?:SHOCK_EFFECT|shock effect)>/i
  249. SHOCK_EFFECT_OFF = /<\/(?:SHOCK_EFFECT|shock effect)>/i
  250.  
  251. BEGIN_EFFECT_STR = /<(?:BEGIN_EFFECT|begin effect):[ ](.*)>/i
  252. BEGIN_EFFECT_ON = /<(?:BEGIN_EFFECT|begin effect)>/i
  253. BEGIN_EFFECT_OFF = /<\/(?:BEGIN_EFFECT|begin effect)>/i
  254.  
  255. WHILE_EFFECT_STR = /<(?:WHILE_EFFECT|while effect):[ ](.*)>/i
  256. WHILE_EFFECT_ON = /<(?:WHILE_EFFECT|while effect)>/i
  257. WHILE_EFFECT_OFF = /<\/(?:WHILE_EFFECT|while effect)>/i
  258.  
  259. CLOSE_EFFECT_STR = /<(?:CLOSE_EFFECT|close effect):[ ](.*)>/i
  260. CLOSE_EFFECT_ON = /<(?:CLOSE_EFFECT|close effect)>/i
  261. CLOSE_EFFECT_OFF = /<\/(?:CLOSE_EFFECT|close effect)>/i
  262.  
  263. end # STATE
  264. end # REGEXP
  265. end # YEA
  266.  
  267.  
  268. #==============================================================================
  269. # ■ DataManager
  270. #==============================================================================
  271.  
  272.  
  273. module DataManager
  274.  
  275. #--------------------------------------------------------------------------
  276. # alias method: load_database
  277. #--------------------------------------------------------------------------
  278. class <<self; alias load_database_lsta load_database; end
  279. def self.load_database
  280. load_database_lsta
  281. load_notetags_lsta
  282. end
  283.  
  284. #--------------------------------------------------------------------------
  285. # new method: load_notetags_lsta
  286. #--------------------------------------------------------------------------
  287. def self.load_notetags_lsta
  288. for state in $data_states
  289. next if state.nil?
  290. state.load_notetags_lsta
  291. end
  292. end
  293.  
  294. end # DataManager
  295.  
  296.  
  297. #==============================================================================
  298. # ■ RPG::State
  299. #==============================================================================
  300.  
  301.  
  302. class RPG::State < RPG::BaseItem
  303.  
  304. #--------------------------------------------------------------------------
  305. # public instance variables
  306. #--------------------------------------------------------------------------
  307. attr_accessor :apply_effects
  308. attr_accessor :erase_effects
  309. attr_accessor :leave_effects
  310. attr_accessor :react_effects
  311. attr_accessor :shock_effects
  312. attr_accessor :begin_effects
  313. attr_accessor :while_effects
  314. attr_accessor :close_effects
  315.  
  316. #Edits by me
  317. attr_accessor :state_applied_value
  318.  
  319. #--------------------------------------------------------------------------
  320. # common cache: load_notetags_lsta
  321. #--------------------------------------------------------------------------
  322. def load_notetags_lsta
  323. @apply_effects = ["COMMON APPLY"]
  324. @erase_effects = ["COMMON ERASE"]
  325. @leave_effects = ["COMMON LEAVE"]
  326. @react_effects = ["COMMON REACT"]
  327. @shock_effects = ["COMMON SHOCK"]
  328. @begin_effects = ["COMMON BEGIN"]
  329. @while_effects = ["COMMON WHILE"]
  330. @close_effects = ["COMMON CLOSE"]
  331. @apply_effects_on = false
  332. @erase_effects_on = false
  333. @leave_effects_on = false
  334. @react_effects_on = false
  335. @shock_effects_on = false
  336. @begin_effects_on = false
  337. @while_effects_on = false
  338. @close_effects_on = false
  339. #---
  340. self.note.split(/[\r\n]+/).each { |line|
  341. case line
  342. #---
  343. when YEA::REGEXP::STATE::APPLY_EFFECT_STR
  344. @apply_effects.push($1.to_s)
  345. when YEA::REGEXP::STATE::ERASE_EFFECT_STR
  346. @erase_effects.push($1.to_s)
  347. when YEA::REGEXP::STATE::LEAVE_EFFECT_STR
  348. @leave_effects.push($1.to_s)
  349. when YEA::REGEXP::STATE::REACT_EFFECT_STR
  350. @react_effects.push($1.to_s)
  351. when YEA::REGEXP::STATE::SHOCK_EFFECT_STR
  352. @shock_effects.push($1.to_s)
  353. when YEA::REGEXP::STATE::BEGIN_EFFECT_STR
  354. @begin_effects.push($1.to_s)
  355. when YEA::REGEXP::STATE::WHILE_EFFECT_STR
  356. @while_effects.push($1.to_s)
  357. when YEA::REGEXP::STATE::CLOSE_EFFECT_STR
  358. @close_effects.push($1.to_s)
  359. #---
  360. when YEA::REGEXP::STATE::APPLY_EFFECT_ON
  361. @apply_effects_on = true
  362. when YEA::REGEXP::STATE::ERASE_EFFECT_ON
  363. @erase_effects_on = true
  364. when YEA::REGEXP::STATE::LEAVE_EFFECT_ON
  365. @leave_effects_on = true
  366. when YEA::REGEXP::STATE::REACT_EFFECT_ON
  367. @react_effects_on = true
  368. when YEA::REGEXP::STATE::SHOCK_EFFECT_ON
  369. @shock_effects_on = true
  370. when YEA::REGEXP::STATE::BEGIN_EFFECT_ON
  371. @begin_effects_on = true
  372. when YEA::REGEXP::STATE::WHILE_EFFECT_ON
  373. @while_effects_on = true
  374. when YEA::REGEXP::STATE::CLOSE_EFFECT_ON
  375. @close_effects_on = true
  376. #---
  377. when YEA::REGEXP::STATE::APPLY_EFFECT_OFF
  378. @apply_effects_on = false
  379. when YEA::REGEXP::STATE::ERASE_EFFECT_OFF
  380. @erase_effects_on = false
  381. when YEA::REGEXP::STATE::LEAVE_EFFECT_OFF
  382. @leave_effects_on = false
  383. when YEA::REGEXP::STATE::REACT_EFFECT_OFF
  384. @react_effects_on = false
  385. when YEA::REGEXP::STATE::SHOCK_EFFECT_OFF
  386. @shock_effects_on = false
  387. when YEA::REGEXP::STATE::BEGIN_EFFECT_OFF
  388. @begin_effects_on = false
  389. when YEA::REGEXP::STATE::WHILE_EFFECT_OFF
  390. @while_effects_on = false
  391. when YEA::REGEXP::STATE::CLOSE_EFFECT_OFF
  392. @close_effects_on = false
  393. #---
  394. else
  395. @apply_effects.push(line.to_s) if @after_effects_on
  396. @erase_effects.push(line.to_s) if @erase_effects_on
  397. @leave_effects.push(line.to_s) if @leave_effects_on
  398. @react_effects.push(line.to_s) if @react_effects_on
  399. @shock_effects.push(line.to_s) if @shock_effects_on
  400. @begin_effects.push(line.to_s) if @begin_effects_on
  401. @while_effects.push(line.to_s) if @while_effects_on
  402. @close_effects.push(line.to_s) if @close_effects_on
  403. end
  404. } # self.note.split
  405. #---
  406. end
  407.  
  408. end # RPG::State
  409.  
  410.  
  411. #==============================================================================
  412. # ■ Game_BattlerBase
  413. #==============================================================================
  414.  
  415.  
  416. class Game_BattlerBase
  417.  
  418. #--------------------------------------------------------------------------
  419. # alias method: clear_states
  420. #--------------------------------------------------------------------------
  421. alias game_battlerbase_clear_states_lsta clear_states
  422. def clear_states
  423. game_battlerbase_clear_states_lsta
  424. clear_state_origins
  425. end
  426.  
  427. #--------------------------------------------------------------------------
  428. # alias method: erase_state
  429. #--------------------------------------------------------------------------
  430. alias game_battlerbase_erase_state_lsta erase_state
  431. def erase_state(state_id)
  432. lunatic_state_effect(:erase, $data_states[state_id], self)
  433. change_state_origin(:erase)
  434. game_battlerbase_erase_state_lsta(state_id)
  435. end
  436.  
  437. #--------------------------------------------------------------------------
  438. # new method: clear_state_origins
  439. #--------------------------------------------------------------------------
  440. def clear_state_origins
  441. @state_origins = {}
  442. end
  443.  
  444. #--------------------------------------------------------------------------
  445. # new method: change_state_origin
  446. #--------------------------------------------------------------------------
  447. def change_state_origin(state_id, type = :apply)
  448. return unless $game_party.in_battle
  449. return if state_id == death_state_id
  450. if :apply && SceneManager.scene_is?(Scene_Battle)
  451. subject = SceneManager.scene.subject
  452. clear_state_origins if @state_origins.nil?
  453. if subject.nil?
  454. @state_origins[state_id] = [:actor, self.id] if self.actor?
  455. @state_origins[state_id] = [:enemy, self.index] unless self.actor?
  456. elsif subject.actor?
  457. @state_origins[state_id] = [:actor, subject.id]
  458. else
  459. @state_origins[state_id] = [:enemy, subject.index]
  460. end
  461. else # :erase
  462. @state_origins[state_id] = nil
  463. end
  464. end
  465.  
  466. #--------------------------------------------------------------------------
  467. # new method: state_origin?
  468. #--------------------------------------------------------------------------
  469. def state_origin?(state_id)
  470. return self unless $game_party.in_battle
  471. return self if @state_origins[state_id].nil?
  472. team = @state_origins[state_id][0]
  473. subject = @state_origins[state_id][1]
  474. if team == :actor
  475. return $game_actors[subject]
  476. else # :enemy
  477. return $game_troop.members[subject]
  478. end
  479. end
  480.  
  481. end # Game_BattlerBase
  482.  
  483.  
  484. #==============================================================================
  485. # ■ Game_Battler
  486. #==============================================================================
  487.  
  488.  
  489. class Game_Battler < Game_BattlerBase
  490.  
  491. #--------------------------------------------------------------------------
  492. # alias method: on_battle_start
  493. #--------------------------------------------------------------------------
  494. alias game_battler_on_battle_start_lsta on_battle_start
  495. def on_battle_start
  496. game_battler_on_battle_start_lsta
  497. clear_state_origins
  498. end
  499.  
  500. #--------------------------------------------------------------------------
  501. # alias method: on_battle_end
  502. #--------------------------------------------------------------------------
  503. alias game_battler_on_battle_end_lsta on_battle_end
  504. def on_battle_end
  505. game_battler_on_battle_end_lsta
  506. clear_state_origins
  507. end
  508.  
  509. #--------------------------------------------------------------------------
  510. # alias method: add_new_state
  511. #--------------------------------------------------------------------------
  512. alias game_battler_add_new_state_lsta add_new_state
  513. def add_new_state(state_id)
  514. change_state_origin(state_id, :apply)
  515. lunatic_state_effect(:apply, $data_states[state_id], self)
  516. game_battler_add_new_state_lsta(state_id)
  517. end
  518.  
  519. #--------------------------------------------------------------------------
  520. # alias method: remove_states_auto
  521. #--------------------------------------------------------------------------
  522. alias game_battler_remove_states_auto_lsta remove_states_auto
  523. def remove_states_auto(timing)
  524. states.each do |state|
  525. if @state_turns[state.id] == 0 && state.auto_removal_timing == timing
  526. lunatic_state_effect(:leave, state, self)
  527. end
  528. end
  529. game_battler_remove_states_auto_lsta(timing)
  530. end
  531.  
  532. #--------------------------------------------------------------------------
  533. # alias method: execute_damage
  534. #--------------------------------------------------------------------------
  535. alias game_battler_execute_damage_lsta execute_damage
  536. def execute_damage(user)
  537. run_lunatic_states(:react);
  538. game_battler_execute_damage_lsta(user)
  539. @result.restore_damage if $imported["YEA-BattleEngine"]
  540. run_lunatic_states(:shock);
  541. return unless $imported["YEA-BattleEngine"]
  542. @result.store_damage
  543. @result.clear_damage_values
  544. end
  545.  
  546. #--------------------------------------------------------------------------
  547. # new method: run_lunatic_states
  548. #--------------------------------------------------------------------------
  549. def run_lunatic_states(type)
  550. for state in states; lunatic_state_effect(type, state, self); end
  551. end
  552.  
  553. end # Game_Battler
  554.  
  555.  
  556. #==============================================================================
  557. # ■ Scene_Battle
  558. #==============================================================================
  559.  
  560.  
  561. class Scene_Battle < Scene_Base
  562.  
  563. #--------------------------------------------------------------------------
  564. # public instance variables
  565. #--------------------------------------------------------------------------
  566. attr_accessor :log_window
  567. attr_accessor :subject
  568.  
  569. #--------------------------------------------------------------------------
  570. # alias method: turn_start
  571. #--------------------------------------------------------------------------
  572. alias scene_battle_turn_start_lsta turn_start
  573. def turn_start
  574. scene_battle_turn_start_lsta
  575. for member in all_battle_members
  576. if member.alive?
  577. member.run_lunatic_states(:begin)
  578. end
  579. end
  580.  
  581. end
  582.  
  583. #--------------------------------------------------------------------------
  584. # alias method: turn_end
  585. #--------------------------------------------------------------------------
  586. alias scene_battle_turn_end_lsta turn_end
  587. def turn_end
  588. for member in all_battle_members
  589. if(member.alive?)
  590. member.run_lunatic_states(:close)
  591. end
  592. end
  593. scene_battle_turn_end_lsta
  594. end
  595.  
  596. #--------------------------------------------------------------------------
  597. # alias method: execute_action
  598. #--------------------------------------------------------------------------
  599. alias scene_battle_execute_action_lsta execute_action
  600. def execute_action
  601. scene_battle_execute_action_lsta
  602. @subject.run_lunatic_states(:while)
  603. end
  604.  
  605. end # Scene_Battle
  606.  
  607.  
  608. #==============================================================================
  609. # ■ Game_BattlerBase
  610. #==============================================================================
  611.  
  612.  
  613. class Game_BattlerBase
  614.  
  615. #--------------------------------------------------------------------------
  616. # new method: lunatic_state_extension
  617. #--------------------------------------------------------------------------
  618. def lunatic_state_extension(effect, state, user, state_origin, log_window)
  619. # Reserved for future Add-ons.
  620. end
  621.  
  622. end # Game_BattlerBase
  623.  
  624.  
  625. #==============================================================================
  626. #
  627. # ▼ End of File
  628. #
  629. #==============================================================================
RAW Paste Data