设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 647|回复: 3
打印 上一主题 下一主题

[已经解决] va系统如何实现一次技能攻击动画打出多段伤害来

[复制链接]

Lv2.观梦者

梦石
0
星屑
454
在线时间
68 小时
注册时间
2022-10-6
帖子
5
跳转到指定楼层
1
发表于 2023-7-28 11:07:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x

Lv1.梦旅人

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

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

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

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

  410. #==============================================================================
  411. # ¡ Switch
  412. #==============================================================================

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

  424. #==============================================================================
  425. # ¡ Colour
  426. #==============================================================================

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

  440. #==============================================================================
  441. # ¡ Icon
  442. #==============================================================================

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

  451. #==============================================================================
  452. # ¡ Numeric
  453. #==============================================================================

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

  464. #==============================================================================
  465. # ¡ DataManager
  466. #==============================================================================

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

  492. #==============================================================================
  493. # ¡ RPG::UsableItem
  494. #==============================================================================

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

  519. #==============================================================================
  520. # ¡ RPG::Enemy
  521. #==============================================================================

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

  550. #==============================================================================
  551. # ¡ RPG::Enemy
  552. #==============================================================================

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

  591. #==============================================================================
  592. # ¡ BattleManager
  593. #==============================================================================

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

  713. #==============================================================================
  714. # ¡ Game_System
  715. #==============================================================================

  716. class Game_System
  717.   
  718.   #--------------------------------------------------------------------------
  719.   # new method: battle_system
  720.   #--------------------------------------------------------------------------
  721.   def battle_system
  722.     if @battle_system.nil?
  723.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  724.     else
  725.       return battle_system_corrected(@battle_system)
  726.     end
  727.   end
  728.   
  729.   #--------------------------------------------------------------------------
  730.   # new method: set_battle_system
  731.   #--------------------------------------------------------------------------
  732.   def set_battle_system(type)
  733.     case type
  734.     when :dtb; @battle_system = :dtb
  735.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  736.     else;      @battle_system = :dtb
  737.     end
  738.   end
  739.   
  740.   #--------------------------------------------------------------------------
  741.   # new method: battle_system_corrected
  742.   #--------------------------------------------------------------------------
  743.   def battle_system_corrected(type)
  744.     case type
  745.     when :dtb; return :dtb
  746.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  747.     else;      return :dtb
  748.     end
  749.   end
  750.   
  751. end # Game_System

  752. #==============================================================================
  753. # ¡ Sprite_Base
  754. #==============================================================================

  755. class Sprite_Base < Sprite
  756.   
  757.   #--------------------------------------------------------------------------
  758.   # new method: start_pseudo_animation
  759.   #--------------------------------------------------------------------------
  760.   unless $imported["YEA-CoreEngine"]
  761.   def start_pseudo_animation(animation, mirror = false)
  762.     dispose_animation
  763.     @animation = animation
  764.     return if @animation.nil?
  765.     @ani_mirror = mirror
  766.     set_animation_rate
  767.     @ani_duration = @animation.frame_max * @ani_rate + 1
  768.     @ani_sprites = []
  769.   end
  770.   end # $imported["YEA-CoreEngine"]
  771.   
  772. end # Sprite_Base

  773. #==============================================================================
  774. # ¡ Sprite_Battler
  775. #==============================================================================

  776. class Sprite_Battler < Sprite_Base
  777.   
  778.   #--------------------------------------------------------------------------
  779.   # public instance variables
  780.   #--------------------------------------------------------------------------
  781.   attr_accessor :effect_type
  782.   attr_accessor :battler_visible
  783.   attr_accessor :popups
  784.   
  785.   #--------------------------------------------------------------------------
  786.   # alias method: initialize
  787.   #--------------------------------------------------------------------------
  788.   alias sprite_battler_initialize_abe initialize
  789.   def initialize(viewport, battler = nil)
  790.     sprite_battler_initialize_abe(viewport, battler)
  791.     @popups = []
  792.     @popup_flags = []
  793.   end
  794.   
  795.   #--------------------------------------------------------------------------
  796.   # alias method: update_bitmap
  797.   #--------------------------------------------------------------------------
  798.   alias sprite_battler_update_bitmap_abe update_bitmap
  799.   def update_bitmap
  800.     return if @battler.actor? && @battler.battler_name == ""
  801.     sprite_battler_update_bitmap_abe
  802.   end
  803.   
  804.   #--------------------------------------------------------------------------
  805.   # alias method: setup_new_animation
  806.   #--------------------------------------------------------------------------
  807.   unless $imported["YEA-CoreEngine"]
  808.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  809.   def setup_new_animation
  810.     sprite_battler_setup_new_animation_abe
  811.     return if @battler.pseudo_ani_id <= 0
  812.     animation = $data_animations[@battler.pseudo_ani_id]
  813.     mirror = @battler.animation_mirror
  814.     start_pseudo_animation(animation, mirror)
  815.     @battler.pseudo_ani_id = 0
  816.   end
  817.   end # $imported["YEA-CoreEngine"]
  818.   
  819.   #--------------------------------------------------------------------------
  820.   # alias method: setup_new_effect
  821.   #--------------------------------------------------------------------------
  822.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  823.   def setup_new_effect
  824.     sprite_battler_setup_new_effect_abe
  825.     setup_popups
  826.   end
  827.   
  828.   #--------------------------------------------------------------------------
  829.   # new method: setup_popups
  830.   #--------------------------------------------------------------------------
  831.   def setup_popups
  832.     return unless @battler.use_sprite?
  833.     @battler.popups = [] if @battler.popups.nil?
  834.     return if @battler.popups == []
  835.     array = @battler.popups.shift
  836.     create_new_popup(array[0], array[1], array[2])
  837.   end
  838.   
  839.   #--------------------------------------------------------------------------
  840.   # new method: create_new_popup
  841.   #--------------------------------------------------------------------------
  842.   def create_new_popup(value, rules, flags)
  843.     return if @battler == nil
  844.     return if flags & @popup_flags != []
  845.     array = YEA::BATTLE::POPUP_RULES[rules]
  846.     for popup in @popups
  847.       popup.y -= 24
  848.     end
  849.     return unless SceneManager.scene.is_a?(Scene_Battle)
  850.     return if SceneManager.scene.spriteset.nil?
  851.     view = SceneManager.scene.spriteset.viewportPopups
  852.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  853.     @popups.push(new_popup)
  854.     @popup_flags.push("weakness") if flags.include?("weakness")
  855.     @popup_flags.push("resistant") if flags.include?("resistant")
  856.     @popup_flags.push("immune") if flags.include?("immune")
  857.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  858.   end
  859.   
  860.   #--------------------------------------------------------------------------
  861.   # alias method: update_effect
  862.   #--------------------------------------------------------------------------
  863.   alias sprite_battler_update_effect_abe update_effect
  864.   def update_effect
  865.     sprite_battler_update_effect_abe
  866.     update_popups
  867.   end
  868.   
  869.   #--------------------------------------------------------------------------
  870.   # new method: update_popups
  871.   #--------------------------------------------------------------------------
  872.   def update_popups
  873.     for popup in @popups
  874.       popup.update
  875.       next unless popup.opacity <= 0
  876.       popup.bitmap.dispose
  877.       popup.dispose
  878.       @popups.delete(popup)
  879.       popup = nil
  880.     end
  881.     @popup_flags = [] if @popups == [] && @popup_flags != []
  882.     return unless SceneManager.scene_is?(Scene_Battle)
  883.     if @current_active_battler != SceneManager.scene.subject
  884.       @current_active_battler = SceneManager.scene.subject
  885.       @popup_flags = []
  886.     end
  887.   end
  888.   
  889. end # Sprite_Battler

  890. #==============================================================================
  891. # ¡ Sprite_Popup
  892. #==============================================================================

  893. class Sprite_Popup < Sprite_Base
  894.   
  895.   #--------------------------------------------------------------------------
  896.   # public instance variables
  897.   #--------------------------------------------------------------------------
  898.   attr_accessor :flags
  899.   
  900.   #--------------------------------------------------------------------------
  901.   # initialize
  902.   #--------------------------------------------------------------------------
  903.   def initialize(viewport, battler, value, rules, flags)
  904.     super(viewport)
  905.     @value = value
  906.     @rules = rules
  907.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  908.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  909.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  910.     @flags = flags
  911.     @battler = battler
  912.     create_popup_bitmap
  913.   end
  914.   
  915.   #--------------------------------------------------------------------------
  916.   # create_popup_bitmap
  917.   #--------------------------------------------------------------------------
  918.   def create_popup_bitmap
  919.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  920.     bw = Graphics.width
  921.     bw += 48 if @flags.include?("state")
  922.     bh = Font.default_size * 3
  923.     bitmap = Bitmap.new(bw, bh)
  924.     bitmap.font.name = rules_array[8]
  925.     size = @flags.include?("critical") ? rules_array[2] * 1.5 : rules_array[2]

  926.     bitmap.font.size = size
  927.     bitmap.font.bold = rules_array[3]
  928.     bitmap.font.italic = rules_array[4]
  929.     if flags.include?("critical")
  930.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  931.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  932.     else
  933.       bitmap.font.out_color.set(0, 0, 0, 255)
  934.     end
  935.     dx = 0; dy = 0; dw = 0
  936.     dx += 24 if @flags.include?("state")
  937.     dw += 24 if @flags.include?("state")
  938.     if @flags.include?("state") || @flags.include?("buff")
  939.       c_width = bitmap.text_size(@value).width
  940.       icon_bitmap = $game_temp.iconset
  941.       icon_index = flag_state_icon
  942.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  943.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  944.     end
  945.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  946.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  947.     self.bitmap = bitmap
  948.     self.x = @battler.screen_x
  949.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  950.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  951.     self.y = @battler.screen_y - @battler.sprite.oy/2
  952.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  953.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  954.     self.ox = bw/2; self.oy = bh/2
  955.     self.zoom_x = self.zoom_y = rules_array[0]
  956.     if @flags.include?("no zoom")
  957.       self.zoom_x = self.zoom_y = rules_array[1]
  958.     end
  959.     @target_zoom = rules_array[1]
  960.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  961.     self.z = 500
  962.   end
  963.   
  964.   #--------------------------------------------------------------------------
  965.   # update
  966.   #--------------------------------------------------------------------------
  967.   def update
  968.     super
  969.     #---
  970.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  971.       @hue_duration = 6 if @hue_duration == nil || @hue_duration == 0
  972.       @hue_duration -= 1
  973.       self.bitmap.hue_change(45) if @hue_duration <= 0
  974.     end
  975.     #---
  976.     if @zoom_direction == "up"
  977.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  978.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  979.     else
  980.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  981.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  982.     end
  983.     #---
  984.     @full -= 1
  985.     return if @full > 0
  986.     self.y -= 1
  987.     self.opacity -= @fade
  988.   end
  989.   
  990.   #--------------------------------------------------------------------------
  991.   # flag_state_icon
  992.   #--------------------------------------------------------------------------
  993.   def flag_state_icon
  994.     for item in @flags; return item if item.is_a?(Integer); end
  995.     return 0
  996.   end
  997.   
  998. end # Sprite_Popup

  999. #==============================================================================
  1000. # ¡ Spriteset_Battle
  1001. #==============================================================================

  1002. class Spriteset_Battle
  1003.   
  1004.   #--------------------------------------------------------------------------
  1005.   # public instance variables
  1006.   #--------------------------------------------------------------------------
  1007.   attr_accessor :actor_sprites
  1008.   attr_accessor :enemy_sprites
  1009.   attr_accessor :viewport1
  1010.   attr_accessor :viewportPopups
  1011.   
  1012.   #--------------------------------------------------------------------------
  1013.   # alias method: create_viewports
  1014.   #--------------------------------------------------------------------------
  1015.   alias spriteset_battle_create_viewports_abe create_viewports
  1016.   def create_viewports
  1017.     spriteset_battle_create_viewports_abe
  1018.     @viewportPopups = Viewport.new
  1019.     @viewportPopups.z = 200
  1020.   end
  1021.   
  1022.   #--------------------------------------------------------------------------
  1023.   # alias method: dispose_viewports
  1024.   #--------------------------------------------------------------------------
  1025.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1026.   def dispose_viewports
  1027.     spriteset_battle_dispose_viewports_abe
  1028.     @viewportPopups.dispose
  1029.   end
  1030.   
  1031.   #--------------------------------------------------------------------------
  1032.   # alias method: update_viewports
  1033.   #--------------------------------------------------------------------------
  1034.   alias spriteset_battle_update_viewports_abe update_viewports
  1035.   def update_viewports
  1036.     spriteset_battle_update_viewports_abe
  1037.     @viewportPopups.update
  1038.   end
  1039.   
  1040. end # Spriteset_Battle

  1041. #==============================================================================
  1042. # ¡ Game_Temp
  1043. #==============================================================================

  1044. class Game_Temp
  1045.   
  1046.   #--------------------------------------------------------------------------
  1047.   # public instance variables
  1048.   #--------------------------------------------------------------------------
  1049.   attr_accessor :battle_aid
  1050.   attr_accessor :evaluating
  1051.   attr_accessor :iconset
  1052.   
  1053.   #--------------------------------------------------------------------------
  1054.   # alias method: initialize
  1055.   #--------------------------------------------------------------------------
  1056.   alias game_temp_initialize_abe initialize
  1057.   def initialize
  1058.     game_temp_initialize_abe
  1059.     @iconset = Cache.system("Iconset")
  1060.   end
  1061.   
  1062. end # Game_Temp

  1063. #==============================================================================
  1064. # ¡ Game_Action
  1065. #==============================================================================

  1066. class Game_Action
  1067.   
  1068.   #--------------------------------------------------------------------------
  1069.   # overwrite method: speed
  1070.   #--------------------------------------------------------------------------
  1071.   def speed
  1072.     speed = subject.agi
  1073.     speed += item.speed if item
  1074.     speed += subject.atk_speed if attack?
  1075.     return speed
  1076.   end
  1077.   
  1078.   #--------------------------------------------------------------------------
  1079.   # alias method: evaluate_item_with_target
  1080.   #--------------------------------------------------------------------------
  1081.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1082.   def evaluate_item_with_target(target)
  1083.     $game_temp.evaluating = true
  1084.     result = evaluate_item_with_target_abe(target)
  1085.     $game_temp.evaluating = false
  1086.     return result
  1087.   end
  1088.   
  1089. end # Game_Action

  1090. #==============================================================================
  1091. # ¡ Game_ActionResult
  1092. #==============================================================================

  1093. class Game_ActionResult
  1094.   
  1095.   #--------------------------------------------------------------------------
  1096.   # alias method: clear
  1097.   #--------------------------------------------------------------------------
  1098.   alias game_actionresult_clear_abe clear
  1099.   def clear
  1100.     game_actionresult_clear_abe
  1101.     clear_stored_damage
  1102.   end
  1103.   
  1104.   #--------------------------------------------------------------------------
  1105.   # new method: clear_stored_damage
  1106.   #--------------------------------------------------------------------------
  1107.   def clear_stored_damage
  1108.     @stored_hp_damage = 0
  1109.     @stored_mp_damage = 0
  1110.     @stored_tp_damage = 0
  1111.     @stored_hp_drain = 0
  1112.     @stored_mp_drain = 0
  1113.   end
  1114.   
  1115.   #--------------------------------------------------------------------------
  1116.   # new method: store_damage
  1117.   #--------------------------------------------------------------------------
  1118.   def store_damage
  1119.     @stored_hp_damage += @hp_damage
  1120.     @stored_mp_damage += @mp_damage
  1121.     @stored_tp_damage += @tp_damage
  1122.     @stored_hp_drain += @hp_drain
  1123.     @stored_mp_drain += @mp_drain
  1124.   end
  1125.   
  1126.   #--------------------------------------------------------------------------
  1127.   # new method: restore_damage
  1128.   #--------------------------------------------------------------------------
  1129.   def restore_damage
  1130.     @hp_damage = @stored_hp_damage
  1131.     @mp_damage = @stored_mp_damage
  1132.     @tp_damage = @stored_tp_damage
  1133.     @hp_drain = @stored_hp_drain
  1134.     @mp_drain = @stored_mp_drain
  1135.     clear_stored_damage
  1136.   end
  1137.   
  1138. end # Game_ActionResult

  1139. #==============================================================================
  1140. # ¡ Game_BattlerBase
  1141. #==============================================================================

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

  1340. #==============================================================================
  1341. # ¡ Game_Battler
  1342. #==============================================================================

  1343. class Game_Battler < Game_BattlerBase
  1344.   
  1345.   #--------------------------------------------------------------------------
  1346.   # public instance variables
  1347.   #--------------------------------------------------------------------------
  1348.   attr_accessor :pseudo_ani_id
  1349.   
  1350.   #--------------------------------------------------------------------------
  1351.   # alias method: on_battle_end
  1352.   #--------------------------------------------------------------------------
  1353.   alias game_battler_on_battle_end_abe on_battle_end
  1354.   def on_battle_end
  1355.     game_battler_on_battle_end_abe
  1356.     @popups = []
  1357.   end
  1358.   
  1359.   #--------------------------------------------------------------------------
  1360.   # alias method: clear_sprite_effects
  1361.   #--------------------------------------------------------------------------
  1362.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1363.   def clear_sprite_effects
  1364.     game_battler_clear_sprite_effects_abe
  1365.     @pseudo_ani_id = 0
  1366.   end
  1367.   
  1368.   #--------------------------------------------------------------------------
  1369.   # alias method: item_apply
  1370.   #--------------------------------------------------------------------------
  1371.   alias game_battler_item_apply_abe item_apply
  1372.   def item_apply(user, item)
  1373.     game_battler_item_apply_abe(user, item)
  1374.     make_miss_popups(user, item)
  1375.   end
  1376.   
  1377.   #--------------------------------------------------------------------------
  1378.   # alias method: make_damage_value
  1379.   #--------------------------------------------------------------------------
  1380.   alias game_battler_make_damage_value_abe make_damage_value
  1381.   def make_damage_value(user, item)
  1382.     game_battler_make_damage_value_abe(user, item)
  1383.     rate = item_element_rate(user, item)
  1384.     make_rate_popup(rate) unless $game_temp.evaluating
  1385.   end
  1386.   
  1387.   #--------------------------------------------------------------------------
  1388.   # alias method: execute_damage
  1389.   #--------------------------------------------------------------------------
  1390.   alias game_battler_execute_damage_abe execute_damage
  1391.   def execute_damage(user)
  1392.     game_battler_execute_damage_abe(user)
  1393.     make_damage_popups(user)
  1394.   end
  1395.   
  1396.   #--------------------------------------------------------------------------
  1397.   # alias method: item_effect_recover_hp
  1398.   #--------------------------------------------------------------------------
  1399.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1400.   def item_effect_recover_hp(user, item, effect)
  1401.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1402.     make_damage_popups(user)
  1403.   end
  1404.   
  1405.   #--------------------------------------------------------------------------
  1406.   # alias method: item_effect_recover_mp
  1407.   #--------------------------------------------------------------------------
  1408.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1409.   def item_effect_recover_mp(user, item, effect)
  1410.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1411.     make_damage_popups(user)
  1412.   end
  1413.   
  1414.   #--------------------------------------------------------------------------
  1415.   # alias method: item_effect_gain_tp
  1416.   #--------------------------------------------------------------------------
  1417.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1418.   def item_effect_gain_tp(user, item, effect)
  1419.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1420.     make_damage_popups(user)
  1421.   end
  1422.   
  1423.   #--------------------------------------------------------------------------
  1424.   # alias method: item_user_effect
  1425.   #--------------------------------------------------------------------------
  1426.   alias game_battler_item_user_effect_abe item_user_effect
  1427.   def item_user_effect(user, item)
  1428.     game_battler_item_user_effect_abe(user, item)
  1429.     @result.restore_damage
  1430.   end
  1431.   
  1432.   #--------------------------------------------------------------------------
  1433.   # alias method: add_new_state
  1434.   #--------------------------------------------------------------------------
  1435.   alias game_battler_add_new_state_abe add_new_state
  1436.   def add_new_state(state_id)
  1437.     game_battler_add_new_state_abe(state_id)
  1438.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1439.   end
  1440.   
  1441.   #--------------------------------------------------------------------------
  1442.   # alias method: add_buff
  1443.   #--------------------------------------------------------------------------
  1444.   alias game_battler_add_buff_abe add_buff
  1445.   def add_buff(param_id, turns)
  1446.     make_buff_popup(param_id, true)
  1447.     game_battler_add_buff_abe(param_id, turns)
  1448.   end
  1449.   
  1450.   #--------------------------------------------------------------------------
  1451.   # alias method: add_debuff
  1452.   #--------------------------------------------------------------------------
  1453.   alias game_battler_add_debuff_abe add_debuff
  1454.   def add_debuff(param_id, turns)
  1455.     make_buff_popup(param_id, false)
  1456.     game_battler_add_debuff_abe(param_id, turns)
  1457.   end
  1458.   
  1459.   #--------------------------------------------------------------------------
  1460.   # alias method: regenerate_all
  1461.   #--------------------------------------------------------------------------
  1462.   alias game_battler_regenerate_all_abe regenerate_all
  1463.   def regenerate_all
  1464.     game_battler_regenerate_all_abe
  1465.     return unless alive?
  1466.     make_damage_popups(self)
  1467.   end
  1468.   
  1469.   #--------------------------------------------------------------------------
  1470.   # new method: can_collapse?
  1471.   #--------------------------------------------------------------------------
  1472.   def can_collapse?
  1473.     return false unless dead?
  1474.     unless actor?
  1475.       return false unless sprite.battler_visible
  1476.       array = [:collapse, :boss_collapse, :instant_collapse]
  1477.       return false if array.include?(sprite.effect_type)
  1478.     end
  1479.     return true
  1480.   end
  1481.   
  1482.   #--------------------------------------------------------------------------
  1483.   # new method: draw_mp?
  1484.   #--------------------------------------------------------------------------
  1485.   def draw_mp?; return true; end
  1486.   
  1487.   #--------------------------------------------------------------------------
  1488.   # new method: draw_tp?
  1489.   #--------------------------------------------------------------------------
  1490.   def draw_tp?
  1491.     return $data_system.opt_display_tp
  1492.   end
  1493.   
  1494. end # Game_Battler

  1495. #==============================================================================
  1496. # ¡ Game_Actor
  1497. #==============================================================================

  1498. class Game_Actor < Game_Battler
  1499.   
  1500.   #--------------------------------------------------------------------------
  1501.   # overwrite method: perform_damage_effect
  1502.   #--------------------------------------------------------------------------
  1503.   def perform_damage_effect
  1504.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1505.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1506.     Sound.play_actor_damage
  1507.   end
  1508.   
  1509.   #--------------------------------------------------------------------------
  1510.   # overwrite method: use_sprite?
  1511.   #--------------------------------------------------------------------------
  1512.   def use_sprite?; return true; end
  1513.    
  1514.   #--------------------------------------------------------------------------
  1515.   # new method: screen_x
  1516.   #--------------------------------------------------------------------------
  1517.   def screen_x
  1518.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1519.     status_window = SceneManager.scene.status_window
  1520.     return 0 if status_window.nil?
  1521.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1522.     ext = SceneManager.scene.info_viewport.ox
  1523.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1524.     constant = 128 + 12
  1525.     return constant + rect.x + item_rect_width / 2 - ext
  1526.   end
  1527.   
  1528.   #--------------------------------------------------------------------------
  1529.   # new method: screen_y
  1530.   #--------------------------------------------------------------------------
  1531.   def screen_y
  1532.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1533.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1534.     return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  1535.   end
  1536.   
  1537.   #--------------------------------------------------------------------------
  1538.   # new method: screen_z
  1539.   #--------------------------------------------------------------------------
  1540.   def screen_z; return 100; end
  1541.   
  1542.   #--------------------------------------------------------------------------
  1543.   # new method: sprite
  1544.   #--------------------------------------------------------------------------
  1545.   def sprite
  1546.     index = $game_party.battle_members.index(self)
  1547.     return SceneManager.scene.spriteset.actor_sprites[index]
  1548.   end
  1549.   
  1550.   #--------------------------------------------------------------------------
  1551.   # new method: draw_mp?
  1552.   #--------------------------------------------------------------------------
  1553.   def draw_mp?
  1554.     return true unless draw_tp?
  1555.     for skill in skills
  1556.       next unless added_skill_types.include?(skill.stype_id)
  1557.       return true if skill.mp_cost > 0
  1558.     end
  1559.     return false
  1560.   end
  1561.   
  1562.   #--------------------------------------------------------------------------
  1563.   # new method: draw_tp?
  1564.   #--------------------------------------------------------------------------
  1565.   def draw_tp?
  1566.     return false unless $data_system.opt_display_tp
  1567.     for skill in skills
  1568.       next unless added_skill_types.include?(skill.stype_id)
  1569.       return true if skill.tp_cost > 0
  1570.     end
  1571.     return false
  1572.   end
  1573.   
  1574.   #--------------------------------------------------------------------------
  1575.   # alias method: input
  1576.   #--------------------------------------------------------------------------
  1577.   alias game_actor_input_abe input
  1578.   def input
  1579.     if @actions.nil?
  1580.       make_actions
  1581.       @action_input_index = 0
  1582.     end
  1583.     if @actions[@action_input_index].nil?
  1584.       @actions[@action_input_index] = Game_Action.new(self)
  1585.     end
  1586.     return game_actor_input_abe
  1587.   end
  1588.   
  1589. end # Game_Actor

  1590. #==============================================================================
  1591. # ¡ Game_Enemy
  1592. #==============================================================================

  1593. class Game_Enemy < Game_Battler
  1594.   
  1595.   #--------------------------------------------------------------------------
  1596.   # overwrite method: perform_damage_effect
  1597.   #--------------------------------------------------------------------------
  1598.   def perform_damage_effect
  1599.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1600.     Sound.play_enemy_damage
  1601.   end
  1602.   
  1603.   #--------------------------------------------------------------------------
  1604.   # new methods: attack_animation_id
  1605.   #--------------------------------------------------------------------------
  1606.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1607.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1608.   
  1609.   #--------------------------------------------------------------------------
  1610.   # new method: sprite
  1611.   #--------------------------------------------------------------------------
  1612.   def sprite
  1613.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1614.   end
  1615.   
  1616. end # Game_Enemy

  1617. #==============================================================================
  1618. # ¡ Game_Unit
  1619. #==============================================================================

  1620. class Game_Unit
  1621.   
  1622.   #--------------------------------------------------------------------------
  1623.   # alias method: make_actions
  1624.   #--------------------------------------------------------------------------
  1625.   alias game_unit_make_actions_abe make_actions
  1626.   def make_actions
  1627.     game_unit_make_actions_abe
  1628.     refresh_autobattler_status_window
  1629.   end
  1630.   
  1631.   #--------------------------------------------------------------------------
  1632.   # new method: refresh_autobattler_status_window
  1633.   #--------------------------------------------------------------------------
  1634.   def refresh_autobattler_status_window
  1635.     return unless SceneManager.scene_is?(Scene_Battle)
  1636.     return unless self.is_a?(Game_Party)
  1637.     SceneManager.scene.refresh_autobattler_status_window
  1638.   end
  1639.   
  1640. end # Game_Unit

  1641. #==============================================================================
  1642. # ¡ Window_PartyCommand
  1643. #==============================================================================

  1644. class Window_PartyCommand < Window_Command
  1645.   
  1646.   #--------------------------------------------------------------------------
  1647.   # overwrite method: process_handling
  1648.   #--------------------------------------------------------------------------
  1649.   def process_handling
  1650.     return unless open? && active
  1651.     return process_dir6 if Input.repeat?(:RIGHT)
  1652.     return super
  1653.   end
  1654.   
  1655.   #--------------------------------------------------------------------------
  1656.   # new method: process_dir6
  1657.   #--------------------------------------------------------------------------
  1658.   def process_dir6
  1659.     Sound.play_cursor
  1660.     Input.update
  1661.     deactivate
  1662.     call_handler(:dir6)
  1663.   end
  1664.   
  1665. end # Window_PartyCommand

  1666. #==============================================================================
  1667. # ¡ Window_ActorCommand
  1668. #==============================================================================

  1669. class Window_ActorCommand < Window_Command
  1670.   
  1671.   #--------------------------------------------------------------------------
  1672.   # overwrite method: process_handling
  1673.   #--------------------------------------------------------------------------
  1674.   def process_handling
  1675.     return unless open? && active
  1676.     return process_dir4 if Input.repeat?(:LEFT)
  1677.     return process_dir6 if Input.repeat?(:RIGHT)
  1678.     return super
  1679.   end
  1680.   
  1681.   #--------------------------------------------------------------------------
  1682.   # new method: process_dir4
  1683.   #--------------------------------------------------------------------------
  1684.   def process_dir4
  1685.     Sound.play_cursor
  1686.     Input.update
  1687.     deactivate
  1688.     call_handler(:cancel)
  1689.   end
  1690.   
  1691.   #--------------------------------------------------------------------------
  1692.   # new method: process_dir6
  1693.   #--------------------------------------------------------------------------
  1694.   def process_dir6
  1695.     Sound.play_cursor
  1696.     Input.update
  1697.     deactivate
  1698.     call_handler(:dir6)
  1699.   end
  1700.   
  1701. end # Window_ActorCommand

  1702. #==============================================================================
  1703. # ¡ Window_BattleStatus
  1704. #==============================================================================

  1705. class Window_BattleStatus < Window_Selectable
  1706.   
  1707.   #--------------------------------------------------------------------------
  1708.   # overwrite method: initialize
  1709.   #--------------------------------------------------------------------------
  1710.   def initialize
  1711.     super(0, 0, window_width, window_height)
  1712.     self.openness = 0
  1713.     @party = $game_party.battle_members.clone
  1714.   end
  1715.   
  1716.   #--------------------------------------------------------------------------
  1717.   # overwrite method: col_max
  1718.   #--------------------------------------------------------------------------
  1719.   def col_max; return $game_party.max_battle_members; end
  1720.   
  1721.   #--------------------------------------------------------------------------
  1722.   # new method: battle_members
  1723.   #--------------------------------------------------------------------------
  1724.   def battle_members; return $game_party.battle_members; end
  1725.   
  1726.   #--------------------------------------------------------------------------
  1727.   # new method: actor
  1728.   #--------------------------------------------------------------------------
  1729.   def actor; return battle_members[@index]; end
  1730.   
  1731.   #--------------------------------------------------------------------------
  1732.   # overwrite method: update
  1733.   #--------------------------------------------------------------------------
  1734.   def update
  1735.     super
  1736.     return if @party == $game_party.battle_members
  1737.     @party = $game_party.battle_members.clone
  1738.     refresh
  1739.   end
  1740.   
  1741.   #--------------------------------------------------------------------------
  1742.   # overwrite method: draw_item
  1743.   #--------------------------------------------------------------------------
  1744.   def draw_item(index)
  1745.     return if index.nil?
  1746.     clear_item(index)
  1747.     actor = battle_members[index]
  1748.     rect = item_rect(index)
  1749.     return if actor.nil?
  1750.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1751.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1752.     draw_actor_action(actor, rect.x, rect.y)
  1753.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1754.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1755.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1756.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1757.     if draw_tp?(actor) && draw_mp?(actor) && ( actor.state?(98) || actor.id!=5 )
  1758.       dw = rect.width/2-2
  1759.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1760.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1761.       dw = rect.width - rect.width/2 - 2
  1762.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1763.     elsif ( draw_tp?(actor) && !draw_mp?(actor) ) || actor.id==5
  1764.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1765.     else
  1766.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1767.     end
  1768.   end
  1769.   
  1770.   #--------------------------------------------------------------------------
  1771.   # overwrite method: item_rect
  1772.   #--------------------------------------------------------------------------
  1773.   def item_rect(index)
  1774.     rect = Rect.new
  1775.     if $game_variables[51] > 0
  1776.       rect.width = contents.width / $game_variables[51]
  1777.     else
  1778.       rect.width = contents.width / 4
  1779.     end
  1780.     rect.height = contents.height
  1781.     rect.x = index * rect.width
  1782.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1783.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1784.     end
  1785.     rect.y = 0
  1786.     return rect
  1787.   end
  1788.   
  1789.   #--------------------------------------------------------------------------
  1790.   # overwrite method: draw_face
  1791.   #--------------------------------------------------------------------------
  1792.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1793.     bitmap = Cache.face(face_name)
  1794.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1795.     fy = face_index / 4 * 96 + 2
  1796.     fw = [item_rect(0).width - 4, 92].min
  1797.     rect = Rect.new(fx, fy, fw, 92)
  1798.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1799.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1800.     bitmap.dispose
  1801.   end
  1802.   
  1803.   #--------------------------------------------------------------------------
  1804.   # overwrite method: draw_actor_name
  1805.   #--------------------------------------------------------------------------
  1806.   def draw_actor_name(actor, dx, dy, dw = 112)
  1807.     reset_font_settings
  1808.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1809.     change_color(hp_color(actor))
  1810.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1811.   end
  1812.   
  1813.   #--------------------------------------------------------------------------
  1814.   # new method: draw_actor_action
  1815.   #--------------------------------------------------------------------------
  1816.   def draw_actor_action(actor, dx, dy)
  1817.     draw_icon(action_icon(actor), dx, dy)
  1818.   end
  1819.   
  1820.   #--------------------------------------------------------------------------
  1821.   # new method: action_icon
  1822.   #--------------------------------------------------------------------------
  1823.   def action_icon(actor)
  1824.     return Icon.no_action if actor.current_action.nil?
  1825.     return Icon.no_action if actor.current_action.item.nil?
  1826.     return actor.current_action.item.icon_index
  1827.   end
  1828.   
  1829.   #--------------------------------------------------------------------------
  1830.   # new method: draw_tp?
  1831.   #--------------------------------------------------------------------------
  1832.   def draw_tp?(actor)
  1833.     return actor.draw_tp?
  1834.   end
  1835.   
  1836.   #--------------------------------------------------------------------------
  1837.   # new method: draw_mp?
  1838.   #--------------------------------------------------------------------------
  1839.   def draw_mp?(actor)
  1840.     return actor.draw_mp?
  1841.   end
  1842.   
  1843.   #--------------------------------------------------------------------------
  1844.   # overwrite method: draw_current_and_max_values
  1845.   #--------------------------------------------------------------------------
  1846.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1847.     change_color(color1)
  1848.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1849.   end
  1850.   
  1851.   #--------------------------------------------------------------------------
  1852.   # overwrite method: draw_current_and_max_values HIDDEN
  1853.   #--------------------------------------------------------------------------
  1854.   def draw_current_and_max_values_HIDDEN(dx, dy, dw, color1,color2)
  1855.     change_color(color1)
  1856.     draw_text(dx, dy, dw, line_height, "?", 2)
  1857.   end
  1858.   
  1859.   #--------------------------------------------------------------------------
  1860.   # overwrite method: draw_actor_hp
  1861.   #--------------------------------------------------------------------------
  1862.   def draw_actor_hp(actor, dx, dy, width = 124)
  1863.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1864.     change_color(system_color)
  1865.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1866.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1867.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1868.       hp_color(actor), normal_color)
  1869.     end
  1870.    
  1871.   #--------------------------------------------------------------------------
  1872.   # overwrite method: draw_actor_mp
  1873.   #--------------------------------------------------------------------------
  1874.   def draw_actor_mp(actor, dx, dy, width = 124)
  1875.     if actor.state?(89)
  1876.       draw_gauge(dx, dy, width, 100, normal_color, gauge_back_color)
  1877.     else
  1878.       draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1879.     end
  1880.     change_color(system_color)
  1881.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1882.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1883.     if actor.state?(95)
  1884.       draw_current_and_max_values_HIDDEN(dx, dy+cy, width, mp_color(actor), normal_color)
  1885.     else
  1886.       draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1887.       mp_color(actor), normal_color)
  1888.     end
  1889.     end
  1890.    
  1891.   #--------------------------------------------------------------------------
  1892.   # overwrite method: draw_actor_tp
  1893.   #--------------------------------------------------------------------------
  1894.   def draw_actor_tp(actor, dx, dy, width = 124)
  1895.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1896.     change_color(system_color)
  1897.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1898.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1899.     change_color(tp_color(actor))
  1900.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1901.   end
  1902.   
  1903. end # Window_BattleStatus

  1904. #==============================================================================
  1905. # ¡ Window_BattleActor
  1906. #==============================================================================

  1907. class Window_BattleActor < Window_BattleStatus
  1908.   
  1909.   #--------------------------------------------------------------------------
  1910.   # overwrite method: show
  1911.   #--------------------------------------------------------------------------
  1912.   def show
  1913.     create_flags
  1914.     super
  1915.   end
  1916.   
  1917.   #--------------------------------------------------------------------------
  1918.   # new method: create_flags
  1919.   #--------------------------------------------------------------------------
  1920.   def create_flags
  1921.     set_select_flag(:any)
  1922.     select(0)
  1923.     return if $game_temp.battle_aid.nil?
  1924.     if $game_temp.battle_aid.need_selection?
  1925.       select(0)
  1926.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1927.     elsif $game_temp.battle_aid.for_user?
  1928.       battler = BattleManager.actor
  1929.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1930.       select(id)
  1931.       set_select_flag(:user)
  1932.     elsif $game_temp.battle_aid.for_all?
  1933.       select(0)
  1934.       set_select_flag(:all)
  1935.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1936.     elsif $game_temp.battle_aid.for_random?
  1937.       select(0)
  1938.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1939.     end
  1940.   end
  1941.   
  1942.   #--------------------------------------------------------------------------
  1943.   # new method: set_flag
  1944.   #--------------------------------------------------------------------------
  1945.   def set_select_flag(flag)
  1946.     @select_flag = flag
  1947.     case @select_flag
  1948.     when :all, :all_dead, :random
  1949.       @cursor_all = true
  1950.     else
  1951.       @cursor_all = false
  1952.     end
  1953.   end
  1954.   
  1955.   #--------------------------------------------------------------------------
  1956.   # overwrite method: update_cursor
  1957.   #--------------------------------------------------------------------------
  1958.   def update_cursor
  1959.     if @cursor_all
  1960.       cursor_rect.set(0, 0, contents.width, contents.height)
  1961.       self.top_row = 0
  1962.     elsif @index < 0
  1963.       cursor_rect.empty
  1964.     else
  1965.       ensure_cursor_visible
  1966.       cursor_rect.set(item_rect(@index))
  1967.     end
  1968.   end
  1969.   
  1970.   #--------------------------------------------------------------------------
  1971.   # overwrite method: cursor_movable?
  1972.   #--------------------------------------------------------------------------
  1973.   def cursor_movable?
  1974.     return false if @select_flag == :user
  1975.     return super
  1976.   end
  1977.   
  1978.   #--------------------------------------------------------------------------
  1979.   # overwrite method: current_item_enabled?
  1980.   #--------------------------------------------------------------------------
  1981.   def current_item_enabled?
  1982.     return true if $game_temp.battle_aid.nil?
  1983.     if $game_temp.battle_aid.need_selection?
  1984.       member = $game_party.battle_members[@index]
  1985.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1986.     elsif $game_temp.battle_aid.for_dead_friend?
  1987.       for member in $game_party.battle_members
  1988.         return true if member.dead?
  1989.       end
  1990.       return false
  1991.     end
  1992.     return true
  1993.   end
  1994.   
  1995. end # Window_BattleActor

  1996. #==============================================================================
  1997. # ¡ Window_BattleStatusAid
  1998. #==============================================================================

  1999. class Window_BattleStatusAid < Window_BattleStatus
  2000.   
  2001.   #--------------------------------------------------------------------------
  2002.   # public instance variables
  2003.   #--------------------------------------------------------------------------
  2004.   attr_accessor :status_window
  2005.   
  2006.   #--------------------------------------------------------------------------
  2007.   # overwrite method: initialize
  2008.   #--------------------------------------------------------------------------
  2009.   def initialize
  2010.     super
  2011.     self.visible = false
  2012.     self.openness = 255
  2013.   end
  2014.   
  2015.   #--------------------------------------------------------------------------
  2016.   # overwrite method: window_width
  2017.   #--------------------------------------------------------------------------
  2018.   def window_width; return 128; end
  2019.   
  2020.   #--------------------------------------------------------------------------
  2021.   # overwrite method: show
  2022.   #--------------------------------------------------------------------------
  2023.   def show
  2024.     super
  2025.     refresh
  2026.   end
  2027.   
  2028.   #--------------------------------------------------------------------------
  2029.   # overwrite method: refresh
  2030.   #--------------------------------------------------------------------------
  2031.   def refresh
  2032.     contents.clear
  2033.     return if @status_window.nil?
  2034.     draw_item(@status_window.index)
  2035.   end
  2036.   
  2037.   #--------------------------------------------------------------------------
  2038.   # overwrite method: item_rect
  2039.   #--------------------------------------------------------------------------
  2040.   def item_rect(index)
  2041.     return Rect.new(0, 0, contents.width, contents.height)
  2042.   end
  2043.   
  2044. end # Window_BattleStatusAid

  2045. #==============================================================================
  2046. # ¡ Window_BattleEnemy
  2047. #==============================================================================

  2048. class Window_BattleEnemy < Window_Selectable
  2049.   
  2050.   #--------------------------------------------------------------------------
  2051.   # overwrite method: initialize
  2052.   #--------------------------------------------------------------------------
  2053.   def initialize(info_viewport)
  2054.     super(0, Graphics.height, window_width, fitting_height(1))
  2055.     refresh
  2056.     self.visible = false
  2057.     @info_viewport = info_viewport
  2058.   end
  2059.   
  2060.   #--------------------------------------------------------------------------
  2061.   # overwrite method: col_max
  2062.   #--------------------------------------------------------------------------
  2063.   def col_max; return item_max; end
  2064.   
  2065.   #--------------------------------------------------------------------------
  2066.   # overwrite method: show
  2067.   #--------------------------------------------------------------------------
  2068.   def show
  2069.     create_flags
  2070.     super
  2071.   end
  2072.   
  2073.   #--------------------------------------------------------------------------
  2074.   # new method: create_flags
  2075.   #--------------------------------------------------------------------------
  2076.   def create_flags
  2077.     set_select_flag(:any)
  2078.     select(0)
  2079.     return if $game_temp.battle_aid.nil?
  2080.     if $game_temp.battle_aid.need_selection?
  2081.       select(0)
  2082.     elsif $game_temp.battle_aid.for_all?
  2083.       select(0)
  2084.       set_select_flag(:all)
  2085.     elsif $game_temp.battle_aid.for_random?
  2086.       select(0)
  2087.       set_select_flag(:random)
  2088.     end
  2089.   end
  2090.   
  2091.   #--------------------------------------------------------------------------
  2092.   # new method: set_flag
  2093.   #--------------------------------------------------------------------------
  2094.   def set_select_flag(flag)
  2095.     @select_flag = flag
  2096.     case @select_flag
  2097.     when :all, :random
  2098.       @cursor_all = true
  2099.     else
  2100.       @cursor_all = false
  2101.     end
  2102.   end
  2103.   
  2104.   #--------------------------------------------------------------------------
  2105.   # new method: select_all?
  2106.   #--------------------------------------------------------------------------
  2107.   def select_all?
  2108.     return true if @select_flag == :all
  2109.     return true if @select_flag == :random
  2110.     return false
  2111.   end
  2112.   
  2113.   #--------------------------------------------------------------------------
  2114.   # overwrite method: update_cursor
  2115.   #--------------------------------------------------------------------------
  2116.   def update_cursor
  2117.     if @cursor_all
  2118.       cursor_rect.set(0, 0, contents.width, contents.height)
  2119.       self.top_row = 0
  2120.     elsif @index < 0
  2121.       cursor_rect.empty
  2122.     else
  2123.       ensure_cursor_visible
  2124.       cursor_rect.set(item_rect(@index))
  2125.     end
  2126.   end
  2127.   
  2128.   #--------------------------------------------------------------------------
  2129.   # overwrite method: cursor_movable?
  2130.   #--------------------------------------------------------------------------
  2131.   def cursor_movable?
  2132.     return false if @select_flag == :user
  2133.     return super
  2134.   end
  2135.   
  2136.   #--------------------------------------------------------------------------
  2137.   # overwrite method: current_item_enabled?
  2138.   #--------------------------------------------------------------------------
  2139.   def current_item_enabled?
  2140.     return true if $game_temp.battle_aid.nil?
  2141.     if $game_temp.battle_aid.need_selection?
  2142.       member = $game_party.battle_members[@index]
  2143.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2144.     elsif $game_temp.battle_aid.for_dead_friend?
  2145.       for member in $game_party.battle_members
  2146.         return true if member.dead?
  2147.       end
  2148.       return false
  2149.     end
  2150.     return true
  2151.   end
  2152.   
  2153.   #--------------------------------------------------------------------------
  2154.   # overwrite method: enemy
  2155.   #--------------------------------------------------------------------------
  2156.   def enemy; @data[index]; end
  2157.   
  2158.   #--------------------------------------------------------------------------
  2159.   # overwrite method: refresh
  2160.   #--------------------------------------------------------------------------
  2161.   def refresh
  2162.     make_item_list
  2163.     create_contents
  2164.     draw_all_items
  2165.   end
  2166.   
  2167.   #--------------------------------------------------------------------------
  2168.   # overwrite method: make_item_list
  2169.   #--------------------------------------------------------------------------
  2170.   def make_item_list
  2171.     @data = $game_troop.alive_members
  2172.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2173.   end
  2174.   
  2175.   #--------------------------------------------------------------------------
  2176.   # overwrite method: draw_item
  2177.   #--------------------------------------------------------------------------
  2178.   def draw_item(index); return; end
  2179.   
  2180.   #--------------------------------------------------------------------------
  2181.   # overwrite method: update
  2182.   #--------------------------------------------------------------------------
  2183.   def update
  2184.     super
  2185.     return unless active
  2186.     enemy.sprite_effect_type = :whiten
  2187.     return unless select_all?
  2188.     for enemy in $game_troop.alive_members
  2189.       enemy.sprite_effect_type = :whiten
  2190.     end
  2191.   end
  2192.   
  2193. end # Window_BattleEnemy

  2194. #==============================================================================
  2195. # ¡ Window_BattleHelp
  2196. #==============================================================================

  2197. class Window_BattleHelp < Window_Help
  2198.   
  2199.   #--------------------------------------------------------------------------
  2200.   # public instance variables
  2201.   #--------------------------------------------------------------------------
  2202.   attr_accessor :actor_window
  2203.   attr_accessor :enemy_window
  2204.   
  2205.   #--------------------------------------------------------------------------
  2206.   # update
  2207.   #--------------------------------------------------------------------------
  2208.   def update
  2209.     super
  2210.     if !self.visible and @text != ""
  2211.       @text = ""
  2212.       return refresh
  2213.     end
  2214.     update_battler_name
  2215.   end
  2216.   
  2217.   #--------------------------------------------------------------------------
  2218.   # update_battler_name
  2219.   #--------------------------------------------------------------------------
  2220.   def update_battler_name
  2221.     return unless @actor_window.active || @enemy_window.active
  2222.     if @actor_window.active
  2223.       battler = $game_party.battle_members[@actor_window.index]
  2224.     elsif @enemy_window.active
  2225.       battler = @enemy_window.enemy
  2226.     end
  2227.     if special_display?
  2228.       refresh_special_case(battler)
  2229.     else
  2230.       refresh_battler_name(battler) if battler_name(battler) != @text
  2231.     end
  2232.   end
  2233.   
  2234.   #--------------------------------------------------------------------------
  2235.   # battler_name
  2236.   #--------------------------------------------------------------------------
  2237.   def battler_name(battler)
  2238.     text = battler.name.clone
  2239.     return text
  2240.   end
  2241.   
  2242.   #--------------------------------------------------------------------------
  2243.   # refresh_battler_name
  2244.   #--------------------------------------------------------------------------
  2245.   def refresh_battler_name(battler)
  2246.     contents.clear
  2247.     reset_font_settings
  2248.     change_color(normal_color)
  2249.     @text = battler_name(battler)
  2250.     icons = battler.state_icons + battler.buff_icons
  2251.     dy = icons.size <= 0 ? line_height / 2 : 0
  2252.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2253.     dx = (contents.width - (icons.size * 24)) / 2
  2254.     draw_actor_icons(battler, dx, line_height, contents.width)
  2255.   end
  2256.   
  2257.   #--------------------------------------------------------------------------
  2258.   # special_display?
  2259.   #--------------------------------------------------------------------------
  2260.   def special_display?
  2261.     return false if $game_temp.battle_aid.nil?
  2262.     return false if $game_temp.battle_aid.for_user?
  2263.     return !$game_temp.battle_aid.need_selection?
  2264.   end
  2265.   
  2266.   #--------------------------------------------------------------------------
  2267.   # refresh_special_case
  2268.   #--------------------------------------------------------------------------
  2269.   def refresh_special_case(battler)
  2270.     if $game_temp.battle_aid.for_opponent?
  2271.       if $game_temp.battle_aid.for_all?
  2272.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2273.       else
  2274.         case $game_temp.battle_aid.number_of_targets
  2275.         when 1
  2276.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2277.         else
  2278.           number = $game_temp.battle_aid.number_of_targets
  2279.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2280.         end
  2281.       end
  2282.     else # $game_temp.battle_aid.for_friend?
  2283.       if $game_temp.battle_aid.for_dead_friend?
  2284.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2285.       elsif $game_temp.battle_aid.for_random?
  2286.         case $game_temp.battle_aid.number_of_targets
  2287.         when 1
  2288.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2289.         else
  2290.           number = $game_temp.battle_aid.number_of_targets
  2291.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2292.         end
  2293.       else
  2294.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2295.       end
  2296.     end
  2297.     return if text == @text
  2298.     @text = text
  2299.     contents.clear
  2300.     reset_font_settings
  2301.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2302.   end
  2303.   
  2304. end # Window_BattleHelp

  2305. #==============================================================================
  2306. # ¡ Window_BattleLog
  2307. #==============================================================================

  2308. class Window_BattleLog < Window_Selectable
  2309.   
  2310.   #--------------------------------------------------------------------------
  2311.   # alias method: display_current_state
  2312.   #--------------------------------------------------------------------------
  2313.   alias window_battlelog_display_current_state_abe display_current_state
  2314.   def display_current_state(subject)
  2315.     subject.make_during_state_popup
  2316.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2317.     window_battlelog_display_current_state_abe(subject)
  2318.   end
  2319.   
  2320.   #--------------------------------------------------------------------------
  2321.   # alias method: display_use_item
  2322.   #--------------------------------------------------------------------------
  2323.   alias window_battlelog_display_use_item_abe display_use_item
  2324.   def display_use_item(subject, item)
  2325.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2326.     window_battlelog_display_use_item_abe(subject, item)
  2327.   end
  2328.   
  2329.   #--------------------------------------------------------------------------
  2330.   # alias method: display_counter
  2331.   #--------------------------------------------------------------------------
  2332.   alias window_battlelog_display_counter_abe display_counter
  2333.   def display_counter(target, item)
  2334.     if YEA::BATTLE::MSG_COUNTERATTACK
  2335.       window_battlelog_display_counter_abe(target, item)
  2336.     else
  2337.       Sound.play_evasion
  2338.     end
  2339.   end
  2340.   
  2341.   #--------------------------------------------------------------------------
  2342.   # alias method: display_reflection
  2343.   #--------------------------------------------------------------------------
  2344.   alias window_battlelog_display_reflection_abe display_reflection
  2345.   def display_reflection(target, item)
  2346.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2347.       window_battlelog_display_reflection_abe(target, item)
  2348.     else
  2349.       Sound.play_reflection
  2350.     end
  2351.   end
  2352.   
  2353.   #--------------------------------------------------------------------------
  2354.   # alias method: display_substitute
  2355.   #--------------------------------------------------------------------------
  2356.   alias window_battlelog_display_substitute_abe display_substitute
  2357.   def display_substitute(substitute, target)
  2358.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2359.     window_battlelog_display_substitute_abe(substitute, target)
  2360.   end
  2361.   
  2362.   #--------------------------------------------------------------------------
  2363.   # alias method: display_failure
  2364.   #--------------------------------------------------------------------------
  2365.   alias window_battlelog_display_failure_abe display_failure
  2366.   def display_failure(target, item)
  2367.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2368.     window_battlelog_display_failure_abe(target, item)
  2369.   end
  2370.   
  2371.   #--------------------------------------------------------------------------
  2372.   # alias method: display_critical
  2373.   #--------------------------------------------------------------------------
  2374.   alias window_battlelog_display_critical_abe display_critical
  2375.   def display_critical(target, item)
  2376.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2377.     window_battlelog_display_critical_abe(target, item)
  2378.   end
  2379.   
  2380.   #--------------------------------------------------------------------------
  2381.   # alias method: display_miss
  2382.   #--------------------------------------------------------------------------
  2383.   alias window_battlelog_display_miss_abe display_miss
  2384.   def display_miss(target, item)
  2385.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2386.     window_battlelog_display_miss_abe(target, item)
  2387.   end
  2388.   
  2389.   #--------------------------------------------------------------------------
  2390.   # alias method: display_evasion
  2391.   #--------------------------------------------------------------------------
  2392.   alias window_battlelog_display_evasion_abe display_evasion
  2393.   def display_evasion(target, item)
  2394.     if YEA::BATTLE::MSG_EVASION
  2395.       window_battlelog_display_evasion_abe(target, item)
  2396.     else
  2397.       if !item || item.physical?
  2398.         Sound.play_evasion
  2399.       else
  2400.         Sound.play_magic_evasion
  2401.       end
  2402.     end
  2403.   end
  2404.   
  2405.   #--------------------------------------------------------------------------
  2406.   # overwrite method: display_hp_damage
  2407.   #--------------------------------------------------------------------------
  2408.   def display_hp_damage(target, item)
  2409.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2410.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2411.       target.perform_damage_effect
  2412.     end
  2413.     Sound.play_recovery if target.result.hp_damage < 0
  2414.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2415.     add_text(target.result.hp_damage_text)
  2416.     wait
  2417.   end
  2418.   
  2419.   #--------------------------------------------------------------------------
  2420.   # overwrite method: display_mp_damage
  2421.   #--------------------------------------------------------------------------
  2422.   def display_mp_damage(target, item)
  2423.     return if target.dead? || target.result.mp_damage == 0
  2424.     Sound.play_recovery if target.result.mp_damage < 0
  2425.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2426.     add_text(target.result.mp_damage_text)
  2427.     wait
  2428.   end
  2429.   
  2430.   #--------------------------------------------------------------------------
  2431.   # overwrite method: display_tp_damage
  2432.   #--------------------------------------------------------------------------
  2433.   def display_tp_damage(target, item)
  2434.     return if target.dead? || target.result.tp_damage == 0
  2435.     Sound.play_recovery if target.result.tp_damage < 0
  2436.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2437.     add_text(target.result.tp_damage_text)
  2438.     wait
  2439.   end
  2440.   
  2441.   #--------------------------------------------------------------------------
  2442.   # alias method: display_added_states
  2443.   #--------------------------------------------------------------------------
  2444.   alias window_battlelog_display_added_states_abe display_added_states
  2445.   def display_added_states(target)
  2446.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2447.     window_battlelog_display_added_states_abe(target)
  2448.   end
  2449.   
  2450.   #--------------------------------------------------------------------------
  2451.   # alias method: display_removed_states
  2452.   #--------------------------------------------------------------------------
  2453.   alias window_battlelog_display_removed_states_abe display_removed_states
  2454.   def display_removed_states(target)
  2455.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2456.     window_battlelog_display_removed_states_abe(target)
  2457.   end
  2458.   
  2459.   #--------------------------------------------------------------------------
  2460.   # alias method: display_changed_buffs
  2461.   #--------------------------------------------------------------------------
  2462.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2463.   def display_changed_buffs(target)
  2464.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2465.     window_battlelog_display_changed_buffs_abe(target)
  2466.   end
  2467.   
  2468. end # Window_BattleLog

  2469. #==============================================================================
  2470. # ¡ Window_SkillList
  2471. #==============================================================================

  2472. class Window_SkillList < Window_Selectable
  2473.   
  2474.   #--------------------------------------------------------------------------
  2475.   # overwrite method: spacing
  2476.   #--------------------------------------------------------------------------
  2477.   def spacing
  2478.     return 8 if $game_party.in_battle
  2479.     return super
  2480.   end
  2481.   
  2482. end # Window_SkillList

  2483. #==============================================================================
  2484. # ¡ Window_ItemList
  2485. #==============================================================================

  2486. class Window_ItemList < Window_Selectable
  2487.   
  2488.   #--------------------------------------------------------------------------
  2489.   # overwrite method: spacing
  2490.   #--------------------------------------------------------------------------
  2491.   def spacing
  2492.     return 8 if $game_party.in_battle
  2493.     return super
  2494.   end
  2495.   
  2496. end # Window_ItemList

  2497. #==============================================================================
  2498. # ¡ Scene_Battle
  2499. #==============================================================================

  2500. class Scene_Battle < Scene_Base
  2501.   
  2502.   #--------------------------------------------------------------------------
  2503.   # public instance variables
  2504.   #--------------------------------------------------------------------------
  2505.   attr_accessor :enemy_window
  2506.   attr_accessor :info_viewport
  2507.   attr_accessor :spriteset
  2508.   attr_accessor :status_window
  2509.   attr_accessor :status_aid_window
  2510.   attr_accessor :subject
  2511.   
  2512.   #--------------------------------------------------------------------------
  2513.   # alias method: create_spriteset
  2514.   #--------------------------------------------------------------------------
  2515.   alias scene_battle_create_spriteset_abe create_spriteset
  2516.   def create_spriteset
  2517.     BattleManager.init_battle_type
  2518.     scene_battle_create_spriteset_abe
  2519.   end
  2520.   
  2521.   #--------------------------------------------------------------------------
  2522.   # alias method: update_basic
  2523.   #--------------------------------------------------------------------------
  2524.   alias scene_battle_update_basic_abe update_basic
  2525.   def update_basic
  2526.     scene_battle_update_basic_abe
  2527.     update_debug
  2528.   end
  2529.   
  2530.   #--------------------------------------------------------------------------
  2531.   # new method: update_debug
  2532.   #--------------------------------------------------------------------------
  2533.   def update_debug
  2534.     return unless $TEST || $BTEST
  2535.     debug_heal_party if Input.trigger?(:F5)
  2536.     debug_damage_party if Input.trigger?(:F6)
  2537.     debug_fill_tp if Input.trigger?(:F7)
  2538.     debug_kill_all if Input.trigger?(:F8)
  2539.   end
  2540.   
  2541.   #--------------------------------------------------------------------------
  2542.   # new method: debug_heal_party
  2543.   #--------------------------------------------------------------------------
  2544.   def debug_heal_party
  2545.     Sound.play_recovery
  2546.     for member in $game_party.battle_members
  2547.       member.recover_all
  2548.     end
  2549.     @status_window.refresh
  2550.   end
  2551.   
  2552.   #--------------------------------------------------------------------------
  2553.   # new method: debug_damage_party
  2554.   #--------------------------------------------------------------------------
  2555.   def debug_damage_party
  2556.     Sound.play_actor_damage
  2557.     for member in $game_party.alive_members
  2558.       member.hp = 1
  2559.       member.mp = 0
  2560.       member.tp = 0
  2561.     end
  2562.     @status_window.refresh
  2563.   end
  2564.   
  2565.   #--------------------------------------------------------------------------
  2566.   # new method: debug_fill_tp
  2567.   #--------------------------------------------------------------------------
  2568.   def debug_fill_tp
  2569.     Sound.play_recovery
  2570.     for member in $game_party.alive_members
  2571.       member.tp = member.max_tp
  2572.     end
  2573.     @status_window.refresh
  2574.   end
  2575.   
  2576.   #--------------------------------------------------------------------------
  2577.   # new method: debug_kill_all
  2578.   #--------------------------------------------------------------------------
  2579.   def debug_kill_all
  2580.     for enemy in $game_troop.alive_members
  2581.       enemy.hp = 0
  2582.       enemy.perform_collapse_effect
  2583.     end
  2584.     BattleManager.judge_win_loss
  2585.     @log_window.wait
  2586.     @log_window.wait_for_effect
  2587.   end
  2588.   
  2589.   #--------------------------------------------------------------------------
  2590.   # alias method: create_all_windows
  2591.   #--------------------------------------------------------------------------
  2592.   alias scene_battle_create_all_windows_abe create_all_windows
  2593.   def create_all_windows
  2594.     scene_battle_create_all_windows_abe
  2595.     create_battle_status_aid_window
  2596.     set_help_window
  2597.   end
  2598.   
  2599.   #--------------------------------------------------------------------------
  2600.   # alias method: create_info_viewport
  2601.   #--------------------------------------------------------------------------
  2602.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2603.   def create_info_viewport
  2604.     scene_battle_create_info_viewport_abe
  2605.     @status_window.refresh
  2606.   end
  2607.   
  2608.   #--------------------------------------------------------------------------
  2609.   # new method: create_battle_status_aid_window
  2610.   #--------------------------------------------------------------------------
  2611.   def create_battle_status_aid_window
  2612.     @status_aid_window = Window_BattleStatusAid.new
  2613.     @status_aid_window.status_window = @status_window
  2614.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2615.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2616.   end
  2617.   
  2618.   #--------------------------------------------------------------------------
  2619.   # overwrite method: create_help_window
  2620.   #--------------------------------------------------------------------------
  2621.   def create_help_window
  2622.     @help_window = Window_BattleHelp.new
  2623.     @help_window.hide
  2624.   end
  2625.   
  2626.   #--------------------------------------------------------------------------
  2627.   # new method: set_help_window
  2628.   #--------------------------------------------------------------------------
  2629.   def set_help_window
  2630.     @help_window.actor_window = @actor_window
  2631.     @help_window.enemy_window = @enemy_window
  2632.   end
  2633.   
  2634.   #--------------------------------------------------------------------------
  2635.   # alias method: create_party_command_window
  2636.   #--------------------------------------------------------------------------
  2637.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2638.   def create_party_command_window
  2639.     scene_battle_create_party_command_window_abe
  2640.     @party_command_window.set_handler(:dir6, method(:command_fight))
  2641.   end
  2642.   
  2643.   #--------------------------------------------------------------------------
  2644.   # alias method: create_actor_command_window
  2645.   #--------------------------------------------------------------------------
  2646.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2647.   def create_actor_command_window
  2648.     scene_battle_create_actor_command_window_abe
  2649.     @actor_command_window.set_handler(:dir4, method(:prior_command))
  2650.     @actor_command_window.set_handler(:dir6, method(:next_command))
  2651.   end
  2652.   
  2653.   #--------------------------------------------------------------------------
  2654.   # alias method: create_skill_window
  2655.   #--------------------------------------------------------------------------
  2656.   alias scene_battle_create_skill_window_abe create_skill_window
  2657.   def create_skill_window
  2658.     scene_battle_create_skill_window_abe
  2659.     @skill_window.height = @info_viewport.rect.height
  2660.     @skill_window.width = Graphics.width - @actor_command_window.width
  2661.     @skill_window.y = Graphics.height - @skill_window.height
  2662.   end
  2663.   
  2664.   #--------------------------------------------------------------------------
  2665.   # alias method: create_item_window
  2666.   #--------------------------------------------------------------------------
  2667.   alias scene_battle_create_item_window_abe create_item_window
  2668.   def create_item_window
  2669.     scene_battle_create_item_window_abe
  2670.     @item_window.height = @skill_window.height
  2671.     @item_window.width = @skill_window.width
  2672.     @item_window.y = Graphics.height - @item_window.height
  2673.   end
  2674.   
  2675.   #--------------------------------------------------------------------------
  2676.   # alias method: show_fast?
  2677.   #--------------------------------------------------------------------------
  2678.   alias scene_battle_show_fast_abe show_fast?
  2679.   def show_fast?
  2680.     return true if YEA::BATTLE::AUTO_FAST
  2681.     return scene_battle_show_fast_abe
  2682.   end
  2683.   
  2684.   #--------------------------------------------------------------------------
  2685.   # alias method: next_command
  2686.   #--------------------------------------------------------------------------
  2687.   alias scene_battle_next_command_abe next_command
  2688.   def next_command
  2689.     @status_window.show
  2690.     redraw_current_status
  2691.     @actor_command_window.show
  2692.     @status_aid_window.hide
  2693.     scene_battle_next_command_abe
  2694.   end
  2695.   
  2696.   #--------------------------------------------------------------------------
  2697.   # alias method: prior_command
  2698.   #--------------------------------------------------------------------------
  2699.   alias scene_battle_prior_command_abe prior_command
  2700.   def prior_command
  2701.     redraw_current_status
  2702.     scene_battle_prior_command_abe
  2703.   end
  2704.   
  2705.   #--------------------------------------------------------------------------
  2706.   # new method: redraw_current_status
  2707.   #--------------------------------------------------------------------------
  2708.   def redraw_current_status
  2709.     return if @status_window.index < 0
  2710.     @status_window.draw_item(@status_window.index)
  2711.   end
  2712.   
  2713.   #--------------------------------------------------------------------------
  2714.   # alias method: command_attack
  2715.   #--------------------------------------------------------------------------
  2716.   alias scene_battle_command_attack_abe command_attack
  2717.   def command_attack
  2718.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2719.     scene_battle_command_attack_abe
  2720.   end
  2721.   
  2722.   #--------------------------------------------------------------------------
  2723.   # alias method: command_skill
  2724.   #--------------------------------------------------------------------------
  2725.   alias scene_battle_command_skill_abe command_skill
  2726.   def command_skill
  2727.     scene_battle_command_skill_abe
  2728.     @status_window.hide
  2729.     @actor_command_window.hide
  2730.     @status_aid_window.show
  2731.   end
  2732.   
  2733.   #--------------------------------------------------------------------------
  2734.   # alias method: command_item
  2735.   #--------------------------------------------------------------------------
  2736.   alias scene_battle_command_item_abe command_item
  2737.   def command_item
  2738.     scene_battle_command_item_abe
  2739.     @status_window.hide
  2740.     @actor_command_window.hide
  2741.     @status_aid_window.show
  2742.   end
  2743.   
  2744.   #--------------------------------------------------------------------------
  2745.   # overwrite method: on_skill_ok
  2746.   #--------------------------------------------------------------------------
  2747.   def on_skill_ok
  2748.     @skill = @skill_window.item
  2749.     $game_temp.battle_aid = @skill
  2750.     BattleManager.actor.input.set_skill(@skill.id)
  2751.     BattleManager.actor.last_skill.object = @skill
  2752.     if @skill.for_opponent?
  2753.       select_enemy_selection
  2754.     elsif @skill.for_user? && @skill.id > 528 && @skill.id < 539
  2755.       @skill_window.hide
  2756.       next_command
  2757.       $game_temp.battle_aid = nil
  2758.     elsif @skill.for_friend?
  2759.       select_actor_selection
  2760.     else
  2761.       @skill_window.hide
  2762.       next_command
  2763.       $game_temp.battle_aid = nil
  2764.     end
  2765.   end
  2766.   
  2767.   
  2768.   #--------------------------------------------------------------------------
  2769.   # alias method: on_skill_cancel
  2770.   #--------------------------------------------------------------------------
  2771.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2772.   def on_skill_cancel
  2773.     scene_battle_on_skill_cancel_abe
  2774.     @status_window.show
  2775.     @actor_command_window.show
  2776.     @status_aid_window.hide
  2777.   end
  2778.   
  2779.   #--------------------------------------------------------------------------
  2780.   # overwrite method: on_item_ok
  2781.   #--------------------------------------------------------------------------
  2782.   def on_item_ok
  2783.     @item = @item_window.item
  2784.     $game_temp.battle_aid = @item
  2785.     BattleManager.actor.input.set_item(@item.id)
  2786.     if @item.for_opponent?
  2787.       select_enemy_selection
  2788.     elsif @item.for_friend?
  2789.       select_actor_selection
  2790.     else
  2791.       @item_window.hide
  2792.       next_command
  2793.       $game_temp.battle_aid = nil
  2794.     end
  2795.     $game_party.last_item.object = @item
  2796.   end
  2797.   
  2798.   #--------------------------------------------------------------------------
  2799.   # alias method: on_item_cancel
  2800.   #--------------------------------------------------------------------------
  2801.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2802.   def on_item_cancel
  2803.     scene_battle_on_item_cancel_abe
  2804.     @status_window.show
  2805.     @actor_command_window.show
  2806.     @status_aid_window.hide
  2807.   end
  2808.   
  2809.   #--------------------------------------------------------------------------
  2810.   # alias method: select_actor_selection
  2811.   #--------------------------------------------------------------------------
  2812.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2813.   def select_actor_selection
  2814.     @status_aid_window.refresh
  2815.     scene_battle_select_actor_selection_abe
  2816.     @status_window.hide
  2817.     @skill_window.hide
  2818.     @item_window.hide
  2819.     @help_window.show
  2820.   end
  2821.   
  2822.   #--------------------------------------------------------------------------
  2823.   # alias method: on_actor_ok
  2824.   #--------------------------------------------------------------------------
  2825.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2826.   def on_actor_ok
  2827.     $game_temp.battle_aid = nil
  2828.     scene_battle_on_actor_ok_abe
  2829.     @status_window.show
  2830.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2831.       @actor_command_window.visible = !@confirm_command_window.visible
  2832.     else
  2833.       @actor_command_window.show
  2834.     end
  2835.     @status_aid_window.hide
  2836.   end
  2837.   
  2838.   #--------------------------------------------------------------------------
  2839.   # alias method: on_actor_cancel
  2840.   #--------------------------------------------------------------------------
  2841.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2842.   def on_actor_cancel
  2843.     BattleManager.actor.input.clear
  2844.     @status_aid_window.refresh
  2845.     $game_temp.battle_aid = nil
  2846.     scene_battle_on_actor_cancel_abe
  2847.     case @actor_command_window.current_symbol
  2848.     when :skill
  2849.       @skill_window.show
  2850.     when :item
  2851.       @item_window.show
  2852.     end
  2853.   end
  2854.   
  2855.   #--------------------------------------------------------------------------
  2856.   # alias method: select_enemy_selection
  2857.   #--------------------------------------------------------------------------
  2858.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2859.   def select_enemy_selection
  2860.     @status_aid_window.refresh
  2861.     scene_battle_select_enemy_selection_abe
  2862.     @help_window.show
  2863.   end
  2864.   #--------------------------------------------------------------------------
  2865.   # alias method: on_enemy_ok
  2866.   #--------------------------------------------------------------------------
  2867.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2868.   def on_enemy_ok
  2869.     $game_temp.battle_aid = nil
  2870.     scene_battle_on_enemy_ok_abe
  2871.   end
  2872.   
  2873.   #--------------------------------------------------------------------------
  2874.   # alias method: on_enemy_cancel
  2875.   #--------------------------------------------------------------------------
  2876.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2877.   def on_enemy_cancel
  2878.     BattleManager.actor.input.clear
  2879.     @status_aid_window.refresh
  2880.     $game_temp.battle_aid = nil
  2881.     scene_battle_on_enemy_cancel_abe
  2882.     if @skill_window.visible || @item_window.visible
  2883.       @help_window.show
  2884.     else
  2885.       @help_window.hide
  2886.     end
  2887.   end
  2888.   
  2889.   #--------------------------------------------------------------------------
  2890.   # alias method: battle_start
  2891.   #--------------------------------------------------------------------------
  2892.   alias scene_battle_battle_start_abe battle_start
  2893.   def battle_start
  2894.     scene_battle_battle_start_abe
  2895.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2896.     @party_command_window.deactivate
  2897.     if BattleManager.input_start
  2898.       command_fight
  2899.     else
  2900.       turn_start
  2901.     end
  2902.   end
  2903.   
  2904.   #--------------------------------------------------------------------------
  2905.   # overwrite method: turn_end
  2906.   #--------------------------------------------------------------------------
  2907.   def turn_end
  2908.     all_battle_members.each do |battler|
  2909.       battler.on_turn_end
  2910.       status_redraw_target(battler)
  2911.       @log_window.display_auto_affected_status(battler)
  2912.       @log_window.wait_and_clear
  2913.     end
  2914.     update_party_cooldowns if $imported["YEA-CommandParty"]
  2915.     BattleManager.turn_end
  2916.     process_event
  2917.     start_party_command_selection
  2918.     return if end_battle_conditions?
  2919.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2920.     if BattleManager.input_start
  2921.       @party_command_window.deactivate
  2922.       command_fight
  2923.     else
  2924.       @party_command_window.deactivate
  2925.       turn_start
  2926.     end
  2927.   end
  2928.   
  2929.   #--------------------------------------------------------------------------
  2930.   # new method: end_battle_conditions?
  2931.   #--------------------------------------------------------------------------
  2932.   def end_battle_conditions?
  2933.     return true if $game_party.members.empty?
  2934.     return true if $game_party.all_dead?
  2935.     return true if $game_troop.all_dead?
  2936.     return true if BattleManager.aborting?
  2937.     return false
  2938.   end
  2939.   
  2940.   #--------------------------------------------------------------------------
  2941.   # overwrite method: execute_action
  2942.   #--------------------------------------------------------------------------
  2943.   def execute_action
  2944.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2945.     use_item
  2946.     @log_window.wait_and_clear
  2947.   end
  2948.   
  2949.   #--------------------------------------------------------------------------
  2950.   # overwrite method: apply_item_effects
  2951.   #--------------------------------------------------------------------------
  2952.   def apply_item_effects(target, item)
  2953.     if $imported["YEA-LunaticObjects"]
  2954.       lunatic_object_effect(:prepare, item, @subject, target)
  2955.     end
  2956.     target.item_apply(@subject, item)
  2957.     status_redraw_target(@subject)
  2958.     status_redraw_target(target) unless target == @subject
  2959.     @log_window.display_action_results(target, item)
  2960.     if $imported["YEA-LunaticObjects"]
  2961.       lunatic_object_effect(:during, item, @subject, target)
  2962.     end
  2963.     perform_collapse_check(target)
  2964.   end
  2965.   
  2966.   #--------------------------------------------------------------------------
  2967.   # overwite method: invoke_counter_attack
  2968.   #--------------------------------------------------------------------------
  2969.   def invoke_counter_attack(target, item)
  2970.     @log_window.display_counter(target, item)
  2971.     attack_skill = $data_skills[target.attack_skill_id]
  2972.     @subject.item_apply(target, attack_skill)
  2973.     status_redraw_target(@subject)
  2974.     status_redraw_target(target) unless target == @subject
  2975.     @log_window.display_action_results(@subject, attack_skill)
  2976.     perform_collapse_check(target)
  2977.     perform_collapse_check(@subject)
  2978.   end
  2979.   
  2980.   #--------------------------------------------------------------------------
  2981.   # new method: perform_collapse_check
  2982.   #--------------------------------------------------------------------------
  2983.   def perform_collapse_check(target)
  2984.     return if YEA::BATTLE::MSG_ADDED_STATES
  2985.     target.perform_collapse_effect if target.can_collapse?
  2986.     @log_window.wait
  2987.     @log_window.wait_for_effect
  2988.   end
  2989.   
  2990.   #--------------------------------------------------------------------------
  2991.   # overwrite method: show_attack_animation
  2992.   #--------------------------------------------------------------------------
  2993.   def show_attack_animation(targets)
  2994.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2995.     wait_for_animation
  2996.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2997.   end
  2998.   
  2999.   #--------------------------------------------------------------------------
  3000.   # overwrite method: show_normal_animation
  3001.   #--------------------------------------------------------------------------
  3002.   def show_normal_animation(targets, animation_id, mirror = false)
  3003.     animation = $data_animations[animation_id]
  3004.     return if animation.nil?
  3005.     ani_check = false
  3006.     targets.each do |target|
  3007.       if ani_check && target.animation_id <= 0
  3008.         target.pseudo_ani_id = animation_id
  3009.       else
  3010.         target.animation_id = animation_id
  3011.       end
  3012.       target.animation_mirror = mirror
  3013.       ani_check = true if animation.to_screen?
  3014.     end
  3015.   end
  3016.   
  3017.   #--------------------------------------------------------------------------
  3018.   # overwrite method: process_action_end
  3019.   #--------------------------------------------------------------------------
  3020.   def process_action_end
  3021.     @subject.on_action_end
  3022.     status_redraw_target(@subject)
  3023.     @log_window.display_auto_affected_status(@subject)
  3024.     @log_window.wait_and_clear
  3025.     @log_window.display_current_state(@subject)
  3026.     @log_window.wait_and_clear
  3027.     BattleManager.judge_win_loss
  3028.   end
  3029.   
  3030.   #--------------------------------------------------------------------------
  3031.   # overwrite method: use_item
  3032.   #--------------------------------------------------------------------------
  3033.   def use_item
  3034.     item = @subject.current_action.item
  3035.     @log_window.display_use_item(@subject, item)
  3036.     @subject.use_item(item)
  3037.     status_redraw_target(@subject)
  3038.     if $imported["YEA-LunaticObjects"]
  3039.       lunatic_object_effect(:before, item, @subject, @subject)
  3040.     end
  3041.     process_casting_animation if $imported["YEA-CastAnimations"]
  3042.     targets = @subject.current_action.make_targets.compact rescue []
  3043.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  3044.     targets.each {|target|
  3045.       if $imported["YEA-TargetManager"]
  3046.         target = alive_random_target(target, item) if item.for_random?
  3047.       end
  3048.       item.repeats.times { invoke_item(target, item) } }
  3049.     if $imported["YEA-LunaticObjects"]
  3050.       lunatic_object_effect(:after, item, @subject, @subject)
  3051.     end
  3052.   end
  3053.   
  3054.   #--------------------------------------------------------------------------
  3055.   # alias method: invoke_item
  3056.   #--------------------------------------------------------------------------
  3057.   alias scene_battle_invoke_item_abe invoke_item
  3058.   def invoke_item(target, item)
  3059.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  3060.     if target.dead? != item.for_dead_friend?
  3061.       @subject.last_target_index = target.index
  3062.       return
  3063.     end
  3064.     scene_battle_invoke_item_abe(target, item)
  3065.   end
  3066.   
  3067.   #--------------------------------------------------------------------------
  3068.   # new method: show_all_animation?
  3069.   #--------------------------------------------------------------------------
  3070.   def show_all_animation?(item)
  3071.     return true if item.one_animation
  3072.     return false if $data_animations[item.animation_id].nil?
  3073.     return false unless $data_animations[item.animation_id].to_screen?
  3074.     return true
  3075.   end
  3076.   
  3077.   #--------------------------------------------------------------------------
  3078.   # new method: separate_ani?
  3079.   #--------------------------------------------------------------------------
  3080.   def separate_ani?(target, item)
  3081.     return false if item.one_animation
  3082.     return false if $data_animations[item.animation_id].nil?
  3083.     return false if $data_animations[item.animation_id].to_screen?
  3084.     return target.dead? == item.for_dead_friend?
  3085.   end
  3086.   
  3087.   #--------------------------------------------------------------------------
  3088.   # new method: status_redraw_target
  3089.   #--------------------------------------------------------------------------
  3090.   def status_redraw_target(target)
  3091.     return unless target.actor?
  3092.     @status_window.draw_item($game_party.battle_members.index(target))
  3093.   end
  3094.   
  3095.   #--------------------------------------------------------------------------
  3096.   # alias method: start_party_command_selection
  3097.   #--------------------------------------------------------------------------
  3098.   alias start_party_command_selection_abe start_party_command_selection
  3099.   def start_party_command_selection
  3100.     @status_window.refresh unless scene_changing?
  3101.     start_party_command_selection_abe
  3102.   end
  3103.   
  3104.   #--------------------------------------------------------------------------
  3105.   # overwrite method: refresh_status
  3106.   #--------------------------------------------------------------------------
  3107.   def refresh_status; return; end
  3108.   
  3109.   #--------------------------------------------------------------------------
  3110.   # new method: refresh_autobattler_status_window
  3111.   #--------------------------------------------------------------------------
  3112.   def refresh_autobattler_status_window
  3113.     for member in $game_party.battle_members
  3114.       next unless member.auto_battle?
  3115.       @status_window.draw_item(member.index)
  3116.     end
  3117.   end
  3118.   
  3119.   #--------------------------------------------------------------------------
  3120.   # new method: hide_extra_gauges
  3121.   #--------------------------------------------------------------------------
  3122.   def hide_extra_gauges
  3123.     # Made for compatibility
  3124.   end
  3125.   
  3126.   #--------------------------------------------------------------------------
  3127.   # new method: show_extra_gauges
  3128.   #--------------------------------------------------------------------------
  3129.   def show_extra_gauges
  3130.     # Made for compatibility
  3131.   end
  3132.   
  3133. end # Scene_Battle

  3134. #==============================================================================
  3135. #
  3136. # ¥ End of File
  3137. #
  3138. #==============================================================================
复制代码
回复 支持 1 反对 0

使用道具 举报

Lv2.观梦者

梦石
0
星屑
454
在线时间
68 小时
注册时间
2022-10-6
帖子
5
3
 楼主| 发表于 2023-7-29 11:31:58 | 只看该作者
晨风1 发表于 2023-7-28 21:13
用这个,在技能栏里备注,然后设置技能段数就行

大佬,备注好了怎么设置技能段数,萌新表示不太懂啊
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
198
在线时间
14 小时
注册时间
2022-12-22
帖子
19
4
发表于 2023-7-29 19:24:36 | 只看该作者
x24678 发表于 2023-7-29 11:31
大佬,备注好了怎么设置技能段数,萌新表示不太懂啊

就是连续次数...
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-12-2 10:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表