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

Project1

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

[已经过期] 咱泪目了。。。Glimmer_LP里的YEA战斗引擎

[复制链接]

Lv4.逐梦者 (超级版主)

嗜谎者

梦石
2
星屑
16572
在线时间
3893 小时
注册时间
2010-9-12
帖子
9635

极短24评委极短23评委极短22评委极短21评委开拓者

跳转到指定楼层
1
发表于 2012-4-14 17:28:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Luciffer 于 2012-4-14 18:26 编辑

先不提这个和CP不兼容的问题。。。
关键问题在于技能动画不播放了。。。外语很弱看不懂说明啊。。。
QAQ求救啊。。。

脚本来源是这边的获奖作品:http://rpg.blue/thread-223368-1-1.html
  1. ==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.19
  4. # -- Last Updated: 2012.01.29
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

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

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

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

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

  407. #==============================================================================
  408. # ■ Switch
  409. #==============================================================================

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

  421. #==============================================================================
  422. # ■ Colour
  423. #==============================================================================

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

  437. #==============================================================================
  438. # ■ Icon
  439. #==============================================================================

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

  448. #==============================================================================
  449. # ■ Numeric
  450. #==============================================================================

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

  461. #==============================================================================
  462. # ■ DataManager
  463. #==============================================================================

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

  489. #==============================================================================
  490. # ■ RPG::UsableItem
  491. #==============================================================================

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

  516. #==============================================================================
  517. # ■ RPG::Enemy
  518. #==============================================================================

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

  547. #==============================================================================
  548. # ■ RPG::Enemy
  549. #==============================================================================

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

  588. #==============================================================================
  589. # ■ BattleManager
  590. #==============================================================================

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

  710. #==============================================================================
  711. # ■ Game_System
  712. #==============================================================================

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

  749. #==============================================================================
  750. # ■ Sprite_Base
  751. #==============================================================================

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

  770. #==============================================================================
  771. # ■ Sprite_Battler
  772. #==============================================================================

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

  887. #==============================================================================
  888. # ■ Sprite_Popup
  889. #==============================================================================

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

  996. #==============================================================================
  997. # ■ Spriteset_Battle
  998. #==============================================================================

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

  1038. #==============================================================================
  1039. # ■ Game_Temp
  1040. #==============================================================================

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

  1060. #==============================================================================
  1061. # ■ Game_Action
  1062. #==============================================================================

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

  1087. #==============================================================================
  1088. # ■ Game_ActionResult
  1089. #==============================================================================

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

  1135. #==============================================================================
  1136. # ■ Game_BattlerBase
  1137. #==============================================================================

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

  1334. #==============================================================================
  1335. # ■ Game_Battler
  1336. #==============================================================================

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

  1489. #==============================================================================
  1490. # ■ Game_Actor
  1491. #==============================================================================

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

  1577. #==============================================================================
  1578. # ■ Game_Enemy
  1579. #==============================================================================

  1580. class Game_Enemy < Game_Battler
  1581.   
  1582.   #--------------------------------------------------------------------------
  1583.   # overwrite method: perform_damage_effect
  1584.   #--------------------------------------------------------------------------
  1585.   def perform_damage_effect
  1586.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1587.     Sound.play_enemy_damage
  1588.   end
  1589.   
  1590.   #--------------------------------------------------------------------------
  1591.   # new methods: attack_animation_id
  1592.   #--------------------------------------------------------------------------
  1593.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1594.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1595.   
  1596.   #--------------------------------------------------------------------------
  1597.   # new method: sprite
  1598.   #--------------------------------------------------------------------------
  1599.   def sprite
  1600.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1601.   end
  1602.   
  1603. end # Game_Enemy

  1604. #==============================================================================
  1605. # ■ Game_Unit
  1606. #==============================================================================

  1607. class Game_Unit
  1608.   
  1609.   #--------------------------------------------------------------------------
  1610.   # alias method: make_actions
  1611.   #--------------------------------------------------------------------------
  1612.   alias game_unit_make_actions_abe make_actions
  1613.   def make_actions
  1614.     game_unit_make_actions_abe
  1615.     refresh_autobattler_status_window
  1616.   end
  1617.   
  1618.   #--------------------------------------------------------------------------
  1619.   # new method: refresh_autobattler_status_window
  1620.   #--------------------------------------------------------------------------
  1621.   def refresh_autobattler_status_window
  1622.     return unless SceneManager.scene_is?(Scene_Battle)
  1623.     return unless self.is_a?(Game_Party)
  1624.     SceneManager.scene.refresh_autobattler_status_window
  1625.   end
  1626.   
  1627. end # Game_Unit

  1628. #==============================================================================
  1629. # ■ Window_PartyCommand
  1630. #==============================================================================

  1631. class Window_PartyCommand < Window_Command
  1632.   
  1633.   #--------------------------------------------------------------------------
  1634.   # overwrite method: process_handling
  1635.   #--------------------------------------------------------------------------
  1636.   def process_handling
  1637.     return unless open? && active
  1638.     return process_dir6 if Input.repeat?(:RIGHT)
  1639.     return super
  1640.   end
  1641.   
  1642.   #--------------------------------------------------------------------------
  1643.   # new method: process_dir6
  1644.   #--------------------------------------------------------------------------
  1645.   def process_dir6
  1646.     Sound.play_cursor
  1647.     Input.update
  1648.     deactivate
  1649.     call_handler(:dir6)
  1650.   end
  1651.   
  1652. end # Window_PartyCommand

  1653. #==============================================================================
  1654. # ■ Window_ActorCommand
  1655. #==============================================================================

  1656. class Window_ActorCommand < Window_Command
  1657.   
  1658.   #--------------------------------------------------------------------------
  1659.   # overwrite method: process_handling
  1660.   #--------------------------------------------------------------------------
  1661.   def process_handling
  1662.     return unless open? && active
  1663.     return process_dir4 if Input.repeat?(:LEFT)
  1664.     return process_dir6 if Input.repeat?(:RIGHT)
  1665.     return super
  1666.   end
  1667.   
  1668.   #--------------------------------------------------------------------------
  1669.   # new method: process_dir4
  1670.   #--------------------------------------------------------------------------
  1671.   def process_dir4
  1672.     Sound.play_cursor
  1673.     Input.update
  1674.     deactivate
  1675.     call_handler(:cancel)
  1676.   end
  1677.   
  1678.   #--------------------------------------------------------------------------
  1679.   # new method: process_dir6
  1680.   #--------------------------------------------------------------------------
  1681.   def process_dir6
  1682.     Sound.play_cursor
  1683.     #Input.update
  1684.     #deactivate
  1685.     #call_handler(:dir6)
  1686.   end
  1687.   
  1688. end # Window_ActorCommand

  1689. #==============================================================================
  1690. # ■ Window_BattleStatus
  1691. #==============================================================================

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

  1878. #==============================================================================
  1879. # ■ Window_BattleActor
  1880. #==============================================================================

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

  1971. #==============================================================================
  1972. # ■ Window_BattleStatusAid
  1973. #==============================================================================

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

  2020. #==============================================================================
  2021. # ■ Window_BattleEnemy
  2022. #==============================================================================

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

  2169. #==============================================================================
  2170. # ■ Window_BattleHelp
  2171. #==============================================================================

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

  2280. #==============================================================================
  2281. # ■ Window_BattleLog
  2282. #==============================================================================

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

  2444. #==============================================================================
  2445. # ■ Window_SkillList
  2446. #==============================================================================

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

  2458. #==============================================================================
  2459. # ■ Window_ItemList
  2460. #==============================================================================

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

  2472. #==============================================================================
  2473. # ■ Scene_Battle
  2474. #==============================================================================

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

  3095. #==============================================================================
  3096. #
  3097. # ▼ End of File
  3098. #
  3099. #==============================================================================
