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

Project1

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

[已经解决] 请问如何修改技能动画的z值?

[复制链接]

Lv2.观梦者

梦石
0
星屑
337
在线时间
65 小时
注册时间
2018-4-22
帖子
16
跳转到指定楼层
1
发表于 2018-9-24 09:16:07 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

无标题.png (670.89 KB, 下载次数: 3)

无标题.png

Lv5.捕梦者

梦石
0
星屑
36402
在线时间
10791 小时
注册时间
2009-3-15
帖子
4813
2
发表于 2018-9-24 09:28:12 | 只看该作者
是动画的视口问题..視口高度限制着...
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
337
在线时间
65 小时
注册时间
2018-4-22
帖子
16
3
 楼主| 发表于 2018-9-24 10:08:18 | 只看该作者
soulsaga 发表于 2018-9-24 09:28
是动画的视口问题..視口高度限制着...

请教一下如何修改,我试着改了一下电脑直接蓝屏了?!?!
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
36402
在线时间
10791 小时
注册时间
2009-3-15
帖子
4813
4
发表于 2018-9-24 10:44:03 | 只看该作者
好像不是视口..我也想不到了..
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
19428
在线时间
3102 小时
注册时间
2013-1-11
帖子
1291
5
发表于 2018-9-24 19:30:41 | 只看该作者
Spriteset_Battle 的222行的@viewport1改成nil,如果不行,就在改下敌人精灵的Z值

点评

谢谢,成功了。  发表于 2018-9-24 19:44

评分

参与人数 2星屑 +20 +1 收起 理由
VIPArcher + 20 认可答案
Caravan + 1 我很赞同

查看全部评分

回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 07:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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