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

Project1

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

[已经解决] 新人Yanfly Engine Ace求教?如何设置脸图个数?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
171 小时
注册时间
2013-8-6
帖子
101
跳转到指定楼层
1
发表于 2013-8-24 02:10:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用了大神的Glimmer_LP_v1.03范例参考,增到6个角色到一个队伍,结果出现脸图破格,只能看到4个人(无法选择了),后面2个出窗口了。
新人求教,研究了一晚上看教程和搜索,修改Window_BattleStatus等等无果,真心不是伸手党
估计是要修改脚本Ace Battle Engine v1.19,请大神们帮帮忙,谢谢
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.19
  4. # -- Last Updated: 2012.01.29
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-BattleEngine"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  17. # 2012.01.24 - Compatibility Update: Enemy Levels
  18. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  19. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  20. #              animation only once.
  21. #            - Reduced lag from battle system constantly recreating bitmaps.
  22. # 2012.01.10 - Compatibility Update: Battle System FTB
  23. # 2012.01.09 - Anticrash methods implemented.
  24. #            - Damage Popups are now separate for damage formulas and recovery.
  25. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  26. # 2012.01.02 - Compatibility Update: Target Manager
  27. #            - Added Option: AUTO_FAST
  28. #            - Random hits now show animations individually.
  29. # 2011.12.30 - Compatibility Update: Enemy Levels
  30. #            - Added Option to center the actors in the HUD.
  31. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  32. #            - Default battle system bug fixes are now included from YEA's Ace
  33. #              Core Engine.
  34. #            - Groundwork is also made to support future battle system types.
  35. #            - Multi-hit actions no longer linger when a target dies during the
  36. #              middle of one of the hits.
  37. #            - Compatibility Update: Lunatic Objects v1.02
  38. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  39. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  40. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  41. #            - Bug fixed: During State popup fix.
  42. #            - Added HIDE_POPUP_SWITCH.
  43. # 2011.12.17 - Compatibiilty Update: Cast Animations
  44. # 2011.12.15 - Compatibility Update: Battle Command List
  45. # 2011.12.14 - Compatibility Update: Lunatic Objects
  46. # 2011.12.13 - Compatibility Update: Command Party
  47. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  48. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  49. #            - Popup graphical bug fixed.
  50. #            - Bug fixed: Didn't wait for boss dead animations.
  51. #            - Bug fixed: Surprise attacks that froze the game.
  52. #            - Bug fixed: Popups didn't show for straight recovery effects.
  53. # 2011.12.08 - Finished Script.
  54. # 2011.12.04 - Started Script.
  55. #
  56. #==============================================================================
  57. # ▼ Introduction
  58. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  59. # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  60. # allows for easier management of the battle engine without adding too many
  61. # features, allowing users to customize what they want as they see fit. While
  62. # the Ace Battle Engine isn't an entirely new engine, it gives users control
  63. # that RPG Maker VX Ace didn't originally give them.
  64. #
  65. # Furthermore, this script provides some new features. They are as follows:
  66. #
  67. # -----------------------------------------------------------------------------
  68. # Animation Fixes
  69. # -----------------------------------------------------------------------------
  70. # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  71. # these fixes are included in this script as well to ensure it's working for
  72. # the battle script in the event someone chooses not to work with the Ace Core
  73. # Engine script. The animation fixes prevent excessive animation overlaying
  74. # (and making the screen look really ugly) and prevents animation clashing
  75. # between two dual wielding normal attack animations.
  76. #
  77. # -----------------------------------------------------------------------------
  78. # Enemy Animations
  79. # -----------------------------------------------------------------------------
  80. # Enemies now show battle animations when they deliver attacks and skills
  81. # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  82. # than just sound effects and the screen shaking. Now, animations play where
  83. # the status window is and relative to the position of each party member.
  84. #
  85. # -----------------------------------------------------------------------------
  86. # Left/Right Command Selection
  87. # -----------------------------------------------------------------------------
  88. # While choosing actions, the player can press Left or Right to move freely
  89. # between (alive) actors to change their skills. Players no longer have to
  90. # cancel all the way back to change one person's skill and reselect everything.
  91. # On that note, there is now the option that when a battle starts or at the
  92. # end of a turn, players will start immediately at command selection rather
  93. # than needing to select "Fight" in the Party Command Window.
  94. #
  95. # -----------------------------------------------------------------------------
  96. # Popups
  97. # -----------------------------------------------------------------------------
  98. # Dealing damage, inflicting states, adding buffs, landing critical hits,
  99. # striking weaknesses, missing attacks, you name it, there's probably a popup
  100. # for it. Popups deliver information to the player in a quick or orderly
  101. # fashion without requiring the player to read lines of text.
  102. #
  103. # -----------------------------------------------------------------------------
  104. # Targeting Window
  105. # -----------------------------------------------------------------------------
  106. # When targeting enemies, the window is no longer displayed. Instead, the
  107. # targeted enemies are highlighted and their names are shown at the top of the
  108. # screen in a help window. Another thing that's changed is when skills that
  109. # target multiple targets are selected, there is a confirmation step that the
  110. # player must take before continuing. In this confirmation step, all of the
  111. # multiple targets are selected and in the help window would display the scope
  112. # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  113. # this step by default.
  114. #
  115. # -----------------------------------------------------------------------------
  116. # Toggling On and Off Special Effects and Text
  117. # -----------------------------------------------------------------------------
  118. # Not everybody likes having the screen shake or the enemies blink when they
  119. # take damage. These effects can now be toggled on and off. Certain text can
  120. # also be toggled on and off from appearing. A lot of the displayed text has
  121. # been rendered redundant through the use of popups.
  122. #
  123. # -----------------------------------------------------------------------------
  124. # Visual Battle Status Window
  125. # -----------------------------------------------------------------------------
  126. # Rather than just having rows of names with HP and MP bars next to them, the
  127. # Battle Status Window now displays actors' faces and their gauges aligned at
  128. # the bottom. More status effects can be shown in addition to showing more
  129. # members on screen at once. The Battle Status Window is also optimized to
  130. # refresh less (thus, removing potential lag from the system).
  131. #
  132. # -----------------------------------------------------------------------------
  133. # Window Position Changes
  134. # -----------------------------------------------------------------------------
  135. # Windows such as the Skill Window and Item Window have been rearranged to
  136. # always provide the player a clear view of the battlefield rather than opening
  137. # up and covering everything. As such, the window positions are placed at the
  138. # bottom of the screen and are repositioned.
  139. #
  140. #==============================================================================
  141. # ▼ Instructions
  142. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  143. # To install this script, open up your script editor and copy/paste this script
  144. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  145. #
  146. # -----------------------------------------------------------------------------
  147. # Skill Notetags - These notetags go in the skills notebox in the database.
  148. # -----------------------------------------------------------------------------
  149. # <one animation>
  150. # Causes the action to display the action animation only once, even if it's a
  151. # multi-hit action. This is used primarily for non-all scope targeting.
  152. #
  153. # -----------------------------------------------------------------------------
  154. # Item Notetags - These notetags go in the items notebox in the database.
  155. # -----------------------------------------------------------------------------
  156. # <one animation>
  157. # Causes the action to display the action animation only once, even if it's a
  158. # multi-hit action. This is used primarily for non-all scope targeting.
  159. #
  160. # -----------------------------------------------------------------------------
  161. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  162. # -----------------------------------------------------------------------------
  163. # <atk ani 1: x>
  164. # <atk ani 2: x>
  165. # Changes the normal attack animation of the particular enemy to animation x.
  166. # Attack animation 1 is the first one that plays. If there's a second animation
  167. # then the second one will play after in mirrored form.
  168. #
  169. # -----------------------------------------------------------------------------
  170. # State Notetags - These notetags go in the state notebox in the database.
  171. # -----------------------------------------------------------------------------
  172. # <popup add: string>
  173. # <popup rem: string>
  174. # <popup dur: string>
  175. # Status effects now create popups whenever they're inflicted. However, if you
  176. # don't like that a certain status effect uses a particular colour setting,
  177. # change "string" to one of the rulesets below to cause that popup to use a
  178. # different ruleset.
  179. #
  180. # <popup hide add>
  181. # <popup hide rem>
  182. # <popup hide dur>
  183. # Not everybody wants status effects to show popups when inflicted. When this
  184. # is the case, insert the respective tag to hide popups from appearing when the
  185. # state is added, removed, or during the stand-by phases.
  186. #
  187. # -----------------------------------------------------------------------------
  188. # Debug Tools - These tools only work during Test Play.
  189. # -----------------------------------------------------------------------------
  190. # - F5 Key -
  191. # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  192. # All states and buffs are removed whether they are positive or negative.
  193. #
  194. # - F6 Key -
  195. # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  196. #
  197. # - F7 Key -
  198. # Sets all actors to have max TP. Everything else is unaffected.
  199. #
  200. # - F8 Key -
  201. # Kills all enemies in battle. Ends the battle quickly.
  202. #
  203. #==============================================================================
  204. # ▼ Compatibility
  205. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  206. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  207. # it will run with RPG Maker VX without adjusting.
  208. #
  209. #==============================================================================
  210.  
  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      = false  # Blink sprite when damaged?
  222.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  223.     SCREEN_SHAKE       = false  # Shake screen in battle?
  224.     SKIP_PARTY_COMMAND = true   # Skips the Fight/Escape menu.
  225.     AUTO_FAST          = true   # 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  = 11
  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 = 20    # Font size used for HP, MP, TP.
  253.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  254.     BATTLESTATUS_HPGAUGE_Y_PLUS = 31    # Y Location buffer used for HP gauge.
  255.     BATTLESTATUS_CENTER_FACES   = false # 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        = "敌方全体"
  265.     HELP_TEXT_ONE_RANDOM_FOE  = "敌方随机成员一名"
  266.     HELP_TEXT_MANY_RANDOM_FOE = "敌方随机成员%d名"
  267.     HELP_TEXT_ALL_ALLIES      = "我方全体"
  268.     HELP_TEXT_ALL_DEAD_ALLIES = "我方全体(战斗不能)"
  269.     HELP_TEXT_ONE_RANDOM_ALLY = "我方随机成员一名"
  270.     HELP_TEXT_RANDOM_ALLIES   = "我方随机成员%d名"
  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  = false#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       => 60,          # 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 MP",    # SprintF for MP damage.
  291.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  292.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  293.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  294.       :drained    => "DRAIN",     # 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     => "NULL",      # 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 = ["黑体", "VL Gothic", "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  = false  # 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    = false  # Show effect failed against target.
  367.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  368.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  369.     MSG_EVASION        = false  # 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   = false  # Show target's added states.
  374.     MSG_REMOVED_STATES = false  # Show target's removed states.
  375.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  376.  
  377.   end # BATTLE
  378. end # YEA
  379.  
  380. #==============================================================================
  381. # ▼ Editting anything past this point may potentially result in causing
  382. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  383. # halitosis so edit at your own risk.
  384. #==============================================================================
  385.  
  386. module YEA
  387.   module REGEXP
  388.   module ENEMY
  389.  
  390.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  391.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  392.  
  393.   end # ENEMY
  394.   module USABLEITEM
  395.  
  396.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  397.  
  398.   end # USABLEITEM
  399.   module STATE
  400.  
  401.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  402.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  403.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  404.  
  405.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  406.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  407.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  408.  
  409.   end # STATE
  410.   end # REGEXP
  411. end # YEA
  412.  
  413. #==============================================================================
  414. # ■ Switch
  415. #==============================================================================
  416.  
  417. module Switch
  418.  
  419.   #--------------------------------------------------------------------------
  420.   # self.hide_popups
  421.   #--------------------------------------------------------------------------
  422.   def self.hide_popups
  423.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  424.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  425.   end
  426.  
  427. end # Switch
  428.  
  429. #==============================================================================
  430. # ■ Colour
  431. #==============================================================================
  432.  
  433. module Colour
  434.  
  435.   #--------------------------------------------------------------------------
  436.   # self.text_colour
  437.   #--------------------------------------------------------------------------
  438.   def self.text_colour(index)
  439.     windowskin = Cache.system("Window")
  440.     x = 64 + (index % 8) * 8
  441.     y = 96 + (index / 8) * 8
  442.     return windowskin.get_pixel(x, y)
  443.   end
  444.  
  445. end # Colour
  446.  
  447. #==============================================================================
  448. # ■ Icon
  449. #==============================================================================
  450.  
  451. module Icon
  452.  
  453.   #--------------------------------------------------------------------------
  454.   # self.no_action
  455.   #--------------------------------------------------------------------------
  456.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  457.  
  458. end # Icon
  459.  
  460. #==============================================================================
  461. # ■ Numeric
  462. #==============================================================================
  463.  
  464. class Numeric
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # new method: group_digits
  468.   #--------------------------------------------------------------------------
  469.   unless $imported["YEA-CoreEngine"]
  470.   def group; return self.to_s; end
  471.   end # $imported["YEA-CoreEngine"]
  472.  
  473. end # Numeric
  474.  
  475. #==============================================================================
  476. # ■ DataManager
  477. #==============================================================================
  478.  
  479. module DataManager
  480.  
  481.   #--------------------------------------------------------------------------
  482.   # alias method: load_database
  483.   #--------------------------------------------------------------------------
  484.   class <<self; alias load_database_abe load_database; end
  485.   def self.load_database
  486.     load_database_abe
  487.     load_notetags_abe
  488.   end
  489.  
  490.   #--------------------------------------------------------------------------
  491.   # new method: load_notetags_abe
  492.   #--------------------------------------------------------------------------
  493.   def self.load_notetags_abe
  494.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  495.     for group in groups
  496.       for obj in group
  497.         next if obj.nil?
  498.         obj.load_notetags_abe
  499.       end
  500.     end
  501.   end
  502.  
  503. end # DataManager
  504.  
  505. #==============================================================================
  506. # ■ RPG::UsableItem
  507. #==============================================================================
  508.  
  509. class RPG::UsableItem < RPG::BaseItem
  510.  
  511.   #--------------------------------------------------------------------------
  512.   # public instance variables
  513.   #--------------------------------------------------------------------------
  514.   attr_accessor :one_animation
  515.  
  516.   #--------------------------------------------------------------------------
  517.   # common cache: load_notetags_abe
  518.   #--------------------------------------------------------------------------
  519.   def load_notetags_abe
  520.     @one_animation = false
  521.     #---
  522.     self.note.split(/[\r\n]+/).each { |line|
  523.       case line
  524.       #---
  525.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  526.         @one_animation = true
  527.       end
  528.     } # self.note.split
  529.     #---
  530.   end
  531.  
  532. end # RPG::UsableItem
  533.  
  534. #==============================================================================
  535. # ■ RPG::Enemy
  536. #==============================================================================
  537.  
  538. class RPG::Enemy < RPG::BaseItem
  539.  
  540.   #--------------------------------------------------------------------------
  541.   # public instance variables
  542.   #--------------------------------------------------------------------------
  543.   attr_accessor :atk_animation_id1
  544.   attr_accessor :atk_animation_id2
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # common cache: load_notetags_abe
  548.   #--------------------------------------------------------------------------
  549.   def load_notetags_abe
  550.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  551.     @atk_animation_id2 = 0
  552.     #---
  553.     self.note.split(/[\r\n]+/).each { |line|
  554.       case line
  555.       #---
  556.       when YEA::REGEXP::ENEMY::ATK_ANI1
  557.         @atk_animation_id1 = $1.to_i
  558.       when YEA::REGEXP::ENEMY::ATK_ANI2
  559.         @atk_animation_id2 = $1.to_i
  560.       end
  561.     } # self.note.split
  562.     #---
  563.   end
  564.  
  565. end # RPG::Enemy
  566.  
  567. #==============================================================================
  568. # ■ RPG::Enemy
  569. #==============================================================================
  570.  
  571. class RPG::State < RPG::BaseItem
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # public instance variables
  575.   #--------------------------------------------------------------------------
  576.   attr_accessor :popup_rules
  577.  
  578.   #--------------------------------------------------------------------------
  579.   # common cache: load_notetags_abe
  580.   #--------------------------------------------------------------------------
  581.   def load_notetags_abe
  582.     @popup_rules = {
  583.       :add_state => "ADDSTATE",
  584.       :rem_state => "REMSTATE",
  585.       :dur_state => nil
  586.     } # Do not remove this.
  587.     #---
  588.     self.note.split(/[\r\n]+/).each { |line|
  589.       case line
  590.       #---
  591.       when YEA::REGEXP::STATE::POPUP_ADD
  592.         @popup_rules[:add_state] = $1.upcase.to_s
  593.       when YEA::REGEXP::STATE::POPUP_REM
  594.         @popup_rules[:rem_state] = $1.upcase.to_s
  595.       when YEA::REGEXP::STATE::POPUP_DUR
  596.         @popup_rules[:dur_state] = $1.upcase.to_s
  597.       when YEA::REGEXP::STATE::HIDE_ADD
  598.         @popup_rules[:add_state] = nil
  599.       when YEA::REGEXP::STATE::HIDE_REM
  600.         @popup_rules[:rem_state] = nil
  601.       when YEA::REGEXP::STATE::HIDE_DUR
  602.         @popup_rules[:dur_state] = nil
  603.       end
  604.     } # self.note.split
  605.     #---
  606.   end
  607.  
  608. end # RPG::State
  609.  
  610. #==============================================================================
  611. # ■ BattleManager
  612. #==============================================================================
  613.  
  614. module BattleManager
  615.  
  616.   #--------------------------------------------------------------------------
  617.   # overwrite method: self.battle_start
  618.   #--------------------------------------------------------------------------
  619.   def self.battle_start
  620.     $game_system.battle_count += 1
  621.     $game_party.on_battle_start
  622.     $game_troop.on_battle_start
  623.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  624.     $game_troop.enemy_names.each do |name|
  625.       $game_message.add(sprintf(Vocab::Emerge, name))
  626.     end
  627.     if @preemptive
  628.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  629.     elsif @surprise
  630.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  631.     end
  632.     wait_for_message
  633.   end
  634.  
  635.   #--------------------------------------------------------------------------
  636.   # overwrite method: make_action_orders
  637.   #--------------------------------------------------------------------------
  638.   def self.make_action_orders
  639.     make_dtb_action_orders if btype?(:dtb)
  640.   end
  641.  
  642.   #--------------------------------------------------------------------------
  643.   # new method: make_dtb_action_orders
  644.   #--------------------------------------------------------------------------
  645.   def self.make_dtb_action_orders
  646.     @action_battlers = []
  647.     @action_battlers += $game_party.members unless @surprise
  648.     @action_battlers += $game_troop.members unless @preemptive
  649.     @action_battlers.each {|battler| battler.make_speed }
  650.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  651.   end
  652.  
  653.   #--------------------------------------------------------------------------
  654.   # overwrite method: turn_start
  655.   #--------------------------------------------------------------------------
  656.   def self.turn_start
  657.     @phase = :turn
  658.     clear_actor
  659.     $game_troop.increase_turn
  660.     @performed_battlers = []
  661.     make_action_orders
  662.   end
  663.  
  664.   #--------------------------------------------------------------------------
  665.   # overwrite method: next_subject
  666.   #--------------------------------------------------------------------------
  667.   def self.next_subject
  668.     @performed_battlers = [] if @performed_battlers.nil?
  669.     loop do
  670.       @action_battlers -= @performed_battlers
  671.       battler = @action_battlers.shift
  672.       return nil unless battler
  673.       next unless battler.index && battler.alive?
  674.       @performed_battlers.push(battler)
  675.       return battler
  676.     end
  677.   end
  678.  
  679.   #--------------------------------------------------------------------------
  680.   # overwrite method: force_action
  681.   #--------------------------------------------------------------------------
  682.   def self.force_action(battler)
  683.     @action_forced = [] if @action_forced == nil
  684.     @action_forced.push(battler)
  685.     return unless Switch.forced_action_remove
  686.     @action_battlers.delete(battler)
  687.   end
  688.  
  689.   #--------------------------------------------------------------------------
  690.   # overwrite method: action_forced?
  691.   #--------------------------------------------------------------------------
  692.   def self.action_forced?
  693.     @action_forced != nil
  694.   end
  695.  
  696.   #--------------------------------------------------------------------------
  697.   # overwrite method: action_forced_battler
  698.   #--------------------------------------------------------------------------
  699.   def self.action_forced_battler
  700.     @action_forced.shift
  701.   end
  702.  
  703.   #--------------------------------------------------------------------------
  704.   # overwrite method: clear_action_force
  705.   #--------------------------------------------------------------------------
  706.   def self.clear_action_force
  707.     return if @action_forced.nil?
  708.     @action_forced = nil if @action_forced.empty?
  709.   end
  710.  
  711.   #--------------------------------------------------------------------------
  712.   # new method: self.init_battle_type
  713.   #--------------------------------------------------------------------------
  714.   def self.init_battle_type
  715.     set_btype($game_system.battle_system)
  716.   end
  717.  
  718.   #--------------------------------------------------------------------------
  719.   # new method: self.set_btype
  720.   #--------------------------------------------------------------------------
  721.   def self.set_btype(btype = :dtb)
  722.     @battle_type = btype
  723.   end
  724.  
  725.   #--------------------------------------------------------------------------
  726.   # new method: self.btype?
  727.   #--------------------------------------------------------------------------
  728.   def self.btype?(btype)
  729.     return @battle_type == btype
  730.   end
  731.  
  732. end # BattleManager
  733.  
  734. #==============================================================================
  735. # ■ Game_System
  736. #==============================================================================
  737.  
  738. class Game_System
  739.  
  740.   #--------------------------------------------------------------------------
  741.   # new method: battle_system
  742.   #--------------------------------------------------------------------------
  743.   def battle_system
  744.     if @battle_system.nil?
  745.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  746.     else
  747.       return battle_system_corrected(@battle_system)
  748.     end
  749.   end
  750.  
  751.   #--------------------------------------------------------------------------
  752.   # new method: set_battle_system
  753.   #--------------------------------------------------------------------------
  754.   def set_battle_system(type)
  755.     case type
  756.     when :dtb; @battle_system = :dtb
  757.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  758.     else;      @battle_system = :dtb
  759.     end
  760.   end
  761.  
  762.   #--------------------------------------------------------------------------
  763.   # new method: battle_system_corrected
  764.   #--------------------------------------------------------------------------
  765.   def battle_system_corrected(type)
  766.     case type
  767.     when :dtb; return :dtb
  768.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  769.     else;      return :dtb
  770.     end
  771.   end
  772.  
  773. end # Game_System
  774.  
  775. #==============================================================================
  776. # ■ Sprite_Base
  777. #==============================================================================
  778.  
  779. class Sprite_Base < Sprite
  780.  
  781.   #--------------------------------------------------------------------------
  782.   # new method: start_pseudo_animation
  783.   #--------------------------------------------------------------------------
  784.   unless $imported["YEA-CoreEngine"]
  785.   def start_pseudo_animation(animation, mirror = false)
  786.     dispose_animation
  787.     @animation = animation
  788.     return if @animation.nil?
  789.     @ani_mirror = mirror
  790.     set_animation_rate
  791.     @ani_duration = @animation.frame_max * @ani_rate + 1
  792.     @ani_sprites = []
  793.   end
  794.   end # $imported["YEA-CoreEngine"]
  795.  
  796. end # Sprite_Base
  797.  
  798. #==============================================================================
  799. # ■ Sprite_Battler
  800. #==============================================================================
  801.  
  802. class Sprite_Battler < Sprite_Base
  803.  
  804.   #--------------------------------------------------------------------------
  805.   # public instance variables
  806.   #--------------------------------------------------------------------------
  807.   attr_accessor :effect_type
  808.   attr_accessor :battler_visible
  809.   attr_accessor :popups
  810.  
  811.   #--------------------------------------------------------------------------
  812.   # alias method: initialize
  813.   #--------------------------------------------------------------------------
  814.   alias sprite_battler_initialize_abe initialize
  815.   def initialize(viewport, battler = nil)
  816.     sprite_battler_initialize_abe(viewport, battler)
  817.     @popups = []
  818.     @popup_flags = []
  819.   end
  820.  
  821.   #--------------------------------------------------------------------------
  822.   # alias method: update_bitmap
  823.   #--------------------------------------------------------------------------
  824.   alias sprite_battler_update_bitmap_abe update_bitmap
  825.   def update_bitmap
  826.     return if @battler.actor? && @battler.battler_name == ""
  827.     sprite_battler_update_bitmap_abe
  828.   end
  829.  
  830.   #--------------------------------------------------------------------------
  831.   # alias method: setup_new_animation
  832.   #--------------------------------------------------------------------------
  833.   unless $imported["YEA-CoreEngine"]
  834.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  835.   def setup_new_animation
  836.     sprite_battler_setup_new_animation_abe
  837.     return if @battler.pseudo_ani_id <= 0
  838.     animation = $data_animations[@battler.pseudo_ani_id]
  839.     mirror = @battler.animation_mirror
  840.     start_pseudo_animation(animation, mirror)
  841.     @battler.pseudo_ani_id = 0
  842.   end
  843.   end # $imported["YEA-CoreEngine"]
  844.  
  845.   #--------------------------------------------------------------------------
  846.   # alias method: setup_new_effect
  847.   #--------------------------------------------------------------------------
  848.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  849.   def setup_new_effect
  850.     sprite_battler_setup_new_effect_abe
  851.     setup_popups
  852.   end
  853.  
  854.   #--------------------------------------------------------------------------
  855.   # new method: setup_popups
  856.   #--------------------------------------------------------------------------
  857.   def setup_popups
  858.     return unless @battler.use_sprite?
  859.     @battler.popups = [] if @battler.popups.nil?
  860.     return if @battler.popups == []
  861.     array = @battler.popups.shift
  862.     create_new_popup(array[0], array[1], array[2])
  863.   end
  864.  
  865.   #--------------------------------------------------------------------------
  866.   # new method: create_new_popup
  867.   #--------------------------------------------------------------------------
  868.   def create_new_popup(value, rules, flags)
  869.     return if @battler == nil
  870.     return if flags & @popup_flags != []
  871.     array = YEA::BATTLE::POPUP_RULES[rules]
  872.     for popup in @popups
  873.       popup.y -= 24
  874.     end
  875.     return unless SceneManager.scene.is_a?(Scene_Battle)
  876.     return if SceneManager.scene.spriteset.nil?
  877.     view = SceneManager.scene.spriteset.viewportPopups
  878.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  879.     @popups.push(new_popup)
  880.     @popup_flags.push("weakness") if flags.include?("weakness")
  881.     @popup_flags.push("resistant") if flags.include?("resistant")
  882.     @popup_flags.push("immune") if flags.include?("immune")
  883.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  884.   end
  885.  
  886.   #--------------------------------------------------------------------------
  887.   # alias method: update_effect
  888.   #--------------------------------------------------------------------------
  889.   alias sprite_battler_update_effect_abe update_effect
  890.   def update_effect
  891.     sprite_battler_update_effect_abe
  892.     update_popups
  893.   end
  894.  
  895.   #--------------------------------------------------------------------------
  896.   # new method: update_popups
  897.   #--------------------------------------------------------------------------
  898.   def update_popups
  899.     for popup in @popups
  900.       popup.update
  901.       next unless popup.opacity <= 0
  902.       popup.bitmap.dispose
  903.       popup.dispose
  904.       @popups.delete(popup)
  905.       popup = nil
  906.     end
  907.     @popup_flags = [] if @popups == [] && @popup_flags != []
  908.     return unless SceneManager.scene_is?(Scene_Battle)
  909.     if @current_active_battler != SceneManager.scene.subject
  910.       @current_active_battler = SceneManager.scene.subject
  911.       @popup_flags = []
  912.     end
  913.   end
  914.  
  915. end # Sprite_Battler
  916.  
  917. #==============================================================================
  918. # ■ Sprite_Popup
  919. #==============================================================================
  920.  
  921. class Sprite_Popup < Sprite_Base
  922.  
  923.   #--------------------------------------------------------------------------
  924.   # public instance variables
  925.   #--------------------------------------------------------------------------
  926.   attr_accessor :flags
  927.  
  928.   #--------------------------------------------------------------------------
  929.   # initialize
  930.   #--------------------------------------------------------------------------
  931.   def initialize(viewport, battler, value, rules, flags)
  932.     super(viewport)
  933.     @value = value
  934.     @rules = rules
  935.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  936.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  937.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  938.     @flags = flags
  939.     @battler = battler
  940.     create_popup_bitmap
  941.   end
  942.  
  943.   #--------------------------------------------------------------------------
  944.   # create_popup_bitmap
  945.   #--------------------------------------------------------------------------
  946.   def create_popup_bitmap
  947.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  948.     bw = Graphics.width
  949.     bw += 48 if @flags.include?("state")
  950.     bh = Font.default_size * 3
  951.     bitmap = Bitmap.new(bw, bh)
  952.     bitmap.font.name = rules_array[8]
  953.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  954.     bitmap.font.size = size
  955.     bitmap.font.bold = rules_array[3]
  956.     bitmap.font.italic = rules_array[4]
  957.     if flags.include?("critical")
  958.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  959.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  960.     else
  961.       bitmap.font.out_color.set(0, 0, 0, 255)
  962.     end
  963.     dx = 0; dy = 0; dw = 0
  964.     dx += 24 if @flags.include?("state")
  965.     dw += 24 if @flags.include?("state")
  966.     if @flags.include?("state") || @flags.include?("buff")
  967.       c_width = bitmap.text_size(@value).width
  968.       icon_bitmap = $game_temp.iconset
  969.       icon_index = flag_state_icon
  970.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  971.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  972.     end
  973.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  974.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  975.     self.bitmap = bitmap
  976.     self.x = @battler.screen_x
  977.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  978.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  979.     self.y = @battler.screen_y - @battler.sprite.oy/2
  980.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  981.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  982.     self.ox = bw/2; self.oy = bh/2
  983.     self.zoom_x = self.zoom_y = rules_array[0]
  984.     if @flags.include?("no zoom")
  985.       self.zoom_x = self.zoom_y = rules_array[1]
  986.     end
  987.     @target_zoom = rules_array[1]
  988.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  989.     self.z = 500
  990.   end
  991.  
  992.   #--------------------------------------------------------------------------
  993.   # update
  994.   #--------------------------------------------------------------------------
  995.   def update
  996.     super
  997.     #---
  998.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  999.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  1000.       @hue_duration -= 1
  1001.       self.bitmap.hue_change(15) if @hue_duration <= 0
  1002.     end
  1003.     #---
  1004.     if @zoom_direction == "up"
  1005.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  1006.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  1007.     else
  1008.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  1009.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  1010.     end
  1011.     #---
  1012.     @full -= 1
  1013.     return if @full > 0
  1014.     self.y -= 1
  1015.     self.opacity -= @fade
  1016.   end
  1017.  
  1018.   #--------------------------------------------------------------------------
  1019.   # flag_state_icon
  1020.   #--------------------------------------------------------------------------
  1021.   def flag_state_icon
  1022.     for item in @flags; return item if item.is_a?(Integer); end
  1023.     return 0
  1024.   end
  1025.  
  1026. end # Sprite_Popup
  1027.  
  1028. #==============================================================================
  1029. # ■ Spriteset_Battle
  1030. #==============================================================================
  1031.  
  1032. class Spriteset_Battle
  1033.  
  1034.   #--------------------------------------------------------------------------
  1035.   # public instance variables
  1036.   #--------------------------------------------------------------------------
  1037.   attr_accessor :actor_sprites
  1038.   attr_accessor :enemy_sprites
  1039.   attr_accessor :viewport1
  1040.   attr_accessor :viewportPopups
  1041.  
  1042.   #--------------------------------------------------------------------------
  1043.   # alias method: create_viewports
  1044.   #--------------------------------------------------------------------------
  1045.   alias spriteset_battle_create_viewports_abe create_viewports
  1046.   def create_viewports
  1047.     spriteset_battle_create_viewports_abe
  1048.     @viewportPopups = Viewport.new
  1049.     @viewportPopups.z = 200
  1050.   end
  1051.  
  1052.   #--------------------------------------------------------------------------
  1053.   # alias method: dispose_viewports
  1054.   #--------------------------------------------------------------------------
  1055.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1056.   def dispose_viewports
  1057.     spriteset_battle_dispose_viewports_abe
  1058.     @viewportPopups.dispose
  1059.   end
  1060.  
  1061.   #--------------------------------------------------------------------------
  1062.   # alias method: update_viewports
  1063.   #--------------------------------------------------------------------------
  1064.   alias spriteset_battle_update_viewports_abe update_viewports
  1065.   def update_viewports
  1066.     spriteset_battle_update_viewports_abe
  1067.     @viewportPopups.update
  1068.   end
  1069.  
  1070. end # Spriteset_Battle
  1071.  
  1072. #==============================================================================
  1073. # ■ Game_Temp
  1074. #==============================================================================
  1075.  
  1076. class Game_Temp
  1077.  
  1078.   #--------------------------------------------------------------------------
  1079.   # public instance variables
  1080.   #--------------------------------------------------------------------------
  1081.   attr_accessor :battle_aid
  1082.   attr_accessor :evaluating
  1083.   attr_accessor :iconset
  1084.  
  1085.   #--------------------------------------------------------------------------
  1086.   # alias method: initialize
  1087.   #--------------------------------------------------------------------------
  1088.   alias game_temp_initialize_abe initialize
  1089.   def initialize
  1090.     game_temp_initialize_abe
  1091.     @iconset = Cache.system("Iconset")
  1092.   end
  1093.  
  1094. end # Game_Temp
  1095.  
  1096. #==============================================================================
  1097. # ■ Game_Action
  1098. #==============================================================================
  1099.  
  1100. class Game_Action
  1101.  
  1102.   #--------------------------------------------------------------------------
  1103.   # overwrite method: speed
  1104.   #--------------------------------------------------------------------------
  1105.   def speed
  1106.     speed = subject.agi
  1107.     speed += item.speed if item
  1108.     speed += subject.atk_speed if attack?
  1109.     return speed
  1110.   end
  1111.  
  1112.   #--------------------------------------------------------------------------
  1113.   # alias method: evaluate_item_with_target
  1114.   #--------------------------------------------------------------------------
  1115.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1116.   def evaluate_item_with_target(target)
  1117.     $game_temp.evaluating = true
  1118.     result = evaluate_item_with_target_abe(target)
  1119.     $game_temp.evaluating = false
  1120.     return result
  1121.   end
  1122.  
  1123. end # Game_Action
  1124.  
  1125. #==============================================================================
  1126. # ■ Game_ActionResult
  1127. #==============================================================================
  1128.  
  1129. class Game_ActionResult
  1130.  
  1131.   #--------------------------------------------------------------------------
  1132.   # alias method: clear
  1133.   #--------------------------------------------------------------------------
  1134.   alias game_actionresult_clear_abe clear
  1135.   def clear
  1136.     game_actionresult_clear_abe
  1137.     clear_stored_damage
  1138.   end
  1139.  
  1140.   #--------------------------------------------------------------------------
  1141.   # new method: clear_stored_damage
  1142.   #--------------------------------------------------------------------------
  1143.   def clear_stored_damage
  1144.     @stored_hp_damage = 0
  1145.     @stored_mp_damage = 0
  1146.     @stored_tp_damage = 0
  1147.     @stored_hp_drain = 0
  1148.     @stored_mp_drain = 0
  1149.   end
  1150.  
  1151.   #--------------------------------------------------------------------------
  1152.   # new method: store_damage
  1153.   #--------------------------------------------------------------------------
  1154.   def store_damage
  1155.     @stored_hp_damage += @hp_damage
  1156.     @stored_mp_damage += @mp_damage
  1157.     @stored_tp_damage += @tp_damage
  1158.     @stored_hp_drain += @hp_drain
  1159.     @stored_mp_drain += @mp_drain
  1160.   end
  1161.  
  1162.   #--------------------------------------------------------------------------
  1163.   # new method: restore_damage
  1164.   #--------------------------------------------------------------------------
  1165.   def restore_damage
  1166.     @hp_damage = @stored_hp_damage
  1167.     @mp_damage = @stored_mp_damage
  1168.     @tp_damage = @stored_tp_damage
  1169.     @hp_drain = @stored_hp_drain
  1170.     @mp_drain = @stored_mp_drain
  1171.   end
  1172.  
  1173. end # Game_ActionResult
  1174.  
  1175. #==============================================================================
  1176. # ■ Game_BattlerBase
  1177. #==============================================================================
  1178.  
  1179. class Game_BattlerBase
  1180.  
  1181.   #--------------------------------------------------------------------------
  1182.   # public instance variables
  1183.   #--------------------------------------------------------------------------
  1184.   attr_accessor :popups
  1185.  
  1186.   #--------------------------------------------------------------------------
  1187.   # new method: create_popup
  1188.   #--------------------------------------------------------------------------
  1189.   def create_popup(value, rules = "DEFAULT", flags = [])
  1190.     return unless SceneManager.scene_is?(Scene_Battle)
  1191.     return unless YEA::BATTLE::ENABLE_POPUPS
  1192.     return if Switch.hide_popups
  1193.     @popups = [] if @popups.nil?
  1194.     @popups.push([value, rules, flags])
  1195.   end
  1196.  
  1197.   #--------------------------------------------------------------------------
  1198.   # new method: make_damage_popups
  1199.   #--------------------------------------------------------------------------
  1200.   def make_damage_popups(user)
  1201.     if @result.hp_drain != 0
  1202.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1203.       rules = "DRAIN"
  1204.       user.create_popup(text, rules)
  1205.       setting = :hp_dmg  if @result.hp_drain < 0
  1206.       setting = :hp_heal if @result.hp_drain > 0
  1207.       rules = "HP_DMG"   if @result.hp_drain < 0
  1208.       rules = "HP_HEAL"  if @result.hp_drain > 0
  1209.       value = @result.hp_drain.abs
  1210.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1211.       user.create_popup(text, rules)
  1212.     end
  1213.     if @result.mp_drain != 0
  1214.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1215.       rules = "DRAIN"
  1216.       user.create_popup(text, rules)
  1217.       setting = :mp_dmg  if @result.mp_drain < 0
  1218.       setting = :mp_heal if @result.mp_drain > 0
  1219.       rules = "HP_DMG"   if @result.mp_drain < 0
  1220.       rules = "HP_HEAL"  if @result.mp_drain > 0
  1221.       value = @result.mp_drain.abs
  1222.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1223.       user.create_popup(text, rules)
  1224.     end
  1225.     #---
  1226.     flags = []
  1227.     flags.push("critical") if @result.critical
  1228.     if @result.hp_damage != 0
  1229.       setting = :hp_dmg  if @result.hp_damage > 0
  1230.       setting = :hp_heal if @result.hp_damage < 0
  1231.       rules = "HP_DMG"   if @result.hp_damage > 0
  1232.       rules = "HP_HEAL"  if @result.hp_damage < 0
  1233.       value = @result.hp_damage.abs
  1234.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1235.       create_popup(text, rules, flags)
  1236.     end
  1237.     if @result.mp_damage != 0
  1238.       setting = :mp_dmg  if @result.mp_damage > 0
  1239.       setting = :mp_heal if @result.mp_damage < 0
  1240.       rules = "MP_DMG"   if @result.mp_damage > 0
  1241.       rules = "MP_HEAL"  if @result.mp_damage < 0
  1242.       value = @result.mp_damage.abs
  1243.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1244.       create_popup(text, rules, flags)
  1245.     end
  1246.     if @result.tp_damage != 0
  1247.       setting = :tp_dmg  if @result.tp_damage > 0
  1248.       setting = :tp_heal if @result.tp_damage < 0
  1249.       rules = "TP_DMG"   if @result.tp_damage > 0
  1250.       rules = "TP_HEAL"  if @result.tp_damage < 0
  1251.       value = @result.tp_damage.abs
  1252.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1253.       create_popup(text, rules)
  1254.     end
  1255.     @result.store_damage
  1256.     @result.clear_damage_values
  1257.   end
  1258.  
  1259.   #--------------------------------------------------------------------------
  1260.   # alias method: erase_state
  1261.   #--------------------------------------------------------------------------
  1262.   alias game_battlerbase_erase_state_abe erase_state
  1263.   def erase_state(state_id)
  1264.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1265.     game_battlerbase_erase_state_abe(state_id)
  1266.   end
  1267.  
  1268.   #--------------------------------------------------------------------------
  1269.   # new method: make_during_state_popup
  1270.   #--------------------------------------------------------------------------
  1271.   def make_during_state_popup
  1272.     state_id = most_important_state_id
  1273.     return if state_id == 0
  1274.     make_state_popup(state_id, :dur_state)
  1275.   end
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # new method: most_important_state_id
  1279.   #--------------------------------------------------------------------------
  1280.   def most_important_state_id
  1281.     states.each {|state| return state.id unless state.message3.empty? }
  1282.     return 0
  1283.   end
  1284.  
  1285.   #--------------------------------------------------------------------------
  1286.   # new method: make_state_popup
  1287.   #--------------------------------------------------------------------------
  1288.   def make_state_popup(state_id, type)
  1289.     state = $data_states[state_id]
  1290.     return if state.icon_index == 0
  1291.     rules = state.popup_rules[type]
  1292.     return if rules.nil?
  1293.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1294.     flags = ["state", state.icon_index]
  1295.     create_popup(text, rules, flags)
  1296.   end
  1297.  
  1298.   #--------------------------------------------------------------------------
  1299.   # new method: make_miss_popups
  1300.   #--------------------------------------------------------------------------
  1301.   def make_miss_popups(user, item)
  1302.     return if dead?
  1303.     if @result.missed
  1304.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1305.       rules = "DEFAULT"
  1306.       create_popup(text, rules)
  1307.     end
  1308.     if @result.evaded
  1309.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1310.       rules = "DEFAULT"
  1311.       create_popup(text, rules)
  1312.     end
  1313.     if @result.hit? && !@result.success
  1314.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1315.       rules = "DEFAULT"
  1316.       create_popup(text, rules)
  1317.     end
  1318.     if @result.hit? && item.damage.to_hp?
  1319.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1320.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1321.         rules = "DEFAULT"
  1322.         create_popup(text, rules)
  1323.       end
  1324.     end
  1325.   end
  1326.  
  1327.   #--------------------------------------------------------------------------
  1328.   # new method: make_rate_popup
  1329.   #--------------------------------------------------------------------------
  1330.   def make_rate_popup(rate)
  1331.     return if rate == 1.0
  1332.     flags = []
  1333.     if rate > 1.0
  1334.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1335.       rules = "WEAK_ELE"
  1336.       flags.push("weakness")
  1337.     elsif rate == 0.0
  1338.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1339.       rules = "IMMU_ELE"
  1340.       flags.push("immune")
  1341.     elsif rate < 0.0
  1342.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1343.       rules = "ABSB_ELE"
  1344.       flags.push("absorbed")
  1345.     else
  1346.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1347.       rules = "REST_ELE"
  1348.       flags.push("resistant")
  1349.     end
  1350.     create_popup(text, rules, flags)
  1351.   end
  1352.  
  1353.   #--------------------------------------------------------------------------
  1354.   # new method: make_buff_popup
  1355.   #--------------------------------------------------------------------------
  1356.   def make_buff_popup(param_id, positive = true)
  1357.     return unless alive?
  1358.     name = Vocab::param(param_id)
  1359.     if positive
  1360.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1361.       rules = "BUFF"
  1362.       buff_level = 1
  1363.     else
  1364.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1365.       rules = "DEBUFF"
  1366.       buff_level = -1
  1367.     end
  1368.     icon = buff_icon_index(buff_level, param_id)
  1369.     flags = ["buff", icon]
  1370.     return if @popups.include?([text, rules, flags])
  1371.     create_popup(text, rules, flags)
  1372.   end
  1373.  
  1374. end # Game_BattlerBase
  1375.  
  1376. #==============================================================================
  1377. # ■ Game_Battler
  1378. #==============================================================================
  1379.  
  1380. class Game_Battler < Game_BattlerBase
  1381.  
  1382.   #--------------------------------------------------------------------------
  1383.   # public instance variables
  1384.   #--------------------------------------------------------------------------
  1385.   attr_accessor :pseudo_ani_id
  1386.  
  1387.   #--------------------------------------------------------------------------
  1388.   # alias method: on_battle_end
  1389.   #--------------------------------------------------------------------------
  1390.   alias game_battler_on_battle_end_abe on_battle_end
  1391.   def on_battle_end
  1392.     game_battler_on_battle_end_abe
  1393.     @popups = []
  1394.   end
  1395.  
  1396.   #--------------------------------------------------------------------------
  1397.   # alias method: clear_sprite_effects
  1398.   #--------------------------------------------------------------------------
  1399.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1400.   def clear_sprite_effects
  1401.     game_battler_clear_sprite_effects_abe
  1402.     @pseudo_ani_id = 0
  1403.   end
  1404.  
  1405.   #--------------------------------------------------------------------------
  1406.   # alias method: item_apply
  1407.   #--------------------------------------------------------------------------
  1408.   alias game_battler_item_apply_abe item_apply
  1409.   def item_apply(user, item)
  1410.     game_battler_item_apply_abe(user, item)
  1411.     make_miss_popups(user, item)
  1412.   end
  1413.  
  1414.   #--------------------------------------------------------------------------
  1415.   # alias method: make_damage_value
  1416.   #--------------------------------------------------------------------------
  1417.   alias game_battler_make_damage_value_abe make_damage_value
  1418.   def make_damage_value(user, item)
  1419.     game_battler_make_damage_value_abe(user, item)
  1420.     rate = item_element_rate(user, item)
  1421.     make_rate_popup(rate) unless $game_temp.evaluating
  1422.   end
  1423.  
  1424.   #--------------------------------------------------------------------------
  1425.   # alias method: execute_damage
  1426.   #--------------------------------------------------------------------------
  1427.   alias game_battler_execute_damage_abe execute_damage
  1428.   def execute_damage(user)
  1429.     game_battler_execute_damage_abe(user)
  1430.     make_damage_popups(user)
  1431.   end
  1432.  
  1433.   #--------------------------------------------------------------------------
  1434.   # alias method: item_effect_recover_hp
  1435.   #--------------------------------------------------------------------------
  1436.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1437.   def item_effect_recover_hp(user, item, effect)
  1438.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1439.     make_damage_popups(user)
  1440.   end
  1441.  
  1442.   #--------------------------------------------------------------------------
  1443.   # alias method: item_effect_recover_mp
  1444.   #--------------------------------------------------------------------------
  1445.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1446.   def item_effect_recover_mp(user, item, effect)
  1447.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1448.     make_damage_popups(user)
  1449.   end
  1450.  
  1451.   #--------------------------------------------------------------------------
  1452.   # alias method: item_effect_gain_tp
  1453.   #--------------------------------------------------------------------------
  1454.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1455.   def item_effect_gain_tp(user, item, effect)
  1456.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1457.     make_damage_popups(user)
  1458.   end
  1459.  
  1460.   #--------------------------------------------------------------------------
  1461.   # alias method: item_user_effect
  1462.   #--------------------------------------------------------------------------
  1463.   alias game_battler_item_user_effect_abe item_user_effect
  1464.   def item_user_effect(user, item)
  1465.     game_battler_item_user_effect_abe(user, item)
  1466.     @result.restore_damage
  1467.   end
  1468.  
  1469.   #--------------------------------------------------------------------------
  1470.   # alias method: add_new_state
  1471.   #--------------------------------------------------------------------------
  1472.   alias game_battler_add_new_state_abe add_new_state
  1473.   def add_new_state(state_id)
  1474.     game_battler_add_new_state_abe(state_id)
  1475.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1476.   end
  1477.  
  1478.   #--------------------------------------------------------------------------
  1479.   # alias method: add_buff
  1480.   #--------------------------------------------------------------------------
  1481.   alias game_battler_add_buff_abe add_buff
  1482.   def add_buff(param_id, turns)
  1483.     make_buff_popup(param_id, true)
  1484.     game_battler_add_buff_abe(param_id, turns)
  1485.   end
  1486.  
  1487.   #--------------------------------------------------------------------------
  1488.   # alias method: add_debuff
  1489.   #--------------------------------------------------------------------------
  1490.   alias game_battler_add_debuff_abe add_debuff
  1491.   def add_debuff(param_id, turns)
  1492.     make_buff_popup(param_id, false)
  1493.     game_battler_add_debuff_abe(param_id, turns)
  1494.   end
  1495.  
  1496.   #--------------------------------------------------------------------------
  1497.   # alias method: regenerate_all
  1498.   #--------------------------------------------------------------------------
  1499.   alias game_battler_regenerate_all_abe regenerate_all
  1500.   def regenerate_all
  1501.     game_battler_regenerate_all_abe
  1502.     return unless alive?
  1503.     make_damage_popups(self)
  1504.   end
  1505.  
  1506.   #--------------------------------------------------------------------------
  1507.   # new method: can_collapse?
  1508.   #--------------------------------------------------------------------------
  1509.   def can_collapse?
  1510.     return false unless dead?
  1511.     unless actor?
  1512.       return false unless sprite.battler_visible
  1513.       array = [:collapse, :boss_collapse, :instant_collapse]
  1514.       return false if array.include?(sprite.effect_type)
  1515.     end
  1516.     return true
  1517.   end
  1518.  
  1519.   #--------------------------------------------------------------------------
  1520.   # new method: draw_mp?
  1521.   #--------------------------------------------------------------------------
  1522.   def draw_mp?; return true; end
  1523.  
  1524.   #--------------------------------------------------------------------------
  1525.   # new method: draw_tp?
  1526.   #--------------------------------------------------------------------------
  1527.   def draw_tp?
  1528.     return $data_system.opt_display_tp
  1529.   end
  1530.  
  1531. end # Game_Battler
  1532.  
  1533. #==============================================================================
  1534. # ■ Game_Actor
  1535. #==============================================================================
  1536.  
  1537. class Game_Actor < Game_Battler
  1538.  
  1539.   #def battler_name
  1540.     #return "Slime"
  1541.   #end
  1542.  
  1543.   #def battler_hue
  1544.     #return 0
  1545.   #end
  1546.  
  1547.   #--------------------------------------------------------------------------
  1548.   # overwrite method: perform_damage_effect
  1549.   #--------------------------------------------------------------------------
  1550.   def perform_damage_effect
  1551.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1552.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1553.     Sound.play_actor_damage
  1554.   end
  1555.  
  1556.   #--------------------------------------------------------------------------
  1557.   # overwrite method: use_sprite?
  1558.   #--------------------------------------------------------------------------
  1559.   def use_sprite?; return true; end
  1560.  
  1561.   #--------------------------------------------------------------------------
  1562.   # new method: screen_x
  1563.   #--------------------------------------------------------------------------
  1564.   def screen_x
  1565.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1566.     status_window = SceneManager.scene.status_window
  1567.     return 0 if status_window.nil?
  1568.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1569.     ext = SceneManager.scene.info_viewport.ox
  1570.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1571.     constant = 128 + 12
  1572.     return constant + rect.x + item_rect_width / 2 - ext
  1573.   end
  1574.  
  1575.   #--------------------------------------------------------------------------
  1576.   # new method: screen_y
  1577.   #--------------------------------------------------------------------------
  1578.   def screen_y
  1579.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1580.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1581.     return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  1582.   end
  1583.  
  1584.   #--------------------------------------------------------------------------
  1585.   # new method: screen_z
  1586.   #--------------------------------------------------------------------------
  1587.   def screen_z; return 100; end
  1588.  
  1589.   #--------------------------------------------------------------------------
  1590.   # new method: sprite
  1591.   #--------------------------------------------------------------------------
  1592.   def sprite
  1593.     index = $game_party.battle_members.index(self)
  1594.     return SceneManager.scene.spriteset.actor_sprites[index]
  1595.   end
  1596.  
  1597.   #--------------------------------------------------------------------------
  1598.   # new method: draw_mp?
  1599.   #--------------------------------------------------------------------------
  1600.   def draw_mp?
  1601.     return true unless draw_tp?
  1602.     for skill in skills
  1603.       next unless added_skill_types.include?(skill.stype_id)
  1604.       return true if skill.mp_cost > 0
  1605.     end
  1606.     return false
  1607.   end
  1608.  
  1609.   #--------------------------------------------------------------------------
  1610.   # new method: draw_tp?
  1611.   #--------------------------------------------------------------------------
  1612.   def draw_tp?
  1613.     return false unless $data_system.opt_display_tp
  1614.     for skill in skills
  1615.       next unless added_skill_types.include?(skill.stype_id)
  1616.       return true if skill.tp_cost > 0
  1617.     end
  1618.     return false
  1619.   end
  1620.  
  1621. end # Game_Actor
  1622.  
  1623. #==============================================================================
  1624. # ■ Game_Enemy
  1625. #==============================================================================
  1626.  
  1627. class Game_Enemy < Game_Battler
  1628.  
  1629.   #--------------------------------------------------------------------------
  1630.   # overwrite method: perform_damage_effect
  1631.   #--------------------------------------------------------------------------
  1632.   def perform_damage_effect
  1633.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1634.     Sound.play_enemy_damage
  1635.   end
  1636.  
  1637.   #--------------------------------------------------------------------------
  1638.   # new methods: attack_animation_id
  1639.   #--------------------------------------------------------------------------
  1640.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1641.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1642.  
  1643.   #--------------------------------------------------------------------------
  1644.   # new method: sprite
  1645.   #--------------------------------------------------------------------------
  1646.   def sprite
  1647.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1648.   end
  1649.  
  1650. end # Game_Enemy
  1651.  
  1652. #==============================================================================
  1653. # ■ Game_Unit
  1654. #==============================================================================
  1655.  
  1656. class Game_Unit
  1657.  
  1658.   #--------------------------------------------------------------------------
  1659.   # alias method: make_actions
  1660.   #--------------------------------------------------------------------------
  1661.   alias game_unit_make_actions_abe make_actions
  1662.   def make_actions
  1663.     game_unit_make_actions_abe
  1664.     refresh_autobattler_status_window
  1665.   end
  1666.  
  1667.   #--------------------------------------------------------------------------
  1668.   # new method: refresh_autobattler_status_window
  1669.   #--------------------------------------------------------------------------
  1670.   def refresh_autobattler_status_window
  1671.     return unless SceneManager.scene_is?(Scene_Battle)
  1672.     return unless self.is_a?(Game_Party)
  1673.     SceneManager.scene.refresh_autobattler_status_window
  1674.   end
  1675.  
  1676. end # Game_Unit
  1677.  
  1678. #==============================================================================
  1679. # ■ Window_PartyCommand
  1680. #==============================================================================
  1681.  
  1682. class Window_PartyCommand < Window_Command
  1683.  
  1684.   #--------------------------------------------------------------------------
  1685.   # overwrite method: process_handling
  1686.   #--------------------------------------------------------------------------
  1687.   def process_handling
  1688.     return unless open? && active
  1689.     return process_dir6 if Input.repeat?(:RIGHT)
  1690.     return super
  1691.   end
  1692.  
  1693.   #--------------------------------------------------------------------------
  1694.   # new method: process_dir6
  1695.   #--------------------------------------------------------------------------
  1696.   def process_dir6
  1697.     Sound.play_cursor
  1698.     Input.update
  1699.     deactivate
  1700.     call_handler(:dir6)
  1701.   end
  1702.  
  1703. end # Window_PartyCommand
  1704.  
  1705. #==============================================================================
  1706. # ■ Window_ActorCommand
  1707. #==============================================================================
  1708.  
  1709. class Window_ActorCommand < Window_Command
  1710.  
  1711.   #--------------------------------------------------------------------------
  1712.   # overwrite method: process_handling
  1713.   #--------------------------------------------------------------------------
  1714.   def process_handling
  1715.     return unless open? && active
  1716.     return process_dir4 if Input.repeat?(:LEFT)
  1717.     return process_dir6 if Input.repeat?(:RIGHT)
  1718.     return super
  1719.   end
  1720.  
  1721.   #--------------------------------------------------------------------------
  1722.   # new method: process_dir4
  1723.   #--------------------------------------------------------------------------
  1724.   def process_dir4
  1725.     Sound.play_cursor
  1726.     Input.update
  1727.     deactivate
  1728.     call_handler(:cancel)
  1729.   end
  1730.  
  1731.   #--------------------------------------------------------------------------
  1732.   # new method: process_dir6
  1733.   #--------------------------------------------------------------------------
  1734.   def process_dir6
  1735.     Sound.play_cursor
  1736.     #Input.update
  1737.     #deactivate
  1738.     #call_handler(:dir6)
  1739.   end
  1740.  
  1741. end # Window_ActorCommand
  1742.  
  1743. #==============================================================================
  1744. # ■ Window_BattleStatus
  1745. #==============================================================================
  1746.  
  1747. class Window_BattleStatus < Window_Selectable
  1748.  
  1749.   #--------------------------------------------------------------------------
  1750.   # overwrite method: initialize
  1751.   #--------------------------------------------------------------------------
  1752.   def initialize
  1753.     super(0, 0, window_width, window_height+24)
  1754.     self.openness = 0
  1755.     @party = $game_party.battle_members.clone
  1756.   end
  1757.  
  1758.   #--------------------------------------------------------------------------
  1759.   # overwrite method: col_max
  1760.   #--------------------------------------------------------------------------
  1761.   def col_max; return $game_party.max_battle_members; end
  1762.  
  1763.   #--------------------------------------------------------------------------
  1764.   # new method: battle_members
  1765.   #--------------------------------------------------------------------------
  1766.   def battle_members; return $game_party.battle_members; end
  1767.  
  1768.   #--------------------------------------------------------------------------
  1769.   # new method: actor
  1770.   #--------------------------------------------------------------------------
  1771.   def actor; return battle_members[@index]; end
  1772.  
  1773.   #--------------------------------------------------------------------------
  1774.   # overwrite method: update
  1775.   #--------------------------------------------------------------------------
  1776.   def update
  1777.     super
  1778.     return if @party == $game_party.battle_members
  1779.     @party = $game_party.battle_members.clone
  1780.     refresh
  1781.   end
  1782.  
  1783.   def draw_actor_figure(actor, x, y, enabled = true)
  1784.     bitmap = Cache.system("bf"+actor.id.to_s+".png")
  1785.     rect = Rect.new(0,0,bitmap.width, bitmap.height)
  1786.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1787.     bitmap.dispose
  1788.   end
  1789.   #--------------------------------------------------------------------------
  1790.   # overwrite method: draw_item
  1791.   #--------------------------------------------------------------------------
  1792.   def draw_item(index)
  1793.     return if index.nil?
  1794.     clear_item(index)
  1795.     actor = battle_members[index]
  1796.     rect = item_rect(index)
  1797.     item_x = rect.x + 6
  1798.     return if actor.nil?
  1799.     draw_actor_figure(actor, item_x+2, rect.y+2, actor.alive?)
  1800.     #draw_actor_name(actor, item_x, rect.y, rect.width-8)
  1801.     draw_actor_action(actor, item_x + 96, rect.y - 2)
  1802.     draw_actor_icons(actor, item_x, rect.y + 2, rect.width)
  1803.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1804.     yadj = 10
  1805.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1806.     draw_actor_hp(actor, item_x+2, line_height*2+gx, rect.width-4-12)
  1807.     if draw_tp?(actor) && draw_mp?(actor)
  1808.       dw = rect.width/2-2-16
  1809.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1810.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, dw)
  1811.       dw = rect.width - rect.width/2 - 2-6
  1812.       draw_actor_mp(actor, item_x+rect.width/2-6, line_height*3+gx-yadj+3, dw)
  1813.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1814.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width-4-12)
  1815.     else
  1816.       draw_actor_mp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width-4-12)
  1817.     end
  1818.   end
  1819.   #--------------------------------------------------------------------------
  1820.   # overwrite method: item_rect
  1821.   #--------------------------------------------------------------------------
  1822.   def item_rect(index)
  1823.     rect = Rect.new
  1824.     rect.width = contents.width / $game_party.max_battle_members + 32
  1825.     rect.height = contents.height
  1826.     rect.x = index * rect.width
  1827.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1828.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1829.     end
  1830.     rect.y = 0
  1831.     return rect
  1832.   end
  1833.  
  1834.   #--------------------------------------------------------------------------
  1835.   # overwrite method: draw_face
  1836.   #--------------------------------------------------------------------------
  1837.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1838.     bitmap = Cache.face(face_name)
  1839.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1840.     fy = face_index / 4 * 96 + 2
  1841.     fw = [item_rect(0).width - 4, 92].min
  1842.     rect = Rect.new(fx, fy, fw, 92)
  1843.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1844.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1845.     bitmap.dispose
  1846.   end
  1847.  
  1848.   #--------------------------------------------------------------------------
  1849.   # overwrite method: draw_actor_name
  1850.   #--------------------------------------------------------------------------
  1851.   def draw_actor_name(actor, dx, dy, dw = 112)
  1852.     reset_font_settings
  1853.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1854.     change_color(hp_color(actor))
  1855.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1856.   end
  1857.  
  1858.   #--------------------------------------------------------------------------
  1859.   # new method: draw_actor_action
  1860.   #--------------------------------------------------------------------------
  1861.   def draw_actor_action(actor, dx, dy)
  1862.     draw_icon(action_icon(actor), dx, dy)
  1863.   end
  1864.  
  1865.   #--------------------------------------------------------------------------
  1866.   # new method: action_icon
  1867.   #--------------------------------------------------------------------------
  1868.   def action_icon(actor)
  1869.     return Icon.no_action if actor.current_action.nil?
  1870.     return Icon.no_action if actor.current_action.item.nil?
  1871.     return actor.current_action.item.icon_index
  1872.   end
  1873.  
  1874.   #--------------------------------------------------------------------------
  1875.   # new method: draw_tp?
  1876.   #--------------------------------------------------------------------------
  1877.   def draw_tp?(actor)
  1878.     return actor.draw_tp?
  1879.   end
  1880.  
  1881.   #--------------------------------------------------------------------------
  1882.   # new method: draw_mp?
  1883.   #--------------------------------------------------------------------------
  1884.   def draw_mp?(actor)
  1885.     return actor.draw_mp?
  1886.   end
  1887.  
  1888.   #--------------------------------------------------------------------------
  1889.   # overwrite method: draw_current_and_max_values
  1890.   #--------------------------------------------------------------------------
  1891.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1892.     change_color(color1)
  1893.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1894.   end
  1895.  
  1896.   #--------------------------------------------------------------------------
  1897.   # overwrite method: draw_actor_hp
  1898.   #--------------------------------------------------------------------------
  1899.   def draw_actor_hp(actor, dx, dy, width = 124)
  1900.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1901.     change_color(system_color)
  1902.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1903.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1904.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1905.       hp_color(actor), normal_color)
  1906.     end
  1907.  
  1908.   #--------------------------------------------------------------------------
  1909.   # overwrite method: draw_actor_mp
  1910.   #--------------------------------------------------------------------------
  1911.   def draw_actor_mp(actor, dx, dy, width = 124)
  1912.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1913.     change_color(system_color)
  1914.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1915.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1916.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1917.       mp_color(actor), normal_color)
  1918.     end
  1919.  
  1920.   #--------------------------------------------------------------------------
  1921.   # overwrite method: draw_actor_tp
  1922.   #--------------------------------------------------------------------------
  1923.   def draw_actor_tp(actor, dx, dy, width = 124)
  1924.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1925.     change_color(system_color)
  1926.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1927.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1928.     change_color(tp_color(actor))
  1929.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1930.   end
  1931.  
  1932. end # Window_BattleStatus
  1933.  
  1934. #==============================================================================
  1935. # ■ Window_BattleActor
  1936. #==============================================================================
  1937.  
  1938. class Window_BattleActor < Window_BattleStatus
  1939.  
  1940.   #--------------------------------------------------------------------------
  1941.   # overwrite method: show
  1942.   #--------------------------------------------------------------------------
  1943.   def show
  1944.     create_flags
  1945.     super
  1946.   end
  1947.  
  1948.   #--------------------------------------------------------------------------
  1949.   # new method: create_flags
  1950.   #--------------------------------------------------------------------------
  1951.   def create_flags
  1952.     set_select_flag(:any)
  1953.     select(0)
  1954.     return if $game_temp.battle_aid.nil?
  1955.     if $game_temp.battle_aid.need_selection?
  1956.       select(0)
  1957.       #set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1958.     elsif $game_temp.battle_aid.for_user?
  1959.       battler = BattleManager.actor
  1960.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1961.       select(id)
  1962.       set_select_flag(:user)
  1963.     elsif $game_temp.battle_aid.for_all?
  1964.       select(0)
  1965.       set_select_flag(:all)
  1966.       set_select_flag(:all) if $game_temp.battle_aid.for_dead_friend?
  1967.       #set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1968.     elsif $game_temp.battle_aid.for_random?
  1969.       select(0)
  1970.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1971.     end
  1972.   end
  1973.  
  1974.   #--------------------------------------------------------------------------
  1975.   # new method: set_flag
  1976.   #--------------------------------------------------------------------------
  1977.   def set_select_flag(flag)
  1978.     @select_flag = flag
  1979.     case @select_flag
  1980.     when :all, :all_dead, :random
  1981.       @cursor_all = true
  1982.     else
  1983.       @cursor_all = false
  1984.     end
  1985.   end
  1986.  
  1987.   #--------------------------------------------------------------------------
  1988.   # overwrite method: update_cursor
  1989.   #--------------------------------------------------------------------------
  1990.   def update_cursor
  1991.     if @cursor_all
  1992.       cursor_rect.set(0, 0, contents.width, contents.height)
  1993.       self.top_row = 0
  1994.     elsif @index < 0
  1995.       cursor_rect.empty
  1996.     else
  1997.       ensure_cursor_visible
  1998.       cursor_rect.set(item_rect(@index))
  1999.     end
  2000.   end
  2001.  
  2002.   #--------------------------------------------------------------------------
  2003.   # overwrite method: cursor_movable?
  2004.   #--------------------------------------------------------------------------
  2005.   def cursor_movable?
  2006.     return false if @select_flag == :user
  2007.     return super
  2008.   end
  2009.  
  2010.   #--------------------------------------------------------------------------
  2011.   # overwrite method: current_item_enabled?
  2012.   #--------------------------------------------------------------------------
  2013.   def current_item_enabled?
  2014.     return true if $game_temp.battle_aid.nil?
  2015.     if $game_temp.battle_aid.need_selection?
  2016.       member = $game_party.battle_members[@index]
  2017.       return true#member.dead? if $game_temp.battle_aid.for_dead_friend?
  2018.     elsif $game_temp.battle_aid.for_dead_friend?
  2019.       for member in $game_party.battle_members
  2020.         return true #if member.dead?
  2021.       end
  2022.       return false
  2023.     end
  2024.     return true
  2025.   end
  2026.  
  2027. end # Window_BattleActor
  2028.  
  2029. #==============================================================================
  2030. # ■ Window_BattleStatusAid
  2031. #==============================================================================
  2032.  
  2033. class Window_BattleStatusAid < Window_BattleStatus
  2034.  
  2035.   #--------------------------------------------------------------------------
  2036.   # public instance variables
  2037.   #--------------------------------------------------------------------------
  2038.   attr_accessor :status_window
  2039.  
  2040.   #--------------------------------------------------------------------------
  2041.   # overwrite method: initialize
  2042.   #--------------------------------------------------------------------------
  2043.   def initialize
  2044.     super
  2045.     self.visible = false
  2046.     self.openness = 255
  2047.   end
  2048.  
  2049.   #--------------------------------------------------------------------------
  2050.   # overwrite method: window_width
  2051.   #--------------------------------------------------------------------------
  2052.   def window_width; return 128; end
  2053.  
  2054.   #--------------------------------------------------------------------------
  2055.   # overwrite method: show
  2056.   #--------------------------------------------------------------------------
  2057.   def show
  2058.     super
  2059.     refresh
  2060.   end
  2061.  
  2062.   #--------------------------------------------------------------------------
  2063.   # overwrite method: refresh
  2064.   #--------------------------------------------------------------------------
  2065.   def refresh
  2066.     contents.clear
  2067.     return if @status_window.nil?
  2068.     draw_item(@status_window.index)
  2069.   end
  2070.  
  2071.   #--------------------------------------------------------------------------
  2072.   # overwrite method: item_rect
  2073.   #--------------------------------------------------------------------------
  2074.   def item_rect(index)
  2075.     return Rect.new(0, 0, contents.width, contents.height)
  2076.   end
  2077.  
  2078. end # Window_BattleStatusAid
  2079.  
  2080. #==============================================================================
  2081. # ■ Window_BattleEnemy
  2082. #==============================================================================
  2083.  
  2084. class Window_BattleEnemy < Window_Selectable
  2085.  
  2086.   #--------------------------------------------------------------------------
  2087.   # overwrite method: initialize
  2088.   #--------------------------------------------------------------------------
  2089.   def initialize(info_viewport)
  2090.     super(0, Graphics.height, window_width, fitting_height(1))
  2091.     refresh
  2092.     self.visible = false
  2093.     @info_viewport = info_viewport
  2094.   end
  2095.  
  2096.   #--------------------------------------------------------------------------
  2097.   # overwrite method: col_max
  2098.   #--------------------------------------------------------------------------
  2099.   def col_max; return item_max; end
  2100.  
  2101.   #--------------------------------------------------------------------------
  2102.   # overwrite method: show
  2103.   #--------------------------------------------------------------------------
  2104.   def show
  2105.     create_flags
  2106.     super
  2107.   end
  2108.  
  2109.   #--------------------------------------------------------------------------
  2110.   # new method: create_flags
  2111.   #--------------------------------------------------------------------------
  2112.   def create_flags
  2113.     set_select_flag(:any)
  2114.     select(0)
  2115.     return if $game_temp.battle_aid.nil?
  2116.     if $game_temp.battle_aid.need_selection?
  2117.       select(0)
  2118.     elsif $game_temp.battle_aid.for_all?
  2119.       select(0)
  2120.       set_select_flag(:all)
  2121.     elsif $game_temp.battle_aid.for_random?
  2122.       select(0)
  2123.       set_select_flag(:random)
  2124.     end
  2125.   end
  2126.  
  2127.   #--------------------------------------------------------------------------
  2128.   # new method: set_flag
  2129.   #--------------------------------------------------------------------------
  2130.   def set_select_flag(flag)
  2131.     @select_flag = flag
  2132.     case @select_flag
  2133.     when :all, :random
  2134.       @cursor_all = true
  2135.     else
  2136.       @cursor_all = false
  2137.     end
  2138.   end
  2139.  
  2140.   #--------------------------------------------------------------------------
  2141.   # new method: select_all?
  2142.   #--------------------------------------------------------------------------
  2143.   def select_all?
  2144.     return true if @select_flag == :all
  2145.     return true if @select_flag == :random
  2146.     return false
  2147.   end
  2148.  
  2149.   #--------------------------------------------------------------------------
  2150.   # overwrite method: update_cursor
  2151.   #--------------------------------------------------------------------------
  2152.   def update_cursor
  2153.     if @cursor_all
  2154.       cursor_rect.set(0, 0, contents.width, contents.height)
  2155.       self.top_row = 0
  2156.     elsif @index < 0
  2157.       cursor_rect.empty
  2158.     else
  2159.       ensure_cursor_visible
  2160.       cursor_rect.set(item_rect(@index))
  2161.     end
  2162.   end
  2163.  
  2164.   #--------------------------------------------------------------------------
  2165.   # overwrite method: cursor_movable?
  2166.   #--------------------------------------------------------------------------
  2167.   def cursor_movable?
  2168.     return false if @select_flag == :user
  2169.     return super
  2170.   end
  2171.  
  2172.   #--------------------------------------------------------------------------
  2173.   # overwrite method: current_item_enabled?
  2174.   #--------------------------------------------------------------------------
  2175.   def current_item_enabled?
  2176.     return true if $game_temp.battle_aid.nil?
  2177.     if $game_temp.battle_aid.need_selection?
  2178.       member = $game_party.battle_members[@index]
  2179.       return true#member.dead? if $game_temp.battle_aid.for_dead_friend?
  2180.     elsif $game_temp.battle_aid.for_dead_friend?
  2181.       for member in $game_party.battle_members
  2182.         return true #if member.dead?
  2183.       end
  2184.       return false
  2185.     end
  2186.     return true
  2187.   end
  2188.  
  2189.   #--------------------------------------------------------------------------
  2190.   # overwrite method: enemy
  2191.   #--------------------------------------------------------------------------
  2192.   def enemy; @data[index]; end
  2193.  
  2194.   #--------------------------------------------------------------------------
  2195.   # overwrite method: refresh
  2196.   #--------------------------------------------------------------------------
  2197.   def refresh
  2198.     make_item_list
  2199.     create_contents
  2200.     draw_all_items
  2201.   end
  2202.  
  2203.   #--------------------------------------------------------------------------
  2204.   # overwrite method: make_item_list
  2205.   #--------------------------------------------------------------------------
  2206.   def make_item_list
  2207.     @data = $game_troop.alive_members
  2208.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2209.   end
  2210.  
  2211.   #--------------------------------------------------------------------------
  2212.   # overwrite method: draw_item
  2213.   #--------------------------------------------------------------------------
  2214.   def draw_item(index); return; end
  2215.  
  2216.   #--------------------------------------------------------------------------
  2217.   # overwrite method: update
  2218.   #--------------------------------------------------------------------------
  2219.   def update
  2220.     super
  2221.     return unless active
  2222.     enemy.sprite_effect_type = :whiten
  2223.     return unless select_all?
  2224.     for enemy in $game_troop.alive_members
  2225.       enemy.sprite_effect_type = :whiten
  2226.     end
  2227.   end
  2228.  
  2229. end # Window_BattleEnemy
  2230.  
  2231. #==============================================================================
  2232. # ■ Window_BattleHelp
  2233. #==============================================================================
  2234.  
  2235. class Window_BattleHelp < Window_Help
  2236.  
  2237.   #--------------------------------------------------------------------------
  2238.   # public instance variables
  2239.   #--------------------------------------------------------------------------
  2240.   attr_accessor :actor_window
  2241.   attr_accessor :enemy_window
  2242.  
  2243.   #--------------------------------------------------------------------------
  2244.   # update
  2245.   #--------------------------------------------------------------------------
  2246.   def update
  2247.     super
  2248.     if !self.visible and @text != ""
  2249.       @text = ""
  2250.       return refresh
  2251.     end
  2252.     update_battler_name
  2253.   end
  2254.  
  2255.   #--------------------------------------------------------------------------
  2256.   # update_battler_name
  2257.   #--------------------------------------------------------------------------
  2258.   def update_battler_name
  2259.     return unless @actor_window.active || @enemy_window.active
  2260.     if @actor_window.active
  2261.       battler = $game_party.battle_members[@actor_window.index]
  2262.     elsif @enemy_window.active
  2263.       battler = @enemy_window.enemy
  2264.     end
  2265.     if special_display?
  2266.       refresh_special_case(battler)
  2267.     else
  2268.       refresh_battler_name(battler) if battler_name(battler) != @text
  2269.     end
  2270.   end
  2271.  
  2272.   #--------------------------------------------------------------------------
  2273.   # battler_name
  2274.   #--------------------------------------------------------------------------
  2275.   def battler_name(battler)
  2276.     text = battler.name.clone
  2277.     return text
  2278.   end
  2279.  
  2280.   #--------------------------------------------------------------------------
  2281.   # refresh_battler_name
  2282.   #--------------------------------------------------------------------------
  2283.   def refresh_battler_name(battler)
  2284.     contents.clear
  2285.     reset_font_settings
  2286.     change_color(normal_color)
  2287.     @text = battler_name(battler)
  2288.     icons = battler.state_icons + battler.buff_icons
  2289.     dy = icons.size <= 0 ? line_height / 2 : 0
  2290.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2291.     dx = (contents.width - (icons.size * 24)) / 2
  2292.     draw_actor_icons(battler, dx, line_height, contents.width)
  2293.   end
  2294.  
  2295.   #--------------------------------------------------------------------------
  2296.   # special_display?
  2297.   #--------------------------------------------------------------------------
  2298.   def special_display?
  2299.     return false if $game_temp.battle_aid.nil?
  2300.     return false if $game_temp.battle_aid.for_user?
  2301.     return !$game_temp.battle_aid.need_selection?
  2302.   end
  2303.  
  2304.   #--------------------------------------------------------------------------
  2305.   # refresh_special_case
  2306.   #--------------------------------------------------------------------------
  2307.   def refresh_special_case(battler)
  2308.     if $game_temp.battle_aid.for_opponent?
  2309.       if $game_temp.battle_aid.for_all?
  2310.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2311.       else
  2312.         case $game_temp.battle_aid.number_of_targets
  2313.         when 1
  2314.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2315.         else
  2316.           number = $game_temp.battle_aid.number_of_targets
  2317.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2318.         end
  2319.       end
  2320.     else # $game_temp.battle_aid.for_friend?
  2321.       if $game_temp.battle_aid.for_dead_friend?
  2322.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2323.       elsif $game_temp.battle_aid.for_random?
  2324.         case $game_temp.battle_aid.number_of_targets
  2325.         when 1
  2326.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2327.         else
  2328.           number = $game_temp.battle_aid.number_of_targets
  2329.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2330.         end
  2331.       else
  2332.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2333.       end
  2334.     end
  2335.     return if text == @text
  2336.     @text = text
  2337.     contents.clear
  2338.     reset_font_settings
  2339.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2340.   end
  2341.  
  2342. end # Window_BattleHelp
  2343.  
  2344. #==============================================================================
  2345. # ■ Window_BattleLog
  2346. #==============================================================================
  2347.  
  2348. class Window_BattleLog < Window_Selectable
  2349.  
  2350.   #--------------------------------------------------------------------------
  2351.   # alias method: display_current_state
  2352.   #--------------------------------------------------------------------------
  2353.   alias window_battlelog_display_current_state_abe display_current_state
  2354.   def display_current_state(subject)
  2355.     subject.make_during_state_popup
  2356.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2357.     window_battlelog_display_current_state_abe(subject)
  2358.   end
  2359.  
  2360.   #--------------------------------------------------------------------------
  2361.   # alias method: display_use_item
  2362.   #--------------------------------------------------------------------------
  2363.   alias window_battlelog_display_use_item_abe display_use_item
  2364.   def display_use_item(subject, item)
  2365.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2366.     window_battlelog_display_use_item_abe(subject, item)
  2367.   end
  2368.  
  2369.   #--------------------------------------------------------------------------
  2370.   # alias method: display_counter
  2371.   #--------------------------------------------------------------------------
  2372.   alias window_battlelog_display_counter_abe display_counter
  2373.   def display_counter(target, item)
  2374.     if YEA::BATTLE::MSG_COUNTERATTACK
  2375.       window_battlelog_display_counter_abe(target, item)
  2376.     else
  2377.       Sound.play_evasion
  2378.     end
  2379.   end
  2380.  
  2381.   #--------------------------------------------------------------------------
  2382.   # alias method: display_reflection
  2383.   #--------------------------------------------------------------------------
  2384.   alias window_battlelog_display_reflection_abe display_reflection
  2385.   def display_reflection(target, item)
  2386.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2387.       window_battlelog_display_reflection_abe(target, item)
  2388.     else
  2389.       Sound.play_reflection
  2390.     end
  2391.   end
  2392.  
  2393.   #--------------------------------------------------------------------------
  2394.   # alias method: display_substitute
  2395.   #--------------------------------------------------------------------------
  2396.   alias window_battlelog_display_substitute_abe display_substitute
  2397.   def display_substitute(substitute, target)
  2398.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2399.     window_battlelog_display_substitute_abe(substitute, target)
  2400.   end
  2401.  
  2402.   #--------------------------------------------------------------------------
  2403.   # alias method: display_failure
  2404.   #--------------------------------------------------------------------------
  2405.   alias window_battlelog_display_failure_abe display_failure
  2406.   def display_failure(target, item)
  2407.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2408.     window_battlelog_display_failure_abe(target, item)
  2409.   end
  2410.  
  2411.   #--------------------------------------------------------------------------
  2412.   # alias method: display_critical
  2413.   #--------------------------------------------------------------------------
  2414.   alias window_battlelog_display_critical_abe display_critical
  2415.   def display_critical(target, item)
  2416.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2417.     window_battlelog_display_critical_abe(target, item)
  2418.   end
  2419.  
  2420.   #--------------------------------------------------------------------------
  2421.   # alias method: display_miss
  2422.   #--------------------------------------------------------------------------
  2423.   alias window_battlelog_display_miss_abe display_miss
  2424.   def display_miss(target, item)
  2425.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2426.     window_battlelog_display_miss_abe(target, item)
  2427.   end
  2428.  
  2429.   #--------------------------------------------------------------------------
  2430.   # alias method: display_evasion
  2431.   #--------------------------------------------------------------------------
  2432.   alias window_battlelog_display_evasion_abe display_evasion
  2433.   def display_evasion(target, item)
  2434.     if YEA::BATTLE::MSG_EVASION
  2435.       window_battlelog_display_evasion_abe(target, item)
  2436.     else
  2437.       if !item || item.physical?
  2438.         Sound.play_evasion
  2439.       else
  2440.         Sound.play_magic_evasion
  2441.       end
  2442.     end
  2443.   end
  2444.  
  2445.   #--------------------------------------------------------------------------
  2446.   # overwrite method: display_hp_damage
  2447.   #--------------------------------------------------------------------------
  2448.   def display_hp_damage(target, item)
  2449.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2450.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2451.       target.perform_damage_effect
  2452.     end
  2453.     Sound.play_recovery if target.result.hp_damage < 0
  2454.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2455.     add_text(target.result.hp_damage_text)
  2456.     wait
  2457.   end
  2458.  
  2459.   #--------------------------------------------------------------------------
  2460.   # overwrite method: display_mp_damage
  2461.   #--------------------------------------------------------------------------
  2462.   def display_mp_damage(target, item)
  2463.     return if target.dead? || target.result.mp_damage == 0
  2464.     Sound.play_recovery if target.result.mp_damage < 0
  2465.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2466.     add_text(target.result.mp_damage_text)
  2467.     wait
  2468.   end
  2469.  
  2470.   #--------------------------------------------------------------------------
  2471.   # overwrite method: display_tp_damage
  2472.   #--------------------------------------------------------------------------
  2473.   def display_tp_damage(target, item)
  2474.     return if target.dead? || target.result.tp_damage == 0
  2475.     Sound.play_recovery if target.result.tp_damage < 0
  2476.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2477.     add_text(target.result.tp_damage_text)
  2478.     wait
  2479.   end
  2480.  
  2481.   #--------------------------------------------------------------------------
  2482.   # alias method: display_added_states
  2483.   #--------------------------------------------------------------------------
  2484.   alias window_battlelog_display_added_states_abe display_added_states
  2485.   def display_added_states(target)
  2486.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2487.     window_battlelog_display_added_states_abe(target)
  2488.   end
  2489.  
  2490.   #--------------------------------------------------------------------------
  2491.   # alias method: display_removed_states
  2492.   #--------------------------------------------------------------------------
  2493.   alias window_battlelog_display_removed_states_abe display_removed_states
  2494.   def display_removed_states(target)
  2495.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2496.     window_battlelog_display_removed_states_abe(target)
  2497.   end
  2498.  
  2499.   #--------------------------------------------------------------------------
  2500.   # alias method: display_changed_buffs
  2501.   #--------------------------------------------------------------------------
  2502.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2503.   def display_changed_buffs(target)
  2504.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2505.     window_battlelog_display_changed_buffs_abe(target)
  2506.   end
  2507.  
  2508. end # Window_BattleLog
  2509.  
  2510. #==============================================================================
  2511. # ■ Window_SkillList
  2512. #==============================================================================
  2513.  
  2514. class Window_SkillList < Window_Selectable
  2515.  
  2516.   #--------------------------------------------------------------------------
  2517.   # overwrite method: spacing
  2518.   #--------------------------------------------------------------------------
  2519.   def spacing
  2520.     return 8 if $game_party.in_battle
  2521.     return super
  2522.   end
  2523.  
  2524. end # Window_SkillList
  2525.  
  2526. #==============================================================================
  2527. # ■ Window_ItemList
  2528. #==============================================================================
  2529.  
  2530. class Window_ItemList < Window_Selectable
  2531.  
  2532.   #--------------------------------------------------------------------------
  2533.   # overwrite method: spacing
  2534.   #--------------------------------------------------------------------------
  2535.   def spacing
  2536.     return 8 if $game_party.in_battle
  2537.     return super
  2538.   end
  2539.  
  2540. end # Window_ItemList
  2541.  
  2542. #==============================================================================
  2543. # ■ Scene_Battle
  2544. #==============================================================================
  2545.  
  2546. class Scene_Battle < Scene_Base
  2547.  
  2548.   #--------------------------------------------------------------------------
  2549.   # public instance variables
  2550.   #--------------------------------------------------------------------------
  2551.   attr_accessor :enemy_window
  2552.   attr_accessor :info_viewport
  2553.   attr_accessor :spriteset
  2554.   attr_accessor :status_window
  2555.   attr_accessor :status_aid_window
  2556.   attr_accessor :subject
  2557.  
  2558.   #--------------------------------------------------------------------------
  2559.   # alias method: create_spriteset
  2560.   #--------------------------------------------------------------------------
  2561.   alias scene_battle_create_spriteset_abe create_spriteset
  2562.   def create_spriteset
  2563.     BattleManager.init_battle_type
  2564.     scene_battle_create_spriteset_abe
  2565.   end
  2566.  
  2567.   #--------------------------------------------------------------------------
  2568.   # alias method: update_basic
  2569.   #--------------------------------------------------------------------------
  2570.   alias scene_battle_update_basic_abe update_basic
  2571.   def update_basic
  2572.     scene_battle_update_basic_abe
  2573.     update_debug
  2574.   end
  2575.  
  2576.   #--------------------------------------------------------------------------
  2577.   # new method: update_debug
  2578.   #--------------------------------------------------------------------------
  2579.   def update_debug
  2580.     return unless $TEST || $BTEST
  2581.     debug_heal_party if Input.trigger?(:F5)
  2582.     debug_damage_party if Input.trigger?(:F6)
  2583.     debug_fill_tp if Input.trigger?(:F7)
  2584.     debug_kill_all if Input.trigger?(:F8)
  2585.   end
  2586.  
  2587.   #--------------------------------------------------------------------------
  2588.   # new method: debug_heal_party
  2589.   #--------------------------------------------------------------------------
  2590.   def debug_heal_party
  2591.     Sound.play_recovery
  2592.     for member in $game_party.battle_members
  2593.       member.recover_all
  2594.     end
  2595.     @status_window.refresh
  2596.   end
  2597.  
  2598.   #--------------------------------------------------------------------------
  2599.   # new method: debug_damage_party
  2600.   #--------------------------------------------------------------------------
  2601.   def debug_damage_party
  2602.     Sound.play_actor_damage
  2603.     for member in $game_party.alive_members
  2604.       member.hp = 1
  2605.       member.mp = 0
  2606.       member.tp = 0
  2607.     end
  2608.     @status_window.refresh
  2609.   end
  2610.  
  2611.   #--------------------------------------------------------------------------
  2612.   # new method: debug_fill_tp
  2613.   #--------------------------------------------------------------------------
  2614.   def debug_fill_tp
  2615.     Sound.play_recovery
  2616.     for member in $game_party.alive_members
  2617.       member.tp = member.max_tp
  2618.     end
  2619.     @status_window.refresh
  2620.   end
  2621.  
  2622.   #--------------------------------------------------------------------------
  2623.   # new method: debug_kill_all
  2624.   #--------------------------------------------------------------------------
  2625.   def debug_kill_all
  2626.     for enemy in $game_troop.alive_members
  2627.       enemy.hp = 0
  2628.       enemy.perform_collapse_effect
  2629.     end
  2630.     BattleManager.judge_win_loss
  2631.     @log_window.wait
  2632.     @log_window.wait_for_effect
  2633.   end
  2634.  
  2635.   #--------------------------------------------------------------------------
  2636.   # alias method: create_all_windows
  2637.   #--------------------------------------------------------------------------
  2638.   alias scene_battle_create_all_windows_abe create_all_windows
  2639.   def create_all_windows
  2640.     scene_battle_create_all_windows_abe
  2641.     create_battle_status_aid_window
  2642.     set_help_window
  2643.   end
  2644.  
  2645.   #--------------------------------------------------------------------------
  2646.   # alias method: create_info_viewport
  2647.   #--------------------------------------------------------------------------
  2648.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2649.   def create_info_viewport
  2650.     scene_battle_create_info_viewport_abe
  2651.     @status_window.refresh
  2652.   end
  2653.  
  2654.   #--------------------------------------------------------------------------
  2655.   # new method: create_battle_status_aid_window
  2656.   #--------------------------------------------------------------------------
  2657.   def create_battle_status_aid_window
  2658.     @status_aid_window = Window_BattleStatusAid.new
  2659.     @status_aid_window.status_window = @status_window
  2660.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2661.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2662.   end
  2663.  
  2664.   #--------------------------------------------------------------------------
  2665.   # overwrite method: create_help_window
  2666.   #--------------------------------------------------------------------------
  2667.   def create_help_window
  2668.     @help_window = Window_BattleHelp.new
  2669.     @help_window.hide
  2670.   end
  2671.  
  2672.   #--------------------------------------------------------------------------
  2673.   # new method: set_help_window
  2674.   #--------------------------------------------------------------------------
  2675.   def set_help_window
  2676.     @help_window.actor_window = @actor_window
  2677.     @help_window.enemy_window = @enemy_window
  2678.   end
  2679.  
  2680.   #--------------------------------------------------------------------------
  2681.   # alias method: create_party_command_window
  2682.   #--------------------------------------------------------------------------
  2683.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2684.   def create_party_command_window
  2685.     scene_battle_create_party_command_window_abe
  2686.     @party_command_window.set_handler(:dir6, method(:command_fight))
  2687.   end
  2688.  
  2689.   #--------------------------------------------------------------------------
  2690.   # alias method: create_actor_command_window
  2691.   #--------------------------------------------------------------------------
  2692.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2693.   def create_actor_command_window
  2694.     scene_battle_create_actor_command_window_abe
  2695.     @actor_command_window.set_handler(:dir4, method(:prior_command))
  2696.     @actor_command_window.set_handler(:dir6, method(:next_command))
  2697.   end
  2698.  
  2699.   #--------------------------------------------------------------------------
  2700.   # alias method: create_skill_window
  2701.   #--------------------------------------------------------------------------
  2702.   alias scene_battle_create_skill_window_abe create_skill_window
  2703.   def create_skill_window
  2704.     scene_battle_create_skill_window_abe
  2705.     @skill_window.height = @info_viewport.rect.height
  2706.     @skill_window.width = Graphics.width - @actor_command_window.width
  2707.     @skill_window.y = Graphics.height - @skill_window.height
  2708.   end
  2709.  
  2710.   #--------------------------------------------------------------------------
  2711.   # alias method: create_item_window
  2712.   #--------------------------------------------------------------------------
  2713.   alias scene_battle_create_item_window_abe create_item_window
  2714.   def create_item_window
  2715.     scene_battle_create_item_window_abe
  2716.     @item_window.height = @skill_window.height
  2717.     @item_window.width = @skill_window.width
  2718.     @item_window.y = Graphics.height - @item_window.height
  2719.   end
  2720.  
  2721.   #--------------------------------------------------------------------------
  2722.   # alias method: show_fast?
  2723.   #--------------------------------------------------------------------------
  2724.   alias scene_battle_show_fast_abe show_fast?
  2725.   def show_fast?
  2726.     return true if YEA::BATTLE::AUTO_FAST
  2727.     return scene_battle_show_fast_abe
  2728.   end
  2729.  
  2730.   #--------------------------------------------------------------------------
  2731.   # alias method: next_command
  2732.   #--------------------------------------------------------------------------
  2733.   alias scene_battle_next_command_abe next_command
  2734.   def next_command
  2735.     @status_window.show
  2736.     redraw_current_status
  2737.     @actor_command_window.show
  2738.     @status_aid_window.hide
  2739.     scene_battle_next_command_abe
  2740.   end
  2741.  
  2742.   #--------------------------------------------------------------------------
  2743.   # alias method: prior_command
  2744.   #--------------------------------------------------------------------------
  2745.   alias scene_battle_prior_command_abe prior_command
  2746.   def prior_command
  2747.     redraw_current_status
  2748.     scene_battle_prior_command_abe
  2749.   end
  2750.  
  2751.   #--------------------------------------------------------------------------
  2752.   # new method: redraw_current_status
  2753.   #--------------------------------------------------------------------------
  2754.   def redraw_current_status
  2755.     return if @status_window.index < 0
  2756.     @status_window.draw_item(@status_window.index)
  2757.   end
  2758.  
  2759.   #--------------------------------------------------------------------------
  2760.   # alias method: command_attack
  2761.   #--------------------------------------------------------------------------
  2762.   alias scene_battle_command_attack_abe command_attack
  2763.   def command_attack
  2764.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2765.     scene_battle_command_attack_abe
  2766.   end
  2767.  
  2768.   #--------------------------------------------------------------------------
  2769.   # alias method: command_skill
  2770.   #--------------------------------------------------------------------------
  2771.   alias scene_battle_command_skill_abe command_skill
  2772.   def command_skill
  2773.     scene_battle_command_skill_abe
  2774.     @status_window.hide
  2775.     @actor_command_window.hide
  2776.     @status_aid_window.show
  2777.   end
  2778.  
  2779.   #--------------------------------------------------------------------------
  2780.   # alias method: command_item
  2781.   #--------------------------------------------------------------------------
  2782.   alias scene_battle_command_item_abe command_item
  2783.   def command_item
  2784.     scene_battle_command_item_abe
  2785.     @status_window.hide
  2786.     @actor_command_window.hide
  2787.     @status_aid_window.show
  2788.   end
  2789.  
  2790.   #--------------------------------------------------------------------------
  2791.   # overwrite method: on_skill_ok
  2792.   #--------------------------------------------------------------------------
  2793.   def on_skill_ok
  2794.     @skill = @skill_window.item
  2795.     $game_temp.battle_aid = @skill
  2796.     BattleManager.actor.input.set_skill(@skill.id)
  2797.     BattleManager.actor.last_skill.object = @skill
  2798.     if @skill.for_opponent?
  2799.       select_enemy_selection
  2800.     elsif @skill.for_friend?
  2801.       select_actor_selection
  2802.     else
  2803.       @skill_window.hide
  2804.       next_command
  2805.       $game_temp.battle_aid = nil
  2806.     end
  2807.   end
  2808.  
  2809.   #--------------------------------------------------------------------------
  2810.   # alias method: on_skill_cancel
  2811.   #--------------------------------------------------------------------------
  2812.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2813.   def on_skill_cancel
  2814.     scene_battle_on_skill_cancel_abe
  2815.     @status_window.show
  2816.     @actor_command_window.show
  2817.     @status_aid_window.hide
  2818.   end
  2819.  
  2820.   #--------------------------------------------------------------------------
  2821.   # overwrite method: on_item_ok
  2822.   #--------------------------------------------------------------------------
  2823.   def on_item_ok
  2824.     @item = @item_window.item
  2825.     $game_temp.battle_aid = @item
  2826.     BattleManager.actor.input.set_item(@item.id)
  2827.     if @item.for_opponent?
  2828.       select_enemy_selection
  2829.     elsif @item.for_friend?
  2830.       select_actor_selection
  2831.     else
  2832.       @item_window.hide
  2833.       next_command
  2834.       $game_temp.battle_aid = nil
  2835.     end
  2836.     $game_party.last_item.object = @item
  2837.   end
  2838.  
  2839.   #--------------------------------------------------------------------------
  2840.   # alias method: on_item_cancel
  2841.   #--------------------------------------------------------------------------
  2842.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2843.   def on_item_cancel
  2844.     scene_battle_on_item_cancel_abe
  2845.     @status_window.show
  2846.     @actor_command_window.show
  2847.     @status_aid_window.hide
  2848.   end
  2849.  
  2850.   #--------------------------------------------------------------------------
  2851.   # alias method: select_actor_selection
  2852.   #--------------------------------------------------------------------------
  2853.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2854.   def select_actor_selection
  2855.     @status_aid_window.refresh
  2856.     scene_battle_select_actor_selection_abe
  2857.     @status_window.hide
  2858.     @skill_window.hide
  2859.     @item_window.hide
  2860.     @help_window.show
  2861.   end
  2862.  
  2863.   #--------------------------------------------------------------------------
  2864.   # alias method: on_actor_ok
  2865.   #--------------------------------------------------------------------------
  2866.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2867.   def on_actor_ok
  2868.     $game_temp.battle_aid = nil
  2869.     scene_battle_on_actor_ok_abe
  2870.     @status_window.show
  2871.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2872.       @actor_command_window.visible = !@confirm_command_window.visible
  2873.     else
  2874.       @actor_command_window.show
  2875.     end
  2876.     @status_aid_window.hide
  2877.   end
  2878.  
  2879.   #--------------------------------------------------------------------------
  2880.   # alias method: on_actor_cancel
  2881.   #--------------------------------------------------------------------------
  2882.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2883.   def on_actor_cancel
  2884.     BattleManager.actor.input.clear
  2885.     @status_aid_window.refresh
  2886.     $game_temp.battle_aid = nil
  2887.     scene_battle_on_actor_cancel_abe
  2888.     case @actor_command_window.current_symbol
  2889.     when :skill
  2890.       @skill_window.show
  2891.     when :item
  2892.       @item_window.show
  2893.     end
  2894.   end
  2895.  
  2896.   #--------------------------------------------------------------------------
  2897.   # alias method: select_enemy_selection
  2898.   #--------------------------------------------------------------------------
  2899.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2900.   def select_enemy_selection
  2901.     @status_aid_window.refresh
  2902.     scene_battle_select_enemy_selection_abe
  2903.     @help_window.show
  2904.   end
  2905.   #--------------------------------------------------------------------------
  2906.   # alias method: on_enemy_ok
  2907.   #--------------------------------------------------------------------------
  2908.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2909.   def on_enemy_ok
  2910.     $game_temp.battle_aid = nil
  2911.     scene_battle_on_enemy_ok_abe
  2912.   end
  2913.  
  2914.   #--------------------------------------------------------------------------
  2915.   # alias method: on_enemy_cancel
  2916.   #--------------------------------------------------------------------------
  2917.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2918.   def on_enemy_cancel
  2919.     BattleManager.actor.input.clear
  2920.     @status_aid_window.refresh
  2921.     $game_temp.battle_aid = nil
  2922.     scene_battle_on_enemy_cancel_abe
  2923.     if @skill_window.visible || @item_window.visible
  2924.       @help_window.show
  2925.     else
  2926.       @help_window.hide
  2927.     end
  2928.   end
  2929.  
  2930.   #--------------------------------------------------------------------------
  2931.   # alias method: battle_start
  2932.   #--------------------------------------------------------------------------
  2933.   alias scene_battle_battle_start_abe battle_start
  2934.   def battle_start
  2935.     scene_battle_battle_start_abe
  2936.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2937.     @party_command_window.deactivate
  2938.     if BattleManager.input_start
  2939.       command_fight
  2940.     else
  2941.       turn_start
  2942.     end
  2943.   end
  2944.  
  2945.   #--------------------------------------------------------------------------
  2946.   # overwrite method: turn_end
  2947.   #--------------------------------------------------------------------------
  2948.   def turn_end
  2949.     all_battle_members.each do |battler|
  2950.       battler.on_turn_end
  2951.       status_redraw_target(battler)
  2952.       @log_window.display_auto_affected_status(battler)
  2953.       @log_window.wait_and_clear
  2954.     end
  2955.     update_party_cooldowns if $imported["YEA-CommandParty"]
  2956.     BattleManager.turn_end
  2957.     process_event
  2958.     start_party_command_selection
  2959.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2960.     if BattleManager.input_start
  2961.       @party_command_window.deactivate
  2962.       command_fight
  2963.     else
  2964.       @party_command_window.deactivate
  2965.       turn_start
  2966.     end
  2967.   end
  2968.  
  2969.   #--------------------------------------------------------------------------
  2970.   # overwrite method: execute_action
  2971.   #--------------------------------------------------------------------------
  2972.   def execute_action
  2973.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2974.     use_item
  2975.     @log_window.wait_and_clear
  2976.   end
  2977.  
  2978.   #--------------------------------------------------------------------------
  2979.   # overwrite method: apply_item_effects
  2980.   #--------------------------------------------------------------------------
  2981.   def apply_item_effects(target, item)
  2982.     if $imported["YEA-LunaticObjects"]
  2983.       lunatic_object_effect(:prepare, item, @subject, target)
  2984.     end
  2985.     target.item_apply(@subject, item)
  2986.     status_redraw_target(@subject)
  2987.     status_redraw_target(target) unless target == @subject
  2988.     @log_window.display_action_results(target, item)
  2989.     if $imported["YEA-LunaticObjects"]
  2990.       lunatic_object_effect(:during, item, @subject, target)
  2991.     end
  2992.     perform_collapse_check(target)
  2993.   end
  2994.  
  2995.   #--------------------------------------------------------------------------
  2996.   # overwite method: invoke_counter_attack
  2997.   #--------------------------------------------------------------------------
  2998.   def invoke_counter_attack(target, item)
  2999.     @log_window.display_counter(target, item)
  3000.     attack_skill = $data_skills[target.attack_skill_id]
  3001.     @subject.item_apply(target, attack_skill)
  3002.     status_redraw_target(@subject)
  3003.     status_redraw_target(target) unless target == @subject
  3004.     @log_window.display_action_results(@subject, attack_skill)
  3005.     perform_collapse_check(target)
  3006.     perform_collapse_check(@subject)
  3007.   end
  3008.  
  3009.   #--------------------------------------------------------------------------
  3010.   # new method: perform_collapse_check
  3011.   #--------------------------------------------------------------------------
  3012.   def perform_collapse_check(target)
  3013.     return if YEA::BATTLE::MSG_ADDED_STATES
  3014.     target.perform_collapse_effect if target.can_collapse?
  3015.     @log_window.wait
  3016.     @log_window.wait_for_effect
  3017.   end
  3018.  
  3019.   #--------------------------------------------------------------------------
  3020.   # overwrite method: show_attack_animation
  3021.   #--------------------------------------------------------------------------
  3022.   def show_attack_animation(targets)
  3023.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  3024.     wait_for_animation
  3025.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  3026.   end
  3027.  
  3028.   #--------------------------------------------------------------------------
  3029.   # overwrite method: show_normal_animation
  3030.   #--------------------------------------------------------------------------
  3031.   def show_normal_animation(targets, animation_id, mirror = false)
  3032.     animation = $data_animations[animation_id]
  3033.     return if animation.nil?
  3034.     ani_check = false
  3035.     if targets != nil
  3036.     targets.each do |target|
  3037.       if ani_check && target.animation_id <= 0
  3038.         target.pseudo_ani_id = animation_id
  3039.       else
  3040.         target.animation_id = animation_id
  3041.       end
  3042.       target.animation_mirror = mirror
  3043.       ani_check = true if animation.to_screen?
  3044.     end
  3045.     end
  3046.   end
  3047.  
  3048.   #--------------------------------------------------------------------------
  3049.   # overwrite method: process_action_end
  3050.   #--------------------------------------------------------------------------
  3051.   def process_action_end
  3052.     @subject.on_action_end
  3053.     status_redraw_target(@subject)
  3054.     @log_window.display_auto_affected_status(@subject)
  3055.     @log_window.wait_and_clear
  3056.     @log_window.display_current_state(@subject)
  3057.     @log_window.wait_and_clear
  3058.     BattleManager.judge_win_loss
  3059.   end
  3060.  
  3061.   #--------------------------------------------------------------------------
  3062.   # overwrite method: use_item
  3063.   #--------------------------------------------------------------------------
  3064.   def use_item
  3065.     item = @subject.current_action.item
  3066.     @log_window.display_use_item(@subject, item)
  3067.     @subject.use_item(item)
  3068.     status_redraw_target(@subject)
  3069.     if $imported["YEA-LunaticObjects"]
  3070.       lunatic_object_effect(:before, item, @subject, @subject)
  3071.     end
  3072.     process_casting_animation if $imported["YEA-CastAnimations"]
  3073.     targets = @subject.current_action.make_targets.compact rescue []
  3074.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  3075.     targets.each {|target|
  3076.       if $imported["YEA-TargetManager"]
  3077.         target = alive_random_target(target, item) if item.for_random?
  3078.       end
  3079.       item.repeats.times { invoke_item(target, item) } }
  3080.     if $imported["YEA-LunaticObjects"]
  3081.       lunatic_object_effect(:after, item, @subject, @subject)
  3082.     end
  3083.   end
  3084.  
  3085.   #--------------------------------------------------------------------------
  3086.   # alias method: invoke_item
  3087.   #--------------------------------------------------------------------------
  3088.   alias scene_battle_invoke_item_abe invoke_item
  3089.   def invoke_item(target, item)
  3090.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  3091.     #if target.dead? != item.for_dead_friend?
  3092.     #  @subject.last_target_index = target.index
  3093.     #  return
  3094.     #end
  3095.     scene_battle_invoke_item_abe(target, item)
  3096.   end
  3097.  
  3098.   #--------------------------------------------------------------------------
  3099.   # new method: show_all_animation?
  3100.   #--------------------------------------------------------------------------
  3101.   def show_all_animation?(item)
  3102.     return true if item.one_animation
  3103.     return false if $data_animations[item.animation_id].nil?
  3104.     return false unless $data_animations[item.animation_id].to_screen?
  3105.     return true
  3106.   end
  3107.  
  3108.   #--------------------------------------------------------------------------
  3109.   # new method: separate_ani?
  3110.   #--------------------------------------------------------------------------
  3111.   def separate_ani?(target, item)
  3112.     #return false if item.one_animation
  3113.     #return false if $data_animations[item.animation_id].nil?
  3114.     #return false if $data_animations[item.animation_id].to_screen?
  3115.     #return target.dead? == item.for_dead_friend?
  3116.     return false
  3117.   end
  3118.  
  3119.   #--------------------------------------------------------------------------
  3120.   # new method: status_redraw_target
  3121.   #--------------------------------------------------------------------------
  3122.   def status_redraw_target(target)
  3123.     return unless target.actor?
  3124.     @status_window.draw_item($game_party.battle_members.index(target))
  3125.   end
  3126.  
  3127.   #--------------------------------------------------------------------------
  3128.   # alias method: start_party_command_selection
  3129.   #--------------------------------------------------------------------------
  3130.   alias start_party_command_selection_abe start_party_command_selection
  3131.   def start_party_command_selection
  3132.     @status_window.refresh unless scene_changing?
  3133.     start_party_command_selection_abe
  3134.   end
  3135.  
  3136.   #--------------------------------------------------------------------------
  3137.   # overwrite method: refresh_status
  3138.   #--------------------------------------------------------------------------
  3139.   def refresh_status; return; end
  3140.  
  3141.   #--------------------------------------------------------------------------
  3142.   # new method: refresh_autobattler_status_window
  3143.   #--------------------------------------------------------------------------
  3144.   def refresh_autobattler_status_window
  3145.     for member in $game_party.battle_members
  3146.       next unless member.auto_battle?
  3147.       @status_window.draw_item(member.index)
  3148.     end
  3149.   end
  3150.  
  3151.   #--------------------------------------------------------------------------
  3152.   # new method: hide_extra_gauges
  3153.   #--------------------------------------------------------------------------
  3154.   def hide_extra_gauges
  3155.     # Made for compatibility
  3156.   end
  3157.  
  3158.   #--------------------------------------------------------------------------
  3159.   # new method: show_extra_gauges
  3160.   #--------------------------------------------------------------------------
  3161.   def show_extra_gauges
  3162.     # Made for compatibility
  3163.   end
  3164.  
  3165. end # Scene_Battle
  3166.  
  3167. #==============================================================================
  3168. #
  3169. # ▼ End of File
  3170. #
  3171. #==============================================================================