复制代码
大约是这个脚本的问题吧。。。求诸大大帮助啊QAQ。。。

搜狗截图_2012-04-14_17-26-34.png (7.84 KB, 下载次数: 18)

搜狗截图_2012-04-14_17-26-34.png

点评

我说,怎么能忘记加脚本框。  发表于 2012-4-14 18:03

评分

参与人数 1星屑 +800 收起 理由
「旅」 + 800 帖子已过期,返回积分~

查看全部评分

Lv2.观梦者

虚構歪曲

梦石
0
星屑
309
在线时间
1194 小时
注册时间
2010-12-18
帖子
3928

贵宾

2
发表于 2012-4-14 17:32:50 | 只看该作者
求助前请学会贴上脚本文件或引用链接。
并不是每个人都会储存或者了解你所要问的问题相关的脚本。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
71
在线时间
1149 小时
注册时间
2011-12-27
帖子
676
3
发表于 2012-4-14 17:39:35 | 只看该作者
你有没有把原作中数据库里最后几项动画按照原ID顺序复制过去?如果没有或是ID不一致的话,会报错,或者动画播放错误。

点评

我没做横版。。。知道那几个是横版需要的啦。。。  发表于 2012-4-14 17:46
一壶浊酒喜相逢,古今多少事,都付笑谈中。
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 07:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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