查看: 1153|回复: 5

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

[复制链接]
梦石
0
星屑
337
在线时间
64 小时
注册时间
2018-4-22
回帖
9
发表于 2018-9-24 09:16:07 | 显示全部楼层 |阅读模式

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

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

×
我用了可以显示我方技能动画的脸图战斗脚本,但是技能动画是在窗口下面的,求问如何才能把技能动画改到窗口上面去?
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.22
  4. # -- Last Updated: 2012.03.04
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

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

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

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

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

  410. #==============================================================================
  411. # ■ Switch
  412. #==============================================================================

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

  424. #==============================================================================
  425. # ■ Colour
  426. #==============================================================================

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

  440. #==============================================================================
  441. # ■ Icon
  442. #==============================================================================

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

  451. #==============================================================================
  452. # ■ Numeric
  453. #==============================================================================

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

  464. #==============================================================================
  465. # ■ DataManager
  466. #==============================================================================

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

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

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

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

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

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

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

  591. #==============================================================================
  592. # ■ BattleManager
  593. #==============================================================================

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

  713. #==============================================================================
  714. # ■ Game_System
  715. #==============================================================================

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

  752. #==============================================================================
  753. # ■ Sprite_Base
  754. #==============================================================================

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

  772. #==============================================================================
  773. # ■ Sprite_Battler
  774. #==============================================================================

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

  889. #==============================================================================
  890. # ■ Sprite_Popup
  891. #==============================================================================

  892. class Sprite_Popup < Sprite_Base
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # public instance variables
  896.   #--------------------------------------------------------------------------
  897.   attr_accessor :flags
  898.   
  899.   #--------------------------------------------------------------------------
  900.   # initialize
  901.   #--------------------------------------------------------------------------
  902.   def initialize(viewport, battler, value, rules, flags)
  903.     super(viewport)
  904.     @value = value
  905.     @rules = rules
  906.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  907.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  908.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  909.     @flags = flags
  910.     @battler = battler
  911.     create_popup_bitmap
  912.   end
  913.   
  914.   #--------------------------------------------------------------------------
  915.   # create_popup_bitmap
  916.   #--------------------------------------------------------------------------
  917.   def create_popup_bitmap
  918.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  919.     bw = Graphics.width
  920.     bw += 48 if @flags.include?("state")
  921.     bh = Font.default_size * 3
  922.     bitmap = Bitmap.new(bw, bh)
  923.     bitmap.font.name = rules_array[8]
  924.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  925.     bitmap.font.size = size
  926.     bitmap.font.bold = rules_array[3]
  927.     bitmap.font.italic = rules_array[4]
  928.     if flags.include?("critical")
  929.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  930.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  931.     else
  932.       bitmap.font.out_color.set(0, 0, 0, 255)
  933.     end
  934.     dx = 0; dy = 0; dw = 0
  935.     dx += 24 if @flags.include?("state")
  936.     dw += 24 if @flags.include?("state")
  937.     if @flags.include?("state") || @flags.include?("buff")
  938.       c_width = bitmap.text_size(@value).width
  939.       icon_bitmap = $game_temp.iconset
  940.       icon_index = flag_state_icon
  941.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  942.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  943.     end
  944.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  945.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  946.     self.bitmap = bitmap
  947.     self.x = @battler.screen_x
  948.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  949.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  950.     self.y = @battler.screen_y - @battler.sprite.oy/2
  951.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  952.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  953.     self.ox = bw/2; self.oy = bh/2
  954.     self.zoom_x = self.zoom_y = rules_array[0]
  955.     if @flags.include?("no zoom")
  956.       self.zoom_x = self.zoom_y = rules_array[1]
  957.     end
  958.     @target_zoom = rules_array[1]
  959.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  960.     self.z = 500
  961.   end
  962.   
  963.   #--------------------------------------------------------------------------
  964.   # update
  965.   #--------------------------------------------------------------------------
  966.   def update
  967.     super
  968.     #---
  969.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  970.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  971.       @hue_duration -= 1
  972.       self.bitmap.hue_change(15) if @hue_duration <= 0
  973.     end
  974.     #---
  975.     if @zoom_direction == "up"
  976.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  977.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  978.     else
  979.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  980.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  981.     end
  982.     #---
  983.     @full -= 1
  984.     return if @full > 0
  985.     self.y -= 1
  986.     self.opacity -= @fade
  987.   end
  988.   
  989.   #--------------------------------------------------------------------------
  990.   # flag_state_icon
  991.   #--------------------------------------------------------------------------
  992.   def flag_state_icon
  993.     for item in @flags; return item if item.is_a?(Integer); end
  994.     return 0
  995.   end
  996.   
  997. end # Sprite_Popup

  998. #==============================================================================
  999. # ■ Spriteset_Battle
  1000. #==============================================================================

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

  1040. #==============================================================================
  1041. # ■ Game_Temp
  1042. #==============================================================================

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

  1062. #==============================================================================
  1063. # ■ Game_Action
  1064. #==============================================================================

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

  1089. #==============================================================================
  1090. # ■ Game_ActionResult
  1091. #==============================================================================

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

  1138. #==============================================================================
  1139. # ■ Game_BattlerBase
  1140. #==============================================================================

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

  1338. #==============================================================================
  1339. # ■ Game_Battler
  1340. #==============================================================================

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

  1493. #==============================================================================
  1494. # ■ Game_Actor
  1495. #==============================================================================

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

  1588. #==============================================================================
  1589. # ■ Game_Enemy
  1590. #==============================================================================

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

  1615. #==============================================================================
  1616. # ■ Game_Unit
  1617. #==============================================================================

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

  1639. #==============================================================================
  1640. # ■ Window_PartyCommand
  1641. #==============================================================================

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

  1664. #==============================================================================
  1665. # ■ Window_ActorCommand
  1666. #==============================================================================

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

  1700. #==============================================================================
  1701. # ■ Window_BattleStatus
  1702. #==============================================================================

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

  1882. #==============================================================================
  1883. # ■ Window_BattleActor
  1884. #==============================================================================

  1885. class Window_BattleActor < Window_BattleStatus
  1886.   
  1887.   #--------------------------------------------------------------------------
  1888.   # overwrite method: show
  1889.   #--------------------------------------------------------------------------
  1890.   def show
  1891.     create_flags
  1892.     super
  1893.   end
  1894.   
  1895.   #--------------------------------------------------------------------------
  1896.   # new method: create_flags
  1897.   #--------------------------------------------------------------------------
  1898.   def create_flags
  1899.     set_select_flag(:any)
  1900.     select(0)
  1901.     return if $game_temp.battle_aid.nil?
  1902.     if $game_temp.battle_aid.need_selection?
  1903.       select(0)
  1904.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1905.     elsif $game_temp.battle_aid.for_user?
  1906.       battler = BattleManager.actor
  1907.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1908.       select(id)
  1909.       set_select_flag(:user)
  1910.     elsif $game_temp.battle_aid.for_all?
  1911.       select(0)
  1912.       set_select_flag(:all)
  1913.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1914.     elsif $game_temp.battle_aid.for_random?
  1915.       select(0)
  1916.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1917.     end
  1918.   end
  1919.   
  1920.   #--------------------------------------------------------------------------
  1921.   # new method: set_flag
  1922.   #--------------------------------------------------------------------------
  1923.   def set_select_flag(flag)
  1924.     @select_flag = flag
  1925.     case @select_flag
  1926.     when :all, :all_dead, :random
  1927.       @cursor_all = true
  1928.     else
  1929.       @cursor_all = false
  1930.     end
  1931.   end
  1932.   
  1933.   #--------------------------------------------------------------------------
  1934.   # overwrite method: update_cursor
  1935.   #--------------------------------------------------------------------------
  1936.   def update_cursor
  1937.     if @cursor_all
  1938.       cursor_rect.set(0, 0, contents.width, contents.height)
  1939.       self.top_row = 0
  1940.     elsif @index < 0
  1941.       cursor_rect.empty
  1942.     else
  1943.       ensure_cursor_visible
  1944.       cursor_rect.set(item_rect(@index))
  1945.     end
  1946.   end
  1947.   
  1948.   #--------------------------------------------------------------------------
  1949.   # overwrite method: cursor_movable?
  1950.   #--------------------------------------------------------------------------
  1951.   def cursor_movable?
  1952.     return false if @select_flag == :user
  1953.     return super
  1954.   end
  1955.   
  1956.   #--------------------------------------------------------------------------
  1957.   # overwrite method: current_item_enabled?
  1958.   #--------------------------------------------------------------------------
  1959.   def current_item_enabled?
  1960.     return true if $game_temp.battle_aid.nil?
  1961.     if $game_temp.battle_aid.need_selection?
  1962.       member = $game_party.battle_members[@index]
  1963.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1964.     elsif $game_temp.battle_aid.for_dead_friend?
  1965.       for member in $game_party.battle_members
  1966.         return true if member.dead?
  1967.       end
  1968.       return false
  1969.     end
  1970.     return true
  1971.   end
  1972.   
  1973. end # Window_BattleActor

  1974. #==============================================================================
  1975. # ■ Window_BattleStatusAid
  1976. #==============================================================================

  1977. class Window_BattleStatusAid < Window_BattleStatus
  1978.   
  1979.   #--------------------------------------------------------------------------
  1980.   # public instance variables
  1981.   #--------------------------------------------------------------------------
  1982.   attr_accessor :status_window
  1983.   
  1984.   #--------------------------------------------------------------------------
  1985.   # overwrite method: initialize
  1986.   #--------------------------------------------------------------------------
  1987.   def initialize
  1988.     super
  1989.     self.visible = false
  1990.     self.openness = 255
  1991.   end
  1992.   
  1993.   #--------------------------------------------------------------------------
  1994.   # overwrite method: window_width
  1995.   #--------------------------------------------------------------------------
  1996.   def window_width; return 128; end
  1997.   
  1998.   #--------------------------------------------------------------------------
  1999.   # overwrite method: show
  2000.   #--------------------------------------------------------------------------
  2001.   def show
  2002.     super
  2003.     refresh
  2004.   end
  2005.   
  2006.   #--------------------------------------------------------------------------
  2007.   # overwrite method: refresh
  2008.   #--------------------------------------------------------------------------
  2009.   def refresh
  2010.     contents.clear
  2011.     return if @status_window.nil?
  2012.     draw_item(@status_window.index)
  2013.   end
  2014.   
  2015.   #--------------------------------------------------------------------------
  2016.   # overwrite method: item_rect
  2017.   #--------------------------------------------------------------------------
  2018.   def item_rect(index)
  2019.     return Rect.new(0, 0, contents.width, contents.height)
  2020.   end
  2021.   
  2022. end # Window_BattleStatusAid

  2023. #==============================================================================
  2024. # ■ Window_BattleEnemy
  2025. #==============================================================================

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

  2172. #==============================================================================
  2173. # ■ Window_BattleHelp
  2174. #==============================================================================

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

  2283. #==============================================================================
  2284. # ■ Window_BattleLog
  2285. #==============================================================================

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

  2447. #==============================================================================
  2448. # ■ Window_SkillList
  2449. #==============================================================================

  2450. class Window_SkillList < Window_Selectable
  2451.   
  2452.   #--------------------------------------------------------------------------
  2453.   # overwrite method: spacing
  2454.   #--------------------------------------------------------------------------
  2455.   def spacing
  2456.     return 8 if $game_party.in_battle
  2457.     return super
  2458.   end
  2459.   
  2460. end # Window_SkillList

  2461. #==============================================================================
  2462. # ■ Window_ItemList
  2463. #==============================================================================

  2464. class Window_ItemList < Window_Selectable
  2465.   
  2466.   #--------------------------------------------------------------------------
  2467.   # overwrite method: spacing
  2468.   #--------------------------------------------------------------------------
  2469.   def spacing
  2470.     return 8 if $game_party.in_battle
  2471.     return super
  2472.   end
  2473.   
  2474. end # Window_ItemList

  2475. #==============================================================================
  2476. # ■ Scene_Battle
  2477. #==============================================================================

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

  3107. #==============================================================================
  3108. #
  3109. # ▼ End of File
  3110. #
  3111. #==============================================================================
复制代码
无标题.png
梦石
0
星屑
39336
在线时间
11161 小时
注册时间
2009-3-15
回帖
4768
发表于 2018-9-24 09:28:12 | 显示全部楼层
是动画的视口问题..視口高度限制着...
回复

使用道具 举报

梦石
0
星屑
337
在线时间
64 小时
注册时间
2018-4-22
回帖
9
 楼主| 发表于 2018-9-24 10:08:18 | 显示全部楼层
soulsaga 发表于 2018-9-24 09:28
是动画的视口问题..視口高度限制着...

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

使用道具 举报

梦石
0
星屑
39336
在线时间
11161 小时
注册时间
2009-3-15
回帖
4768
发表于 2018-9-24 10:44:03 | 显示全部楼层
好像不是视口..我也想不到了..
回复

使用道具 举报

梦石
0
星屑
19426
在线时间
3082 小时
注册时间
2013-1-11
回帖
1207
发表于 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

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部