Project1

标题: 关于横版战斗的问题 [打印本页]

作者: 杰总    时间: 2012-7-6 12:46
标题: 关于横版战斗的问题
我用了横版战斗的脚本>>>http://rpg.blue/thread-225130-1-1.html
他会发起一次攻击时发动两次攻击。
我要怎么改?
[attach]119026[/attach]dsu_plus_rewardpost_czw
作者: lirn    时间: 2012-7-6 12:47
本帖最后由 lirn 于 2012-7-6 12:48 编辑

如果是问分段伤害的话详细参考下面的使用说明。

如果是问多次攻击的话,技能那里有选择攻击次数。
作者: 杰总    时间: 2012-7-6 12:50
求教怎么改,谢谢好心人...
作者: 杰总    时间: 2012-7-6 12:55
“ace战斗系统”脚本:
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.21
  4. # -- Last Updated: 2012.02.13
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-BattleEngine"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.02.13 - Bug fixed: Odd Victory game crash fixed.
  15. # 2012.02.12 - Bug fixed: Displayed damage in combat log is correct now.
  16. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  17. # 2012.01.24 - Compatibility Update: Enemy Levels
  18. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  19. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  20. #              animation only once.
  21. #            - Reduced lag from battle system constantly recreating bitmaps.
  22. # 2012.01.10 - Compatibility Update: Battle System FTB
  23. # 2012.01.09 - Anticrash methods implemented.
  24. #            - Damage Popups are now separate for damage formulas and recovery.
  25. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  26. # 2012.01.02 - Compatibility Update: Target Manager
  27. #            - Added Option: AUTO_FAST
  28. #            - Random hits now show animations individually.
  29. # 2011.12.30 - Compatibility Update: Enemy Levels
  30. #            - Added Option to center the actors in the HUD.
  31. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  32. #            - Default battle system bug fixes are now included from YEA's Ace
  33. #              Core Engine.
  34. #            - Groundwork is also made to support future battle system types.
  35. #            - Multi-hit actions no longer linger when a target dies during the
  36. #              middle of one of the hits.
  37. #            - Compatibility Update: Lunatic Objects v1.02
  38. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  39. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  40. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  41. #            - Bug fixed: During State popup fix.
  42. #            - Added HIDE_POPUP_SWITCH.
  43. # 2011.12.17 - Compatibiilty Update: Cast Animations
  44. # 2011.12.15 - Compatibility Update: Battle Command List
  45. # 2011.12.14 - Compatibility Update: Lunatic Objects
  46. # 2011.12.13 - Compatibility Update: Command Party
  47. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  48. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  49. #            - Popup graphical bug fixed.
  50. #            - Bug fixed: Didn't wait for boss dead animations.
  51. #            - Bug fixed: Surprise attacks that froze the game.
  52. #            - Bug fixed: Popups didn't show for straight recovery effects.
  53. # 2011.12.08 - Finished Script.
  54. # 2011.12.04 - Started Script.
  55. #
  56. #==============================================================================
  57. # ▼ Introduction
  58. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  59. # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  60. # allows for easier management of the battle engine without adding too many
  61. # features, allowing users to customize what they want as they see fit. While
  62. # the Ace Battle Engine isn't an entirely new engine, it gives users control
  63. # that RPG Maker VX Ace didn't originally give them.
  64. #
  65. # Furthermore, this script provides some new features. They are as follows:
  66. #
  67. # -----------------------------------------------------------------------------
  68. # Animation Fixes
  69. # -----------------------------------------------------------------------------
  70. # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  71. # these fixes are included in this script as well to ensure it's working for
  72. # the battle script in the event someone chooses not to work with the Ace Core
  73. # Engine script. The animation fixes prevent excessive animation overlaying
  74. # (and making the screen look really ugly) and prevents animation clashing
  75. # between two dual wielding normal attack animations.
  76. #
  77. # -----------------------------------------------------------------------------
  78. # Enemy Animations
  79. # -----------------------------------------------------------------------------
  80. # Enemies now show battle animations when they deliver attacks and skills
  81. # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  82. # than just sound effects and the screen shaking. Now, animations play where
  83. # the status window is and relative to the position of each party member.
  84. #
  85. # -----------------------------------------------------------------------------
  86. # Left/Right Command Selection
  87. # -----------------------------------------------------------------------------
  88. # While choosing actions, the player can press Left or Right to move freely
  89. # between (alive) actors to change their skills. Players no longer have to
  90. # cancel all the way back to change one person's skill and reselect everything.
  91. # On that note, there is now the option that when a battle starts or at the
  92. # end of a turn, players will start immediately at command selection rather
  93. # than needing to select "Fight" in the Party Command Window.
  94. #
  95. # -----------------------------------------------------------------------------
  96. # Popups
  97. # -----------------------------------------------------------------------------
  98. # Dealing damage, inflicting states, adding buffs, landing critical hits,
  99. # striking weaknesses, missing attacks, you name it, there's probably a popup
  100. # for it. Popups deliver information to the player in a quick or orderly
  101. # fashion without requiring the player to read lines of text.
  102. #
  103. # -----------------------------------------------------------------------------
  104. # Targeting Window
  105. # -----------------------------------------------------------------------------
  106. # When targeting enemies, the window is no longer displayed. Instead, the
  107. # targeted enemies are highlighted and their names are shown at the top of the
  108. # screen in a help window. Another thing that's changed is when skills that
  109. # target multiple targets are selected, there is a confirmation step that the
  110. # player must take before continuing. In this confirmation step, all of the
  111. # multiple targets are selected and in the help window would display the scope
  112. # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  113. # this step by default.
  114. #
  115. # -----------------------------------------------------------------------------
  116. # Toggling On and Off Special Effects and Text
  117. # -----------------------------------------------------------------------------
  118. # Not everybody likes having the screen shake or the enemies blink when they
  119. # take damage. These effects can now be toggled on and off. Certain text can
  120. # also be toggled on and off from appearing. A lot of the displayed text has
  121. # been rendered redundant through the use of popups.
  122. #
  123. # -----------------------------------------------------------------------------
  124. # Visual Battle Status Window
  125. # -----------------------------------------------------------------------------
  126. # Rather than just having rows of names with HP and MP bars next to them, the
  127. # Battle Status Window now displays actors' faces and their gauges aligned at
  128. # the bottom. More status effects can be shown in addition to showing more
  129. # members on screen at once. The Battle Status Window is also optimized to
  130. # refresh less (thus, removing potential lag from the system).
  131. #
  132. # -----------------------------------------------------------------------------
  133. # Window Position Changes
  134. # -----------------------------------------------------------------------------
  135. # Windows such as the Skill Window and Item Window have been rearranged to
  136. # always provide the player a clear view of the battlefield rather than opening
  137. # up and covering everything. As such, the window positions are placed at the
  138. # bottom of the screen and are repositioned.
  139. #
  140. #==============================================================================
  141. # ▼ Instructions
  142. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  143. # To install this script, open up your script editor and copy/paste this script
  144. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  145. #
  146. # -----------------------------------------------------------------------------
  147. # Skill Notetags - These notetags go in the skills notebox in the database.
  148. # -----------------------------------------------------------------------------
  149. # <one animation>
  150. # Causes the action to display the action animation only once, even if it's a
  151. # multi-hit action. This is used primarily for non-all scope targeting.
  152. #
  153. # -----------------------------------------------------------------------------
  154. # Item Notetags - These notetags go in the items notebox in the database.
  155. # -----------------------------------------------------------------------------
  156. # <one animation>
  157. # Causes the action to display the action animation only once, even if it's a
  158. # multi-hit action. This is used primarily for non-all scope targeting.
  159. #
  160. # -----------------------------------------------------------------------------
  161. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  162. # -----------------------------------------------------------------------------
  163. # <atk ani 1: x>
  164. # <atk ani 2: x>
  165. # Changes the normal attack animation of the particular enemy to animation x.
  166. # Attack animation 1 is the first one that plays. If there's a second animation
  167. # then the second one will play after in mirrored form.
  168. #
  169. # -----------------------------------------------------------------------------
  170. # State Notetags - These notetags go in the state notebox in the database.
  171. # -----------------------------------------------------------------------------
  172. # <popup add: string>
  173. # <popup rem: string>
  174. # <popup dur: string>
  175. # Status effects now create popups whenever they're inflicted. However, if you
  176. # don't like that a certain status effect uses a particular colour setting,
  177. # change "string" to one of the rulesets below to cause that popup to use a
  178. # different ruleset.
  179. #
  180. # <popup hide add>
  181. # <popup hide rem>
  182. # <popup hide dur>
  183. # Not everybody wants status effects to show popups when inflicted. When this
  184. # is the case, insert the respective tag to hide popups from appearing when the
  185. # state is added, removed, or during the stand-by phases.
  186. #
  187. # -----------------------------------------------------------------------------
  188. # Debug Tools - These tools only work during Test Play.
  189. # -----------------------------------------------------------------------------
  190. # - F5 Key -
  191. # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  192. # All states and buffs are removed whether they are positive or negative.
  193. #
  194. # - F6 Key -
  195. # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  196. #
  197. # - F7 Key -
  198. # Sets all actors to have max TP. Everything else is unaffected.
  199. #
  200. # - F8 Key -
  201. # Kills all enemies in battle. Ends the battle quickly.
  202. #
  203. #==============================================================================
  204. # ▼ Compatibility
  205. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  206. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  207. # it will run with RPG Maker VX without adjusting.
  208. #
  209. #==============================================================================

  210. module YEA
  211.   module BATTLE
  212.    
  213.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  214.     # - General Battle Settings -
  215.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  216.     # These settings are adjusted for the overall battle system. These are
  217.     # various miscellaneous options to adjust. Each of the settings below will
  218.     # explain what they do. Change default enemy battle animations here, too.
  219.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  220.     BLINK_EFFECTS      = false  # Blink sprite when damaged?
  221.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  222.     SCREEN_SHAKE       = false  # Shake screen in battle?
  223.     SKIP_PARTY_COMMAND = false  # Skips the Fight/Escape menu.
  224.     AUTO_FAST          = true   # Causes message windows to not wait.
  225.     ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  226.    
  227.     # If this switch is ON, popups will be hidden. If OFF, the popups will be
  228.     # shown. If you do not wish to use this switch, set it to 0.
  229.     HIDE_POPUP_SWITCH  = 0
  230.    
  231.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  232.     # - Battle Status Window -
  233.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  234.     # This sets the default battle system your game will use. If your game
  235.     # doesn't have any other battle systems installed, it will use :dtb.
  236.     #
  237.     # Battle System        Requirement
  238.     #   :dtb               - Default Turn Battle. Default system.
  239.     #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  240.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241.     DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  242.    
  243.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  244.     # - Battle Status Window -
  245.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  246.     # Here, you can adjust the settings for the battle status window. The
  247.     # battle status window, by default, will show the actor's face, HP, MP, TP
  248.     # (if viable), and any inflicted status effects.
  249.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250.     BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  251.     BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
  252.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  253.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # Y Location buffer used for HP gauge.
  254.     BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  255.    
  256.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  257.     # - Help Window Text -
  258.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  259.     # When selecting a target to attack, this is the text that will be shown
  260.     # in place of a target's name for special cases. These special cases are
  261.     # for selections that were originally non-targetable battle scopes.
  262.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  263.     HELP_TEXT_ALL_FOES        = "All Foes"
  264.     HELP_TEXT_ONE_RANDOM_FOE  = "One Random Foe"
  265.     HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  266.     HELP_TEXT_ALL_ALLIES      = "All Allies"
  267.     HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  268.     HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  269.     HELP_TEXT_RANDOM_ALLIES   = "%d Random Allies"
  270.    
  271.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  272.     # - Popup Settings -
  273.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  274.     # These settings will adjust the popups that appear in battle. Popups
  275.     # deliver information to your player as battlers deal damage, inflict
  276.     # status effects, and more.
  277.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  278.     ENABLE_POPUPS  = true     # Set this to false if you wish to disable them.
  279.     FLASH_CRITICAL = true     # Sets critical hits to flash.
  280.    
  281.     # This hash adjusts the popup settings that will govern how popups appear.
  282.     # Adjust them accordingly.
  283.     POPUP_SETTINGS ={
  284.       :offset     => -24,         # Height offset of a popup.
  285.       :fade       => 12,          # Fade rate for each popup.
  286.       :full       => 60,          # Frames before a popup fades.
  287.       :hp_dmg     => "-%s ",      # SprintF for HP damage.
  288.       :hp_heal    => "+%s ",      # SprintF for HP healing.
  289.       :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  290.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  291.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  292.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  293.       :drained    => "DRAIN",     # Text display for draining HP/MP.
  294.       :critical   => "CRITICAL!", # Text display for critical hit.
  295.       :missed     => "MISS",      # Text display for missed attack.
  296.       :evaded     => "EVADE!",    # Text display for evaded attack.
  297.       :nulled     => "NULL",      # Text display for nulled attack.
  298.       :failed     => "FAILED",    # Text display for a failed attack.
  299.       :add_state  => "+%s",      # SprintF for added states.
  300.       :rem_state  => "-%s",      # SprintF for removed states.
  301.       :dur_state  => "%s",        # SprintF for during states.
  302.       :ele_rates  => true,        # This will display elemental affinities.
  303.       :ele_wait   => 20,          # This is how many frames will wait.
  304.       :weakpoint  => "WEAKPOINT", # Appears if foe is weak to element.
  305.       :resistant  => "RESIST",    # Appears if foe is resistant to element.
  306.       :immune     => "IMMUNE",    # Appears if foe is immune to element.
  307.       :absorbed   => "ABSORB",    # Appears if foe can absorb the element.
  308.       :add_buff   => "%s+",      # Appears when a positive buff is applied.
  309.       :add_debuff => "%s-",      # Appears when a negative buff is applied.
  310.     } # Do not remove this.
  311.    
  312.     # This is the default font used for the popups. Adjust them accordingly
  313.     # or even add new ones.
  314.     DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  315.    
  316.     # The following are the various rules that govern the individual popup
  317.     # types that will appear. Adjust them accordingly. Here is a list of what
  318.     # each category does.
  319.     #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  320.     #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  321.     #   Sz       The font size used for the popup text.
  322.     #   Bold     Applying bold for the popup text.
  323.     #   Italic   Applying italic for the popup text.
  324.     #   Red      The red value of the popup text.
  325.     #   Grn      The green value of the popup text.
  326.     #   Blu      The blue value of the popup text.
  327.     #   Font     The font used for the popup text.
  328.     POPUP_RULES ={
  329.       # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  330.       "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  331.       "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  332.       "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  333.       "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  334.       "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  335.       "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  336.       "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  337.       "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  338.       "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  339.       "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  340.       "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  341.       "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  342.       "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  343.       "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  344.       "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  345.       "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  346.       "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  347.       "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  348.       "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  349.       "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  350.     } # Do not remove this.
  351.    
  352.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  353.     # - Streamlined Messages -
  354.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  355.     # Want to remove some of those annoying messages that appear all the time?
  356.     # Now you can! Select which messages you want to enable or disable. Some of
  357.     # these messages will be rendered useless due to popups.
  358.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  359.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  360.     MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  361.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  362.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  363.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  364.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  365.     MSG_FAILURE_HIT    = false  # Show effect failed against target.
  366.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  367.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  368.     MSG_EVASION        = false  # Show attack was evaded by the target.
  369.     MSG_HP_DAMAGE      = false  # Show HP damage to target.
  370.     MSG_MP_DAMAGE      = false  # Show MP damage to target.
  371.     MSG_TP_DAMAGE      = false  # Show TP damage to target.
  372.     MSG_ADDED_STATES   = false  # Show target's added states.
  373.     MSG_REMOVED_STATES = false  # Show target's removed states.
  374.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  375.    
  376.   end # BATTLE
  377. end # YEA

  378. #==============================================================================
  379. # ▼ Editting anything past this point may potentially result in causing
  380. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  381. # halitosis so edit at your own risk.
  382. #==============================================================================

  383. module YEA
  384.   module REGEXP
  385.   module ENEMY
  386.    
  387.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  388.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  389.    
  390.   end # ENEMY
  391.   module USABLEITEM
  392.    
  393.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  394.    
  395.   end # USABLEITEM
  396.   module STATE
  397.    
  398.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  399.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  400.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  401.    
  402.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  403.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  404.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  405.    
  406.   end # STATE
  407.   end # REGEXP
  408. end # YEA

  409. #==============================================================================
  410. # ■ Switch
  411. #==============================================================================

  412. module Switch
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # self.hide_popups
  416.   #--------------------------------------------------------------------------
  417.   def self.hide_popups
  418.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  419.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  420.   end
  421.   
  422. end # Switch

  423. #==============================================================================
  424. # ■ Colour
  425. #==============================================================================

  426. module Colour
  427.   
  428.   #--------------------------------------------------------------------------
  429.   # self.text_colour
  430.   #--------------------------------------------------------------------------
  431.   def self.text_colour(index)
  432.     windowskin = Cache.system("Window")
  433.     x = 64 + (index % 8) * 8
  434.     y = 96 + (index / 8) * 8
  435.     return windowskin.get_pixel(x, y)
  436.   end
  437.   
  438. end # Colour

  439. #==============================================================================
  440. # ■ Icon
  441. #==============================================================================

  442. module Icon
  443.   
  444.   #--------------------------------------------------------------------------
  445.   # self.no_action
  446.   #--------------------------------------------------------------------------
  447.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  448.    
  449. end # Icon

  450. #==============================================================================
  451. # ■ Numeric
  452. #==============================================================================

  453. class Numeric
  454.   
  455.   #--------------------------------------------------------------------------
  456.   # new method: group_digits
  457.   #--------------------------------------------------------------------------
  458.   unless $imported["YEA-CoreEngine"]
  459.   def group; return self.to_s; end
  460.   end # $imported["YEA-CoreEngine"]
  461.    
  462. end # Numeric

  463. #==============================================================================
  464. # ■ DataManager
  465. #==============================================================================

  466. module DataManager
  467.   
  468.   #--------------------------------------------------------------------------
  469.   # alias method: load_database
  470.   #--------------------------------------------------------------------------
  471.   class <<self; alias load_database_abe load_database; end
  472.   def self.load_database
  473.     load_database_abe
  474.     load_notetags_abe
  475.   end
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # new method: load_notetags_abe
  479.   #--------------------------------------------------------------------------
  480.   def self.load_notetags_abe
  481.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  482.     for group in groups
  483.       for obj in group
  484.         next if obj.nil?
  485.         obj.load_notetags_abe
  486.       end
  487.     end
  488.   end
  489.   
  490. end # DataManager

  491. #==============================================================================
  492. # ■ RPG::UsableItem
  493. #==============================================================================

  494. class RPG::UsableItem < RPG::BaseItem
  495.   
  496.   #--------------------------------------------------------------------------
  497.   # public instance variables
  498.   #--------------------------------------------------------------------------
  499.   attr_accessor :one_animation
  500.   
  501.   #--------------------------------------------------------------------------
  502.   # common cache: load_notetags_abe
  503.   #--------------------------------------------------------------------------
  504.   def load_notetags_abe
  505.     @one_animation = false
  506.     #---
  507.     self.note.split(/[\r\n]+/).each { |line|
  508.       case line
  509.       #---
  510.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  511.         @one_animation = true
  512.       end
  513.     } # self.note.split
  514.     #---
  515.   end
  516.   
  517. end # RPG::UsableItem

  518. #==============================================================================
  519. # ■ RPG::Enemy
  520. #==============================================================================

  521. class RPG::Enemy < RPG::BaseItem
  522.   
  523.   #--------------------------------------------------------------------------
  524.   # public instance variables
  525.   #--------------------------------------------------------------------------
  526.   attr_accessor :atk_animation_id1
  527.   attr_accessor :atk_animation_id2
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # common cache: load_notetags_abe
  531.   #--------------------------------------------------------------------------
  532.   def load_notetags_abe
  533.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  534.     @atk_animation_id2 = 0
  535.     #---
  536.     self.note.split(/[\r\n]+/).each { |line|
  537.       case line
  538.       #---
  539.       when YEA::REGEXP::ENEMY::ATK_ANI1
  540.         @atk_animation_id1 = $1.to_i
  541.       when YEA::REGEXP::ENEMY::ATK_ANI2
  542.         @atk_animation_id2 = $1.to_i
  543.       end
  544.     } # self.note.split
  545.     #---
  546.   end
  547.   
  548. end # RPG::Enemy

  549. #==============================================================================
  550. # ■ RPG::Enemy
  551. #==============================================================================

  552. class RPG::State < RPG::BaseItem
  553.   
  554.   #--------------------------------------------------------------------------
  555.   # public instance variables
  556.   #--------------------------------------------------------------------------
  557.   attr_accessor :popup_rules
  558.   
  559.   #--------------------------------------------------------------------------
  560.   # common cache: load_notetags_abe
  561.   #--------------------------------------------------------------------------
  562.   def load_notetags_abe
  563.     @popup_rules = {
  564.       :add_state => "ADDSTATE",
  565.       :rem_state => "REMSTATE",
  566.       :dur_state => nil
  567.     } # Do not remove this.
  568.     #---
  569.     self.note.split(/[\r\n]+/).each { |line|
  570.       case line
  571.       #---
  572.       when YEA::REGEXP::STATE::POPUP_ADD
  573.         @popup_rules[:add_state] = $1.upcase.to_s
  574.       when YEA::REGEXP::STATE::POPUP_REM
  575.         @popup_rules[:rem_state] = $1.upcase.to_s
  576.       when YEA::REGEXP::STATE::POPUP_DUR
  577.         @popup_rules[:dur_state] = $1.upcase.to_s
  578.       when YEA::REGEXP::STATE::HIDE_ADD
  579.         @popup_rules[:add_state] = nil
  580.       when YEA::REGEXP::STATE::HIDE_REM
  581.         @popup_rules[:rem_state] = nil
  582.       when YEA::REGEXP::STATE::HIDE_DUR
  583.         @popup_rules[:dur_state] = nil
  584.       end
  585.     } # self.note.split
  586.     #---
  587.   end
  588.   
  589. end # RPG::State

  590. #==============================================================================
  591. # ■ BattleManager
  592. #==============================================================================

  593. module BattleManager
  594.   
  595.   #--------------------------------------------------------------------------
  596.   # overwrite method: self.battle_start
  597.   #--------------------------------------------------------------------------
  598.   def self.battle_start
  599.     $game_system.battle_count += 1
  600.     $game_party.on_battle_start
  601.     $game_troop.on_battle_start
  602.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  603.     $game_troop.enemy_names.each do |name|
  604.       $game_message.add(sprintf(Vocab::Emerge, name))
  605.     end
  606.     if @preemptive
  607.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  608.     elsif @surprise
  609.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  610.     end
  611.     wait_for_message
  612.   end
  613.   
  614.   #--------------------------------------------------------------------------
  615.   # overwrite method: make_action_orders
  616.   #--------------------------------------------------------------------------
  617.   def self.make_action_orders
  618.     make_dtb_action_orders if btype?(:dtb)
  619.   end
  620.   
  621.   #--------------------------------------------------------------------------
  622.   # new method: make_dtb_action_orders
  623.   #--------------------------------------------------------------------------
  624.   def self.make_dtb_action_orders
  625.     @action_battlers = []
  626.     @action_battlers += $game_party.members unless @surprise
  627.     @action_battlers += $game_troop.members unless @preemptive
  628.     @action_battlers.each {|battler| battler.make_speed }
  629.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  630.   end
  631.   
  632.   #--------------------------------------------------------------------------
  633.   # overwrite method: turn_start
  634.   #--------------------------------------------------------------------------
  635.   def self.turn_start
  636.     @phase = :turn
  637.     clear_actor
  638.     $game_troop.increase_turn
  639.     @performed_battlers = []
  640.     make_action_orders
  641.   end
  642.   
  643.   #--------------------------------------------------------------------------
  644.   # overwrite method: next_subject
  645.   #--------------------------------------------------------------------------
  646.   def self.next_subject
  647.     @performed_battlers = [] if @performed_battlers.nil?
  648.     loop do
  649.       @action_battlers -= @performed_battlers
  650.       battler = @action_battlers.shift
  651.       return nil unless battler
  652.       next unless battler.index && battler.alive?
  653.       @performed_battlers.push(battler)
  654.       return battler
  655.     end
  656.   end
  657.   
  658.   #--------------------------------------------------------------------------
  659.   # new method: self.init_battle_type
  660.   #--------------------------------------------------------------------------
  661.   def self.init_battle_type
  662.     set_btype($game_system.battle_system)
  663.   end
  664.   
  665.   #--------------------------------------------------------------------------
  666.   # new method: self.set_btype
  667.   #--------------------------------------------------------------------------
  668.   def self.set_btype(btype = :dtb)
  669.     @battle_type = btype
  670.   end
  671.   
  672.   #--------------------------------------------------------------------------
  673.   # new method: self.btype?
  674.   #--------------------------------------------------------------------------
  675.   def self.btype?(btype)
  676.     return @battle_type == btype
  677.   end
  678.   
  679. end # BattleManager

  680. #==============================================================================
  681. # ■ Game_System
  682. #==============================================================================

  683. class Game_System
  684.   
  685.   #--------------------------------------------------------------------------
  686.   # new method: battle_system
  687.   #--------------------------------------------------------------------------
  688.   def battle_system
  689.     if @battle_system.nil?
  690.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  691.     else
  692.       return battle_system_corrected(@battle_system)
  693.     end
  694.   end
  695.   
  696.   #--------------------------------------------------------------------------
  697.   # new method: set_battle_system
  698.   #--------------------------------------------------------------------------
  699.   def set_battle_system(type)
  700.     case type
  701.     when :dtb; @battle_system = :dtb
  702.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  703.     else;      @battle_system = :dtb
  704.     end
  705.   end
  706.   
  707.   #--------------------------------------------------------------------------
  708.   # new method: battle_system_corrected
  709.   #--------------------------------------------------------------------------
  710.   def battle_system_corrected(type)
  711.     case type
  712.     when :dtb; return :dtb
  713.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  714.     else;      return :dtb
  715.     end
  716.   end
  717.   
  718. end # Game_System

  719. #==============================================================================
  720. # ■ Sprite_Base
  721. #==============================================================================

  722. class Sprite_Base < Sprite
  723.   
  724.   #--------------------------------------------------------------------------
  725.   # new method: start_pseudo_animation
  726.   #--------------------------------------------------------------------------
  727.   unless $imported["YEA-CoreEngine"]
  728.   def start_pseudo_animation(animation, mirror = false)
  729.     dispose_animation
  730.     @animation = animation
  731.     return if @animation.nil?
  732.     @ani_mirror = mirror
  733.     set_animation_rate
  734.     @ani_duration = @animation.frame_max * @ani_rate + 1
  735.     @ani_sprites = []
  736.   end
  737.   end # $imported["YEA-CoreEngine"]
  738.   
  739. end # Sprite_Base

  740. #==============================================================================
  741. # ■ Sprite_Battler
  742. #==============================================================================

  743. class Sprite_Battler < Sprite_Base
  744.   
  745.   #--------------------------------------------------------------------------
  746.   # public instance variables
  747.   #--------------------------------------------------------------------------
  748.   attr_accessor :effect_type
  749.   attr_accessor :battler_visible
  750.   attr_accessor :popups
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # alias method: initialize
  754.   #--------------------------------------------------------------------------
  755.   alias sprite_battler_initialize_abe initialize
  756.   def initialize(viewport, battler = nil)
  757.     sprite_battler_initialize_abe(viewport, battler)
  758.     @popups = []
  759.     @popup_flags = []
  760.   end
  761.   
  762.   #--------------------------------------------------------------------------
  763.   # alias method: update_bitmap
  764.   #--------------------------------------------------------------------------
  765.   alias sprite_battler_update_bitmap_abe update_bitmap
  766.   def update_bitmap
  767.     return if @battler.actor? && @battler.battler_name == ""
  768.     sprite_battler_update_bitmap_abe
  769.   end
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # alias method: setup_new_animation
  773.   #--------------------------------------------------------------------------
  774.   unless $imported["YEA-CoreEngine"]
  775.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  776.   def setup_new_animation
  777.     sprite_battler_setup_new_animation_abe
  778.     return if @battler.pseudo_ani_id <= 0
  779.     animation = $data_animations[@battler.pseudo_ani_id]
  780.     mirror = @battler.animation_mirror
  781.     start_pseudo_animation(animation, mirror)
  782.     @battler.pseudo_ani_id = 0
  783.   end
  784.   end # $imported["YEA-CoreEngine"]
  785.   
  786.   #--------------------------------------------------------------------------
  787.   # alias method: setup_new_effect
  788.   #--------------------------------------------------------------------------
  789.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  790.   def setup_new_effect
  791.     sprite_battler_setup_new_effect_abe
  792.     setup_popups
  793.   end
  794.   
  795.   #--------------------------------------------------------------------------
  796.   # new method: setup_popups
  797.   #--------------------------------------------------------------------------
  798.   def setup_popups
  799.     return unless @battler.use_sprite?
  800.     @battler.popups = [] if @battler.popups.nil?
  801.     return if @battler.popups == []
  802.     array = @battler.popups.shift
  803.     create_new_popup(array[0], array[1], array[2])
  804.   end
  805.   
  806.   #--------------------------------------------------------------------------
  807.   # new method: create_new_popup
  808.   #--------------------------------------------------------------------------
  809.   def create_new_popup(value, rules, flags)
  810.     return if @battler == nil
  811.     return if flags & @popup_flags != []
  812.     array = YEA::BATTLE::POPUP_RULES[rules]
  813.     for popup in @popups
  814.       popup.y -= 24
  815.     end
  816.     return unless SceneManager.scene.is_a?(Scene_Battle)
  817.     return if SceneManager.scene.spriteset.nil?
  818.     view = SceneManager.scene.spriteset.viewportPopups
  819.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  820.     @popups.push(new_popup)
  821.     @popup_flags.push("weakness") if flags.include?("weakness")
  822.     @popup_flags.push("resistant") if flags.include?("resistant")
  823.     @popup_flags.push("immune") if flags.include?("immune")
  824.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  825.   end
  826.   
  827.   #--------------------------------------------------------------------------
  828.   # alias method: update_effect
  829.   #--------------------------------------------------------------------------
  830.   alias sprite_battler_update_effect_abe update_effect
  831.   def update_effect
  832.     sprite_battler_update_effect_abe
  833.     update_popups
  834.   end
  835.   
  836.   #--------------------------------------------------------------------------
  837.   # new method: update_popups
  838.   #--------------------------------------------------------------------------
  839.   def update_popups
  840.     for popup in @popups
  841.       popup.update
  842.       next unless popup.opacity <= 0
  843.       popup.bitmap.dispose
  844.       popup.dispose
  845.       @popups.delete(popup)
  846.       popup = nil
  847.     end
  848.     @popup_flags = [] if @popups == [] && @popup_flags != []
  849.     return unless SceneManager.scene_is?(Scene_Battle)
  850.     if @current_active_battler != SceneManager.scene.subject
  851.       @current_active_battler = SceneManager.scene.subject
  852.       @popup_flags = []
  853.     end
  854.   end
  855.   
  856. end # Sprite_Battler

  857. #==============================================================================
  858. # ■ Sprite_Popup
  859. #==============================================================================

  860. class Sprite_Popup < Sprite_Base
  861.   
  862.   #--------------------------------------------------------------------------
  863.   # public instance variables
  864.   #--------------------------------------------------------------------------
  865.   attr_accessor :flags
  866.   
  867.   #--------------------------------------------------------------------------
  868.   # initialize
  869.   #--------------------------------------------------------------------------
  870.   def initialize(viewport, battler, value, rules, flags)
  871.     super(viewport)
  872.     @value = value
  873.     @rules = rules
  874.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  875.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  876.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  877.     @flags = flags
  878.     @battler = battler
  879.     create_popup_bitmap
  880.   end
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # create_popup_bitmap
  884.   #--------------------------------------------------------------------------
  885.   def create_popup_bitmap
  886.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  887.     bw = Graphics.width
  888.     bw += 48 if @flags.include?("state")
  889.     bh = Font.default_size * 3
  890.     bitmap = Bitmap.new(bw, bh)
  891.     bitmap.font.name = rules_array[8]
  892.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  893.     bitmap.font.size = size
  894.     bitmap.font.bold = rules_array[3]
  895.     bitmap.font.italic = rules_array[4]
  896.     if flags.include?("critical")
  897.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  898.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  899.     else
  900.       bitmap.font.out_color.set(0, 0, 0, 255)
  901.     end
  902.     dx = 0; dy = 0; dw = 0
  903.     dx += 24 if @flags.include?("state")
  904.     dw += 24 if @flags.include?("state")
  905.     if @flags.include?("state") || @flags.include?("buff")
  906.       c_width = bitmap.text_size(@value).width
  907.       icon_bitmap = $game_temp.iconset
  908.       icon_index = flag_state_icon
  909.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  910.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  911.     end
  912.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  913.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  914.     self.bitmap = bitmap
  915.     self.x = @battler.screen_x
  916.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  917.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  918.     self.y = @battler.screen_y - @battler.sprite.oy/2
  919.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  920.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  921.     self.ox = bw/2; self.oy = bh/2
  922.     self.zoom_x = self.zoom_y = rules_array[0]
  923.     if @flags.include?("no zoom")
  924.       self.zoom_x = self.zoom_y = rules_array[1]
  925.     end
  926.     @target_zoom = rules_array[1]
  927.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  928.     self.z = 500
  929.   end
  930.   
  931.   #--------------------------------------------------------------------------
  932.   # update
  933.   #--------------------------------------------------------------------------
  934.   def update
  935.     super
  936.     #---
  937.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  938.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  939.       @hue_duration -= 1
  940.       self.bitmap.hue_change(15) if @hue_duration <= 0
  941.     end
  942.     #---
  943.     if @zoom_direction == "up"
  944.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  945.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  946.     else
  947.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  948.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  949.     end
  950.     #---
  951.     @full -= 1
  952.     return if @full > 0
  953.     self.y -= 1
  954.     self.opacity -= @fade
  955.   end
  956.   
  957.   #--------------------------------------------------------------------------
  958.   # flag_state_icon
  959.   #--------------------------------------------------------------------------
  960.   def flag_state_icon
  961.     for item in @flags; return item if item.is_a?(Integer); end
  962.     return 0
  963.   end
  964.   
  965. end # Sprite_Popup

  966. #==============================================================================
  967. # ■ Spriteset_Battle
  968. #==============================================================================

  969. class Spriteset_Battle
  970.   
  971.   #--------------------------------------------------------------------------
  972.   # public instance variables
  973.   #--------------------------------------------------------------------------
  974.   attr_accessor :actor_sprites
  975.   attr_accessor :enemy_sprites
  976.   attr_accessor :viewport1
  977.   attr_accessor :viewportPopups
  978.   
  979.   #--------------------------------------------------------------------------
  980.   # alias method: create_viewports
  981.   #--------------------------------------------------------------------------
  982.   alias spriteset_battle_create_viewports_abe create_viewports
  983.   def create_viewports
  984.     spriteset_battle_create_viewports_abe
  985.     @viewportPopups = Viewport.new
  986.     @viewportPopups.z = 200
  987.   end
  988.   
  989.   #--------------------------------------------------------------------------
  990.   # alias method: dispose_viewports
  991.   #--------------------------------------------------------------------------
  992.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  993.   def dispose_viewports
  994.     spriteset_battle_dispose_viewports_abe
  995.     @viewportPopups.dispose
  996.   end
  997.   
  998.   #--------------------------------------------------------------------------
  999.   # alias method: update_viewports
  1000.   #--------------------------------------------------------------------------
  1001.   alias spriteset_battle_update_viewports_abe update_viewports
  1002.   def update_viewports
  1003.     spriteset_battle_update_viewports_abe
  1004.     @viewportPopups.update
  1005.   end
  1006.   
  1007. end # Spriteset_Battle

  1008. #==============================================================================
  1009. # ■ Game_Temp
  1010. #==============================================================================

  1011. class Game_Temp
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # public instance variables
  1015.   #--------------------------------------------------------------------------
  1016.   attr_accessor :battle_aid
  1017.   attr_accessor :evaluating
  1018.   attr_accessor :iconset
  1019.   
  1020.   #--------------------------------------------------------------------------
  1021.   # alias method: initialize
  1022.   #--------------------------------------------------------------------------
  1023.   alias game_temp_initialize_abe initialize
  1024.   def initialize
  1025.     game_temp_initialize_abe
  1026.     @iconset = Cache.system("Iconset")
  1027.   end
  1028.   
  1029. end # Game_Temp

  1030. #==============================================================================
  1031. # ■ Game_Action
  1032. #==============================================================================

  1033. class Game_Action
  1034.   
  1035.   #--------------------------------------------------------------------------
  1036.   # overwrite method: speed
  1037.   #--------------------------------------------------------------------------
  1038.   def speed
  1039.     speed = subject.agi
  1040.     speed += item.speed if item
  1041.     speed += subject.atk_speed if attack?
  1042.     return speed
  1043.   end
  1044.   
  1045.   #--------------------------------------------------------------------------
  1046.   # alias method: evaluate_item_with_target
  1047.   #--------------------------------------------------------------------------
  1048.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1049.   def evaluate_item_with_target(target)
  1050.     $game_temp.evaluating = true
  1051.     result = evaluate_item_with_target_abe(target)
  1052.     $game_temp.evaluating = false
  1053.     return result
  1054.   end
  1055.   
  1056. end # Game_Action

  1057. #==============================================================================
  1058. # ■ Game_ActionResult
  1059. #==============================================================================

  1060. class Game_ActionResult
  1061.   
  1062.   #--------------------------------------------------------------------------
  1063.   # alias method: clear
  1064.   #--------------------------------------------------------------------------
  1065.   alias game_actionresult_clear_abe clear
  1066.   def clear
  1067.     game_actionresult_clear_abe
  1068.     clear_stored_damage
  1069.   end
  1070.   
  1071.   #--------------------------------------------------------------------------
  1072.   # new method: clear_stored_damage
  1073.   #--------------------------------------------------------------------------
  1074.   def clear_stored_damage
  1075.     @stored_hp_damage = 0
  1076.     @stored_mp_damage = 0
  1077.     @stored_tp_damage = 0
  1078.     @stored_hp_drain = 0
  1079.     @stored_mp_drain = 0
  1080.   end
  1081.   
  1082.   #--------------------------------------------------------------------------
  1083.   # new method: store_damage
  1084.   #--------------------------------------------------------------------------
  1085.   def store_damage
  1086.     @stored_hp_damage += @hp_damage
  1087.     @stored_mp_damage += @mp_damage
  1088.     @stored_tp_damage += @tp_damage
  1089.     @stored_hp_drain += @hp_drain
  1090.     @stored_mp_drain += @mp_drain
  1091.   end
  1092.   
  1093.   #--------------------------------------------------------------------------
  1094.   # new method: restore_damage
  1095.   #--------------------------------------------------------------------------
  1096.   def restore_damage
  1097.     @hp_damage = @stored_hp_damage
  1098.     @mp_damage = @stored_mp_damage
  1099.     @tp_damage = @stored_tp_damage
  1100.     @hp_drain = @stored_hp_drain
  1101.     @mp_drain = @stored_mp_drain
  1102.     clear_stored_damage
  1103.   end
  1104.   
  1105. end # Game_ActionResult

  1106. #==============================================================================
  1107. # ■ Game_BattlerBase
  1108. #==============================================================================

  1109. class Game_BattlerBase
  1110.   
  1111.   #--------------------------------------------------------------------------
  1112.   # public instance variables
  1113.   #--------------------------------------------------------------------------
  1114.   attr_accessor :popups
  1115.   
  1116.   #--------------------------------------------------------------------------
  1117.   # new method: create_popup
  1118.   #--------------------------------------------------------------------------
  1119.   def create_popup(value, rules = "DEFAULT", flags = [])
  1120.     return unless SceneManager.scene_is?(Scene_Battle)
  1121.     return unless YEA::BATTLE::ENABLE_POPUPS
  1122.     return if Switch.hide_popups
  1123.     @popups = [] if @popups.nil?
  1124.     @popups.push([value, rules, flags])
  1125.   end
  1126.   
  1127.   #--------------------------------------------------------------------------
  1128.   # new method: make_damage_popups
  1129.   #--------------------------------------------------------------------------
  1130.   def make_damage_popups(user)
  1131.     if @result.hp_drain != 0
  1132.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1133.       rules = "DRAIN"
  1134.       user.create_popup(text, rules)
  1135.       setting = :hp_dmg  if @result.hp_drain < 0
  1136.       setting = :hp_heal if @result.hp_drain > 0
  1137.       rules = "HP_DMG"   if @result.hp_drain < 0
  1138.       rules = "HP_HEAL"  if @result.hp_drain > 0
  1139.       value = @result.hp_drain.abs
  1140.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1141.       user.create_popup(text, rules)
  1142.     end
  1143.     if @result.mp_drain != 0
  1144.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1145.       rules = "DRAIN"
  1146.       user.create_popup(text, rules)
  1147.       setting = :mp_dmg  if @result.mp_drain < 0
  1148.       setting = :mp_heal if @result.mp_drain > 0
  1149.       rules = "HP_DMG"   if @result.mp_drain < 0
  1150.       rules = "HP_HEAL"  if @result.mp_drain > 0
  1151.       value = @result.mp_drain.abs
  1152.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1153.       user.create_popup(text, rules)
  1154.     end
  1155.     #---
  1156.     flags = []
  1157.     flags.push("critical") if @result.critical
  1158.     if @result.hp_damage != 0
  1159.       setting = :hp_dmg  if @result.hp_damage > 0
  1160.       setting = :hp_heal if @result.hp_damage < 0
  1161.       rules = "HP_DMG"   if @result.hp_damage > 0
  1162.       rules = "HP_HEAL"  if @result.hp_damage < 0
  1163.       value = @result.hp_damage.abs
  1164.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1165.       create_popup(text, rules, flags)
  1166.     end
  1167.     if @result.mp_damage != 0
  1168.       setting = :mp_dmg  if @result.mp_damage > 0
  1169.       setting = :mp_heal if @result.mp_damage < 0
  1170.       rules = "MP_DMG"   if @result.mp_damage > 0
  1171.       rules = "MP_HEAL"  if @result.mp_damage < 0
  1172.       value = @result.mp_damage.abs
  1173.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1174.       create_popup(text, rules, flags)
  1175.     end
  1176.     if @result.tp_damage != 0
  1177.       setting = :tp_dmg  if @result.tp_damage > 0
  1178.       setting = :tp_heal if @result.tp_damage < 0
  1179.       rules = "TP_DMG"   if @result.tp_damage > 0
  1180.       rules = "TP_HEAL"  if @result.tp_damage < 0
  1181.       value = @result.tp_damage.abs
  1182.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1183.       create_popup(text, rules)
  1184.     end
  1185.     @result.store_damage
  1186.     @result.clear_damage_values
  1187.   end
  1188.   
  1189.   #--------------------------------------------------------------------------
  1190.   # alias method: erase_state
  1191.   #--------------------------------------------------------------------------
  1192.   alias game_battlerbase_erase_state_abe erase_state
  1193.   def erase_state(state_id)
  1194.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1195.     game_battlerbase_erase_state_abe(state_id)
  1196.   end
  1197.   
  1198.   #--------------------------------------------------------------------------
  1199.   # new method: make_during_state_popup
  1200.   #--------------------------------------------------------------------------
  1201.   def make_during_state_popup
  1202.     state_id = most_important_state_id
  1203.     return if state_id == 0
  1204.     make_state_popup(state_id, :dur_state)
  1205.   end
  1206.   
  1207.   #--------------------------------------------------------------------------
  1208.   # new method: most_important_state_id
  1209.   #--------------------------------------------------------------------------
  1210.   def most_important_state_id
  1211.     states.each {|state| return state.id unless state.message3.empty? }
  1212.     return 0
  1213.   end
  1214.   
  1215.   #--------------------------------------------------------------------------
  1216.   # new method: make_state_popup
  1217.   #--------------------------------------------------------------------------
  1218.   def make_state_popup(state_id, type)
  1219.     state = $data_states[state_id]
  1220.     return if state.icon_index == 0
  1221.     rules = state.popup_rules[type]
  1222.     return if rules.nil?
  1223.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1224.     flags = ["state", state.icon_index]
  1225.     create_popup(text, rules, flags)
  1226.   end
  1227.   
  1228.   #--------------------------------------------------------------------------
  1229.   # new method: make_miss_popups
  1230.   #--------------------------------------------------------------------------
  1231.   def make_miss_popups(user, item)
  1232.     return if dead?
  1233.     if @result.missed
  1234.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1235.       rules = "DEFAULT"
  1236.       create_popup(text, rules)
  1237.     end
  1238.     if @result.evaded
  1239.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1240.       rules = "DEFAULT"
  1241.       create_popup(text, rules)
  1242.     end
  1243.     if @result.hit? && [email protected]
  1244.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1245.       rules = "DEFAULT"
  1246.       create_popup(text, rules)
  1247.     end
  1248.     if @result.hit? && item.damage.to_hp?
  1249.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1250.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1251.         rules = "DEFAULT"
  1252.         create_popup(text, rules)
  1253.       end
  1254.     end
  1255.   end
  1256.   
  1257.   #--------------------------------------------------------------------------
  1258.   # new method: make_rate_popup
  1259.   #--------------------------------------------------------------------------
  1260.   def make_rate_popup(rate)
  1261.     return if rate == 1.0
  1262.     flags = []
  1263.     if rate > 1.0
  1264.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1265.       rules = "WEAK_ELE"
  1266.       flags.push("weakness")
  1267.     elsif rate == 0.0
  1268.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1269.       rules = "IMMU_ELE"
  1270.       flags.push("immune")
  1271.     elsif rate < 0.0
  1272.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1273.       rules = "ABSB_ELE"
  1274.       flags.push("absorbed")
  1275.     else
  1276.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1277.       rules = "REST_ELE"
  1278.       flags.push("resistant")
  1279.     end
  1280.     create_popup(text, rules, flags)
  1281.   end
  1282.   
  1283.   #--------------------------------------------------------------------------
  1284.   # new method: make_buff_popup
  1285.   #--------------------------------------------------------------------------
  1286.   def make_buff_popup(param_id, positive = true)
  1287.     return unless SceneManager.scene_is?(Scene_Battle)
  1288.     return unless alive?
  1289.     name = Vocab::param(param_id)
  1290.     if positive
  1291.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1292.       rules = "BUFF"
  1293.       buff_level = 1
  1294.     else
  1295.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1296.       rules = "DEBUFF"
  1297.       buff_level = -1
  1298.     end
  1299.     icon = buff_icon_index(buff_level, param_id)
  1300.     flags = ["buff", icon]
  1301.     return if @popups.include?([text, rules, flags])
  1302.     create_popup(text, rules, flags)
  1303.   end
  1304.   
  1305. end # Game_BattlerBase

  1306. #==============================================================================
  1307. # ■ Game_Battler
  1308. #==============================================================================

  1309. class Game_Battler < Game_BattlerBase
  1310.   
  1311.   #--------------------------------------------------------------------------
  1312.   # public instance variables
  1313.   #--------------------------------------------------------------------------
  1314.   attr_accessor :pseudo_ani_id
  1315.   
  1316.   #--------------------------------------------------------------------------
  1317.   # alias method: on_battle_end
  1318.   #--------------------------------------------------------------------------
  1319.   alias game_battler_on_battle_end_abe on_battle_end
  1320.   def on_battle_end
  1321.     game_battler_on_battle_end_abe
  1322.     @popups = []
  1323.   end
  1324.   
  1325.   #--------------------------------------------------------------------------
  1326.   # alias method: clear_sprite_effects
  1327.   #--------------------------------------------------------------------------
  1328.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1329.   def clear_sprite_effects
  1330.     game_battler_clear_sprite_effects_abe
  1331.     @pseudo_ani_id = 0
  1332.   end
  1333.   
  1334.   #--------------------------------------------------------------------------
  1335.   # alias method: item_apply
  1336.   #--------------------------------------------------------------------------
  1337.   alias game_battler_item_apply_abe item_apply
  1338.   def item_apply(user, item)
  1339.     game_battler_item_apply_abe(user, item)
  1340.     make_miss_popups(user, item)
  1341.   end
  1342.   
  1343.   #--------------------------------------------------------------------------
  1344.   # alias method: make_damage_value
  1345.   #--------------------------------------------------------------------------
  1346.   alias game_battler_make_damage_value_abe make_damage_value
  1347.   def make_damage_value(user, item)
  1348.     game_battler_make_damage_value_abe(user, item)
  1349.     rate = item_element_rate(user, item)
  1350.     make_rate_popup(rate) unless $game_temp.evaluating
  1351.   end
  1352.   
  1353.   #--------------------------------------------------------------------------
  1354.   # alias method: execute_damage
  1355.   #--------------------------------------------------------------------------
  1356.   alias game_battler_execute_damage_abe execute_damage
  1357.   def execute_damage(user)
  1358.     game_battler_execute_damage_abe(user)
  1359.     make_damage_popups(user)
  1360.   end
  1361.   
  1362.   #--------------------------------------------------------------------------
  1363.   # alias method: item_effect_recover_hp
  1364.   #--------------------------------------------------------------------------
  1365.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1366.   def item_effect_recover_hp(user, item, effect)
  1367.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1368.     make_damage_popups(user)
  1369.   end
  1370.   
  1371.   #--------------------------------------------------------------------------
  1372.   # alias method: item_effect_recover_mp
  1373.   #--------------------------------------------------------------------------
  1374.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1375.   def item_effect_recover_mp(user, item, effect)
  1376.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1377.     make_damage_popups(user)
  1378.   end
  1379.   
  1380.   #--------------------------------------------------------------------------
  1381.   # alias method: item_effect_gain_tp
  1382.   #--------------------------------------------------------------------------
  1383.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1384.   def item_effect_gain_tp(user, item, effect)
  1385.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1386.     make_damage_popups(user)
  1387.   end
  1388.   
  1389.   #--------------------------------------------------------------------------
  1390.   # alias method: item_user_effect
  1391.   #--------------------------------------------------------------------------
  1392.   alias game_battler_item_user_effect_abe item_user_effect
  1393.   def item_user_effect(user, item)
  1394.     game_battler_item_user_effect_abe(user, item)
  1395.     @result.restore_damage
  1396.   end
  1397.   
  1398.   #--------------------------------------------------------------------------
  1399.   # alias method: add_new_state
  1400.   #--------------------------------------------------------------------------
  1401.   alias game_battler_add_new_state_abe add_new_state
  1402.   def add_new_state(state_id)
  1403.     game_battler_add_new_state_abe(state_id)
  1404.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1405.   end
  1406.   
  1407.   #--------------------------------------------------------------------------
  1408.   # alias method: add_buff
  1409.   #--------------------------------------------------------------------------
  1410.   alias game_battler_add_buff_abe add_buff
  1411.   def add_buff(param_id, turns)
  1412.     make_buff_popup(param_id, true)
  1413.     game_battler_add_buff_abe(param_id, turns)
  1414.   end
  1415.   
  1416.   #--------------------------------------------------------------------------
  1417.   # alias method: add_debuff
  1418.   #--------------------------------------------------------------------------
  1419.   alias game_battler_add_debuff_abe add_debuff
  1420.   def add_debuff(param_id, turns)
  1421.     make_buff_popup(param_id, false)
  1422.     game_battler_add_debuff_abe(param_id, turns)
  1423.   end
  1424.   
  1425.   #--------------------------------------------------------------------------
  1426.   # alias method: regenerate_all
  1427.   #--------------------------------------------------------------------------
  1428.   alias game_battler_regenerate_all_abe regenerate_all
  1429.   def regenerate_all
  1430.     game_battler_regenerate_all_abe
  1431.     return unless alive?
  1432.     make_damage_popups(self)
  1433.   end
  1434.   
  1435.   #--------------------------------------------------------------------------
  1436.   # new method: can_collapse?
  1437.   #--------------------------------------------------------------------------
  1438.   def can_collapse?
  1439.     return false unless dead?
  1440.     unless actor?
  1441.       return false unless sprite.battler_visible
  1442.       array = [:collapse, :boss_collapse, :instant_collapse]
  1443.       return false if array.include?(sprite.effect_type)
  1444.     end
  1445.     return true
  1446.   end
  1447.   
  1448.   #--------------------------------------------------------------------------
  1449.   # new method: draw_mp?
  1450.   #--------------------------------------------------------------------------
  1451.   def draw_mp?; return true; end
  1452.   
  1453.   #--------------------------------------------------------------------------
  1454.   # new method: draw_tp?
  1455.   #--------------------------------------------------------------------------
  1456.   def draw_tp?
  1457.     return $data_system.opt_display_tp
  1458.   end
  1459.   
  1460. end # Game_Battler

  1461. #==============================================================================
  1462. # ■ Game_Actor
  1463. #==============================================================================

  1464. class Game_Actor < Game_Battler
  1465.   
  1466.   #--------------------------------------------------------------------------
  1467.   # overwrite method: perform_damage_effect
  1468.   #--------------------------------------------------------------------------
  1469.   def perform_damage_effect
  1470.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1471.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1472.     Sound.play_actor_damage
  1473.   end
  1474.   
  1475.   #--------------------------------------------------------------------------
  1476.   # overwrite method: use_sprite?
  1477.   #--------------------------------------------------------------------------
  1478.   def use_sprite?; return true; end
  1479.    
  1480.   #--------------------------------------------------------------------------
  1481.   # new method: screen_x
  1482.   #--------------------------------------------------------------------------
  1483.   def screen_x
  1484.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1485.     status_window = SceneManager.scene.status_window
  1486.     return 0 if status_window.nil?
  1487.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1488.     ext = SceneManager.scene.info_viewport.ox
  1489.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1490.     constant = 128 + 12
  1491.     return constant + rect.x + item_rect_width / 2 - ext
  1492.   end
  1493.   
  1494.   #--------------------------------------------------------------------------
  1495.   # new method: screen_y
  1496.   #--------------------------------------------------------------------------
  1497.   def screen_y
  1498.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1499.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1500.     return Graphics.height - 120
  1501.   end
  1502.   
  1503.   #--------------------------------------------------------------------------
  1504.   # new method: screen_z
  1505.   #--------------------------------------------------------------------------
  1506.   def screen_z; return 100; end
  1507.   
  1508.   #--------------------------------------------------------------------------
  1509.   # new method: sprite
  1510.   #--------------------------------------------------------------------------
  1511.   def sprite
  1512.     index = $game_party.battle_members.index(self)
  1513.     return SceneManager.scene.spriteset.actor_sprites[index]
  1514.   end
  1515.   
  1516.   #--------------------------------------------------------------------------
  1517.   # new method: draw_mp?
  1518.   #--------------------------------------------------------------------------
  1519.   def draw_mp?
  1520.     return true unless draw_tp?
  1521.     for skill in skills
  1522.       next unless added_skill_types.include?(skill.stype_id)
  1523.       return true if skill.mp_cost > 0
  1524.     end
  1525.     return false
  1526.   end
  1527.   
  1528.   #--------------------------------------------------------------------------
  1529.   # new method: draw_tp?
  1530.   #--------------------------------------------------------------------------
  1531.   def draw_tp?
  1532.     return false unless $data_system.opt_display_tp
  1533.     for skill in skills
  1534.       next unless added_skill_types.include?(skill.stype_id)
  1535.       return true if skill.tp_cost > 0
  1536.     end
  1537.     return false
  1538.   end
  1539.   
  1540. end # Game_Actor

  1541. #==============================================================================
  1542. # ■ Game_Enemy
  1543. #==============================================================================

  1544. class Game_Enemy < Game_Battler
  1545.   
  1546.   #--------------------------------------------------------------------------
  1547.   # overwrite method: perform_damage_effect
  1548.   #--------------------------------------------------------------------------
  1549.   def perform_damage_effect
  1550.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1551.     Sound.play_enemy_damage
  1552.   end
  1553.   
  1554.   #--------------------------------------------------------------------------
  1555.   # new methods: attack_animation_id
  1556.   #--------------------------------------------------------------------------
  1557.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1558.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1559.   
  1560.   #--------------------------------------------------------------------------
  1561.   # new method: sprite
  1562.   #--------------------------------------------------------------------------
  1563.   def sprite
  1564.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1565.   end
  1566.   
  1567. end # Game_Enemy

  1568. #==============================================================================
  1569. # ■ Game_Unit
  1570. #==============================================================================

  1571. class Game_Unit
  1572.   
  1573.   #--------------------------------------------------------------------------
  1574.   # alias method: make_actions
  1575.   #--------------------------------------------------------------------------
  1576.   alias game_unit_make_actions_abe make_actions
  1577.   def make_actions
  1578.     game_unit_make_actions_abe
  1579.     refresh_autobattler_status_window
  1580.   end
  1581.   
  1582.   #--------------------------------------------------------------------------
  1583.   # new method: refresh_autobattler_status_window
  1584.   #--------------------------------------------------------------------------
  1585.   def refresh_autobattler_status_window
  1586.     return unless SceneManager.scene_is?(Scene_Battle)
  1587.     return unless self.is_a?(Game_Party)
  1588.     SceneManager.scene.refresh_autobattler_status_window
  1589.   end
  1590.   
  1591. end # Game_Unit





  1592. #==============================================================================
  1593. # ■ Window_BattleStatus
  1594. #==============================================================================

  1595. class Window_BattleStatus < Window_Selectable
  1596.   
  1597.   #--------------------------------------------------------------------------
  1598.   # overwrite method: initialize
  1599.   #--------------------------------------------------------------------------
  1600.   def initialize
  1601.     super(0, 0, window_width, window_height)
  1602.     self.openness = 0
  1603.     @party = $game_party.battle_members.clone
  1604.   end
  1605.   
  1606.   #--------------------------------------------------------------------------
  1607.   # overwrite method: col_max
  1608.   #--------------------------------------------------------------------------
  1609.   def col_max; return $game_party.max_battle_members; end
  1610.   
  1611.   #--------------------------------------------------------------------------
  1612.   # new method: battle_members
  1613.   #--------------------------------------------------------------------------
  1614.   def battle_members; return $game_party.battle_members; end
  1615.   
  1616.   #--------------------------------------------------------------------------
  1617.   # new method: actor
  1618.   #--------------------------------------------------------------------------
  1619.   def actor; return battle_members[@index]; end
  1620.   
  1621.   #--------------------------------------------------------------------------
  1622.   # overwrite method: update
  1623.   #--------------------------------------------------------------------------
  1624.   def update
  1625.     super
  1626.     return if @party == $game_party.battle_members
  1627.     @party = $game_party.battle_members.clone
  1628.     refresh
  1629.   end
  1630.   
  1631.   #--------------------------------------------------------------------------
  1632.   # overwrite method: draw_item
  1633.   #--------------------------------------------------------------------------
  1634.   def draw_item(index)
  1635.     return if index.nil?
  1636.     clear_item(index)
  1637.     actor = battle_members[index]
  1638.     rect = item_rect(index)
  1639.     return if actor.nil?
  1640.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1641.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1642.     draw_actor_action(actor, rect.x, rect.y)
  1643.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1644.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1645.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1646.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1647.     if draw_tp?(actor) && draw_mp?(actor)
  1648.       dw = rect.width/2-2
  1649.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1650.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1651.       dw = rect.width - rect.width/2 - 2
  1652.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1653.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1654.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1655.     else
  1656.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1657.     end
  1658.   end
  1659.   
  1660.   #--------------------------------------------------------------------------
  1661.   # overwrite method: item_rect
  1662.   #--------------------------------------------------------------------------
  1663.   def item_rect(index)
  1664.     rect = Rect.new
  1665.     rect.width = contents.width / $game_party.max_battle_members
  1666.     rect.height = contents.height
  1667.     rect.x = index * rect.width
  1668.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1669.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1670.     end
  1671.     rect.y = 0
  1672.     return rect
  1673.   end
  1674.   
  1675.   #--------------------------------------------------------------------------
  1676.   # overwrite method: draw_face
  1677.   #--------------------------------------------------------------------------
  1678.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1679.     bitmap = Cache.face(face_name)
  1680.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1681.     fy = face_index / 4 * 96 + 2
  1682.     fw = [item_rect(0).width - 4, 92].min
  1683.     rect = Rect.new(fx, fy, fw, 92)
  1684.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1685.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1686.     bitmap.dispose
  1687.   end
  1688.   
  1689.   #--------------------------------------------------------------------------
  1690.   # overwrite method: draw_actor_name
  1691.   #--------------------------------------------------------------------------
  1692.   def draw_actor_name(actor, dx, dy, dw = 112)
  1693.     reset_font_settings
  1694.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1695.     change_color(hp_color(actor))
  1696.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1697.   end
  1698.   
  1699.   #--------------------------------------------------------------------------
  1700.   # new method: draw_actor_action
  1701.   #--------------------------------------------------------------------------
  1702.   def draw_actor_action(actor, dx, dy)
  1703.     draw_icon(action_icon(actor), dx, dy)
  1704.   end
  1705.   
  1706.   #--------------------------------------------------------------------------
  1707.   # new method: action_icon
  1708.   #--------------------------------------------------------------------------
  1709.   def action_icon(actor)
  1710.     return Icon.no_action if actor.current_action.nil?
  1711.     return Icon.no_action if actor.current_action.item.nil?
  1712.     return actor.current_action.item.icon_index
  1713.   end
  1714.   
  1715.   #--------------------------------------------------------------------------
  1716.   # new method: draw_tp?
  1717.   #--------------------------------------------------------------------------
  1718.   def draw_tp?(actor)
  1719.     return actor.draw_tp?
  1720.   end
  1721.   
  1722.   #--------------------------------------------------------------------------
  1723.   # new method: draw_mp?
  1724.   #--------------------------------------------------------------------------
  1725.   def draw_mp?(actor)
  1726.     return actor.draw_mp?
  1727.   end
  1728.   
  1729.   #--------------------------------------------------------------------------
  1730.   # overwrite method: draw_current_and_max_values
  1731.   #--------------------------------------------------------------------------
  1732.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1733.     change_color(color1)
  1734.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1735.   end
  1736.   
  1737.   #--------------------------------------------------------------------------
  1738.   # overwrite method: draw_actor_hp
  1739.   #--------------------------------------------------------------------------
  1740.   def draw_actor_hp(actor, dx, dy, width = 124)
  1741.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1742.     change_color(system_color)
  1743.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1744.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1745.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1746.       hp_color(actor), normal_color)
  1747.     end
  1748.    
  1749.   #--------------------------------------------------------------------------
  1750.   # overwrite method: draw_actor_mp
  1751.   #--------------------------------------------------------------------------
  1752.   def draw_actor_mp(actor, dx, dy, width = 124)
  1753.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1754.     change_color(system_color)
  1755.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1756.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1757.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1758.       mp_color(actor), normal_color)
  1759.     end
  1760.    
  1761.   #--------------------------------------------------------------------------
  1762.   # overwrite method: draw_actor_tp
  1763.   #--------------------------------------------------------------------------
  1764.   def draw_actor_tp(actor, dx, dy, width = 124)
  1765.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1766.     change_color(system_color)
  1767.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1768.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1769.     change_color(tp_color(actor))
  1770.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1771.   end
  1772.   
  1773. end # Window_BattleStatus

  1774. #==============================================================================
  1775. # ■ Window_BattleActor
  1776. #==============================================================================

  1777. class Window_BattleActor < Window_BattleStatus
  1778.   
  1779.   #--------------------------------------------------------------------------
  1780.   # overwrite method: show
  1781.   #--------------------------------------------------------------------------
  1782.   def show
  1783.     create_flags
  1784.     super
  1785.   end
  1786.   
  1787.   #--------------------------------------------------------------------------
  1788.   # new method: create_flags
  1789.   #--------------------------------------------------------------------------
  1790.   def create_flags
  1791.     set_select_flag(:any)
  1792.     select(0)
  1793.     return if $game_temp.battle_aid.nil?
  1794.     if $game_temp.battle_aid.need_selection?
  1795.       select(0)
  1796.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1797.     elsif $game_temp.battle_aid.for_user?
  1798.       battler = BattleManager.actor
  1799.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1800.       select(id)
  1801.       set_select_flag(:user)
  1802.     elsif $game_temp.battle_aid.for_all?
  1803.       select(0)
  1804.       set_select_flag(:all)
  1805.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1806.     elsif $game_temp.battle_aid.for_random?
  1807.       select(0)
  1808.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1809.     end
  1810.   end
  1811.   
  1812.   #--------------------------------------------------------------------------
  1813.   # new method: set_flag
  1814.   #--------------------------------------------------------------------------
  1815.   def set_select_flag(flag)
  1816.     @select_flag = flag
  1817.     case @select_flag
  1818.     when :all, :all_dead, :random
  1819.       @cursor_all = true
  1820.     else
  1821.       @cursor_all = false
  1822.     end
  1823.   end
  1824.   
  1825.   #--------------------------------------------------------------------------
  1826.   # overwrite method: update_cursor
  1827.   #--------------------------------------------------------------------------
  1828.   def update_cursor
  1829.     if @cursor_all
  1830.       cursor_rect.set(0, 0, contents.width, contents.height)
  1831.       self.top_row = 0
  1832.     elsif @index < 0
  1833.       cursor_rect.empty
  1834.     else
  1835.       ensure_cursor_visible
  1836.       cursor_rect.set(item_rect(@index))
  1837.     end
  1838.   end
  1839.   
  1840.   #--------------------------------------------------------------------------
  1841.   # overwrite method: cursor_movable?
  1842.   #--------------------------------------------------------------------------
  1843.   def cursor_movable?
  1844.     return false if @select_flag == :user
  1845.     return super
  1846.   end
  1847.   
  1848.   #--------------------------------------------------------------------------
  1849.   # overwrite method: current_item_enabled?
  1850.   #--------------------------------------------------------------------------
  1851.   def current_item_enabled?
  1852.     return true if $game_temp.battle_aid.nil?
  1853.     if $game_temp.battle_aid.need_selection?
  1854.       member = $game_party.battle_members[@index]
  1855.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1856.     elsif $game_temp.battle_aid.for_dead_friend?
  1857.       for member in $game_party.battle_members
  1858.         return true if member.dead?
  1859.       end
  1860.       return false
  1861.     end
  1862.     return true
  1863.   end
  1864.   
  1865. end # Window_BattleActor

  1866. #==============================================================================
  1867. # ■ Window_BattleStatusAid
  1868. #==============================================================================

  1869. class Window_BattleStatusAid < Window_BattleStatus
  1870.   
  1871.   #--------------------------------------------------------------------------
  1872.   # public instance variables
  1873.   #--------------------------------------------------------------------------
  1874.   attr_accessor :status_window
  1875.   
  1876.   #--------------------------------------------------------------------------
  1877.   # overwrite method: initialize
  1878.   #--------------------------------------------------------------------------
  1879.   def initialize
  1880.     super
  1881.     self.visible = false
  1882.     self.openness = 255
  1883.   end
  1884.   
  1885.   #--------------------------------------------------------------------------
  1886.   # overwrite method: window_width
  1887.   #--------------------------------------------------------------------------
  1888.   def window_width; return 128; end
  1889.   
  1890.   #--------------------------------------------------------------------------
  1891.   # overwrite method: show
  1892.   #--------------------------------------------------------------------------
  1893.   def show
  1894.     super
  1895.     refresh
  1896.   end
  1897.   
  1898.   #--------------------------------------------------------------------------
  1899.   # overwrite method: refresh
  1900.   #--------------------------------------------------------------------------
  1901.   def refresh
  1902.     contents.clear
  1903.     return if @status_window.nil?
  1904.     draw_item(@status_window.index)
  1905.   end
  1906.   
  1907.   #--------------------------------------------------------------------------
  1908.   # overwrite method: item_rect
  1909.   #--------------------------------------------------------------------------
  1910.   def item_rect(index)
  1911.     return Rect.new(0, 0, contents.width, contents.height)
  1912.   end
  1913.   
  1914. end # Window_BattleStatusAid

  1915. #==============================================================================
  1916. # ■ Window_BattleEnemy
  1917. #==============================================================================

  1918. class Window_BattleEnemy < Window_Selectable
  1919.   
  1920.   #--------------------------------------------------------------------------
  1921.   # overwrite method: initialize
  1922.   #--------------------------------------------------------------------------
  1923.   def initialize(info_viewport)
  1924.     super(0, Graphics.height, window_width, fitting_height(1))
  1925.     refresh
  1926.     self.visible = false
  1927.     @info_viewport = info_viewport
  1928.   end
  1929.   
  1930.   #--------------------------------------------------------------------------
  1931.   # overwrite method: col_max
  1932.   #--------------------------------------------------------------------------
  1933.   def col_max; return item_max; end
  1934.   
  1935.   #--------------------------------------------------------------------------
  1936.   # overwrite method: show
  1937.   #--------------------------------------------------------------------------
  1938.   def show
  1939.     create_flags
  1940.     super
  1941.   end
  1942.   
  1943.   #--------------------------------------------------------------------------
  1944.   # new method: create_flags
  1945.   #--------------------------------------------------------------------------
  1946.   def create_flags
  1947.     set_select_flag(:any)
  1948.     select(0)
  1949.     return if $game_temp.battle_aid.nil?
  1950.     if $game_temp.battle_aid.need_selection?
  1951.       select(0)
  1952.     elsif $game_temp.battle_aid.for_all?
  1953.       select(0)
  1954.       set_select_flag(:all)
  1955.     elsif $game_temp.battle_aid.for_random?
  1956.       select(0)
  1957.       set_select_flag(:random)
  1958.     end
  1959.   end
  1960.   
  1961.   #--------------------------------------------------------------------------
  1962.   # new method: set_flag
  1963.   #--------------------------------------------------------------------------
  1964.   def set_select_flag(flag)
  1965.     @select_flag = flag
  1966.     case @select_flag
  1967.     when :all, :random
  1968.       @cursor_all = true
  1969.     else
  1970.       @cursor_all = false
  1971.     end
  1972.   end
  1973.   
  1974.   #--------------------------------------------------------------------------
  1975.   # new method: select_all?
  1976.   #--------------------------------------------------------------------------
  1977.   def select_all?
  1978.     return true if @select_flag == :all
  1979.     return true if @select_flag == :random
  1980.     return false
  1981.   end
  1982.   
  1983.   #--------------------------------------------------------------------------
  1984.   # overwrite method: update_cursor
  1985.   #--------------------------------------------------------------------------
  1986.   def update_cursor
  1987.     if @cursor_all
  1988.       cursor_rect.set(0, 0, contents.width, contents.height)
  1989.       self.top_row = 0
  1990.     elsif @index < 0
  1991.       cursor_rect.empty
  1992.     else
  1993.       ensure_cursor_visible
  1994.       cursor_rect.set(item_rect(@index))
  1995.     end
  1996.   end
  1997.   
  1998.   #--------------------------------------------------------------------------
  1999.   # overwrite method: cursor_movable?
  2000.   #--------------------------------------------------------------------------
  2001.   def cursor_movable?
  2002.     return false if @select_flag == :user
  2003.     return super
  2004.   end
  2005.   
  2006.   #--------------------------------------------------------------------------
  2007.   # overwrite method: current_item_enabled?
  2008.   #--------------------------------------------------------------------------
  2009.   def current_item_enabled?
  2010.     return true if $game_temp.battle_aid.nil?
  2011.     if $game_temp.battle_aid.need_selection?
  2012.       member = $game_party.battle_members[@index]
  2013.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2014.     elsif $game_temp.battle_aid.for_dead_friend?
  2015.       for member in $game_party.battle_members
  2016.         return true if member.dead?
  2017.       end
  2018.       return false
  2019.     end
  2020.     return true
  2021.   end
  2022.   
  2023.   #--------------------------------------------------------------------------
  2024.   # overwrite method: enemy
  2025.   #--------------------------------------------------------------------------
  2026.   def enemy; @data[index]; end
  2027.   
  2028.   #--------------------------------------------------------------------------
  2029.   # overwrite method: refresh
  2030.   #--------------------------------------------------------------------------
  2031.   def refresh
  2032.     make_item_list
  2033.     create_contents
  2034.     draw_all_items
  2035.   end
  2036.   
  2037.   #--------------------------------------------------------------------------
  2038.   # overwrite method: make_item_list
  2039.   #--------------------------------------------------------------------------
  2040.   def make_item_list
  2041.     @data = $game_troop.alive_members
  2042.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2043.   end
  2044.   
  2045.   #--------------------------------------------------------------------------
  2046.   # overwrite method: draw_item
  2047.   #--------------------------------------------------------------------------
  2048.   def draw_item(index); return; end
  2049.   
  2050.   #--------------------------------------------------------------------------
  2051.   # overwrite method: update
  2052.   #--------------------------------------------------------------------------
  2053.   def update
  2054.     super
  2055.     return unless active
  2056.     enemy.sprite_effect_type = :whiten
  2057.     return unless select_all?
  2058.     for enemy in $game_troop.alive_members
  2059.       enemy.sprite_effect_type = :whiten
  2060.     end
  2061.   end
  2062.   
  2063. end # Window_BattleEnemy

  2064. #==============================================================================
  2065. # ■ Window_BattleHelp
  2066. #==============================================================================

  2067. class Window_BattleHelp < Window_Help
  2068.   
  2069.   #--------------------------------------------------------------------------
  2070.   # public instance variables
  2071.   #--------------------------------------------------------------------------
  2072.   attr_accessor :actor_window
  2073.   attr_accessor :enemy_window
  2074.   
  2075.   #--------------------------------------------------------------------------
  2076.   # update
  2077.   #--------------------------------------------------------------------------
  2078.   def update
  2079.     super
  2080.     if !self.visible and @text != ""
  2081.       @text = ""
  2082.       return refresh
  2083.     end
  2084.     update_battler_name
  2085.   end
  2086.   
  2087.   #--------------------------------------------------------------------------
  2088.   # update_battler_name
  2089.   #--------------------------------------------------------------------------
  2090.   def update_battler_name
  2091.     return unless @actor_window.active || @enemy_window.active
  2092.     if @actor_window.active
  2093.       battler = $game_party.battle_members[@actor_window.index]
  2094.     elsif @enemy_window.active
  2095.       battler = @enemy_window.enemy
  2096.     end
  2097.     if special_display?
  2098.       refresh_special_case(battler)
  2099.     else
  2100.       refresh_battler_name(battler) if battler_name(battler) != @text
  2101.     end
  2102.   end
  2103.   
  2104.   #--------------------------------------------------------------------------
  2105.   # battler_name
  2106.   #--------------------------------------------------------------------------
  2107.   def battler_name(battler)
  2108.     text = battler.name.clone
  2109.     return text
  2110.   end
  2111.   
  2112.   #--------------------------------------------------------------------------
  2113.   # refresh_battler_name
  2114.   #--------------------------------------------------------------------------
  2115.   def refresh_battler_name(battler)
  2116.     contents.clear
  2117.     reset_font_settings
  2118.     change_color(normal_color)
  2119.     @text = battler_name(battler)
  2120.     icons = battler.state_icons + battler.buff_icons
  2121.     dy = icons.size <= 0 ? line_height / 2 : 0
  2122.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2123.     dx = (contents.width - (icons.size * 24)) / 2
  2124.     draw_actor_icons(battler, dx, line_height, contents.width)
  2125.   end
  2126.   
  2127.   #--------------------------------------------------------------------------
  2128.   # special_display?
  2129.   #--------------------------------------------------------------------------
  2130.   def special_display?
  2131.     return false if $game_temp.battle_aid.nil?
  2132.     return false if $game_temp.battle_aid.for_user?
  2133.     return !$game_temp.battle_aid.need_selection?
  2134.   end
  2135.   
  2136.   #--------------------------------------------------------------------------
  2137.   # refresh_special_case
  2138.   #--------------------------------------------------------------------------
  2139.   def refresh_special_case(battler)
  2140.     if $game_temp.battle_aid.for_opponent?
  2141.       if $game_temp.battle_aid.for_all?
  2142.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2143.       else
  2144.         case $game_temp.battle_aid.number_of_targets
  2145.         when 1
  2146.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2147.         else
  2148.           number = $game_temp.battle_aid.number_of_targets
  2149.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2150.         end
  2151.       end
  2152.     else # $game_temp.battle_aid.for_friend?
  2153.       if $game_temp.battle_aid.for_dead_friend?
  2154.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2155.       elsif $game_temp.battle_aid.for_random?
  2156.         case $game_temp.battle_aid.number_of_targets
  2157.         when 1
  2158.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2159.         else
  2160.           number = $game_temp.battle_aid.number_of_targets
  2161.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2162.         end
  2163.       else
  2164.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2165.       end
  2166.     end
  2167.     return if text == @text
  2168.     @text = text
  2169.     contents.clear
  2170.     reset_font_settings
  2171.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2172.   end
  2173.   
  2174. end # Window_BattleHelp

  2175. #==============================================================================
  2176. # ■ Window_BattleLog
  2177. #==============================================================================

  2178. class Window_BattleLog < Window_Selectable
  2179.   
  2180.   #--------------------------------------------------------------------------
  2181.   # alias method: display_current_state
  2182.   #--------------------------------------------------------------------------
  2183.   alias window_battlelog_display_current_state_abe display_current_state
  2184.   def display_current_state(subject)
  2185.     subject.make_during_state_popup
  2186.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2187.     window_battlelog_display_current_state_abe(subject)
  2188.   end
  2189.   
  2190.   #--------------------------------------------------------------------------
  2191.   # alias method: display_use_item
  2192.   #--------------------------------------------------------------------------
  2193.   alias window_battlelog_display_use_item_abe display_use_item
  2194.   def display_use_item(subject, item)
  2195.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2196.     window_battlelog_display_use_item_abe(subject, item)
  2197.   end
  2198.   
  2199.   #--------------------------------------------------------------------------
  2200.   # alias method: display_counter
  2201.   #--------------------------------------------------------------------------
  2202.   alias window_battlelog_display_counter_abe display_counter
  2203.   def display_counter(target, item)
  2204.     if YEA::BATTLE::MSG_COUNTERATTACK
  2205.       window_battlelog_display_counter_abe(target, item)
  2206.     else
  2207.       Sound.play_evasion
  2208.     end
  2209.   end
  2210.   
  2211.   #--------------------------------------------------------------------------
  2212.   # alias method: display_reflection
  2213.   #--------------------------------------------------------------------------
  2214.   alias window_battlelog_display_reflection_abe display_reflection
  2215.   def display_reflection(target, item)
  2216.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2217.       window_battlelog_display_reflection_abe(target, item)
  2218.     else
  2219.       Sound.play_reflection
  2220.     end
  2221.   end
  2222.   
  2223.   #--------------------------------------------------------------------------
  2224.   # alias method: display_substitute
  2225.   #--------------------------------------------------------------------------
  2226.   alias window_battlelog_display_substitute_abe display_substitute
  2227.   def display_substitute(substitute, target)
  2228.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2229.     window_battlelog_display_substitute_abe(substitute, target)
  2230.   end
  2231.   
  2232.   #--------------------------------------------------------------------------
  2233.   # alias method: display_failure
  2234.   #--------------------------------------------------------------------------
  2235.   alias window_battlelog_display_failure_abe display_failure
  2236.   def display_failure(target, item)
  2237.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2238.     window_battlelog_display_failure_abe(target, item)
  2239.   end
  2240.   
  2241.   #--------------------------------------------------------------------------
  2242.   # alias method: display_critical
  2243.   #--------------------------------------------------------------------------
  2244.   alias window_battlelog_display_critical_abe display_critical
  2245.   def display_critical(target, item)
  2246.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2247.     window_battlelog_display_critical_abe(target, item)
  2248.   end
  2249.   
  2250.   #--------------------------------------------------------------------------
  2251.   # alias method: display_miss
  2252.   #--------------------------------------------------------------------------
  2253.   alias window_battlelog_display_miss_abe display_miss
  2254.   def display_miss(target, item)
  2255.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2256.     window_battlelog_display_miss_abe(target, item)
  2257.   end
  2258.   
  2259.   #--------------------------------------------------------------------------
  2260.   # alias method: display_evasion
  2261.   #--------------------------------------------------------------------------
  2262.   alias window_battlelog_display_evasion_abe display_evasion
  2263.   def display_evasion(target, item)
  2264.     if YEA::BATTLE::MSG_EVASION
  2265.       window_battlelog_display_evasion_abe(target, item)
  2266.     else
  2267.       if !item || item.physical?
  2268.         Sound.play_evasion
  2269.       else
  2270.         Sound.play_magic_evasion
  2271.       end
  2272.     end
  2273.   end
  2274.   
  2275.   #--------------------------------------------------------------------------
  2276.   # overwrite method: display_hp_damage
  2277.   #--------------------------------------------------------------------------
  2278.   def display_hp_damage(target, item)
  2279.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2280.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2281.       target.perform_damage_effect
  2282.     end
  2283.     Sound.play_recovery if target.result.hp_damage < 0
  2284.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2285.     add_text(target.result.hp_damage_text)
  2286.     wait
  2287.   end
  2288.   
  2289.   #--------------------------------------------------------------------------
  2290.   # overwrite method: display_mp_damage
  2291.   #--------------------------------------------------------------------------
  2292.   def display_mp_damage(target, item)
  2293.     return if target.dead? || target.result.mp_damage == 0
  2294.     Sound.play_recovery if target.result.mp_damage < 0
  2295.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2296.     add_text(target.result.mp_damage_text)
  2297.     wait
  2298.   end
  2299.   
  2300.   #--------------------------------------------------------------------------
  2301.   # overwrite method: display_tp_damage
  2302.   #--------------------------------------------------------------------------
  2303.   def display_tp_damage(target, item)
  2304.     return if target.dead? || target.result.tp_damage == 0
  2305.     Sound.play_recovery if target.result.tp_damage < 0
  2306.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2307.     add_text(target.result.tp_damage_text)
  2308.     wait
  2309.   end
  2310.   
  2311.   #--------------------------------------------------------------------------
  2312.   # alias method: display_added_states
  2313.   #--------------------------------------------------------------------------
  2314.   alias window_battlelog_display_added_states_abe display_added_states
  2315.   def display_added_states(target)
  2316.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2317.     window_battlelog_display_added_states_abe(target)
  2318.   end
  2319.   
  2320.   #--------------------------------------------------------------------------
  2321.   # alias method: display_removed_states
  2322.   #--------------------------------------------------------------------------
  2323.   alias window_battlelog_display_removed_states_abe display_removed_states
  2324.   def display_removed_states(target)
  2325.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2326.     window_battlelog_display_removed_states_abe(target)
  2327.   end
  2328.   
  2329.   #--------------------------------------------------------------------------
  2330.   # alias method: display_changed_buffs
  2331.   #--------------------------------------------------------------------------
  2332.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2333.   def display_changed_buffs(target)
  2334.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2335.     window_battlelog_display_changed_buffs_abe(target)
  2336.   end
  2337.   
  2338. end # Window_BattleLog

  2339. #==============================================================================
  2340. # ■ Window_SkillList
  2341. #==============================================================================

  2342. class Window_SkillList < Window_Selectable
  2343.   
  2344.   #--------------------------------------------------------------------------
  2345.   # overwrite method: spacing
  2346.   #--------------------------------------------------------------------------
  2347.   def spacing
  2348.     return 8 if $game_party.in_battle
  2349.     return super
  2350.   end
  2351.   
  2352. end # Window_SkillList

  2353. #==============================================================================
  2354. # ■ Window_ItemList
  2355. #==============================================================================

  2356. class Window_ItemList < Window_Selectable
  2357.   
  2358.   #--------------------------------------------------------------------------
  2359.   # overwrite method: spacing
  2360.   #--------------------------------------------------------------------------
  2361.   def spacing
  2362.     return 8 if $game_party.in_battle
  2363.     return super
  2364.   end
  2365.   
  2366. end # Window_ItemList

  2367. #==============================================================================
  2368. # ■ Scene_Battle
  2369. #==============================================================================

  2370. class Scene_Battle < Scene_Base
  2371.   
  2372.   #--------------------------------------------------------------------------
  2373.   # public instance variables
  2374.   #--------------------------------------------------------------------------
  2375.   attr_accessor :enemy_window
  2376.   attr_accessor :info_viewport
  2377.   attr_accessor :spriteset
  2378.   attr_accessor :status_window
  2379.   attr_accessor :status_aid_window
  2380.   attr_accessor :subject
  2381.   
  2382.   #--------------------------------------------------------------------------
  2383.   # alias method: create_spriteset
  2384.   #--------------------------------------------------------------------------
  2385.   alias scene_battle_create_spriteset_abe create_spriteset
  2386.   def create_spriteset
  2387.     BattleManager.init_battle_type
  2388.     scene_battle_create_spriteset_abe
  2389.   end
  2390.   
  2391.   #--------------------------------------------------------------------------
  2392.   # alias method: update_basic
  2393.   #--------------------------------------------------------------------------
  2394.   alias scene_battle_update_basic_abe update_basic
  2395.   def update_basic
  2396.     scene_battle_update_basic_abe
  2397.     update_debug
  2398.   end
  2399.   
  2400.   #--------------------------------------------------------------------------
  2401.   # new method: update_debug
  2402.   #--------------------------------------------------------------------------
  2403.   def update_debug
  2404.     return unless $TEST || $BTEST
  2405.     debug_heal_party if Input.trigger?(:F5)
  2406.     debug_damage_party if Input.trigger?(:F6)
  2407.     debug_fill_tp if Input.trigger?(:F7)
  2408.     debug_kill_all if Input.trigger?(:F8)
  2409.   end
  2410.   
  2411.   #--------------------------------------------------------------------------
  2412.   # new method: debug_heal_party
  2413.   #--------------------------------------------------------------------------
  2414.   def debug_heal_party
  2415.     Sound.play_recovery
  2416.     for member in $game_party.battle_members
  2417.       member.recover_all
  2418.     end
  2419.     @status_window.refresh
  2420.   end
  2421.   
  2422.   #--------------------------------------------------------------------------
  2423.   # new method: debug_damage_party
  2424.   #--------------------------------------------------------------------------
  2425.   def debug_damage_party
  2426.     Sound.play_actor_damage
  2427.     for member in $game_party.alive_members
  2428.       member.hp = 1
  2429.       member.mp = 0
  2430.       member.tp = 0
  2431.     end
  2432.     @status_window.refresh
  2433.   end
  2434.   
  2435.   #--------------------------------------------------------------------------
  2436.   # new method: debug_fill_tp
  2437.   #--------------------------------------------------------------------------
  2438.   def debug_fill_tp
  2439.     Sound.play_recovery
  2440.     for member in $game_party.alive_members
  2441.       member.tp = member.max_tp
  2442.     end
  2443.     @status_window.refresh
  2444.   end
  2445.   
  2446.   #--------------------------------------------------------------------------
  2447.   # new method: debug_kill_all
  2448.   #--------------------------------------------------------------------------
  2449.   def debug_kill_all
  2450.     for enemy in $game_troop.alive_members
  2451.       enemy.hp = 0
  2452.       enemy.perform_collapse_effect
  2453.     end
  2454.     BattleManager.judge_win_loss
  2455.     @log_window.wait
  2456.     @log_window.wait_for_effect
  2457.   end
  2458.   
  2459.   #--------------------------------------------------------------------------
  2460.   # alias method: create_all_windows
  2461.   #--------------------------------------------------------------------------
  2462.   alias scene_battle_create_all_windows_abe create_all_windows
  2463.   def create_all_windows
  2464.     scene_battle_create_all_windows_abe
  2465.     create_battle_status_aid_window
  2466.     set_help_window
  2467.   end
  2468.   
  2469.   #--------------------------------------------------------------------------
  2470.   # alias method: create_info_viewport
  2471.   #--------------------------------------------------------------------------
  2472.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2473.   def create_info_viewport
  2474.     scene_battle_create_info_viewport_abe
  2475.     @status_window.refresh
  2476.   end
  2477.   
  2478.   #--------------------------------------------------------------------------
  2479.   # new method: create_battle_status_aid_window
  2480.   #--------------------------------------------------------------------------
  2481.   def create_battle_status_aid_window
  2482.     @status_aid_window = Window_BattleStatusAid.new
  2483.     @status_aid_window.status_window = @status_window
  2484.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2485.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2486.   end
  2487.   
  2488.   #--------------------------------------------------------------------------
  2489.   # overwrite method: create_help_window
  2490.   #--------------------------------------------------------------------------
  2491.   def create_help_window
  2492.     @help_window = Window_BattleHelp.new
  2493.     @help_window.hide
  2494.   end
  2495.   
  2496.   #--------------------------------------------------------------------------
  2497.   # new method: set_help_window
  2498.   #--------------------------------------------------------------------------
  2499.   def set_help_window
  2500.     @help_window.actor_window = @actor_window
  2501.     @help_window.enemy_window = @enemy_window
  2502.   end
  2503.   
  2504.   #--------------------------------------------------------------------------
  2505.   # alias method: create_party_command_window
  2506.   #--------------------------------------------------------------------------
  2507.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2508.   def create_party_command_window
  2509.     scene_battle_create_party_command_window_abe

  2510.   end
  2511.   
  2512.   #--------------------------------------------------------------------------
  2513.   # alias method: create_actor_command_window
  2514.   #--------------------------------------------------------------------------
  2515.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2516.   def create_actor_command_window
  2517.     scene_battle_create_actor_command_window_abe

  2518.   end
  2519.   
  2520.   #--------------------------------------------------------------------------
  2521.   # alias method: create_skill_window
  2522.   #--------------------------------------------------------------------------
  2523.   alias scene_battle_create_skill_window_abe create_skill_window
  2524.   def create_skill_window
  2525.     scene_battle_create_skill_window_abe
  2526.     @skill_window.height = @info_viewport.rect.height
  2527.     @skill_window.width = Graphics.width - @actor_command_window.width
  2528.     @skill_window.y = Graphics.height - @skill_window.height
  2529.   end
  2530.   
  2531.   #--------------------------------------------------------------------------
  2532.   # alias method: create_item_window
  2533.   #--------------------------------------------------------------------------
  2534.   alias scene_battle_create_item_window_abe create_item_window
  2535.   def create_item_window
  2536.     scene_battle_create_item_window_abe
  2537.     @item_window.height = @skill_window.height
  2538.     @item_window.width = @skill_window.width
  2539.     @item_window.y = Graphics.height - @item_window.height
  2540.   end
  2541.   
  2542.   #--------------------------------------------------------------------------
  2543.   # alias method: show_fast?
  2544.   #--------------------------------------------------------------------------
  2545.   alias scene_battle_show_fast_abe show_fast?
  2546.   def show_fast?
  2547.     return true if YEA::BATTLE::AUTO_FAST
  2548.     return scene_battle_show_fast_abe
  2549.   end
  2550.   
  2551.   #--------------------------------------------------------------------------
  2552.   # alias method: next_command
  2553.   #--------------------------------------------------------------------------
  2554.   alias scene_battle_next_command_abe next_command
  2555.   def next_command
  2556.     @status_window.show
  2557.     redraw_current_status
  2558.     @actor_command_window.show
  2559.     @status_aid_window.hide
  2560.     scene_battle_next_command_abe
  2561.   end
  2562.   
  2563.   #--------------------------------------------------------------------------
  2564.   # alias method: prior_command
  2565.   #--------------------------------------------------------------------------
  2566.   alias scene_battle_prior_command_abe prior_command
  2567.   def prior_command
  2568.     redraw_current_status
  2569.     scene_battle_prior_command_abe
  2570.   end
  2571.   
  2572.   #--------------------------------------------------------------------------
  2573.   # new method: redraw_current_status
  2574.   #--------------------------------------------------------------------------
  2575.   def redraw_current_status
  2576.     return if @status_window.index < 0
  2577.     @status_window.draw_item(@status_window.index)
  2578.   end
  2579.   
  2580.   #--------------------------------------------------------------------------
  2581.   # alias method: command_attack
  2582.   #--------------------------------------------------------------------------
  2583.   alias scene_battle_command_attack_abe command_attack
  2584.   def command_attack
  2585.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2586.     scene_battle_command_attack_abe
  2587.   end
  2588.   
  2589.   #--------------------------------------------------------------------------
  2590.   # alias method: command_skill
  2591.   #--------------------------------------------------------------------------
  2592.   alias scene_battle_command_skill_abe command_skill
  2593.   def command_skill
  2594.     scene_battle_command_skill_abe
  2595.     @status_window.hide
  2596.     @actor_command_window.hide
  2597.     @status_aid_window.show
  2598.   end
  2599.   
  2600.   #--------------------------------------------------------------------------
  2601.   # alias method: command_item
  2602.   #--------------------------------------------------------------------------
  2603.   alias scene_battle_command_item_abe command_item
  2604.   def command_item
  2605.     scene_battle_command_item_abe
  2606.     @status_window.hide
  2607.     @actor_command_window.hide
  2608.     @status_aid_window.show
  2609.   end
  2610.   
  2611.   #--------------------------------------------------------------------------
  2612.   # overwrite method: on_skill_ok
  2613.   #--------------------------------------------------------------------------
  2614.   def on_skill_ok
  2615.     @skill = @skill_window.item
  2616.     $game_temp.battle_aid = @skill
  2617.     BattleManager.actor.input.set_skill(@skill.id)
  2618.     BattleManager.actor.last_skill.object = @skill
  2619.     if @skill.for_opponent?
  2620.       select_enemy_selection
  2621.     elsif @skill.for_friend?
  2622.       select_actor_selection
  2623.     else
  2624.       @skill_window.hide
  2625.       next_command
  2626.       $game_temp.battle_aid = nil
  2627.     end
  2628.   end
  2629.   
  2630.   #--------------------------------------------------------------------------
  2631.   # alias method: on_skill_cancel
  2632.   #--------------------------------------------------------------------------
  2633.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2634.   def on_skill_cancel
  2635.     scene_battle_on_skill_cancel_abe
  2636.     @status_window.show
  2637.     @actor_command_window.show
  2638.     @status_aid_window.hide
  2639.   end
  2640.   
  2641.   #--------------------------------------------------------------------------
  2642.   # overwrite method: on_item_ok
  2643.   #--------------------------------------------------------------------------
  2644.   def on_item_ok
  2645.     @item = @item_window.item
  2646.     $game_temp.battle_aid = @item
  2647.     BattleManager.actor.input.set_item(@item.id)
  2648.     if @item.for_opponent?
  2649.       select_enemy_selection
  2650.     elsif @item.for_friend?
  2651.       select_actor_selection
  2652.     else
  2653.       @item_window.hide
  2654.       next_command
  2655.       $game_temp.battle_aid = nil
  2656.     end
  2657.     $game_party.last_item.object = @item
  2658.   end
  2659.   
  2660.   #--------------------------------------------------------------------------
  2661.   # alias method: on_item_cancel
  2662.   #--------------------------------------------------------------------------
  2663.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2664.   def on_item_cancel
  2665.     scene_battle_on_item_cancel_abe
  2666.     @status_window.show
  2667.     @actor_command_window.show
  2668.     @status_aid_window.hide
  2669.   end
  2670.   
  2671.   #--------------------------------------------------------------------------
  2672.   # alias method: select_actor_selection
  2673.   #--------------------------------------------------------------------------
  2674.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2675.   def select_actor_selection
  2676.     @status_aid_window.refresh
  2677.     scene_battle_select_actor_selection_abe
  2678.     @status_window.hide
  2679.     @skill_window.hide
  2680.     @item_window.hide
  2681.     @help_window.show
  2682.   end
  2683.   
  2684.   #--------------------------------------------------------------------------
  2685.   # alias method: on_actor_ok
  2686.   #--------------------------------------------------------------------------
  2687.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2688.   def on_actor_ok
  2689.     $game_temp.battle_aid = nil
  2690.     scene_battle_on_actor_ok_abe
  2691.     @status_window.show
  2692.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2693.       @actor_command_window.visible = !@confirm_command_window.visible
  2694.     else
  2695.       @actor_command_window.show
  2696.     end
  2697.     @status_aid_window.hide
  2698.   end
  2699.   
  2700.   #--------------------------------------------------------------------------
  2701.   # alias method: on_actor_cancel
  2702.   #--------------------------------------------------------------------------
  2703.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2704.   def on_actor_cancel
  2705.     BattleManager.actor.input.clear
  2706.     @status_aid_window.refresh
  2707.     $game_temp.battle_aid = nil
  2708.     scene_battle_on_actor_cancel_abe
  2709.     case @actor_command_window.current_symbol
  2710.     when :skill
  2711.       @skill_window.show
  2712.     when :item
  2713.       @item_window.show
  2714.     end
  2715.   end
  2716.   
  2717.   #--------------------------------------------------------------------------
  2718.   # alias method: select_enemy_selection
  2719.   #--------------------------------------------------------------------------
  2720.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2721.   def select_enemy_selection
  2722.     @status_aid_window.refresh
  2723.     scene_battle_select_enemy_selection_abe
  2724.     @help_window.show
  2725.   end
  2726.   #--------------------------------------------------------------------------
  2727.   # alias method: on_enemy_ok
  2728.   #--------------------------------------------------------------------------
  2729.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2730.   def on_enemy_ok
  2731.     $game_temp.battle_aid = nil
  2732.     scene_battle_on_enemy_ok_abe
  2733.   end
  2734.   
  2735.   #--------------------------------------------------------------------------
  2736.   # alias method: on_enemy_cancel
  2737.   #--------------------------------------------------------------------------
  2738.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2739.   def on_enemy_cancel
  2740.     BattleManager.actor.input.clear
  2741.     @status_aid_window.refresh
  2742.     $game_temp.battle_aid = nil
  2743.     scene_battle_on_enemy_cancel_abe
  2744.     if @skill_window.visible || @item_window.visible
  2745.       @help_window.show
  2746.     else
  2747.       @help_window.hide
  2748.     end
  2749.   end
  2750.   
  2751.   #--------------------------------------------------------------------------
  2752.   # alias method: battle_start
  2753.   #--------------------------------------------------------------------------
  2754.   alias scene_battle_battle_start_abe battle_start
  2755.   def battle_start
  2756.     scene_battle_battle_start_abe
  2757.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2758.     @party_command_window.deactivate
  2759.     if BattleManager.input_start
  2760.       command_fight
  2761.     else
  2762.       turn_start
  2763.     end
  2764.   end
  2765.   
  2766.   #--------------------------------------------------------------------------
  2767.   # overwrite method: turn_end
  2768.   #--------------------------------------------------------------------------
  2769.   def turn_end
  2770.     all_battle_members.each do |battler|
  2771.       battler.on_turn_end
  2772.       status_redraw_target(battler)
  2773.       @log_window.display_auto_affected_status(battler)
  2774.       @log_window.wait_and_clear
  2775.     end
  2776.    
  2777.     BattleManager.turn_end
  2778.     process_event
  2779.     start_party_command_selection
  2780.     return if end_battle_conditions?
  2781.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2782.     if BattleManager.input_start
  2783.       @party_command_window.deactivate
  2784.       command_fight
  2785.     else
  2786.       @party_command_window.deactivate
  2787.       turn_start
  2788.     end
  2789.   end
  2790.   
  2791.   #--------------------------------------------------------------------------
  2792.   # new method: end_battle_conditions?
  2793.   #--------------------------------------------------------------------------
  2794.   def end_battle_conditions?
  2795.     return true if $game_party.members.empty?
  2796.     return true if $game_party.all_dead?
  2797.     return true if $game_troop.all_dead?
  2798.     return true if BattleManager.aborting?
  2799.     return false
  2800.   end
  2801.   
  2802.   #--------------------------------------------------------------------------
  2803.   # overwrite method: execute_action
  2804.   #--------------------------------------------------------------------------
  2805.   def execute_action
  2806.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2807.     use_item
  2808.     @log_window.wait_and_clear
  2809.   end
  2810.   
  2811.   #--------------------------------------------------------------------------
  2812.   # overwrite method: apply_item_effects
  2813.   #--------------------------------------------------------------------------
  2814.   def apply_item_effects(target, item)
  2815.     if $imported["YEA-LunaticObjects"]
  2816.       lunatic_object_effect(:prepare, item, @subject, target)
  2817.     end
  2818.     target.item_apply(@subject, item)
  2819.     status_redraw_target(@subject)
  2820.     status_redraw_target(target) unless target == @subject
  2821.     @log_window.display_action_results(target, item)
  2822.     if $imported["YEA-LunaticObjects"]
  2823.       lunatic_object_effect(:during, item, @subject, target)
  2824.     end
  2825.     perform_collapse_check(target)
  2826.   end
  2827.   
  2828.   #--------------------------------------------------------------------------
  2829.   # overwite method: invoke_counter_attack
  2830.   #--------------------------------------------------------------------------
  2831.   def invoke_counter_attack(target, item)
  2832.     @log_window.display_counter(target, item)
  2833.     attack_skill = $data_skills[target.attack_skill_id]
  2834.     @subject.item_apply(target, attack_skill)
  2835.     status_redraw_target(@subject)
  2836.     status_redraw_target(target) unless target == @subject
  2837.     @log_window.display_action_results(@subject, attack_skill)
  2838.     perform_collapse_check(target)
  2839.     perform_collapse_check(@subject)
  2840.   end
  2841.   
  2842.   #--------------------------------------------------------------------------
  2843.   # new method: perform_collapse_check
  2844.   #--------------------------------------------------------------------------
  2845.   def perform_collapse_check(target)
  2846.     return if YEA::BATTLE::MSG_ADDED_STATES
  2847.     target.perform_collapse_effect if target.can_collapse?
  2848.     @log_window.wait
  2849.     @log_window.wait_for_effect
  2850.   end
  2851.   
  2852.   #--------------------------------------------------------------------------
  2853.   # overwrite method: show_attack_animation
  2854.   #--------------------------------------------------------------------------
  2855.   def show_attack_animation(targets)
  2856.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2857.     wait_for_animation
  2858.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2859.   end
  2860.   
  2861.   #--------------------------------------------------------------------------
  2862.   # overwrite method: show_normal_animation
  2863.   #--------------------------------------------------------------------------
  2864.   def show_normal_animation(targets, animation_id, mirror = false)
  2865.     animation = $data_animations[animation_id]
  2866.     return if animation.nil?
  2867.     ani_check = false
  2868.     targets.each do |target|
  2869.       if ani_check && target.animation_id <= 0
  2870.         target.pseudo_ani_id = animation_id
  2871.       else
  2872.         target.animation_id = animation_id
  2873.       end
  2874.       target.animation_mirror = mirror
  2875.       ani_check = true if animation.to_screen?
  2876.     end
  2877.   end
  2878.   
  2879.   #--------------------------------------------------------------------------
  2880.   # overwrite method: process_action_end
  2881.   #--------------------------------------------------------------------------
  2882.   def process_action_end
  2883.     @subject.on_action_end
  2884.     status_redraw_target(@subject)
  2885.     @log_window.display_auto_affected_status(@subject)
  2886.     @log_window.wait_and_clear
  2887.     @log_window.display_current_state(@subject)
  2888.     @log_window.wait_and_clear
  2889.     BattleManager.judge_win_loss
  2890.   end
  2891.   
  2892.   #--------------------------------------------------------------------------
  2893.   # overwrite method: use_item
  2894.   #--------------------------------------------------------------------------
  2895.   def use_item
  2896.     item = @subject.current_action.item
  2897.     @log_window.display_use_item(@subject, item)
  2898.     @subject.use_item(item)
  2899.     status_redraw_target(@subject)
  2900.     if $imported["YEA-LunaticObjects"]
  2901.       lunatic_object_effect(:before, item, @subject, @subject)
  2902.     end
  2903.     process_casting_animation if $imported["YEA-CastAnimations"]
  2904.     targets = @subject.current_action.make_targets.compact rescue []
  2905.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  2906.     targets.each {|target|
  2907.       if $imported["YEA-TargetManager"]
  2908.         target = alive_random_target(target, item) if item.for_random?
  2909.       end
  2910.       item.repeats.times { invoke_item(target, item) } }
  2911.     if $imported["YEA-LunaticObjects"]
  2912.       lunatic_object_effect(:after, item, @subject, @subject)
  2913.     end
  2914.   end
  2915.   
  2916.   #--------------------------------------------------------------------------
  2917.   # alias method: invoke_item
  2918.   #--------------------------------------------------------------------------
  2919.   alias scene_battle_invoke_item_abe invoke_item
  2920.   def invoke_item(target, item)
  2921.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  2922.     if target.dead? != item.for_dead_friend?
  2923.       @subject.last_target_index = target.index
  2924.       return
  2925.     end
  2926.     scene_battle_invoke_item_abe(target, item)
  2927.   end
  2928.   
  2929.   #--------------------------------------------------------------------------
  2930.   # new method: show_all_animation?
  2931.   #--------------------------------------------------------------------------
  2932.   def show_all_animation?(item)
  2933.     return true if item.one_animation
  2934.     return false if $data_animations[item.animation_id].nil?
  2935.     return false unless $data_animations[item.animation_id].to_screen?
  2936.     return true
  2937.   end
  2938.   
  2939.   #--------------------------------------------------------------------------
  2940.   # new method: separate_ani?
  2941.   #--------------------------------------------------------------------------
  2942.   def separate_ani?(target, item)
  2943.     return false if item.one_animation
  2944.     return false if $data_animations[item.animation_id].nil?
  2945.     return false if $data_animations[item.animation_id].to_screen?
  2946.     return target.dead? == item.for_dead_friend?
  2947.   end
  2948.   
  2949.   #--------------------------------------------------------------------------
  2950.   # new method: status_redraw_target
  2951.   #--------------------------------------------------------------------------
  2952.   def status_redraw_target(target)
  2953.     return unless target.actor?
  2954.     @status_window.draw_item($game_party.battle_members.index(target))
  2955.   end
  2956.   
  2957.   #--------------------------------------------------------------------------
  2958.   # alias method: start_party_command_selection
  2959.   #--------------------------------------------------------------------------
  2960.   alias start_party_command_selection_abe start_party_command_selection
  2961.   def start_party_command_selection
  2962.     @status_window.refresh unless scene_changing?
  2963.     start_party_command_selection_abe
  2964.   end
  2965.   
  2966.   #--------------------------------------------------------------------------
  2967.   # overwrite method: refresh_status
  2968.   #--------------------------------------------------------------------------
  2969.   def refresh_status; return; end
  2970.   
  2971.   #--------------------------------------------------------------------------
  2972.   # new method: refresh_autobattler_status_window
  2973.   #--------------------------------------------------------------------------
  2974.   def refresh_autobattler_status_window
  2975.     for member in $game_party.battle_members
  2976.       next unless member.auto_battle?
  2977.       @status_window.draw_item(member.index)
  2978.     end
  2979.   end
  2980.   
  2981.   #--------------------------------------------------------------------------
  2982.   # new method: hide_extra_gauges
  2983.   #--------------------------------------------------------------------------
  2984.   def hide_extra_gauges
  2985.     # Made for compatibility
  2986.   end
  2987.   
  2988.   #--------------------------------------------------------------------------
  2989.   # new method: show_extra_gauges
  2990.   #--------------------------------------------------------------------------
  2991.   def show_extra_gauges
  2992.     # Made for compatibility
  2993.   end
  2994.   
  2995. end # Scene_Battle

  2996. #==============================================================================
  2997. #
  2998. # ▼ End of File
  2999. #
  3000. #==============================================================================
复制代码

作者: 铅笔描绘的思念    时间: 2012-7-6 13:39
因为二刀流的原因吧
作者: 370599545    时间: 2012-7-6 13:41
LZ,我也下了这个,但为什么打不开???C:\Documents and Settings\Administrator\桌面
作者: 370599545    时间: 2012-7-6 13:45
这个!LZ是怎么打开的???

QQ截图20030101201514.png (4.04 KB, 下载次数: 30)

QQ截图20030101201514.png





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1