help2.JPG (9.54 KB, 下载次数: 4)

help2.JPG

help.JPG (25.55 KB, 下载次数: 3)

help.JPG

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21636
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

2
发表于 2013-8-24 16:28:22 | 只看该作者
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21636
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

3
发表于 2013-8-24 18:12:16 | 只看该作者
新建一个名为“bff 加上角色ID”的文件,和之前的脸图放在同一个目录下
(比如1号角色就是bff1.png)


RUBY 代码复制
  1. class Game_Party < Game_Unit
  2.   def max_battle_members
  3.     return 6
  4.   end
  5. end
  6.  
  7. #==============================================================================
  8. #
  9. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.19
  10. # -- Last Updated: 2012.01.29
  11. # -- Level: Normal, Hard
  12. # -- Requires: n/a
  13. #
  14. #==============================================================================
  15.  
  16. $imported = {} if $imported.nil?
  17. $imported["YEA-BattleEngine"] = true
  18.  
  19. #==============================================================================
  20. # ▼ Updates
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  23. # 2012.01.24 - Compatibility Update: Enemy Levels
  24. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  25. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  26. #              animation only once.
  27. #            - Reduced lag from battle system constantly recreating bitmaps.
  28. # 2012.01.10 - Compatibility Update: Battle System FTB
  29. # 2012.01.09 - Anticrash methods implemented.
  30. #            - Damage Popups are now separate for damage formulas and recovery.
  31. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  32. # 2012.01.02 - Compatibility Update: Target Manager
  33. #            - Added Option: AUTO_FAST
  34. #            - Random hits now show animations individually.
  35. # 2011.12.30 - Compatibility Update: Enemy Levels
  36. #            - Added Option to center the actors in the HUD.
  37. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  38. #            - Default battle system bug fixes are now included from YEA's Ace
  39. #              Core Engine.
  40. #            - Groundwork is also made to support future battle system types.
  41. #            - Multi-hit actions no longer linger when a target dies during the
  42. #              middle of one of the hits.
  43. #            - Compatibility Update: Lunatic Objects v1.02
  44. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  45. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  46. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  47. #            - Bug fixed: During State popup fix.
  48. #            - Added HIDE_POPUP_SWITCH.
  49. # 2011.12.17 - Compatibiilty Update: Cast Animations
  50. # 2011.12.15 - Compatibility Update: Battle Command List
  51. # 2011.12.14 - Compatibility Update: Lunatic Objects
  52. # 2011.12.13 - Compatibility Update: Command Party
  53. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  54. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  55. #            - Popup graphical bug fixed.
  56. #            - Bug fixed: Didn't wait for boss dead animations.
  57. #            - Bug fixed: Surprise attacks that froze the game.
  58. #            - Bug fixed: Popups didn't show for straight recovery effects.
  59. # 2011.12.08 - Finished Script.
  60. # 2011.12.04 - Started Script.
  61. #
  62. #==============================================================================
  63. # ▼ Introduction
  64. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  65. # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  66. # allows for easier management of the battle engine without adding too many
  67. # features, allowing users to customize what they want as they see fit. While
  68. # the Ace Battle Engine isn't an entirely new engine, it gives users control
  69. # that RPG Maker VX Ace didn't originally give them.
  70. #
  71. # Furthermore, this script provides some new features. They are as follows:
  72. #
  73. # -----------------------------------------------------------------------------
  74. # Animation Fixes
  75. # -----------------------------------------------------------------------------
  76. # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  77. # these fixes are included in this script as well to ensure it's working for
  78. # the battle script in the event someone chooses not to work with the Ace Core
  79. # Engine script. The animation fixes prevent excessive animation overlaying
  80. # (and making the screen look really ugly) and prevents animation clashing
  81. # between two dual wielding normal attack animations.
  82. #
  83. # -----------------------------------------------------------------------------
  84. # Enemy Animations
  85. # -----------------------------------------------------------------------------
  86. # Enemies now show battle animations when they deliver attacks and skills
  87. # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  88. # than just sound effects and the screen shaking. Now, animations play where
  89. # the status window is and relative to the position of each party member.
  90. #
  91. # -----------------------------------------------------------------------------
  92. # Left/Right Command Selection
  93. # -----------------------------------------------------------------------------
  94. # While choosing actions, the player can press Left or Right to move freely
  95. # between (alive) actors to change their skills. Players no longer have to
  96. # cancel all the way back to change one person's skill and reselect everything.
  97. # On that note, there is now the option that when a battle starts or at the
  98. # end of a turn, players will start immediately at command selection rather
  99. # than needing to select "Fight" in the Party Command Window.
  100. #
  101. # -----------------------------------------------------------------------------
  102. # Popups
  103. # -----------------------------------------------------------------------------
  104. # Dealing damage, inflicting states, adding buffs, landing critical hits,
  105. # striking weaknesses, missing attacks, you name it, there's probably a popup
  106. # for it. Popups deliver information to the player in a quick or orderly
  107. # fashion without requiring the player to read lines of text.
  108. #
  109. # -----------------------------------------------------------------------------
  110. # Targeting Window
  111. # -----------------------------------------------------------------------------
  112. # When targeting enemies, the window is no longer displayed. Instead, the
  113. # targeted enemies are highlighted and their names are shown at the top of the
  114. # screen in a help window. Another thing that's changed is when skills that
  115. # target multiple targets are selected, there is a confirmation step that the
  116. # player must take before continuing. In this confirmation step, all of the
  117. # multiple targets are selected and in the help window would display the scope
  118. # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  119. # this step by default.
  120. #
  121. # -----------------------------------------------------------------------------
  122. # Toggling On and Off Special Effects and Text
  123. # -----------------------------------------------------------------------------
  124. # Not everybody likes having the screen shake or the enemies blink when they
  125. # take damage. These effects can now be toggled on and off. Certain text can
  126. # also be toggled on and off from appearing. A lot of the displayed text has
  127. # been rendered redundant through the use of popups.
  128. #
  129. # -----------------------------------------------------------------------------
  130. # Visual Battle Status Window
  131. # -----------------------------------------------------------------------------
  132. # Rather than just having rows of names with HP and MP bars next to them, the
  133. # Battle Status Window now displays actors' faces and their gauges aligned at
  134. # the bottom. More status effects can be shown in addition to showing more
  135. # members on screen at once. The Battle Status Window is also optimized to
  136. # refresh less (thus, removing potential lag from the system).
  137. #
  138. # -----------------------------------------------------------------------------
  139. # Window Position Changes
  140. # -----------------------------------------------------------------------------
  141. # Windows such as the Skill Window and Item Window have been rearranged to
  142. # always provide the player a clear view of the battlefield rather than opening
  143. # up and covering everything. As such, the window positions are placed at the
  144. # bottom of the screen and are repositioned.
  145. #
  146. #==============================================================================
  147. # ▼ Instructions
  148. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  149. # To install this script, open up your script editor and copy/paste this script
  150. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  151. #
  152. # -----------------------------------------------------------------------------
  153. # Skill Notetags - These notetags go in the skills notebox in the database.
  154. # -----------------------------------------------------------------------------
  155. # <one animation>
  156. # Causes the action to display the action animation only once, even if it's a
  157. # multi-hit action. This is used primarily for non-all scope targeting.
  158. #
  159. # -----------------------------------------------------------------------------
  160. # Item Notetags - These notetags go in the items notebox in the database.
  161. # -----------------------------------------------------------------------------
  162. # <one animation>
  163. # Causes the action to display the action animation only once, even if it's a
  164. # multi-hit action. This is used primarily for non-all scope targeting.
  165. #
  166. # -----------------------------------------------------------------------------
  167. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  168. # -----------------------------------------------------------------------------
  169. # <atk ani 1: x>
  170. # <atk ani 2: x>
  171. # Changes the normal attack animation of the particular enemy to animation x.
  172. # Attack animation 1 is the first one that plays. If there's a second animation
  173. # then the second one will play after in mirrored form.
  174. #
  175. # -----------------------------------------------------------------------------
  176. # State Notetags - These notetags go in the state notebox in the database.
  177. # -----------------------------------------------------------------------------
  178. # <popup add: string>
  179. # <popup rem: string>
  180. # <popup dur: string>
  181. # Status effects now create popups whenever they're inflicted. However, if you
  182. # don't like that a certain status effect uses a particular colour setting,
  183. # change "string" to one of the rulesets below to cause that popup to use a
  184. # different ruleset.
  185. #
  186. # <popup hide add>
  187. # <popup hide rem>
  188. # <popup hide dur>
  189. # Not everybody wants status effects to show popups when inflicted. When this
  190. # is the case, insert the respective tag to hide popups from appearing when the
  191. # state is added, removed, or during the stand-by phases.
  192. #
  193. # -----------------------------------------------------------------------------
  194. # Debug Tools - These tools only work during Test Play.
  195. # -----------------------------------------------------------------------------
  196. # - F5 Key -
  197. # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  198. # All states and buffs are removed whether they are positive or negative.
  199. #
  200. # - F6 Key -
  201. # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  202. #
  203. # - F7 Key -
  204. # Sets all actors to have max TP. Everything else is unaffected.
  205. #
  206. # - F8 Key -
  207. # Kills all enemies in battle. Ends the battle quickly.
  208. #
  209. #==============================================================================
  210. # ▼ Compatibility
  211. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  212. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  213. # it will run with RPG Maker VX without adjusting.
  214. #
  215. #==============================================================================
  216.  
  217. module YEA
  218.   module BATTLE
  219.  
  220.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  221.     # - General Battle Settings -
  222.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  223.     # These settings are adjusted for the overall battle system. These are
  224.     # various miscellaneous options to adjust. Each of the settings below will
  225.     # explain what they do. Change default enemy battle animations here, too.
  226.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  227.     BLINK_EFFECTS      = false  # Blink sprite when damaged?
  228.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  229.     SCREEN_SHAKE       = false  # Shake screen in battle?
  230.     SKIP_PARTY_COMMAND = true   # Skips the Fight/Escape menu.
  231.     AUTO_FAST          = true   # Causes message windows to not wait.
  232.     ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  233.  
  234.     # If this switch is ON, popups will be hidden. If OFF, the popups will be
  235.     # shown. If you do not wish to use this switch, set it to 0.
  236.     HIDE_POPUP_SWITCH  = 11
  237.  
  238.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  239.     # - Battle Status Window -
  240.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241.     # This sets the default battle system your game will use. If your game
  242.     # doesn't have any other battle systems installed, it will use :dtb.
  243.     #
  244.     # Battle System        Requirement
  245.     #   :dtb               - Default Turn Battle. Default system.
  246.     #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  247.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  248.     DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  249.  
  250.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  251.     # - Battle Status Window -
  252.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  253.     # Here, you can adjust the settings for the battle status window. The
  254.     # battle status window, by default, will show the actor's face, HP, MP, TP
  255.     # (if viable), and any inflicted status effects.
  256.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  257.     BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  258.     BATTLESTATUS_TEXT_FONT_SIZE = 20    # Font size used for HP, MP, TP.
  259.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  260.     BATTLESTATUS_HPGAUGE_Y_PLUS = 31    # Y Location buffer used for HP gauge.
  261.     BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  262.  
  263.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  264.     # - Help Window Text -
  265.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  266.     # When selecting a target to attack, this is the text that will be shown
  267.     # in place of a target's name for special cases. These special cases are
  268.     # for selections that were originally non-targetable battle scopes.
  269.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  270.     HELP_TEXT_ALL_FOES        = "敌方全体"
  271.     HELP_TEXT_ONE_RANDOM_FOE  = "敌方随机成员一名"
  272.     HELP_TEXT_MANY_RANDOM_FOE = "敌方随机成员%d名"
  273.     HELP_TEXT_ALL_ALLIES      = "我方全体"
  274.     HELP_TEXT_ALL_DEAD_ALLIES = "我方全体(战斗不能)"
  275.     HELP_TEXT_ONE_RANDOM_ALLY = "我方随机成员一名"
  276.     HELP_TEXT_RANDOM_ALLIES   = "我方随机成员%d名"
  277.  
  278.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  279.     # - Popup Settings -
  280.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  281.     # These settings will adjust the popups that appear in battle. Popups
  282.     # deliver information to your player as battlers deal damage, inflict
  283.     # status effects, and more.
  284.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  285.     ENABLE_POPUPS  = false#true     # Set this to false if you wish to disable them.
  286.     FLASH_CRITICAL = true     # Sets critical hits to flash.
  287.  
  288.     # This hash adjusts the popup settings that will govern how popups appear.
  289.     # Adjust them accordingly.
  290.     POPUP_SETTINGS ={
  291.       :offset     => -24,         # Height offset of a popup.
  292.       :fade       => 12,          # Fade rate for each popup.
  293.       :full       => 60,          # Frames before a popup fades.
  294.       :hp_dmg     => "-%s ",      # SprintF for HP damage.
  295.       :hp_heal    => "+%s ",      # SprintF for HP healing.
  296.       :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  297.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  298.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  299.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  300.       :drained    => "DRAIN",     # Text display for draining HP/MP.
  301.       :critical   => "CRITICAL!", # Text display for critical hit.
  302.       :missed     => "MISS",      # Text display for missed attack.
  303.       :evaded     => "EVADE!",    # Text display for evaded attack.
  304.       :nulled     => "NULL",      # Text display for nulled attack.
  305.       :failed     => "FAILED",    # Text display for a failed attack.
  306.       :add_state  => "+%s",      # SprintF for added states.
  307.       :rem_state  => "-%s",      # SprintF for removed states.
  308.       :dur_state  => "%s",        # SprintF for during states.
  309.       :ele_rates  => true,        # This will display elemental affinities.
  310.       :ele_wait   => 20,          # This is how many frames will wait.
  311.       :weakpoint  => "WEAKPOINT", # Appears if foe is weak to element.
  312.       :resistant  => "RESIST",    # Appears if foe is resistant to element.
  313.       :immune     => "IMMUNE",    # Appears if foe is immune to element.
  314.       :absorbed   => "ABSORB",    # Appears if foe can absorb the element.
  315.       :add_buff   => "%s+",      # Appears when a positive buff is applied.
  316.       :add_debuff => "%s-",      # Appears when a negative buff is applied.
  317.     } # Do not remove this.
  318.  
  319.     # This is the default font used for the popups. Adjust them accordingly
  320.     # or even add new ones.
  321.     DEFAULT = ["Microsoft Yahei","微软雅黑","黑体", "VL Gothic", "Verdana", "Arial", "Courier"]
  322. #~  
  323.     # The following are the various rules that govern the individual popup
  324.     # types that will appear. Adjust them accordingly. Here is a list of what
  325.     # each category does.
  326.     #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  327.     #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  328.     #   Sz       The font size used for the popup text.
  329.     #   Bold     Applying bold for the popup text.
  330.     #   Italic   Applying italic for the popup text.
  331.     #   Red      The red value of the popup text.
  332.     #   Grn      The green value of the popup text.
  333.     #   Blu      The blue value of the popup text.
  334.     #   Font     The font used for the popup text.
  335.     POPUP_RULES ={
  336.       # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  337.       "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  338.       "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  339.       "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  340.       "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  341.       "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  342.       "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  343.       "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  344.       "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  345.       "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  346.       "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  347.       "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  348.       "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  349.       "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  350.       "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  351.       "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  352.       "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  353.       "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  354.       "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  355.       "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  356.       "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  357.     } # Do not remove this.
  358.  
  359.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  360.     # - Streamlined Messages -
  361.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  362.     # Want to remove some of those annoying messages that appear all the time?
  363.     # Now you can! Select which messages you want to enable or disable. Some of
  364.     # these messages will be rendered useless due to popups.
  365.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  366.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  367.     MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  368.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  369.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  370.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  371.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  372.     MSG_FAILURE_HIT    = false  # Show effect failed against target.
  373.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  374.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  375.     MSG_EVASION        = false  # Show attack was evaded by the target.
  376.     MSG_HP_DAMAGE      = false  # Show HP damage to target.
  377.     MSG_MP_DAMAGE      = false  # Show MP damage to target.
  378.     MSG_TP_DAMAGE      = false  # Show TP damage to target.
  379.     MSG_ADDED_STATES   = false  # Show target's added states.
  380.     MSG_REMOVED_STATES = false  # Show target's removed states.
  381.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  382.  
  383.   end # BATTLE
  384. end # YEA
  385.  
  386. #==============================================================================
  387. # ▼ Editting anything past this point may potentially result in causing
  388. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  389. # halitosis so edit at your own risk.
  390. #==============================================================================
  391.  
  392. module YEA
  393.   module REGEXP
  394.   module ENEMY
  395.  
  396.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  397.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  398.  
  399.   end # ENEMY
  400.   module USABLEITEM
  401.  
  402.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  403.  
  404.   end # USABLEITEM
  405.   module STATE
  406.  
  407.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  408.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  409.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  410.  
  411.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  412.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  413.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  414.  
  415.   end # STATE
  416.   end # REGEXP
  417. end # YEA
  418.  
  419. #==============================================================================
  420. # ■ Switch
  421. #==============================================================================
  422.  
  423. module Switch
  424.  
  425.   #--------------------------------------------------------------------------
  426.   # self.hide_popups
  427.   #--------------------------------------------------------------------------
  428.   def self.hide_popups
  429.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  430.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  431.   end
  432.  
  433. end # Switch
  434.  
  435. #==============================================================================
  436. # ■ Colour
  437. #==============================================================================
  438.  
  439. module Colour
  440.  
  441.   #--------------------------------------------------------------------------
  442.   # self.text_colour
  443.   #--------------------------------------------------------------------------
  444.   def self.text_colour(index)
  445.     windowskin = Cache.system("Window")
  446.     x = 64 + (index % 8) * 8
  447.     y = 96 + (index / 8) * 8
  448.     return windowskin.get_pixel(x, y)
  449.   end
  450.  
  451. end # Colour
  452.  
  453. #==============================================================================
  454. # ■ Icon
  455. #==============================================================================
  456.  
  457. module Icon
  458.  
  459.   #--------------------------------------------------------------------------
  460.   # self.no_action
  461.   #--------------------------------------------------------------------------
  462.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  463.  
  464. end # Icon
  465.  
  466. #==============================================================================
  467. # ■ Numeric
  468. #==============================================================================
  469.  
  470. class Numeric
  471.  
  472.   #--------------------------------------------------------------------------
  473.   # new method: group_digits
  474.   #--------------------------------------------------------------------------
  475.   unless $imported["YEA-CoreEngine"]
  476.   def group; return self.to_s; end
  477.   end # $imported["YEA-CoreEngine"]
  478.  
  479. end # Numeric
  480.  
  481. #==============================================================================
  482. # ■ DataManager
  483. #==============================================================================
  484.  
  485. module DataManager
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # alias method: load_database
  489.   #--------------------------------------------------------------------------
  490.   class <<self; alias load_database_abe load_database; end
  491.   def self.load_database
  492.     load_database_abe
  493.     load_notetags_abe
  494.   end
  495.  
  496.   #--------------------------------------------------------------------------
  497.   # new method: load_notetags_abe
  498.   #--------------------------------------------------------------------------
  499.   def self.load_notetags_abe
  500.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  501.     for group in groups
  502.       for obj in group
  503.         next if obj.nil?
  504.         obj.load_notetags_abe
  505.       end
  506.     end
  507.   end
  508.  
  509. end # DataManager
  510.  
  511. #==============================================================================
  512. # ■ RPG::UsableItem
  513. #==============================================================================
  514.  
  515. class RPG::UsableItem < RPG::BaseItem
  516.  
  517.   #--------------------------------------------------------------------------
  518.   # public instance variables
  519.   #--------------------------------------------------------------------------
  520.   attr_accessor :one_animation
  521.  
  522.   #--------------------------------------------------------------------------
  523.   # common cache: load_notetags_abe
  524.   #--------------------------------------------------------------------------
  525.   def load_notetags_abe
  526.     @one_animation = false
  527.     #---
  528.     self.note.split(/[\r\n]+/).each { |line|
  529.       case line
  530.       #---
  531.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  532.         @one_animation = true
  533.       end
  534.     } # self.note.split
  535.     #---
  536.   end
  537.  
  538. end # RPG::UsableItem
  539.  
  540. #==============================================================================
  541. # ■ RPG::Enemy
  542. #==============================================================================
  543.  
  544. class RPG::Enemy < RPG::BaseItem
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # public instance variables
  548.   #--------------------------------------------------------------------------
  549.   attr_accessor :atk_animation_id1
  550.   attr_accessor :atk_animation_id2
  551.  
  552.   #--------------------------------------------------------------------------
  553.   # common cache: load_notetags_abe
  554.   #--------------------------------------------------------------------------
  555.   def load_notetags_abe
  556.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  557.     @atk_animation_id2 = 0
  558.     #---
  559.     self.note.split(/[\r\n]+/).each { |line|
  560.       case line
  561.       #---
  562.       when YEA::REGEXP::ENEMY::ATK_ANI1
  563.         @atk_animation_id1 = $1.to_i
  564.       when YEA::REGEXP::ENEMY::ATK_ANI2
  565.         @atk_animation_id2 = $1.to_i
  566.       end
  567.     } # self.note.split
  568.     #---
  569.   end
  570.  
  571. end # RPG::Enemy
  572.  
  573. #==============================================================================
  574. # ■ RPG::Enemy
  575. #==============================================================================
  576.  
  577. class RPG::State < RPG::BaseItem
  578.  
  579.   #--------------------------------------------------------------------------
  580.   # public instance variables
  581.   #--------------------------------------------------------------------------
  582.   attr_accessor :popup_rules
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # common cache: load_notetags_abe
  586.   #--------------------------------------------------------------------------
  587.   def load_notetags_abe
  588.     @popup_rules = {
  589.       :add_state => "ADDSTATE",
  590.       :rem_state => "REMSTATE",
  591.       :dur_state => nil
  592.     } # Do not remove this.
  593.     #---
  594.     self.note.split(/[\r\n]+/).each { |line|
  595.       case line
  596.       #---
  597.       when YEA::REGEXP::STATE::POPUP_ADD
  598.         @popup_rules[:add_state] = $1.upcase.to_s
  599.       when YEA::REGEXP::STATE::POPUP_REM
  600.         @popup_rules[:rem_state] = $1.upcase.to_s
  601.       when YEA::REGEXP::STATE::POPUP_DUR
  602.         @popup_rules[:dur_state] = $1.upcase.to_s
  603.       when YEA::REGEXP::STATE::HIDE_ADD
  604.         @popup_rules[:add_state] = nil
  605.       when YEA::REGEXP::STATE::HIDE_REM
  606.         @popup_rules[:rem_state] = nil
  607.       when YEA::REGEXP::STATE::HIDE_DUR
  608.         @popup_rules[:dur_state] = nil
  609.       end
  610.     } # self.note.split
  611.     #---
  612.   end
  613.  
  614. end # RPG::State
  615.  
  616. #==============================================================================
  617. # ■ BattleManager
  618. #==============================================================================
  619.  
  620. module BattleManager
  621.  
  622.   #--------------------------------------------------------------------------
  623.   # overwrite method: self.battle_start
  624.   #--------------------------------------------------------------------------
  625.   def self.battle_start
  626.     $game_system.battle_count += 1
  627.     $game_party.on_battle_start
  628.     $game_troop.on_battle_start
  629.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  630.     $game_troop.enemy_names.each do |name|
  631.       $game_message.add(sprintf(Vocab::Emerge, name))
  632.     end
  633.     if @preemptive
  634.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  635.     elsif @surprise
  636.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  637.     end
  638.     wait_for_message
  639.   end
  640.  
  641.   #--------------------------------------------------------------------------
  642.   # overwrite method: make_action_orders
  643.   #--------------------------------------------------------------------------
  644.   def self.make_action_orders
  645.     make_dtb_action_orders if btype?(:dtb)
  646.   end
  647.  
  648.   #--------------------------------------------------------------------------
  649.   # new method: make_dtb_action_orders
  650.   #--------------------------------------------------------------------------
  651.   def self.make_dtb_action_orders
  652.     @action_battlers = []
  653.     @action_battlers += $game_party.members unless @surprise
  654.     @action_battlers += $game_troop.members unless @preemptive
  655.     @action_battlers.each {|battler| battler.make_speed }
  656.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  657.   end
  658.  
  659.   #--------------------------------------------------------------------------
  660.   # overwrite method: turn_start
  661.   #--------------------------------------------------------------------------
  662.   def self.turn_start
  663.     @phase = :turn
  664.     clear_actor
  665.     $game_troop.increase_turn
  666.     @performed_battlers = []
  667.     make_action_orders
  668.   end
  669.  
  670.   #--------------------------------------------------------------------------
  671.   # overwrite method: next_subject
  672.   #--------------------------------------------------------------------------
  673.   def self.next_subject
  674.     @performed_battlers = [] if @performed_battlers.nil?
  675.     loop do
  676.       @action_battlers -= @performed_battlers
  677.       battler = @action_battlers.shift
  678.       return nil unless battler
  679.       next unless battler.index && battler.alive?
  680.       @performed_battlers.push(battler)
  681.       return battler
  682.     end
  683.   end
  684.  
  685.   #--------------------------------------------------------------------------
  686.   # overwrite method: force_action
  687.   #--------------------------------------------------------------------------
  688.   def self.force_action(battler)
  689.     @action_forced = [] if @action_forced == nil
  690.     @action_forced.push(battler)
  691.     return unless Switch.forced_action_remove
  692.     @action_battlers.delete(battler)
  693.   end
  694.  
  695.   #--------------------------------------------------------------------------
  696.   # overwrite method: action_forced?
  697.   #--------------------------------------------------------------------------
  698.   def self.action_forced?
  699.     @action_forced != nil
  700.   end
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # overwrite method: action_forced_battler
  704.   #--------------------------------------------------------------------------
  705.   def self.action_forced_battler
  706.     @action_forced.shift
  707.   end
  708.  
  709.   #--------------------------------------------------------------------------
  710.   # overwrite method: clear_action_force
  711.   #--------------------------------------------------------------------------
  712.   def self.clear_action_force
  713.     return if @action_forced.nil?
  714.     @action_forced = nil if @action_forced.empty?
  715.   end
  716.  
  717.   #--------------------------------------------------------------------------
  718.   # new method: self.init_battle_type
  719.   #--------------------------------------------------------------------------
  720.   def self.init_battle_type
  721.     set_btype($game_system.battle_system)
  722.   end
  723.  
  724.   #--------------------------------------------------------------------------
  725.   # new method: self.set_btype
  726.   #--------------------------------------------------------------------------
  727.   def self.set_btype(btype = :dtb)
  728.     @battle_type = btype
  729.   end
  730.  
  731.   #--------------------------------------------------------------------------
  732.   # new method: self.btype?
  733.   #--------------------------------------------------------------------------
  734.   def self.btype?(btype)
  735.     return @battle_type == btype
  736.   end
  737.  
  738. end # BattleManager
  739.  
  740. #==============================================================================
  741. # ■ Game_System
  742. #==============================================================================
  743.  
  744. class Game_System
  745.  
  746.   #--------------------------------------------------------------------------
  747.   # new method: battle_system
  748.   #--------------------------------------------------------------------------
  749.   def battle_system
  750.     if @battle_system.nil?
  751.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  752.     else
  753.       return battle_system_corrected(@battle_system)
  754.     end
  755.   end
  756.  
  757.   #--------------------------------------------------------------------------
  758.   # new method: set_battle_system
  759.   #--------------------------------------------------------------------------
  760.   def set_battle_system(type)
  761.     case type
  762.     when :dtb; @battle_system = :dtb
  763.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  764.     else;      @battle_system = :dtb
  765.     end
  766.   end
  767.  
  768.   #--------------------------------------------------------------------------
  769.   # new method: battle_system_corrected
  770.   #--------------------------------------------------------------------------
  771.   def battle_system_corrected(type)
  772.     case type
  773.     when :dtb; return :dtb
  774.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  775.     else;      return :dtb
  776.     end
  777.   end
  778.  
  779. end # Game_System
  780.  
  781. #==============================================================================
  782. # ■ Sprite_Base
  783. #==============================================================================
  784.  
  785. class Sprite_Base < Sprite
  786.  
  787.   #--------------------------------------------------------------------------
  788.   # new method: start_pseudo_animation
  789.   #--------------------------------------------------------------------------
  790.   unless $imported["YEA-CoreEngine"]
  791.   def start_pseudo_animation(animation, mirror = false)
  792.     dispose_animation
  793.     @animation = animation
  794.     return if @animation.nil?
  795.     @ani_mirror = mirror
  796.     set_animation_rate
  797.     @ani_duration = @animation.frame_max * @ani_rate + 1
  798.     @ani_sprites = []
  799.   end
  800.   end # $imported["YEA-CoreEngine"]
  801.  
  802. end # Sprite_Base
  803.  
  804. #==============================================================================
  805. # ■ Sprite_Battler
  806. #==============================================================================
  807.  
  808. class Sprite_Battler < Sprite_Base
  809.  
  810.   #--------------------------------------------------------------------------
  811.   # public instance variables
  812.   #--------------------------------------------------------------------------
  813.   attr_accessor :effect_type
  814.   attr_accessor :battler_visible
  815.   attr_accessor :popups
  816.  
  817.   #--------------------------------------------------------------------------
  818.   # alias method: initialize
  819.   #--------------------------------------------------------------------------
  820.   alias sprite_battler_initialize_abe initialize
  821.   def initialize(viewport, battler = nil)
  822.     sprite_battler_initialize_abe(viewport, battler)
  823.     @popups = []
  824.     @popup_flags = []
  825.   end
  826.  
  827.   #--------------------------------------------------------------------------
  828.   # alias method: update_bitmap
  829.   #--------------------------------------------------------------------------
  830.   alias sprite_battler_update_bitmap_abe update_bitmap
  831.   def update_bitmap
  832.     return if @battler.actor? && @battler.battler_name == ""
  833.     sprite_battler_update_bitmap_abe
  834.   end
  835.  
  836.   #--------------------------------------------------------------------------
  837.   # alias method: setup_new_animation
  838.   #--------------------------------------------------------------------------
  839.   unless $imported["YEA-CoreEngine"]
  840.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  841.   def setup_new_animation
  842.     sprite_battler_setup_new_animation_abe
  843.     return if @battler.pseudo_ani_id <= 0
  844.     animation = $data_animations[@battler.pseudo_ani_id]
  845.     mirror = @battler.animation_mirror
  846.     start_pseudo_animation(animation, mirror)
  847.     @battler.pseudo_ani_id = 0
  848.   end
  849.   end # $imported["YEA-CoreEngine"]
  850.  
  851.   #--------------------------------------------------------------------------
  852.   # alias method: setup_new_effect
  853.   #--------------------------------------------------------------------------
  854.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  855.   def setup_new_effect
  856.     sprite_battler_setup_new_effect_abe
  857.     setup_popups
  858.   end
  859.  
  860.   #--------------------------------------------------------------------------
  861.   # new method: setup_popups
  862.   #--------------------------------------------------------------------------
  863.   def setup_popups
  864.     return unless @battler.use_sprite?
  865.     @battler.popups = [] if @battler.popups.nil?
  866.     return if @battler.popups == []
  867.     array = @battler.popups.shift
  868.     create_new_popup(array[0], array[1], array[2])
  869.   end
  870.  
  871.   #--------------------------------------------------------------------------
  872.   # new method: create_new_popup
  873.   #--------------------------------------------------------------------------
  874.   def create_new_popup(value, rules, flags)
  875.     return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  876.     return if flags & @popup_flags != []
  877.     array = YEA::BATTLE::POPUP_RULES[rules]
  878.     for popup in @popups
  879.       popup.y -= 24
  880.     end
  881.     return unless SceneManager.scene.is_a?(Scene_Battle)
  882.     return if SceneManager.scene.spriteset.nil?
  883.     view = SceneManager.scene.spriteset.viewportPopups
  884.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  885.     @popups.push(new_popup)
  886.     @popup_flags.push("weakness") if flags.include?("weakness")
  887.     @popup_flags.push("resistant") if flags.include?("resistant")
  888.     @popup_flags.push("immune") if flags.include?("immune")
  889.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  890.   end
  891.  
  892.   #--------------------------------------------------------------------------
  893.   # alias method: update_effect
  894.   #--------------------------------------------------------------------------
  895.   alias sprite_battler_update_effect_abe update_effect
  896.   def update_effect
  897.     sprite_battler_update_effect_abe
  898.     update_popups
  899.   end
  900.  
  901.   #--------------------------------------------------------------------------
  902.   # new method: update_popups
  903.   #--------------------------------------------------------------------------
  904.   def update_popups
  905.     for popup in @popups
  906.       popup.update
  907.       next unless popup.opacity <= 0
  908.       popup.bitmap.dispose
  909.       popup.dispose
  910.       @popups.delete(popup)
  911.       popup = nil
  912.     end
  913.     @popup_flags = [] if @popups == [] && @popup_flags != []
  914.     return unless SceneManager.scene_is?(Scene_Battle)
  915.     if @current_active_battler != SceneManager.scene.subject
  916.       @current_active_battler = SceneManager.scene.subject
  917.       @popup_flags = []
  918.     end
  919.   end
  920.  
  921. end # Sprite_Battler
  922.  
  923. #==============================================================================
  924. # ■ Sprite_Popup
  925. #==============================================================================
  926.  
  927. class Sprite_Popup < Sprite_Base
  928.  
  929.   #--------------------------------------------------------------------------
  930.   # public instance variables
  931.   #--------------------------------------------------------------------------
  932.   attr_accessor :flags
  933.  
  934.   #--------------------------------------------------------------------------
  935.   # initialize
  936.   #--------------------------------------------------------------------------
  937.   def initialize(viewport, battler, value, rules, flags)
  938.     super(viewport)
  939.     @value = value
  940.     @rules = rules
  941.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  942.     [url=home.php?mod=space&uid=274289]@fade[/url] = YEA::BATTLE::POPUP_SETTINGS[:fade]
  943.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  944.     @flags = flags
  945.     @battler = battler
  946.     create_popup_bitmap
  947.   end
  948.  
  949.   #--------------------------------------------------------------------------
  950.   # create_popup_bitmap
  951.   #--------------------------------------------------------------------------
  952.   def create_popup_bitmap
  953.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  954.     bw = Graphics.width
  955.     bw += 48 if @flags.include?("state")
  956.     bh = Font.default_size * 3
  957.     bitmap = Bitmap.new(bw, bh)
  958.     bitmap.font.name = rules_array[8]
  959.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  960.     bitmap.font.size = size
  961.     bitmap.font.bold = rules_array[3]
  962.     bitmap.font.italic = rules_array[4]
  963.     if flags.include?("critical")
  964.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  965.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  966.     else
  967.       bitmap.font.out_color.set(0, 0, 0, 255)
  968.     end
  969.     dx = 0; dy = 0; dw = 0
  970.     dx += 24 if @flags.include?("state")
  971.     dw += 24 if @flags.include?("state")
  972.     if @flags.include?("state") || @flags.include?("buff")
  973.       c_width = bitmap.text_size(@value).width
  974.       icon_bitmap = $game_temp.iconset
  975.       icon_index = flag_state_icon
  976.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  977.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  978.     end
  979.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  980.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  981.     self.bitmap = bitmap
  982.     self.x = @battler.screen_x
  983.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  984.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  985.     self.y = @battler.screen_y - @battler.sprite.oy/2
  986.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  987.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  988.     self.ox = bw/2; self.oy = bh/2
  989.     self.zoom_x = self.zoom_y = rules_array[0]
  990.     if @flags.include?("no zoom")
  991.       self.zoom_x = self.zoom_y = rules_array[1]
  992.     end
  993.     @target_zoom = rules_array[1]
  994.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  995.     self.z = 500
  996.   end
  997.  
  998.   #--------------------------------------------------------------------------
  999.   # update
  1000.   #--------------------------------------------------------------------------
  1001.   def update
  1002.     super
  1003.     #---
  1004.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  1005.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  1006.       @hue_duration -= 1
  1007.       self.bitmap.hue_change(15) if @hue_duration <= 0
  1008.     end
  1009.     #---
  1010.     if @zoom_direction == "up"
  1011.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  1012.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  1013.     else
  1014.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  1015.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  1016.     end
  1017.     #---
  1018.     @full -= 1
  1019.     return if @full > 0
  1020.     self.y -= 1
  1021.     self.opacity -= @fade
  1022.   end
  1023.  
  1024.   #--------------------------------------------------------------------------
  1025.   # flag_state_icon
  1026.   #--------------------------------------------------------------------------
  1027.   def flag_state_icon
  1028.     for item in @flags; return item if item.is_a?(Integer); end
  1029.     return 0
  1030.   end
  1031.  
  1032. end # Sprite_Popup
  1033.  
  1034. #==============================================================================
  1035. # ■ Spriteset_Battle
  1036. #==============================================================================
  1037.  
  1038. class Spriteset_Battle
  1039.  
  1040.   #--------------------------------------------------------------------------
  1041.   # public instance variables
  1042.   #--------------------------------------------------------------------------
  1043.   attr_accessor :actor_sprites
  1044.   attr_accessor :enemy_sprites
  1045.   attr_accessor :viewport1
  1046.   attr_accessor :viewportPopups
  1047.  
  1048.   #--------------------------------------------------------------------------
  1049.   # alias method: create_viewports
  1050.   #--------------------------------------------------------------------------
  1051.   alias spriteset_battle_create_viewports_abe create_viewports
  1052.   def create_viewports
  1053.     spriteset_battle_create_viewports_abe
  1054.     @viewportPopups = Viewport.new
  1055.     @viewportPopups.z = 200
  1056.   end
  1057.  
  1058.   #--------------------------------------------------------------------------
  1059.   # alias method: dispose_viewports
  1060.   #--------------------------------------------------------------------------
  1061.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1062.   def dispose_viewports
  1063.     spriteset_battle_dispose_viewports_abe
  1064.     @viewportPopups.dispose
  1065.   end
  1066.  
  1067.   #--------------------------------------------------------------------------
  1068.   # alias method: update_viewports
  1069.   #--------------------------------------------------------------------------
  1070.   alias spriteset_battle_update_viewports_abe update_viewports
  1071.   def update_viewports
  1072.     spriteset_battle_update_viewports_abe
  1073.     @viewportPopups.update
  1074.   end
  1075.  
  1076. end # Spriteset_Battle
  1077.  
  1078. #==============================================================================
  1079. # ■ Game_Temp
  1080. #==============================================================================
  1081.  
  1082. class Game_Temp
  1083.  
  1084.   #--------------------------------------------------------------------------
  1085.   # public instance variables
  1086.   #--------------------------------------------------------------------------
  1087.   attr_accessor :battle_aid
  1088.   attr_accessor :evaluating
  1089.   attr_accessor :iconset
  1090.  
  1091.   #--------------------------------------------------------------------------
  1092.   # alias method: initialize
  1093.   #--------------------------------------------------------------------------
  1094.   alias game_temp_initialize_abe initialize
  1095.   def initialize
  1096.     game_temp_initialize_abe
  1097.     @iconset = Cache.system("Iconset")
  1098.   end
  1099.  
  1100. end # Game_Temp
  1101.  
  1102. #==============================================================================
  1103. # ■ Game_Action
  1104. #==============================================================================
  1105.  
  1106. class Game_Action
  1107.  
  1108.   #--------------------------------------------------------------------------
  1109.   # overwrite method: speed
  1110.   #--------------------------------------------------------------------------
  1111.   def speed
  1112.     speed = subject.agi
  1113.     speed += item.speed if item
  1114.     speed += subject.atk_speed if attack?
  1115.     return speed
  1116.   end
  1117.  
  1118.   #--------------------------------------------------------------------------
  1119.   # alias method: evaluate_item_with_target
  1120.   #--------------------------------------------------------------------------
  1121.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1122.   def evaluate_item_with_target(target)
  1123.     $game_temp.evaluating = true
  1124.     result = evaluate_item_with_target_abe(target)
  1125.     $game_temp.evaluating = false
  1126.     return result
  1127.   end
  1128.  
  1129. end # Game_Action
  1130.  
  1131. #==============================================================================
  1132. # ■ Game_ActionResult
  1133. #==============================================================================
  1134.  
  1135. class Game_ActionResult
  1136.  
  1137.   #--------------------------------------------------------------------------
  1138.   # alias method: clear
  1139.   #--------------------------------------------------------------------------
  1140.   alias game_actionresult_clear_abe clear
  1141.   def clear
  1142.     game_actionresult_clear_abe
  1143.     clear_stored_damage
  1144.   end
  1145.  
  1146.   #--------------------------------------------------------------------------
  1147.   # new method: clear_stored_damage
  1148.   #--------------------------------------------------------------------------
  1149.   def clear_stored_damage
  1150.     @stored_hp_damage = 0
  1151.     @stored_mp_damage = 0
  1152.     @stored_tp_damage = 0
  1153.     @stored_hp_drain = 0
  1154.     @stored_mp_drain = 0
  1155.   end
  1156.  
  1157.   #--------------------------------------------------------------------------
  1158.   # new method: store_damage
  1159.   #--------------------------------------------------------------------------
  1160.   def store_damage
  1161.     @stored_hp_damage += @hp_damage
  1162.     @stored_mp_damage += @mp_damage
  1163.     @stored_tp_damage += @tp_damage
  1164.     @stored_hp_drain += @hp_drain
  1165.     @stored_mp_drain += @mp_drain
  1166.   end
  1167.  
  1168.   #--------------------------------------------------------------------------
  1169.   # new method: restore_damage
  1170.   #--------------------------------------------------------------------------
  1171.   def restore_damage
  1172.     @hp_damage = @stored_hp_damage
  1173.     @mp_damage = @stored_mp_damage
  1174.     @tp_damage = @stored_tp_damage
  1175.     @hp_drain = @stored_hp_drain
  1176.     @mp_drain = @stored_mp_drain
  1177.   end
  1178.  
  1179. end # Game_ActionResult
  1180.  
  1181. #==============================================================================
  1182. # ■ Game_BattlerBase
  1183. #==============================================================================
  1184.  
  1185. class Game_BattlerBase
  1186.  
  1187.   #--------------------------------------------------------------------------
  1188.   # public instance variables
  1189.   #--------------------------------------------------------------------------
  1190.   attr_accessor :popups
  1191.  
  1192.   #--------------------------------------------------------------------------
  1193.   # new method: create_popup
  1194.   #--------------------------------------------------------------------------
  1195.   def create_popup(value, rules = "DEFAULT", flags = [])
  1196.     return unless SceneManager.scene_is?(Scene_Battle)
  1197.     return unless YEA::BATTLE::ENABLE_POPUPS
  1198.     return if Switch.hide_popups
  1199.     @popups = [] if @popups.nil?
  1200.     @popups.push([value, rules, flags])
  1201.   end
  1202.  
  1203.   #--------------------------------------------------------------------------
  1204.   # new method: make_damage_popups
  1205.   #--------------------------------------------------------------------------
  1206.   def make_damage_popups(user)
  1207.     if @result.hp_drain != 0
  1208.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1209.       rules = "DRAIN"
  1210.       user.create_popup(text, rules)
  1211.       setting = :hp_dmg  if @result.hp_drain < 0
  1212.       setting = :hp_heal if @result.hp_drain > 0
  1213.       rules = "HP_DMG"   if @result.hp_drain < 0
  1214.       rules = "HP_HEAL"  if @result.hp_drain > 0
  1215.       value = @result.hp_drain.abs
  1216.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1217.       user.create_popup(text, rules)
  1218.     end
  1219.     if @result.mp_drain != 0
  1220.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1221.       rules = "DRAIN"
  1222.       user.create_popup(text, rules)
  1223.       setting = :mp_dmg  if @result.mp_drain < 0
  1224.       setting = :mp_heal if @result.mp_drain > 0
  1225.       rules = "HP_DMG"   if @result.mp_drain < 0
  1226.       rules = "HP_HEAL"  if @result.mp_drain > 0
  1227.       value = @result.mp_drain.abs
  1228.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1229.       user.create_popup(text, rules)
  1230.     end
  1231.     #---
  1232.     flags = []
  1233.     flags.push("critical") if @result.critical
  1234.     if @result.hp_damage != 0
  1235.       setting = :hp_dmg  if @result.hp_damage > 0
  1236.       setting = :hp_heal if @result.hp_damage < 0
  1237.       rules = "HP_DMG"   if @result.hp_damage > 0
  1238.       rules = "HP_HEAL"  if @result.hp_damage < 0
  1239.       value = @result.hp_damage.abs
  1240.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1241.       create_popup(text, rules, flags)
  1242.     end
  1243.     if @result.mp_damage != 0
  1244.       setting = :mp_dmg  if @result.mp_damage > 0
  1245.       setting = :mp_heal if @result.mp_damage < 0
  1246.       rules = "MP_DMG"   if @result.mp_damage > 0
  1247.       rules = "MP_HEAL"  if @result.mp_damage < 0
  1248.       value = @result.mp_damage.abs
  1249.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1250.       create_popup(text, rules, flags)
  1251.     end
  1252.     if @result.tp_damage != 0
  1253.       setting = :tp_dmg  if @result.tp_damage > 0
  1254.       setting = :tp_heal if @result.tp_damage < 0
  1255.       rules = "TP_DMG"   if @result.tp_damage > 0
  1256.       rules = "TP_HEAL"  if @result.tp_damage < 0
  1257.       value = @result.tp_damage.abs
  1258.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1259.       create_popup(text, rules)
  1260.     end
  1261.     @result.store_damage
  1262.     @result.clear_damage_values
  1263.   end
  1264.  
  1265.   #--------------------------------------------------------------------------
  1266.   # alias method: erase_state
  1267.   #--------------------------------------------------------------------------
  1268.   alias game_battlerbase_erase_state_abe erase_state
  1269.   def erase_state(state_id)
  1270.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1271.     game_battlerbase_erase_state_abe(state_id)
  1272.   end
  1273.  
  1274.   #--------------------------------------------------------------------------
  1275.   # new method: make_during_state_popup
  1276.   #--------------------------------------------------------------------------
  1277.   def make_during_state_popup
  1278.     state_id = most_important_state_id
  1279.     return if state_id == 0
  1280.     make_state_popup(state_id, :dur_state)
  1281.   end
  1282.  
  1283.   #--------------------------------------------------------------------------
  1284.   # new method: most_important_state_id
  1285.   #--------------------------------------------------------------------------
  1286.   def most_important_state_id
  1287.     states.each {|state| return state.id unless state.message3.empty? }
  1288.     return 0
  1289.   end
  1290.  
  1291.   #--------------------------------------------------------------------------
  1292.   # new method: make_state_popup
  1293.   #--------------------------------------------------------------------------
  1294.   def make_state_popup(state_id, type)
  1295.     state = $data_states[state_id]
  1296.     return if state.icon_index == 0
  1297.     rules = state.popup_rules[type]
  1298.     return if rules.nil?
  1299.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1300.     flags = ["state", state.icon_index]
  1301.     create_popup(text, rules, flags)
  1302.   end
  1303.  
  1304.   #--------------------------------------------------------------------------
  1305.   # new method: make_miss_popups
  1306.   #--------------------------------------------------------------------------
  1307.   def make_miss_popups(user, item)
  1308.     return if dead?
  1309.     if @result.missed
  1310.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1311.       rules = "DEFAULT"
  1312.       create_popup(text, rules)
  1313.     end
  1314.     if @result.evaded
  1315.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1316.       rules = "DEFAULT"
  1317.       create_popup(text, rules)
  1318.     end
  1319.     if @result.hit? && !@result.success
  1320.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1321.       rules = "DEFAULT"
  1322.       create_popup(text, rules)
  1323.     end
  1324.     if @result.hit? && item.damage.to_hp?
  1325.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1326.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1327.         rules = "DEFAULT"
  1328.         create_popup(text, rules)
  1329.       end
  1330.     end
  1331.   end
  1332.  
  1333.   #--------------------------------------------------------------------------
  1334.   # new method: make_rate_popup
  1335.   #--------------------------------------------------------------------------
  1336.   def make_rate_popup(rate)
  1337.     return if rate == 1.0
  1338.     flags = []
  1339.     if rate > 1.0
  1340.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1341.       rules = "WEAK_ELE"
  1342.       flags.push("weakness")
  1343.     elsif rate == 0.0
  1344.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1345.       rules = "IMMU_ELE"
  1346.       flags.push("immune")
  1347.     elsif rate < 0.0
  1348.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1349.       rules = "ABSB_ELE"
  1350.       flags.push("absorbed")
  1351.     else
  1352.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1353.       rules = "REST_ELE"
  1354.       flags.push("resistant")
  1355.     end
  1356.     create_popup(text, rules, flags)
  1357.   end
  1358.  
  1359.   #--------------------------------------------------------------------------
  1360.   # new method: make_buff_popup
  1361.   #--------------------------------------------------------------------------
  1362.   def make_buff_popup(param_id, positive = true)
  1363.     return unless alive?
  1364.     name = Vocab::param(param_id)
  1365.     if positive
  1366.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1367.       rules = "BUFF"
  1368.       buff_level = 1
  1369.     else
  1370.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1371.       rules = "DEBUFF"
  1372.       buff_level = -1
  1373.     end
  1374.     icon = buff_icon_index(buff_level, param_id)
  1375.     flags = ["buff", icon]
  1376.     return if @popups.include?([text, rules, flags])
  1377.     create_popup(text, rules, flags)
  1378.   end
  1379.  
  1380. end # Game_BattlerBase
  1381.  
  1382. #==============================================================================
  1383. # ■ Game_Battler
  1384. #==============================================================================
  1385.  
  1386. class Game_Battler < Game_BattlerBase
  1387.  
  1388.   #--------------------------------------------------------------------------
  1389.   # public instance variables
  1390.   #--------------------------------------------------------------------------
  1391.   attr_accessor :pseudo_ani_id
  1392.  
  1393.   #--------------------------------------------------------------------------
  1394.   # alias method: on_battle_end
  1395.   #--------------------------------------------------------------------------
  1396.   alias game_battler_on_battle_end_abe on_battle_end
  1397.   def on_battle_end
  1398.     game_battler_on_battle_end_abe
  1399.     @popups = []
  1400.   end
  1401.  
  1402.   #--------------------------------------------------------------------------
  1403.   # alias method: clear_sprite_effects
  1404.   #--------------------------------------------------------------------------
  1405.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1406.   def clear_sprite_effects
  1407.     game_battler_clear_sprite_effects_abe
  1408.     @pseudo_ani_id = 0
  1409.   end
  1410.  
  1411.   #--------------------------------------------------------------------------
  1412.   # alias method: item_apply
  1413.   #--------------------------------------------------------------------------
  1414.   alias game_battler_item_apply_abe item_apply
  1415.   def item_apply(user, item)
  1416.     game_battler_item_apply_abe(user, item)
  1417.     make_miss_popups(user, item)
  1418.   end
  1419.  
  1420.   #--------------------------------------------------------------------------
  1421.   # alias method: make_damage_value
  1422.   #--------------------------------------------------------------------------
  1423.   alias game_battler_make_damage_value_abe make_damage_value
  1424.   def make_damage_value(user, item)
  1425.     game_battler_make_damage_value_abe(user, item)
  1426.     rate = item_element_rate(user, item)
  1427.     make_rate_popup(rate) unless $game_temp.evaluating
  1428.   end
  1429.  
  1430.   #--------------------------------------------------------------------------
  1431.   # alias method: execute_damage
  1432.   #--------------------------------------------------------------------------
  1433.   alias game_battler_execute_damage_abe execute_damage
  1434.   def execute_damage(user)
  1435.     game_battler_execute_damage_abe(user)
  1436.     make_damage_popups(user)
  1437.   end
  1438.  
  1439.   #--------------------------------------------------------------------------
  1440.   # alias method: item_effect_recover_hp
  1441.   #--------------------------------------------------------------------------
  1442.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1443.   def item_effect_recover_hp(user, item, effect)
  1444.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1445.     make_damage_popups(user)
  1446.   end
  1447.  
  1448.   #--------------------------------------------------------------------------
  1449.   # alias method: item_effect_recover_mp
  1450.   #--------------------------------------------------------------------------
  1451.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1452.   def item_effect_recover_mp(user, item, effect)
  1453.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1454.     make_damage_popups(user)
  1455.   end
  1456.  
  1457.   #--------------------------------------------------------------------------
  1458.   # alias method: item_effect_gain_tp
  1459.   #--------------------------------------------------------------------------
  1460.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1461.   def item_effect_gain_tp(user, item, effect)
  1462.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1463.     make_damage_popups(user)
  1464.   end
  1465.  
  1466.   #--------------------------------------------------------------------------
  1467.   # alias method: item_user_effect
  1468.   #--------------------------------------------------------------------------
  1469.   alias game_battler_item_user_effect_abe item_user_effect
  1470.   def item_user_effect(user, item)
  1471.     game_battler_item_user_effect_abe(user, item)
  1472.     @result.restore_damage
  1473.   end
  1474.  
  1475.   #--------------------------------------------------------------------------
  1476.   # alias method: add_new_state
  1477.   #--------------------------------------------------------------------------
  1478.   alias game_battler_add_new_state_abe add_new_state
  1479.   def add_new_state(state_id)
  1480.     game_battler_add_new_state_abe(state_id)
  1481.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1482.   end
  1483.  
  1484.   #--------------------------------------------------------------------------
  1485.   # alias method: add_buff
  1486.   #--------------------------------------------------------------------------
  1487.   alias game_battler_add_buff_abe add_buff
  1488.   def add_buff(param_id, turns)
  1489.     make_buff_popup(param_id, true)
  1490.     game_battler_add_buff_abe(param_id, turns)
  1491.   end
  1492.  
  1493.   #--------------------------------------------------------------------------
  1494.   # alias method: add_debuff
  1495.   #--------------------------------------------------------------------------
  1496.   alias game_battler_add_debuff_abe add_debuff
  1497.   def add_debuff(param_id, turns)
  1498.     make_buff_popup(param_id, false)
  1499.     game_battler_add_debuff_abe(param_id, turns)
  1500.   end
  1501.  
  1502.   #--------------------------------------------------------------------------
  1503.   # alias method: regenerate_all
  1504.   #--------------------------------------------------------------------------
  1505.   alias game_battler_regenerate_all_abe regenerate_all
  1506.   def regenerate_all
  1507.     game_battler_regenerate_all_abe
  1508.     return unless alive?
  1509.     make_damage_popups(self)
  1510.   end
  1511.  
  1512.   #--------------------------------------------------------------------------
  1513.   # new method: can_collapse?
  1514.   #--------------------------------------------------------------------------
  1515.   def can_collapse?
  1516.     return false unless dead?
  1517.     unless actor?
  1518.       return false unless sprite.battler_visible
  1519.       array = [:collapse, :boss_collapse, :instant_collapse]
  1520.       return false if array.include?(sprite.effect_type)
  1521.     end
  1522.     return true
  1523.   end
  1524.  
  1525.   #--------------------------------------------------------------------------
  1526.   # new method: draw_mp?
  1527.   #--------------------------------------------------------------------------
  1528.   def draw_mp?; return true; end
  1529.  
  1530.   #--------------------------------------------------------------------------
  1531.   # new method: draw_tp?
  1532.   #--------------------------------------------------------------------------
  1533.   def draw_tp?
  1534.     return $data_system.opt_display_tp
  1535.   end
  1536.  
  1537. end # Game_Battler
  1538.  
  1539. #==============================================================================
  1540. # ■ Game_Actor
  1541. #==============================================================================
  1542.  
  1543. class Game_Actor < Game_Battler
  1544.  
  1545.   #def battler_name
  1546.     #return "Slime"
  1547.   #end
  1548.  
  1549.   #def battler_hue
  1550.     #return 0
  1551.   #end
  1552.  
  1553.   #--------------------------------------------------------------------------
  1554.   # overwrite method: perform_damage_effect
  1555.   #--------------------------------------------------------------------------
  1556.   def perform_damage_effect
  1557.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1558.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1559.     Sound.play_actor_damage
  1560.   end
  1561.  
  1562.   #--------------------------------------------------------------------------
  1563.   # overwrite method: use_sprite?
  1564.   #--------------------------------------------------------------------------
  1565.   def use_sprite?; return true; end
  1566.  
  1567.   #--------------------------------------------------------------------------
  1568.   # new method: screen_x
  1569.   #--------------------------------------------------------------------------
  1570.   def screen_x
  1571.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1572.     status_window = SceneManager.scene.status_window
  1573.     return 0 if status_window.nil?
  1574.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1575.     ext = SceneManager.scene.info_viewport.ox
  1576.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1577.     constant = 128 + 12
  1578.     return constant + rect.x + item_rect_width / 2 - ext
  1579.   end
  1580.  
  1581.   #--------------------------------------------------------------------------
  1582.   # new method: screen_y
  1583.   #--------------------------------------------------------------------------
  1584.   def screen_y
  1585.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1586.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1587.     return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  1588.   end
  1589.  
  1590.   #--------------------------------------------------------------------------
  1591.   # new method: screen_z
  1592.   #--------------------------------------------------------------------------
  1593.   def screen_z; return 100; end
  1594.  
  1595.   #--------------------------------------------------------------------------
  1596.   # new method: sprite
  1597.   #--------------------------------------------------------------------------
  1598.   def sprite
  1599.     index = $game_party.battle_members.index(self)
  1600.     return SceneManager.scene.spriteset.actor_sprites[index]
  1601.   end
  1602.  
  1603.   #--------------------------------------------------------------------------
  1604.   # new method: draw_mp?
  1605.   #--------------------------------------------------------------------------
  1606.   def draw_mp?
  1607.     return true unless draw_tp?
  1608.     for skill in skills
  1609.       next unless added_skill_types.include?(skill.stype_id)
  1610.       return true if skill.mp_cost > 0
  1611.     end
  1612.     return false
  1613.   end
  1614.  
  1615.   #--------------------------------------------------------------------------
  1616.   # new method: draw_tp?
  1617.   #--------------------------------------------------------------------------
  1618.   def draw_tp?
  1619.     return false unless $data_system.opt_display_tp
  1620.     for skill in skills
  1621.       next unless added_skill_types.include?(skill.stype_id)
  1622.       return true if skill.tp_cost > 0
  1623.     end
  1624.     return false
  1625.   end
  1626.  
  1627. end # Game_Actor
  1628.  
  1629. #==============================================================================
  1630. # ■ Game_Enemy
  1631. #==============================================================================
  1632.  
  1633. class Game_Enemy < Game_Battler
  1634.  
  1635.   #--------------------------------------------------------------------------
  1636.   # overwrite method: perform_damage_effect
  1637.   #--------------------------------------------------------------------------
  1638.   def perform_damage_effect
  1639.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1640.     Sound.play_enemy_damage
  1641.   end
  1642.  
  1643.   #--------------------------------------------------------------------------
  1644.   # new methods: attack_animation_id
  1645.   #--------------------------------------------------------------------------
  1646.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1647.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1648.  
  1649.   #--------------------------------------------------------------------------
  1650.   # new method: sprite
  1651.   #--------------------------------------------------------------------------
  1652.   def sprite
  1653.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1654.   end
  1655.  
  1656. end # Game_Enemy
  1657.  
  1658. #==============================================================================
  1659. # ■ Game_Unit
  1660. #==============================================================================
  1661.  
  1662. class Game_Unit
  1663.  
  1664.   #--------------------------------------------------------------------------
  1665.   # alias method: make_actions
  1666.   #--------------------------------------------------------------------------
  1667.   alias game_unit_make_actions_abe make_actions
  1668.   def make_actions
  1669.     game_unit_make_actions_abe
  1670.     refresh_autobattler_status_window
  1671.   end
  1672.  
  1673.   #--------------------------------------------------------------------------
  1674.   # new method: refresh_autobattler_status_window
  1675.   #--------------------------------------------------------------------------
  1676.   def refresh_autobattler_status_window
  1677.     return unless SceneManager.scene_is?(Scene_Battle)
  1678.     return unless self.is_a?(Game_Party)
  1679.     SceneManager.scene.refresh_autobattler_status_window
  1680.   end
  1681.  
  1682. end # Game_Unit
  1683.  
  1684. #==============================================================================
  1685. # ■ Window_PartyCommand
  1686. #==============================================================================
  1687.  
  1688. class Window_PartyCommand < Window_Command
  1689.  
  1690.   #--------------------------------------------------------------------------
  1691.   # overwrite method: process_handling
  1692.   #--------------------------------------------------------------------------
  1693.   def process_handling
  1694.     return unless open? && active
  1695.     return process_dir6 if Input.repeat?(:RIGHT)
  1696.     return super
  1697.   end
  1698.  
  1699.   #--------------------------------------------------------------------------
  1700.   # new method: process_dir6
  1701.   #--------------------------------------------------------------------------
  1702.   def process_dir6
  1703.     Sound.play_cursor
  1704.     Input.update
  1705.     deactivate
  1706.     call_handler(:dir6)
  1707.   end
  1708.  
  1709. end # Window_PartyCommand
  1710.  
  1711. #==============================================================================
  1712. # ■ Window_ActorCommand
  1713. #==============================================================================
  1714.  
  1715. class Window_ActorCommand < Window_Command
  1716.  
  1717.   #--------------------------------------------------------------------------
  1718.   # overwrite method: process_handling
  1719.   #--------------------------------------------------------------------------
  1720.   def process_handling
  1721.     return unless open? && active
  1722.     return process_dir4 if Input.repeat?(:LEFT)
  1723.     return process_dir6 if Input.repeat?(:RIGHT)
  1724.     return super
  1725.   end
  1726.  
  1727.   #--------------------------------------------------------------------------
  1728.   # new method: process_dir4
  1729.   #--------------------------------------------------------------------------
  1730.   def process_dir4
  1731.     Sound.play_cursor
  1732.     Input.update
  1733.     deactivate
  1734.     call_handler(:cancel)
  1735.   end
  1736.  
  1737.   #--------------------------------------------------------------------------
  1738.   # new method: process_dir6
  1739.   #--------------------------------------------------------------------------
  1740.   def process_dir6
  1741.     Sound.play_cursor
  1742.     #Input.update
  1743.     #deactivate
  1744.     #call_handler(:dir6)
  1745.   end
  1746.  
  1747. end # Window_ActorCommand
  1748.  
  1749. #==============================================================================
  1750. # ■ Window_BattleStatus
  1751. #==============================================================================
  1752.  
  1753. class Window_BattleStatus < Window_Selectable
  1754.  
  1755.   #--------------------------------------------------------------------------
  1756.   # overwrite method: initialize
  1757.   #--------------------------------------------------------------------------
  1758.   def initialize
  1759.     super(0, 0, window_width, window_height+24)
  1760.     self.openness = 0
  1761.     @party = $game_party.battle_members.clone
  1762.   end
  1763.  
  1764.   #--------------------------------------------------------------------------
  1765.   # overwrite method: col_max
  1766.   #--------------------------------------------------------------------------
  1767.   def col_max; return $game_party.max_battle_members; end
  1768.  
  1769.   #--------------------------------------------------------------------------
  1770.   # new method: battle_members
  1771.   #--------------------------------------------------------------------------
  1772.   def battle_members; return $game_party.battle_members; end
  1773.  
  1774.   #--------------------------------------------------------------------------
  1775.   # new method: actor
  1776.   #--------------------------------------------------------------------------
  1777.   def actor; return battle_members[@index]; end
  1778.  
  1779.   #--------------------------------------------------------------------------
  1780.   # overwrite method: update
  1781.   #--------------------------------------------------------------------------
  1782.   def update
  1783.     super
  1784.     return if @party == $game_party.battle_members
  1785.     @party = $game_party.battle_members.clone
  1786.     refresh
  1787.   end
  1788.  
  1789.   def draw_actor_figure(actor, x, y, enabled = true)
  1790.     bitmap = Cache.system("bf"+actor.id.to_s+".png")
  1791.     rect = Rect.new(0,0,bitmap.width, bitmap.height)   
  1792.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1793.     bitmap.dispose
  1794.   end
  1795.   #--------------------------------------------------------------------------
  1796.   # overwrite method: draw_item
  1797.   #--------------------------------------------------------------------------
  1798.   def draw_item(index)
  1799.     return if index.nil?
  1800.     clear_item(index)
  1801.     actor = battle_members[index]
  1802.     rect = item_rect(index)
  1803.     item_x = rect.x #+ 6
  1804.     return if actor.nil?
  1805. #~     draw_actor_figure(actor, item_x+2, rect.y+2, actor.alive?)
  1806.     draw_actor_figure(actor, item_x, rect.y, actor.alive?)
  1807.     draw_actor_name(actor, item_x, rect.y, rect.width)
  1808. #~     draw_actor_action(actor, item_x + 96, rect.y - 2)
  1809.     draw_actor_action(actor, item_x+41, line_height-7)
  1810.     draw_actor_icons(actor, item_x, rect.y + 2, rect.width)
  1811.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1812.     yadj = 10
  1813.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1814.     draw_actor_hp(actor, item_x+2, line_height*2+gx, rect.width)
  1815.     if draw_tp?(actor) && draw_mp?(actor)
  1816.       dw = rect.width/2-2-16
  1817.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1818.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, dw)
  1819.       dw = rect.width - rect.width/2 - 2-6
  1820.       draw_actor_mp(actor, item_x+rect.width/2-6, line_height*3+gx-yadj+3, dw)
  1821.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1822.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width)
  1823.     else
  1824.       draw_actor_mp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width)
  1825.     end
  1826.   end
  1827.   #--------------------------------------------------------------------------
  1828.   # overwrite method: item_rect
  1829.   #--------------------------------------------------------------------------
  1830.   def item_rect(index)
  1831.     rect = Rect.new
  1832.     rect.width = contents.width / 6 #$game_party.max_battle_members + 32
  1833.     rect.height = contents.height
  1834.     rect.x = index * rect.width
  1835.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1836.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1837.     end
  1838.     rect.y = 0
  1839.     return rect
  1840.   end
  1841.  
  1842.   #--------------------------------------------------------------------------
  1843.   # overwrite method: draw_face
  1844.   #--------------------------------------------------------------------------
  1845.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1846.     bitmap = Cache.face(face_name)
  1847.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1848.     fy = face_index / 4 * 96 + 2
  1849.     fw = [item_rect(0).width - 4, 92].min
  1850.     rect = Rect.new(fx, fy, fw, 92)
  1851.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1852.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1853.     bitmap.dispose
  1854.   end
  1855.  
  1856.   #--------------------------------------------------------------------------
  1857.   # overwrite method: draw_actor_name
  1858.   #--------------------------------------------------------------------------
  1859.   def draw_actor_name(actor, dx, dy, dw = 112)
  1860.     reset_font_settings
  1861.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1862.     change_color(hp_color(actor))
  1863. #~     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1864.     draw_text(dx, dy, dw, line_height, actor.name)
  1865.   end
  1866.  
  1867.   #--------------------------------------------------------------------------
  1868.   # new method: draw_actor_action
  1869.   #--------------------------------------------------------------------------
  1870.   def draw_actor_action(actor, dx, dy)
  1871.     draw_icon(action_icon(actor), dx, dy)
  1872.   end
  1873.  
  1874.   #--------------------------------------------------------------------------
  1875.   # new method: action_icon
  1876.   #--------------------------------------------------------------------------
  1877.   def action_icon(actor)
  1878.     return Icon.no_action if actor.current_action.nil?
  1879.     return Icon.no_action if actor.current_action.item.nil?
  1880.     return actor.current_action.item.icon_index
  1881.   end
  1882.  
  1883.   #--------------------------------------------------------------------------
  1884.   # new method: draw_tp?
  1885.   #--------------------------------------------------------------------------
  1886.   def draw_tp?(actor)
  1887.     return actor.draw_tp?
  1888.   end
  1889.  
  1890.   #--------------------------------------------------------------------------
  1891.   # new method: draw_mp?
  1892.   #--------------------------------------------------------------------------
  1893.   def draw_mp?(actor)
  1894.     return actor.draw_mp?
  1895.   end
  1896.  
  1897.   #--------------------------------------------------------------------------
  1898.   # overwrite method: draw_current_and_max_values
  1899.   #--------------------------------------------------------------------------
  1900.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1901.     change_color(color1)
  1902.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1903.   end
  1904.  
  1905.   #--------------------------------------------------------------------------
  1906.   # overwrite method: draw_actor_hp
  1907.   #--------------------------------------------------------------------------
  1908.   def draw_actor_hp(actor, dx, dy, width = 124)
  1909.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1910.     change_color(system_color)
  1911.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1912. #~     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1913.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1914.       hp_color(actor), normal_color)
  1915.     end
  1916.  
  1917.   #--------------------------------------------------------------------------
  1918.   # overwrite method: draw_actor_mp
  1919.   #--------------------------------------------------------------------------
  1920.   def draw_actor_mp(actor, dx, dy, width = 124)
  1921.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1922.     change_color(system_color)
  1923.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1924. #~     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1925.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1926.       mp_color(actor), normal_color)
  1927.     end
  1928.  
  1929.   #--------------------------------------------------------------------------
  1930.   # overwrite method: draw_actor_tp
  1931.   #--------------------------------------------------------------------------
  1932.   def draw_actor_tp(actor, dx, dy, width = 124)
  1933.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1934.     change_color(system_color)
  1935.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1936.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1937.     change_color(tp_color(actor))
  1938.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1939.   end
  1940.  
  1941. end # Window_BattleStatus
  1942.  
  1943. #==============================================================================
  1944. # ■ Window_BattleActor
  1945. #==============================================================================
  1946.  
  1947. class Window_BattleActor < Window_BattleStatus
  1948.  
  1949.   #--------------------------------------------------------------------------
  1950.   # overwrite method: show
  1951.   #--------------------------------------------------------------------------
  1952.   def show
  1953.     create_flags
  1954.     super
  1955.   end
  1956.  
  1957.   #--------------------------------------------------------------------------
  1958.   # new method: create_flags
  1959.   #--------------------------------------------------------------------------
  1960.   def create_flags
  1961.     set_select_flag(:any)
  1962.     select(0)
  1963.     return if $game_temp.battle_aid.nil?
  1964.     if $game_temp.battle_aid.need_selection?
  1965.       select(0)
  1966.       #set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1967.     elsif $game_temp.battle_aid.for_user?
  1968.       battler = BattleManager.actor
  1969.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1970.       select(id)
  1971.       set_select_flag(:user)
  1972.     elsif $game_temp.battle_aid.for_all?
  1973.       select(0)
  1974.       set_select_flag(:all)
  1975.       set_select_flag(:all) if $game_temp.battle_aid.for_dead_friend?
  1976.       #set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1977.     elsif $game_temp.battle_aid.for_random?
  1978.       select(0)
  1979.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1980.     end
  1981.   end
  1982.  
  1983.   #--------------------------------------------------------------------------
  1984.   # new method: set_flag
  1985.   #--------------------------------------------------------------------------
  1986.   def set_select_flag(flag)
  1987.     @select_flag = flag
  1988.     case @select_flag
  1989.     when :all, :all_dead, :random
  1990.       @cursor_all = true
  1991.     else
  1992.       @cursor_all = false
  1993.     end
  1994.   end
  1995.  
  1996.   #--------------------------------------------------------------------------
  1997.   # overwrite method: update_cursor
  1998.   #--------------------------------------------------------------------------
  1999.   def update_cursor
  2000.     if @cursor_all
  2001.       cursor_rect.set(0, 0, contents.width, contents.height)
  2002.       self.top_row = 0
  2003.     elsif @index < 0
  2004.       cursor_rect.empty
  2005.     else
  2006.       ensure_cursor_visible
  2007.       cursor_rect.set(item_rect(@index))
  2008.     end
  2009.   end
  2010.  
  2011.   #--------------------------------------------------------------------------
  2012.   # overwrite method: cursor_movable?
  2013.   #--------------------------------------------------------------------------
  2014.   def cursor_movable?
  2015.     return false if @select_flag == :user
  2016.     return super
  2017.   end
  2018.  
  2019.   #--------------------------------------------------------------------------
  2020.   # overwrite method: current_item_enabled?
  2021.   #--------------------------------------------------------------------------
  2022.   def current_item_enabled?
  2023.     return true if $game_temp.battle_aid.nil?
  2024.     if $game_temp.battle_aid.need_selection?
  2025.       member = $game_party.battle_members[@index]
  2026.       return true#member.dead? if $game_temp.battle_aid.for_dead_friend?
  2027.     elsif $game_temp.battle_aid.for_dead_friend?
  2028.       for member in $game_party.battle_members
  2029.         return true #if member.dead?
  2030.       end
  2031.       return false
  2032.     end
  2033.     return true
  2034.   end
  2035.  
  2036. end # Window_BattleActor
  2037.  
  2038. #==============================================================================
  2039. # ■ Window_BattleStatusAid
  2040. #==============================================================================
  2041.  
  2042. class Window_BattleStatusAid < Window_BattleStatus
  2043.  
  2044.   #--------------------------------------------------------------------------
  2045.   # public instance variables
  2046.   #--------------------------------------------------------------------------
  2047.   attr_accessor :status_window
  2048.  
  2049.   #--------------------------------------------------------------------------
  2050.   # overwrite method: initialize
  2051.   #--------------------------------------------------------------------------
  2052.   def initialize
  2053.     super
  2054.     self.visible = false
  2055.     self.openness = 255
  2056.   end
  2057.  
  2058.   #--------------------------------------------------------------------------
  2059.   # overwrite method: window_width
  2060.   #--------------------------------------------------------------------------
  2061.   def window_width; return 128; end
  2062.  
  2063.   #--------------------------------------------------------------------------
  2064.   # overwrite method: show
  2065.   #--------------------------------------------------------------------------
  2066.   def show
  2067.     super
  2068.     refresh
  2069.   end
  2070.  
  2071.   #--------------------------------------------------------------------------
  2072.   # overwrite method: refresh
  2073.   #--------------------------------------------------------------------------
  2074.   def refresh
  2075.     contents.clear
  2076.     return if @status_window.nil?
  2077.     draw_item(@status_window.index)
  2078.   end
  2079.  
  2080.   #--------------------------------------------------------------------------
  2081.   # overwrite method: item_rect
  2082.   #--------------------------------------------------------------------------
  2083.   def item_rect(index)
  2084.     return Rect.new(0, 0, contents.width, contents.height)
  2085.   end
  2086.  
  2087.   def draw_item(index)
  2088.     return if index.nil?
  2089.     clear_item(index)
  2090.     actor = battle_members[index]
  2091.     rect = item_rect(index)
  2092.     item_x = rect.x
  2093.     return if actor.nil?
  2094.     draw_actor_figure(actor, item_x + 4 , rect.y+2, actor.alive?)
  2095.     draw_actor_name(actor, item_x, rect.y, rect.width)
  2096.     draw_actor_action(actor, item_x, rect.y - 2)
  2097.     draw_actor_icons(actor, item_x, rect.y + 2, rect.width)
  2098.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  2099.     yadj = 10
  2100.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  2101.     draw_actor_hp(actor, item_x+2, line_height*2+gx, rect.width)
  2102.     if draw_tp?(actor) && draw_mp?(actor)
  2103.       dw = rect.width/2-2-16
  2104.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  2105.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, dw)
  2106.       dw = rect.width - rect.width/2 - 2-6
  2107.       draw_actor_mp(actor, item_x+rect.width/2-6, line_height*3+gx-yadj+3, dw)
  2108.     elsif draw_tp?(actor) && !draw_mp?(actor)
  2109.       draw_actor_tp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width)
  2110.     else
  2111.       draw_actor_mp(actor, item_x+2, line_height*3+gx-yadj+3, rect.width)
  2112.     end
  2113.   end
  2114.  
  2115.   def draw_actor_name(actor, dx, dy, dw = 112)
  2116.     reset_font_settings
  2117.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  2118.     change_color(hp_color(actor))
  2119.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  2120.   end
  2121.  
  2122.   def draw_actor_figure(actor, x, y, enabled = true)
  2123.     bitmap = Cache.system("bff"+actor.id.to_s+".png")
  2124.     rect = Rect.new(0,0,bitmap.width, bitmap.height)   
  2125.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  2126.     bitmap.dispose
  2127.   end
  2128.  
  2129.  
  2130.  
  2131. end # Window_BattleStatusAid
  2132.  
  2133. #==============================================================================
  2134. # ■ Window_BattleEnemy
  2135. #==============================================================================
  2136.  
  2137. class Window_BattleEnemy < Window_Selectable
  2138.   #--------------------------------------------------------------------------
  2139.   # overwrite method: initialize
  2140.   #--------------------------------------------------------------------------
  2141.   def initialize(info_viewport)
  2142.     super(0, Graphics.height, window_width, fitting_height(1))
  2143.     refresh
  2144.     self.visible = false
  2145.     @info_viewport = info_viewport
  2146.   end
  2147.  
  2148.   #--------------------------------------------------------------------------
  2149.   # overwrite method: col_max
  2150.   #--------------------------------------------------------------------------
  2151.   def col_max; return item_max; end
  2152.  
  2153.   #--------------------------------------------------------------------------
  2154.   # overwrite method: show
  2155.   #--------------------------------------------------------------------------
  2156.   def show
  2157.     create_flags
  2158.     super
  2159.   end
  2160.  
  2161.   #--------------------------------------------------------------------------
  2162.   # new method: create_flags
  2163.   #--------------------------------------------------------------------------
  2164.   def create_flags
  2165.     set_select_flag(:any)
  2166.     select(0)
  2167.     return if $game_temp.battle_aid.nil?
  2168.     if $game_temp.battle_aid.need_selection?
  2169.       select(0)
  2170.     elsif $game_temp.battle_aid.for_all?
  2171.       select(0)
  2172.       set_select_flag(:all)
  2173.     elsif $game_temp.battle_aid.for_random?
  2174.       select(0)
  2175.       set_select_flag(:random)
  2176.     end
  2177.   end
  2178.  
  2179.   #--------------------------------------------------------------------------
  2180.   # new method: set_flag
  2181.   #--------------------------------------------------------------------------
  2182.   def set_select_flag(flag)
  2183.     @select_flag = flag
  2184.     case @select_flag
  2185.     when :all, :random
  2186.       @cursor_all = true
  2187.     else
  2188.       @cursor_all = false
  2189.     end
  2190.   end
  2191.  
  2192.   #--------------------------------------------------------------------------
  2193.   # new method: select_all?
  2194.   #--------------------------------------------------------------------------
  2195.   def select_all?
  2196.     return true if @select_flag == :all
  2197.     return true if @select_flag == :random
  2198.     return false
  2199.   end
  2200.  
  2201.   #--------------------------------------------------------------------------
  2202.   # overwrite method: update_cursor
  2203.   #--------------------------------------------------------------------------
  2204.   def update_cursor
  2205.     if @cursor_all
  2206.       cursor_rect.set(0, 0, contents.width, contents.height)
  2207.       self.top_row = 0
  2208.     elsif @index < 0
  2209.       cursor_rect.empty
  2210.     else
  2211.       ensure_cursor_visible
  2212.       cursor_rect.set(item_rect(@index))
  2213.     end
  2214.   end
  2215.  
  2216.   #--------------------------------------------------------------------------
  2217.   # overwrite method: cursor_movable?
  2218.   #--------------------------------------------------------------------------
  2219.   def cursor_movable?
  2220.     return false if @select_flag == :user
  2221.     return super
  2222.   end
  2223.  
  2224.   #--------------------------------------------------------------------------
  2225.   # overwrite method: current_item_enabled?
  2226.   #--------------------------------------------------------------------------
  2227.   def current_item_enabled?
  2228.     return true if $game_temp.battle_aid.nil?
  2229.     if $game_temp.battle_aid.need_selection?
  2230.       member = $game_party.battle_members[@index]
  2231.       return true#member.dead? if $game_temp.battle_aid.for_dead_friend?
  2232.     elsif $game_temp.battle_aid.for_dead_friend?
  2233.       for member in $game_party.battle_members
  2234.         return true #if member.dead?
  2235.       end
  2236.       return false
  2237.     end
  2238.     return true
  2239.   end
  2240.  
  2241.   #--------------------------------------------------------------------------
  2242.   # overwrite method: enemy
  2243.   #--------------------------------------------------------------------------
  2244.   def enemy; @data[index]; end
  2245.  
  2246.   #--------------------------------------------------------------------------
  2247.   # overwrite method: refresh
  2248.   #--------------------------------------------------------------------------
  2249.   def refresh
  2250.     make_item_list
  2251.     create_contents
  2252.     draw_all_items
  2253.   end
  2254.  
  2255.   #--------------------------------------------------------------------------
  2256.   # overwrite method: make_item_list
  2257.   #--------------------------------------------------------------------------
  2258.   def make_item_list
  2259.     @data = $game_troop.alive_members
  2260.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2261.   end
  2262.  
  2263.   #--------------------------------------------------------------------------
  2264.   # overwrite method: draw_item
  2265.   #--------------------------------------------------------------------------
  2266.   def draw_item(index); return; end
  2267.  
  2268.   #--------------------------------------------------------------------------
  2269.   # overwrite method: update
  2270.   #--------------------------------------------------------------------------
  2271.   def update
  2272.     super
  2273.     return unless active
  2274.     enemy.sprite_effect_type = :whiten
  2275.     return unless select_all?
  2276.     for enemy in $game_troop.alive_members
  2277.       enemy.sprite_effect_type = :whiten
  2278.     end
  2279.   end
  2280.  
  2281. end # Window_BattleEnemy
  2282.  
  2283. #==============================================================================
  2284. # ■ Window_BattleHelp
  2285. #==============================================================================
  2286.  
  2287. class Window_BattleHelp < Window_Help
  2288.  
  2289.   #--------------------------------------------------------------------------
  2290.   # public instance variables
  2291.   #--------------------------------------------------------------------------
  2292.   attr_accessor :actor_window
  2293.   attr_accessor :enemy_window
  2294.  
  2295.   #--------------------------------------------------------------------------
  2296.   # update
  2297.   #--------------------------------------------------------------------------
  2298.   def update
  2299.     super
  2300.     if !self.visible and @text != ""
  2301.       @text = ""
  2302.       return refresh
  2303.     end
  2304.     update_battler_name
  2305.   end
  2306.  
  2307.   #--------------------------------------------------------------------------
  2308.   # update_battler_name
  2309.   #--------------------------------------------------------------------------
  2310.   def update_battler_name
  2311.     return unless @actor_window.active || @enemy_window.active
  2312.     if @actor_window.active
  2313.       battler = $game_party.battle_members[@actor_window.index]
  2314.     elsif @enemy_window.active
  2315.       battler = @enemy_window.enemy
  2316.     end
  2317.     if special_display?
  2318.       refresh_special_case(battler)
  2319.     else
  2320.       refresh_battler_name(battler) if battler_name(battler) != @text
  2321.     end
  2322.   end
  2323.  
  2324.   #--------------------------------------------------------------------------
  2325.   # battler_name
  2326.   #--------------------------------------------------------------------------
  2327.   def battler_name(battler)
  2328.     text = battler.name.clone
  2329.     return text
  2330.   end
  2331.  
  2332.   #--------------------------------------------------------------------------
  2333.   # refresh_battler_name
  2334.   #--------------------------------------------------------------------------
  2335.   def refresh_battler_name(battler)
  2336.     contents.clear
  2337.     reset_font_settings
  2338.     change_color(normal_color)
  2339.     @text = battler_name(battler)
  2340.     icons = battler.state_icons + battler.buff_icons
  2341.     dy = icons.size <= 0 ? line_height / 2 : 0
  2342.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2343.     dx = (contents.width - (icons.size * 24)) / 2
  2344.     draw_actor_icons(battler, dx, line_height, contents.width)
  2345.   end
  2346.  
  2347.   #--------------------------------------------------------------------------
  2348.   # special_display?
  2349.   #--------------------------------------------------------------------------
  2350.   def special_display?
  2351.     return false if $game_temp.battle_aid.nil?
  2352.     return false if $game_temp.battle_aid.for_user?
  2353.     return !$game_temp.battle_aid.need_selection?
  2354.   end
  2355.  
  2356.   #--------------------------------------------------------------------------
  2357.   # refresh_special_case
  2358.   #--------------------------------------------------------------------------
  2359.   def refresh_special_case(battler)
  2360.     if $game_temp.battle_aid.for_opponent?
  2361.       if $game_temp.battle_aid.for_all?
  2362.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2363.       else
  2364.         case $game_temp.battle_aid.number_of_targets
  2365.         when 1
  2366.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2367.         else
  2368.           number = $game_temp.battle_aid.number_of_targets
  2369.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2370.         end
  2371.       end
  2372.     else # $game_temp.battle_aid.for_friend?
  2373.       if $game_temp.battle_aid.for_dead_friend?
  2374.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2375.       elsif $game_temp.battle_aid.for_random?
  2376.         case $game_temp.battle_aid.number_of_targets
  2377.         when 1
  2378.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2379.         else
  2380.           number = $game_temp.battle_aid.number_of_targets
  2381.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2382.         end
  2383.       else
  2384.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2385.       end
  2386.     end
  2387.     return if text == @text
  2388.     @text = text
  2389.     contents.clear
  2390.     reset_font_settings
  2391.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2392.   end
  2393.  
  2394. end # Window_BattleHelp
  2395.  
  2396. #==============================================================================
  2397. # ■ Window_BattleLog
  2398. #==============================================================================
  2399.  
  2400. class Window_BattleLog < Window_Selectable
  2401.  
  2402.   #--------------------------------------------------------------------------
  2403.   # alias method: display_current_state
  2404.   #--------------------------------------------------------------------------
  2405.   alias window_battlelog_display_current_state_abe display_current_state
  2406.   def display_current_state(subject)
  2407.     subject.make_during_state_popup
  2408.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2409.     window_battlelog_display_current_state_abe(subject)
  2410.   end
  2411.  
  2412.   #--------------------------------------------------------------------------
  2413.   # alias method: display_use_item
  2414.   #--------------------------------------------------------------------------
  2415.   alias window_battlelog_display_use_item_abe display_use_item
  2416.   def display_use_item(subject, item)
  2417.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2418.     window_battlelog_display_use_item_abe(subject, item)
  2419.   end
  2420.  
  2421.   #--------------------------------------------------------------------------
  2422.   # alias method: display_counter
  2423.   #--------------------------------------------------------------------------
  2424.   alias window_battlelog_display_counter_abe display_counter
  2425.   def display_counter(target, item)
  2426.     if YEA::BATTLE::MSG_COUNTERATTACK
  2427.       window_battlelog_display_counter_abe(target, item)
  2428.     else
  2429.       Sound.play_evasion
  2430.     end
  2431.   end
  2432.  
  2433.   #--------------------------------------------------------------------------
  2434.   # alias method: display_reflection
  2435.   #--------------------------------------------------------------------------
  2436.   alias window_battlelog_display_reflection_abe display_reflection
  2437.   def display_reflection(target, item)
  2438.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2439.       window_battlelog_display_reflection_abe(target, item)
  2440.     else
  2441.       Sound.play_reflection
  2442.     end
  2443.   end
  2444.  
  2445.   #--------------------------------------------------------------------------
  2446.   # alias method: display_substitute
  2447.   #--------------------------------------------------------------------------
  2448.   alias window_battlelog_display_substitute_abe display_substitute
  2449.   def display_substitute(substitute, target)
  2450.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2451.     window_battlelog_display_substitute_abe(substitute, target)
  2452.   end
  2453.  
  2454.   #--------------------------------------------------------------------------
  2455.   # alias method: display_failure
  2456.   #--------------------------------------------------------------------------
  2457.   alias window_battlelog_display_failure_abe display_failure
  2458.   def display_failure(target, item)
  2459.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2460.     window_battlelog_display_failure_abe(target, item)
  2461.   end
  2462.  
  2463.   #--------------------------------------------------------------------------
  2464.   # alias method: display_critical
  2465.   #--------------------------------------------------------------------------
  2466.   alias window_battlelog_display_critical_abe display_critical
  2467.   def display_critical(target, item)
  2468.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2469.     window_battlelog_display_critical_abe(target, item)
  2470.   end
  2471.  
  2472.   #--------------------------------------------------------------------------
  2473.   # alias method: display_miss
  2474.   #--------------------------------------------------------------------------
  2475.   alias window_battlelog_display_miss_abe display_miss
  2476.   def display_miss(target, item)
  2477.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2478.     window_battlelog_display_miss_abe(target, item)
  2479.   end
  2480.  
  2481.   #--------------------------------------------------------------------------
  2482.   # alias method: display_evasion
  2483.   #--------------------------------------------------------------------------
  2484.   alias window_battlelog_display_evasion_abe display_evasion
  2485.   def display_evasion(target, item)
  2486.     if YEA::BATTLE::MSG_EVASION
  2487.       window_battlelog_display_evasion_abe(target, item)
  2488.     else
  2489.       if !item || item.physical?
  2490.         Sound.play_evasion
  2491.       else
  2492.         Sound.play_magic_evasion
  2493.       end
  2494.     end
  2495.   end
  2496.  
  2497.   #--------------------------------------------------------------------------
  2498.   # overwrite method: display_hp_damage
  2499.   #--------------------------------------------------------------------------
  2500.   def display_hp_damage(target, item)
  2501.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2502.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2503.       target.perform_damage_effect
  2504.     end
  2505.     Sound.play_recovery if target.result.hp_damage < 0
  2506.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2507.     add_text(target.result.hp_damage_text)
  2508.     wait
  2509.   end
  2510.  
  2511.   #--------------------------------------------------------------------------
  2512.   # overwrite method: display_mp_damage
  2513.   #--------------------------------------------------------------------------
  2514.   def display_mp_damage(target, item)
  2515.     return if target.dead? || target.result.mp_damage == 0
  2516.     Sound.play_recovery if target.result.mp_damage < 0
  2517.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2518.     add_text(target.result.mp_damage_text)
  2519.     wait
  2520.   end
  2521.  
  2522.   #--------------------------------------------------------------------------
  2523.   # overwrite method: display_tp_damage
  2524.   #--------------------------------------------------------------------------
  2525.   def display_tp_damage(target, item)
  2526.     return if target.dead? || target.result.tp_damage == 0
  2527.     Sound.play_recovery if target.result.tp_damage < 0
  2528.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2529.     add_text(target.result.tp_damage_text)
  2530.     wait
  2531.   end
  2532.  
  2533.   #--------------------------------------------------------------------------
  2534.   # alias method: display_added_states
  2535.   #--------------------------------------------------------------------------
  2536.   alias window_battlelog_display_added_states_abe display_added_states
  2537.   def display_added_states(target)
  2538.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2539.     window_battlelog_display_added_states_abe(target)
  2540.   end
  2541.  
  2542.   #--------------------------------------------------------------------------
  2543.   # alias method: display_removed_states
  2544.   #--------------------------------------------------------------------------
  2545.   alias window_battlelog_display_removed_states_abe display_removed_states
  2546.   def display_removed_states(target)
  2547.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2548.     window_battlelog_display_removed_states_abe(target)
  2549.   end
  2550.  
  2551.   #--------------------------------------------------------------------------
  2552.   # alias method: display_changed_buffs
  2553.   #--------------------------------------------------------------------------
  2554.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2555.   def display_changed_buffs(target)
  2556.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2557.     window_battlelog_display_changed_buffs_abe(target)
  2558.   end
  2559.  
  2560. end # Window_BattleLog
  2561.  
  2562. #==============================================================================
  2563. # ■ Window_SkillList
  2564. #==============================================================================
  2565.  
  2566. class Window_SkillList < Window_Selectable
  2567.  
  2568.   #--------------------------------------------------------------------------
  2569.   # overwrite method: spacing
  2570.   #--------------------------------------------------------------------------
  2571.   def spacing
  2572.     return 8 if $game_party.in_battle
  2573.     return super
  2574.   end
  2575.  
  2576. end # Window_SkillList
  2577.  
  2578. #==============================================================================
  2579. # ■ Window_ItemList
  2580. #==============================================================================
  2581.  
  2582. class Window_ItemList < Window_Selectable
  2583.  
  2584.   #--------------------------------------------------------------------------
  2585.   # overwrite method: spacing
  2586.   #--------------------------------------------------------------------------
  2587.   def spacing
  2588.     return 8 if $game_party.in_battle
  2589.     return super
  2590.   end
  2591.  
  2592. end # Window_ItemList
  2593.  
  2594. #==============================================================================
  2595. # ■ Scene_Battle
  2596. #==============================================================================
  2597.  
  2598. class Scene_Battle < Scene_Base
  2599.  
  2600.   #--------------------------------------------------------------------------
  2601.   # public instance variables
  2602.   #--------------------------------------------------------------------------
  2603.   attr_accessor :enemy_window
  2604.   attr_accessor :info_viewport
  2605.   attr_accessor :spriteset
  2606.   attr_accessor :status_window
  2607.   attr_accessor :status_aid_window
  2608.   attr_accessor :subject
  2609.  
  2610.   #--------------------------------------------------------------------------
  2611.   # alias method: create_spriteset
  2612.   #--------------------------------------------------------------------------
  2613.   alias scene_battle_create_spriteset_abe create_spriteset
  2614.   def create_spriteset
  2615.     BattleManager.init_battle_type
  2616.     scene_battle_create_spriteset_abe
  2617.   end
  2618.  
  2619.   #--------------------------------------------------------------------------
  2620.   # alias method: update_basic
  2621.   #--------------------------------------------------------------------------
  2622.   alias scene_battle_update_basic_abe update_basic
  2623.   def update_basic
  2624.     scene_battle_update_basic_abe
  2625.     update_debug
  2626.   end
  2627.  
  2628.   #--------------------------------------------------------------------------
  2629.   # new method: update_debug
  2630.   #--------------------------------------------------------------------------
  2631.   def update_debug
  2632.     return unless $TEST || $BTEST
  2633.     debug_heal_party if Input.trigger?(:F5)
  2634.     debug_damage_party if Input.trigger?(:F6)
  2635.     debug_fill_tp if Input.trigger?(:F7)
  2636.     debug_kill_all if Input.trigger?(:F8)
  2637.   end
  2638.  
  2639.   #--------------------------------------------------------------------------
  2640.   # new method: debug_heal_party
  2641.   #--------------------------------------------------------------------------
  2642.   def debug_heal_party
  2643.     Sound.play_recovery
  2644.     for member in $game_party.battle_members
  2645.       member.recover_all
  2646.     end
  2647.     @status_window.refresh
  2648.   end
  2649.  
  2650.   #--------------------------------------------------------------------------
  2651.   # new method: debug_damage_party
  2652.   #--------------------------------------------------------------------------
  2653.   def debug_damage_party
  2654.     Sound.play_actor_damage
  2655.     for member in $game_party.alive_members
  2656.       member.hp = 1
  2657.       member.mp = 0
  2658.       member.tp = 0
  2659.     end
  2660.     @status_window.refresh
  2661.   end
  2662.  
  2663.   #--------------------------------------------------------------------------
  2664.   # new method: debug_fill_tp
  2665.   #--------------------------------------------------------------------------
  2666.   def debug_fill_tp
  2667.     Sound.play_recovery
  2668.     for member in $game_party.alive_members
  2669.       member.tp = member.max_tp
  2670.     end
  2671.     @status_window.refresh
  2672.   end
  2673.  
  2674.   #--------------------------------------------------------------------------
  2675.   # new method: debug_kill_all
  2676.   #--------------------------------------------------------------------------
  2677.   def debug_kill_all
  2678.     for enemy in $game_troop.alive_members
  2679.       enemy.hp = 0
  2680.       enemy.perform_collapse_effect
  2681.     end
  2682.     BattleManager.judge_win_loss
  2683.     @log_window.wait
  2684.     @log_window.wait_for_effect
  2685.   end
  2686.  
  2687.   #--------------------------------------------------------------------------
  2688.   # alias method: create_all_windows
  2689.   #--------------------------------------------------------------------------
  2690.   alias scene_battle_create_all_windows_abe create_all_windows
  2691.   def create_all_windows
  2692.     scene_battle_create_all_windows_abe
  2693.     create_battle_status_aid_window
  2694.     set_help_window
  2695.   end
  2696.  
  2697.   #--------------------------------------------------------------------------
  2698.   # alias method: create_info_viewport
  2699.   #--------------------------------------------------------------------------
  2700.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2701.   def create_info_viewport
  2702.     scene_battle_create_info_viewport_abe
  2703.     @status_window.refresh
  2704.   end
  2705.  
  2706.   #--------------------------------------------------------------------------
  2707.   # new method: create_battle_status_aid_window
  2708.   #--------------------------------------------------------------------------
  2709.   def create_battle_status_aid_window
  2710.     @status_aid_window = Window_BattleStatusAid.new
  2711.     @status_aid_window.status_window = @status_window
  2712.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2713.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2714.   end
  2715.  
  2716.   #--------------------------------------------------------------------------
  2717.   # overwrite method: create_help_window
  2718.   #--------------------------------------------------------------------------
  2719.   def create_help_window
  2720.     @help_window = Window_BattleHelp.new
  2721.     @help_window.hide
  2722.   end
  2723.  
  2724.   #--------------------------------------------------------------------------
  2725.   # new method: set_help_window
  2726.   #--------------------------------------------------------------------------
  2727.   def set_help_window
  2728.     @help_window.actor_window = @actor_window
  2729.     @help_window.enemy_window = @enemy_window
  2730.   end
  2731.  
  2732.   #--------------------------------------------------------------------------
  2733.   # alias method: create_party_command_window
  2734.   #--------------------------------------------------------------------------
  2735.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2736.   def create_party_command_window
  2737.     scene_battle_create_party_command_window_abe
  2738.     @party_command_window.set_handler(:dir6, method(:command_fight))
  2739.   end
  2740.  
  2741.   #--------------------------------------------------------------------------
  2742.   # alias method: create_actor_command_window
  2743.   #--------------------------------------------------------------------------
  2744.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2745.   def create_actor_command_window
  2746.     scene_battle_create_actor_command_window_abe
  2747.     @actor_command_window.set_handler(:dir4, method(:prior_command))
  2748.     @actor_command_window.set_handler(:dir6, method(:next_command))
  2749.   end
  2750.  
  2751.   #--------------------------------------------------------------------------
  2752.   # alias method: create_skill_window
  2753.   #--------------------------------------------------------------------------
  2754.   alias scene_battle_create_skill_window_abe create_skill_window
  2755.   def create_skill_window
  2756.     scene_battle_create_skill_window_abe
  2757.     @skill_window.height = @info_viewport.rect.height
  2758.     @skill_window.width = Graphics.width - @actor_command_window.width
  2759.     @skill_window.y = Graphics.height - @skill_window.height
  2760.   end
  2761.  
  2762.   #--------------------------------------------------------------------------
  2763.   # alias method: create_item_window
  2764.   #--------------------------------------------------------------------------
  2765.   alias scene_battle_create_item_window_abe create_item_window
  2766.   def create_item_window
  2767.     scene_battle_create_item_window_abe
  2768.     @item_window.height = @skill_window.height
  2769.     @item_window.width = @skill_window.width
  2770.     @item_window.y = Graphics.height - @item_window.height
  2771.   end
  2772.  
  2773.   #--------------------------------------------------------------------------
  2774.   # alias method: show_fast?
  2775.   #--------------------------------------------------------------------------
  2776.   alias scene_battle_show_fast_abe show_fast?
  2777.   def show_fast?
  2778.     return true if YEA::BATTLE::AUTO_FAST
  2779.     return scene_battle_show_fast_abe
  2780.   end
  2781.  
  2782.   #--------------------------------------------------------------------------
  2783.   # alias method: next_command
  2784.   #--------------------------------------------------------------------------
  2785.   alias scene_battle_next_command_abe next_command
  2786.   def next_command
  2787.     @status_window.show
  2788.     redraw_current_status
  2789.     @actor_command_window.show
  2790.     @status_aid_window.hide
  2791.     scene_battle_next_command_abe
  2792.   end
  2793.  
  2794.   #--------------------------------------------------------------------------
  2795.   # alias method: prior_command
  2796.   #--------------------------------------------------------------------------
  2797.   alias scene_battle_prior_command_abe prior_command
  2798.   def prior_command
  2799.     redraw_current_status
  2800.     scene_battle_prior_command_abe
  2801.   end
  2802.  
  2803.   #--------------------------------------------------------------------------
  2804.   # new method: redraw_current_status
  2805.   #--------------------------------------------------------------------------
  2806.   def redraw_current_status
  2807.     return if @status_window.index < 0
  2808.     @status_window.draw_item(@status_window.index)
  2809.   end
  2810.  
  2811.   #--------------------------------------------------------------------------
  2812.   # alias method: command_attack
  2813.   #--------------------------------------------------------------------------
  2814.   alias scene_battle_command_attack_abe command_attack
  2815.   def command_attack
  2816.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2817.     scene_battle_command_attack_abe
  2818.   end
  2819.  
  2820.   #--------------------------------------------------------------------------
  2821.   # alias method: command_skill
  2822.   #--------------------------------------------------------------------------
  2823.   alias scene_battle_command_skill_abe command_skill
  2824.   def command_skill
  2825.     scene_battle_command_skill_abe
  2826.     @status_window.hide
  2827.     @actor_command_window.hide
  2828.     @status_aid_window.show
  2829.   end
  2830.  
  2831.   #--------------------------------------------------------------------------
  2832.   # alias method: command_item
  2833.   #--------------------------------------------------------------------------
  2834.   alias scene_battle_command_item_abe command_item
  2835.   def command_item
  2836.     scene_battle_command_item_abe
  2837.     @status_window.hide
  2838.     @actor_command_window.hide
  2839.     @status_aid_window.show
  2840.   end
  2841.  
  2842.   #--------------------------------------------------------------------------
  2843.   # overwrite method: on_skill_ok
  2844.   #--------------------------------------------------------------------------
  2845.   def on_skill_ok
  2846.     @skill = @skill_window.item
  2847.     $game_temp.battle_aid = @skill
  2848.     BattleManager.actor.input.set_skill(@skill.id)
  2849.     BattleManager.actor.last_skill.object = @skill
  2850.     if @skill.for_opponent?
  2851.       select_enemy_selection
  2852.     elsif @skill.for_friend?
  2853.       select_actor_selection
  2854.     else
  2855.       @skill_window.hide
  2856.       next_command
  2857.       $game_temp.battle_aid = nil
  2858.     end
  2859.   end
  2860.  
  2861.   #--------------------------------------------------------------------------
  2862.   # alias method: on_skill_cancel
  2863.   #--------------------------------------------------------------------------
  2864.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2865.   def on_skill_cancel
  2866.     scene_battle_on_skill_cancel_abe
  2867.     @status_window.show
  2868.     @actor_command_window.show
  2869.     @status_aid_window.hide
  2870.   end
  2871.  
  2872.   #--------------------------------------------------------------------------
  2873.   # overwrite method: on_item_ok
  2874.   #--------------------------------------------------------------------------
  2875.   def on_item_ok
  2876.     @item = @item_window.item
  2877.     $game_temp.battle_aid = @item
  2878.     BattleManager.actor.input.set_item(@item.id)
  2879.     if @item.for_opponent?
  2880.       select_enemy_selection
  2881.     elsif @item.for_friend?
  2882.       select_actor_selection
  2883.     else
  2884.       @item_window.hide
  2885.       next_command
  2886.       $game_temp.battle_aid = nil
  2887.     end
  2888.     $game_party.last_item.object = @item
  2889.   end
  2890.  
  2891.   #--------------------------------------------------------------------------
  2892.   # alias method: on_item_cancel
  2893.   #--------------------------------------------------------------------------
  2894.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2895.   def on_item_cancel
  2896.     scene_battle_on_item_cancel_abe
  2897.     @status_window.show
  2898.     @actor_command_window.show
  2899.     @status_aid_window.hide
  2900.   end
  2901.  
  2902.   #--------------------------------------------------------------------------
  2903.   # alias method: select_actor_selection
  2904.   #--------------------------------------------------------------------------
  2905.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2906.   def select_actor_selection
  2907.     @status_aid_window.refresh
  2908.     scene_battle_select_actor_selection_abe
  2909.     @status_window.hide
  2910.     @skill_window.hide
  2911.     @item_window.hide
  2912.     @help_window.show
  2913.   end
  2914.  
  2915.   #--------------------------------------------------------------------------
  2916.   # alias method: on_actor_ok
  2917.   #--------------------------------------------------------------------------
  2918.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2919.   def on_actor_ok
  2920.     $game_temp.battle_aid = nil
  2921.     scene_battle_on_actor_ok_abe
  2922.     @status_window.show
  2923.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2924.       @actor_command_window.visible = !@confirm_command_window.visible
  2925.     else
  2926.       @actor_command_window.show
  2927.     end
  2928.     @status_aid_window.hide
  2929.   end
  2930.  
  2931.   #--------------------------------------------------------------------------
  2932.   # alias method: on_actor_cancel
  2933.   #--------------------------------------------------------------------------
  2934.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2935.   def on_actor_cancel
  2936.     BattleManager.actor.input.clear
  2937.     @status_aid_window.refresh
  2938.     $game_temp.battle_aid = nil
  2939.     scene_battle_on_actor_cancel_abe
  2940.     case @actor_command_window.current_symbol
  2941.     when :skill
  2942.       @skill_window.show
  2943.     when :item
  2944.       @item_window.show
  2945.     end
  2946.   end
  2947.  
  2948.   #--------------------------------------------------------------------------
  2949.   # alias method: select_enemy_selection
  2950.   #--------------------------------------------------------------------------
  2951.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2952.   def select_enemy_selection
  2953.     @status_aid_window.refresh
  2954.     scene_battle_select_enemy_selection_abe
  2955.     @help_window.show
  2956.   end
  2957.   #--------------------------------------------------------------------------
  2958.   # alias method: on_enemy_ok
  2959.   #--------------------------------------------------------------------------
  2960.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2961.   def on_enemy_ok
  2962.     $game_temp.battle_aid = nil
  2963.     scene_battle_on_enemy_ok_abe
  2964.   end
  2965.  
  2966.   #--------------------------------------------------------------------------
  2967.   # alias method: on_enemy_cancel
  2968.   #--------------------------------------------------------------------------
  2969.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2970.   def on_enemy_cancel
  2971.     BattleManager.actor.input.clear
  2972.     @status_aid_window.refresh
  2973.     $game_temp.battle_aid = nil
  2974.     scene_battle_on_enemy_cancel_abe
  2975.     if @skill_window.visible || @item_window.visible
  2976.       @help_window.show
  2977.     else
  2978.       @help_window.hide
  2979.     end
  2980.   end
  2981.  
  2982.   #--------------------------------------------------------------------------
  2983.   # alias method: battle_start
  2984.   #--------------------------------------------------------------------------
  2985.   alias scene_battle_battle_start_abe battle_start
  2986.   def battle_start
  2987.     scene_battle_battle_start_abe
  2988.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2989.     @party_command_window.deactivate
  2990.     if BattleManager.input_start
  2991.       command_fight
  2992.     else
  2993.       turn_start
  2994.     end
  2995.   end
  2996.  
  2997.   #--------------------------------------------------------------------------
  2998.   # overwrite method: turn_end
  2999.   #--------------------------------------------------------------------------
  3000.   def turn_end
  3001.     all_battle_members.each do |battler|
  3002.       battler.on_turn_end
  3003.       status_redraw_target(battler)
  3004.       @log_window.display_auto_affected_status(battler)
  3005.       @log_window.wait_and_clear
  3006.     end
  3007.     update_party_cooldowns if $imported["YEA-CommandParty"]
  3008.     BattleManager.turn_end
  3009.     process_event
  3010.     start_party_command_selection
  3011.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  3012.     if BattleManager.input_start
  3013.       @party_command_window.deactivate
  3014.       command_fight
  3015.     else
  3016.       @party_command_window.deactivate
  3017.       turn_start
  3018.     end
  3019.   end
  3020.  
  3021.   #--------------------------------------------------------------------------
  3022.   # overwrite method: execute_action
  3023.   #--------------------------------------------------------------------------
  3024.   def execute_action
  3025.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  3026.     use_item
  3027.     @log_window.wait_and_clear
  3028.   end
  3029.  
  3030.   #--------------------------------------------------------------------------
  3031.   # overwrite method: apply_item_effects
  3032.   #--------------------------------------------------------------------------
  3033.   def apply_item_effects(target, item)
  3034.     if $imported["YEA-LunaticObjects"]
  3035.       lunatic_object_effect(:prepare, item, @subject, target)
  3036.     end
  3037.     target.item_apply(@subject, item)
  3038.     status_redraw_target(@subject)
  3039.     status_redraw_target(target) unless target == @subject
  3040.     @log_window.display_action_results(target, item)
  3041.     if $imported["YEA-LunaticObjects"]
  3042.       lunatic_object_effect(:during, item, @subject, target)
  3043.     end
  3044.     perform_collapse_check(target)
  3045.   end
  3046.  
  3047.   #--------------------------------------------------------------------------
  3048.   # overwite method: invoke_counter_attack
  3049.   #--------------------------------------------------------------------------
  3050.   def invoke_counter_attack(target, item)
  3051.     @log_window.display_counter(target, item)
  3052.     attack_skill = $data_skills[target.attack_skill_id]
  3053.     @subject.item_apply(target, attack_skill)
  3054.     status_redraw_target(@subject)
  3055.     status_redraw_target(target) unless target == @subject
  3056.     @log_window.display_action_results(@subject, attack_skill)
  3057.     perform_collapse_check(target)
  3058.     perform_collapse_check(@subject)
  3059.   end
  3060.  
  3061.   #--------------------------------------------------------------------------
  3062.   # new method: perform_collapse_check
  3063.   #--------------------------------------------------------------------------
  3064.   def perform_collapse_check(target)
  3065.     return if YEA::BATTLE::MSG_ADDED_STATES
  3066.     target.perform_collapse_effect if target.can_collapse?
  3067.     @log_window.wait
  3068.     @log_window.wait_for_effect
  3069.   end
  3070.  
  3071.   #--------------------------------------------------------------------------
  3072.   # overwrite method: show_attack_animation
  3073.   #--------------------------------------------------------------------------
  3074.   def show_attack_animation(targets)
  3075.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  3076.     wait_for_animation
  3077.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  3078.   end
  3079.  
  3080.   #--------------------------------------------------------------------------
  3081.   # overwrite method: show_normal_animation
  3082.   #--------------------------------------------------------------------------
  3083.   def show_normal_animation(targets, animation_id, mirror = false)
  3084.     animation = $data_animations[animation_id]
  3085.     return if animation.nil?
  3086.     ani_check = false
  3087.     if targets != nil
  3088.     targets.each do |target|
  3089.       if ani_check && target.animation_id <= 0
  3090.         target.pseudo_ani_id = animation_id
  3091.       else
  3092.         target.animation_id = animation_id
  3093.       end
  3094.       target.animation_mirror = mirror
  3095.       ani_check = true if animation.to_screen?
  3096.     end
  3097.     end
  3098.   end
  3099.  
  3100.   #--------------------------------------------------------------------------
  3101.   # overwrite method: process_action_end
  3102.   #--------------------------------------------------------------------------
  3103.   def process_action_end
  3104.     @subject.on_action_end
  3105.     status_redraw_target(@subject)
  3106.     @log_window.display_auto_affected_status(@subject)
  3107.     @log_window.wait_and_clear
  3108.     @log_window.display_current_state(@subject)
  3109.     @log_window.wait_and_clear
  3110.     BattleManager.judge_win_loss
  3111.   end
  3112.  
  3113.   #--------------------------------------------------------------------------
  3114.   # overwrite method: use_item
  3115.   #--------------------------------------------------------------------------
  3116.   def use_item
  3117.     item = @subject.current_action.item
  3118.     @log_window.display_use_item(@subject, item)
  3119.     @subject.use_item(item)
  3120.     status_redraw_target(@subject)
  3121.     if $imported["YEA-LunaticObjects"]
  3122.       lunatic_object_effect(:before, item, @subject, @subject)
  3123.     end
  3124.     process_casting_animation if $imported["YEA-CastAnimations"]
  3125.     targets = @subject.current_action.make_targets.compact rescue []
  3126.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  3127.     targets.each {|target|
  3128.       if $imported["YEA-TargetManager"]
  3129.         target = alive_random_target(target, item) if item.for_random?
  3130.       end
  3131.       item.repeats.times { invoke_item(target, item) } }
  3132.     if $imported["YEA-LunaticObjects"]
  3133.       lunatic_object_effect(:after, item, @subject, @subject)
  3134.     end
  3135.   end
  3136.  
  3137.   #--------------------------------------------------------------------------
  3138.   # alias method: invoke_item
  3139.   #--------------------------------------------------------------------------
  3140.   alias scene_battle_invoke_item_abe invoke_item
  3141.   def invoke_item(target, item)
  3142.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  3143.     #if target.dead? != item.for_dead_friend?
  3144.     #  @subject.last_target_index = target.index
  3145.     #  return
  3146.     #end
  3147.     scene_battle_invoke_item_abe(target, item)
  3148.   end
  3149.  
  3150.   #--------------------------------------------------------------------------
  3151.   # new method: show_all_animation?
  3152.   #--------------------------------------------------------------------------
  3153.   def show_all_animation?(item)
  3154.     return true if item.one_animation
  3155.     return false if $data_animations[item.animation_id].nil?
  3156.     return false unless $data_animations[item.animation_id].to_screen?
  3157.     return true
  3158.   end
  3159.  
  3160.   #--------------------------------------------------------------------------
  3161.   # new method: separate_ani?
  3162.   #--------------------------------------------------------------------------
  3163.   def separate_ani?(target, item)
  3164.     #return false if item.one_animation
  3165.     #return false if $data_animations[item.animation_id].nil?
  3166.     #return false if $data_animations[item.animation_id].to_screen?
  3167.     #return target.dead? == item.for_dead_friend?
  3168.     return false
  3169.   end
  3170.  
  3171.   #--------------------------------------------------------------------------
  3172.   # new method: status_redraw_target
  3173.   #--------------------------------------------------------------------------
  3174.   def status_redraw_target(target)
  3175.     return unless target.actor?
  3176.     @status_window.draw_item($game_party.battle_members.index(target))
  3177.   end
  3178.  
  3179.   #--------------------------------------------------------------------------
  3180.   # alias method: start_party_command_selection
  3181.   #--------------------------------------------------------------------------
  3182.   alias start_party_command_selection_abe start_party_command_selection
  3183.   def start_party_command_selection
  3184.     @status_window.refresh unless scene_changing?
  3185.     start_party_command_selection_abe
  3186.   end
  3187.  
  3188.   #--------------------------------------------------------------------------
  3189.   # overwrite method: refresh_status
  3190.   #--------------------------------------------------------------------------
  3191.   def refresh_status; return; end
  3192.  
  3193.   #--------------------------------------------------------------------------
  3194.   # new method: refresh_autobattler_status_window
  3195.   #--------------------------------------------------------------------------
  3196.   def refresh_autobattler_status_window
  3197.     for member in $game_party.battle_members
  3198.       next unless member.auto_battle?
  3199.       @status_window.draw_item(member.index)
  3200.     end
  3201.   end
  3202.  
  3203.   #--------------------------------------------------------------------------
  3204.   # new method: hide_extra_gauges
  3205.   #--------------------------------------------------------------------------
  3206.   def hide_extra_gauges
  3207.     # Made for compatibility
  3208.   end
  3209.  
  3210.   #--------------------------------------------------------------------------
  3211.   # new method: show_extra_gauges
  3212.   #--------------------------------------------------------------------------
  3213.   def show_extra_gauges
  3214.     # Made for compatibility
  3215.   end
  3216.  
  3217. end # Scene_Battle
  3218.  
  3219. #==============================================================================
  3220. #
  3221. # ▼ End of File
  3222. #
  3223. #==============================================================================


评分

参与人数 1梦石 +1 收起 理由
Sion + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 22:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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