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

Project1

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

[已经解决] YEA战斗脚本可以展示tp栏吗?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
739 小时
注册时间
2011-11-24
帖子
341
跳转到指定楼层
1
发表于 2012-5-31 21:57:18 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 kapoleo 于 2012-6-1 15:17 编辑

我之前在66下载了一个YEA战斗脚本
就是直板ATB那个啦
可是这个脚本似乎无法在战斗中展示tp栏?
即使可以也只有第一位角色才有tp栏......而且有时有有时没有.........=.=
请问应该怎么办?

当然如果我也不太想用直板
不过目前横板好像没有ATB系统就是
【长期招募制作成员】
原创科幻RPG - PURIFICATION (内涵‧严肃‧认真)
https://rpg.blue/thread-371063-1-1.html

Lv1.梦旅人

梦石
0
星屑
54
在线时间
434 小时
注册时间
2011-7-9
帖子
161
2
发表于 2012-6-1 01:45:26 | 只看该作者
該角色有TP消費技能才會在戰鬥中顯示TP條

点评

我这边的即使用tp消费技能也没有显示tp条耶~~  发表于 2012-6-1 10:14
D
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

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

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

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

  409. #==============================================================================
  410. # ■ Switch
  411. #==============================================================================

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

  423. #==============================================================================
  424. # ■ Colour
  425. #==============================================================================

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

  439. #==============================================================================
  440. # ■ Icon
  441. #==============================================================================

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

  450. #==============================================================================
  451. # ■ Numeric
  452. #==============================================================================

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

  463. #==============================================================================
  464. # ■ DataManager
  465. #==============================================================================

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

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

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

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

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

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

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

  590. #==============================================================================
  591. # ■ BattleManager
  592. #==============================================================================

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

  680. #==============================================================================
  681. # ■ Game_System
  682. #==============================================================================

  683. class Game_System
  684.   
  685.   #--------------------------------------------------------------------------
  686.   # new method: battle_system
  687.   #--------------------------------------------------------------------------
  688.   def battle_system
  689.     if @battle_system.nil?
  690.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  691.     else
  692.       return battle_system_corrected(@battle_system)
  693.     end
  694.   end
  695.   
  696.   #--------------------------------------------------------------------------
  697.   # new method: set_battle_system
  698.   #--------------------------------------------------------------------------
  699.   def set_battle_system(type)
  700.     case type
  701.     when :dtb; @battle_system = :dtb
  702.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  703.     else;      @battle_system = :dtb
  704.     end
  705.   end
  706.   
  707.   #--------------------------------------------------------------------------
  708.   # new method: battle_system_corrected
  709.   #--------------------------------------------------------------------------
  710.   def battle_system_corrected(type)
  711.     case type
  712.     when :dtb; return :dtb
  713.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  714.     else;      return :dtb
  715.     end
  716.   end
  717.   
  718. end # Game_System

  719. #==============================================================================
  720. # ■ Sprite_Base
  721. #==============================================================================

  722. class Sprite_Base < Sprite
  723.   
  724.   #--------------------------------------------------------------------------
  725.   # new method: start_pseudo_animation
  726.   #--------------------------------------------------------------------------
  727.   unless $imported["YEA-CoreEngine"]
  728.   def start_pseudo_animation(animation, mirror = false)
  729.     dispose_animation
  730.     @animation = animation
  731.     return if @animation.nil?
  732.     @ani_mirror = mirror
  733.     set_animation_rate
  734.     @ani_duration = @animation.frame_max * @ani_rate + 1
  735.     @ani_sprites = []
  736.   end
  737.   end # $imported["YEA-CoreEngine"]
  738.   
  739. end # Sprite_Base

  740. #==============================================================================
  741. # ■ Sprite_Battler
  742. #==============================================================================

  743. class Sprite_Battler < Sprite_Base
  744.   
  745.   #--------------------------------------------------------------------------
  746.   # public instance variables
  747.   #--------------------------------------------------------------------------
  748.   attr_accessor :effect_type
  749.   attr_accessor :battler_visible
  750.   attr_accessor :popups
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # alias method: initialize
  754.   #--------------------------------------------------------------------------
  755.   alias sprite_battler_initialize_abe initialize
  756.   def initialize(viewport, battler = nil)
  757.     sprite_battler_initialize_abe(viewport, battler)
  758.     @popups = []
  759.     @popup_flags = []
  760.   end
  761.   
  762.   #--------------------------------------------------------------------------
  763.   # alias method: update_bitmap
  764.   #--------------------------------------------------------------------------
  765.   alias sprite_battler_update_bitmap_abe update_bitmap
  766.   def update_bitmap
  767.     return if @battler.actor? && @battler.battler_name == ""
  768.     sprite_battler_update_bitmap_abe
  769.   end
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # alias method: setup_new_animation
  773.   #--------------------------------------------------------------------------
  774.   unless $imported["YEA-CoreEngine"]
  775.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  776.   def setup_new_animation
  777.     sprite_battler_setup_new_animation_abe
  778.     @battler.pseudo_ani_id = 0
  779.     return if @battler.pseudo_ani_id <= 0
  780.     animation = $data_animations[@battler.pseudo_ani_id]
  781.     mirror = @battler.animation_mirror
  782.     start_pseudo_animation(animation, mirror)
  783.     @battler.pseudo_ani_id = 0
  784.   end
  785.   end # $imported["YEA-CoreEngine"]
  786.   
  787.   #--------------------------------------------------------------------------
  788.   # alias method: setup_new_effect
  789.   #--------------------------------------------------------------------------
  790.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  791.   def setup_new_effect
  792.     sprite_battler_setup_new_effect_abe
  793.     setup_popups
  794.   end
  795.   
  796.   #--------------------------------------------------------------------------
  797.   # new method: setup_popups
  798.   #--------------------------------------------------------------------------
  799.   def setup_popups
  800.     return unless @battler.use_sprite?
  801.     @battler.popups = [] if @battler.popups.nil?
  802.     return if @battler.popups == []
  803.     array = @battler.popups.shift
  804.     create_new_popup(array[0], array[1], array[2])
  805.   end
  806.   
  807.   #--------------------------------------------------------------------------
  808.   # new method: create_new_popup
  809.   #--------------------------------------------------------------------------
  810.   def create_new_popup(value, rules, flags)
  811.     return if @battler == nil
  812.     return if flags & @popup_flags != []
  813.     array = YEA::BATTLE::POPUP_RULES[rules]
  814.     for popup in @popups
  815.       popup.y -= 24
  816.     end
  817.     return unless SceneManager.scene.is_a?(Scene_Battle)
  818.     return if SceneManager.scene.spriteset.nil?
  819.     view = SceneManager.scene.spriteset.viewportPopups
  820.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  821.     @popups.push(new_popup)
  822.     @popup_flags.push("weakness") if flags.include?("weakness")
  823.     @popup_flags.push("resistant") if flags.include?("resistant")
  824.     @popup_flags.push("immune") if flags.include?("immune")
  825.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  826.   end
  827.   
  828.   #--------------------------------------------------------------------------
  829.   # alias method: update_effect
  830.   #--------------------------------------------------------------------------
  831.   alias sprite_battler_update_effect_abe update_effect
  832.   def update_effect
  833.     sprite_battler_update_effect_abe
  834.     update_popups
  835.   end
  836.   
  837.   #--------------------------------------------------------------------------
  838.   # new method: update_popups
  839.   #--------------------------------------------------------------------------
  840.   def update_popups
  841.     for popup in @popups
  842.       popup.update
  843.       next unless popup.opacity <= 0
  844.       popup.bitmap.dispose
  845.       popup.dispose
  846.       @popups.delete(popup)
  847.       popup = nil
  848.     end
  849.     @popup_flags = [] if @popups == [] && @popup_flags != []
  850.     return unless SceneManager.scene_is?(Scene_Battle)
  851.     if @current_active_battler != SceneManager.scene.subject
  852.       @current_active_battler = SceneManager.scene.subject
  853.       @popup_flags = []
  854.     end
  855.   end
  856.   
  857. end # Sprite_Battler

  858. #==============================================================================
  859. # ■ Sprite_Popup
  860. #==============================================================================

  861. class Sprite_Popup < Sprite_Base
  862.   
  863.   #--------------------------------------------------------------------------
  864.   # public instance variables
  865.   #--------------------------------------------------------------------------
  866.   attr_accessor :flags
  867.   
  868.   #--------------------------------------------------------------------------
  869.   # initialize
  870.   #--------------------------------------------------------------------------
  871.   def initialize(viewport, battler, value, rules, flags)
  872.     super(viewport)
  873.     @value = value
  874.     @rules = rules
  875.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  876.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  877.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  878.     @flags = flags
  879.     @battler = battler
  880.     create_popup_bitmap
  881.   end
  882.   
  883.   #--------------------------------------------------------------------------
  884.   # create_popup_bitmap
  885.   #--------------------------------------------------------------------------
  886.   def create_popup_bitmap
  887.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  888.     bw = Graphics.width
  889.     bw += 48 if @flags.include?("state")
  890.     bh = Font.default_size * 3
  891.     bitmap = Bitmap.new(bw, bh)
  892.     bitmap.font.name = rules_array[8]
  893.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  894.     bitmap.font.size = size
  895.     bitmap.font.bold = rules_array[3]
  896.     bitmap.font.italic = rules_array[4]
  897.     if flags.include?("critical")
  898.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  899.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  900.     else
  901.       bitmap.font.out_color.set(0, 0, 0, 255)
  902.     end
  903.     dx = 0; dy = 0; dw = 0
  904.     dx += 24 if @flags.include?("state")
  905.     dw += 24 if @flags.include?("state")
  906.     if @flags.include?("state") || @flags.include?("buff")
  907.       c_width = bitmap.text_size(@value).width
  908.       icon_bitmap = $game_temp.iconset
  909.       icon_index = flag_state_icon
  910.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  911.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  912.     end
  913.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  914.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  915.     self.bitmap = bitmap
  916.     self.x = @battler.screen_x
  917.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  918.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  919.     self.y = @battler.screen_y - @battler.sprite.oy/2
  920.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  921.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  922.     self.ox = bw/2; self.oy = bh/2
  923.     self.zoom_x = self.zoom_y = rules_array[0]
  924.     if @flags.include?("no zoom")
  925.       self.zoom_x = self.zoom_y = rules_array[1]
  926.     end
  927.     @target_zoom = rules_array[1]
  928.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  929.     self.z = 500
  930.   end
  931.   
  932.   #--------------------------------------------------------------------------
  933.   # update
  934.   #--------------------------------------------------------------------------
  935.   def update
  936.     super
  937.     #---
  938.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  939.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  940.       @hue_duration -= 1
  941.       self.bitmap.hue_change(15) if @hue_duration <= 0
  942.     end
  943.     #---
  944.     if @zoom_direction == "up"
  945.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  946.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  947.     else
  948.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  949.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  950.     end
  951.     #---
  952.     @full -= 1
  953.     return if @full > 0
  954.     self.y -= 1
  955.     self.opacity -= @fade
  956.   end
  957.   
  958.   #--------------------------------------------------------------------------
  959.   # flag_state_icon
  960.   #--------------------------------------------------------------------------
  961.   def flag_state_icon
  962.     for item in @flags; return item if item.is_a?(Integer); end
  963.     return 0
  964.   end
  965.   
  966. end # Sprite_Popup

  967. #==============================================================================
  968. # ■ Spriteset_Battle
  969. #==============================================================================

  970. class Spriteset_Battle
  971.   
  972.   #--------------------------------------------------------------------------
  973.   # public instance variables
  974.   #--------------------------------------------------------------------------
  975.   attr_accessor :actor_sprites
  976.   attr_accessor :enemy_sprites
  977.   attr_accessor :viewport1
  978.   attr_accessor :viewportPopups
  979.   
  980.   #--------------------------------------------------------------------------
  981.   # alias method: create_viewports
  982.   #--------------------------------------------------------------------------
  983.   alias spriteset_battle_create_viewports_abe create_viewports
  984.   def create_viewports
  985.     spriteset_battle_create_viewports_abe
  986.     @viewportPopups = Viewport.new
  987.     @viewportPopups.z = 200
  988.   end
  989.   
  990.   #--------------------------------------------------------------------------
  991.   # alias method: dispose_viewports
  992.   #--------------------------------------------------------------------------
  993.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  994.   def dispose_viewports
  995.     spriteset_battle_dispose_viewports_abe
  996.     @viewportPopups.dispose
  997.   end
  998.   
  999.   #--------------------------------------------------------------------------
  1000.   # alias method: update_viewports
  1001.   #--------------------------------------------------------------------------
  1002.   alias spriteset_battle_update_viewports_abe update_viewports
  1003.   def update_viewports
  1004.     spriteset_battle_update_viewports_abe
  1005.     @viewportPopups.update
  1006.   end
  1007.   
  1008. end # Spriteset_Battle

  1009. #==============================================================================
  1010. # ■ Game_Temp
  1011. #==============================================================================

  1012. class Game_Temp
  1013.   
  1014.   #--------------------------------------------------------------------------
  1015.   # public instance variables
  1016.   #--------------------------------------------------------------------------
  1017.   attr_accessor :battle_aid
  1018.   attr_accessor :evaluating
  1019.   attr_accessor :iconset
  1020.   
  1021.   #--------------------------------------------------------------------------
  1022.   # alias method: initialize
  1023.   #--------------------------------------------------------------------------
  1024.   alias game_temp_initialize_abe initialize
  1025.   def initialize
  1026.     game_temp_initialize_abe
  1027.     @iconset = Cache.system("Iconset")
  1028.   end
  1029.   
  1030. end # Game_Temp

  1031. #==============================================================================
  1032. # ■ Game_Action
  1033. #==============================================================================

  1034. class Game_Action
  1035.   
  1036.   #--------------------------------------------------------------------------
  1037.   # overwrite method: speed
  1038.   #--------------------------------------------------------------------------
  1039.   def speed
  1040.     speed = subject.agi
  1041.     speed += item.speed if item
  1042.     speed += subject.atk_speed if attack?
  1043.     return speed
  1044.   end
  1045.   
  1046.   #--------------------------------------------------------------------------
  1047.   # alias method: evaluate_item_with_target
  1048.   #--------------------------------------------------------------------------
  1049.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1050.   def evaluate_item_with_target(target)
  1051.     $game_temp.evaluating = true
  1052.     result = evaluate_item_with_target_abe(target)
  1053.     $game_temp.evaluating = false
  1054.     return result
  1055.   end
  1056.   
  1057. end # Game_Action

  1058. #==============================================================================
  1059. # ■ Game_ActionResult
  1060. #==============================================================================

  1061. class Game_ActionResult
  1062.   
  1063.   #--------------------------------------------------------------------------
  1064.   # alias method: clear
  1065.   #--------------------------------------------------------------------------
  1066.   alias game_actionresult_clear_abe clear
  1067.   def clear
  1068.     game_actionresult_clear_abe
  1069.     clear_stored_damage
  1070.   end
  1071.   
  1072.   #--------------------------------------------------------------------------
  1073.   # new method: clear_stored_damage
  1074.   #--------------------------------------------------------------------------
  1075.   def clear_stored_damage
  1076.     @stored_hp_damage = 0
  1077.     @stored_mp_damage = 0
  1078.     @stored_tp_damage = 0
  1079.     @stored_hp_drain = 0
  1080.     @stored_mp_drain = 0
  1081.   end
  1082.   
  1083.   #--------------------------------------------------------------------------
  1084.   # new method: store_damage
  1085.   #--------------------------------------------------------------------------
  1086.   def store_damage
  1087.     @stored_hp_damage += @hp_damage
  1088.     @stored_mp_damage += @mp_damage
  1089.     @stored_tp_damage += @tp_damage
  1090.     @stored_hp_drain += @hp_drain
  1091.     @stored_mp_drain += @mp_drain
  1092.   end
  1093.   
  1094.   #--------------------------------------------------------------------------
  1095.   # new method: restore_damage
  1096.   #--------------------------------------------------------------------------
  1097.   def restore_damage
  1098.     @hp_damage = @stored_hp_damage
  1099.     @mp_damage = @stored_mp_damage
  1100.     @tp_damage = @stored_tp_damage
  1101.     @hp_drain = @stored_hp_drain
  1102.     @mp_drain = @stored_mp_drain
  1103.     clear_stored_damage
  1104.   end
  1105.   
  1106. end # Game_ActionResult

  1107. #==============================================================================
  1108. # ■ Game_BattlerBase
  1109. #==============================================================================

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

  1307. #==============================================================================
  1308. # ■ Game_Battler
  1309. #==============================================================================

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

  1462. #==============================================================================
  1463. # ■ Game_Actor
  1464. #==============================================================================

  1465. class Game_Actor < Game_Battler
  1466.   
  1467.   #--------------------------------------------------------------------------
  1468.   # overwrite method: perform_damage_effect
  1469.   #--------------------------------------------------------------------------
  1470.   def perform_damage_effect
  1471.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1472.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1473.     Sound.play_actor_damage
  1474.   end
  1475.   
  1476.   #--------------------------------------------------------------------------
  1477.   # overwrite method: use_sprite?
  1478.   #--------------------------------------------------------------------------
  1479.   def use_sprite?; return true; end
  1480.    
  1481.   #--------------------------------------------------------------------------
  1482.   # new method: screen_x
  1483.   #--------------------------------------------------------------------------
  1484.   def screen_x
  1485.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1486.     status_window = SceneManager.scene.status_window
  1487.     return 0 if status_window.nil?
  1488.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1489.     ext = SceneManager.scene.info_viewport.ox
  1490.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1491.     constant = 128 + 12
  1492.     return constant + rect.x + item_rect_width / 2 - ext
  1493.   end
  1494.   
  1495.   #--------------------------------------------------------------------------
  1496.   # new method: screen_y
  1497.   #--------------------------------------------------------------------------
  1498.   def screen_y
  1499.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1500.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1501.     return Graphics.height - 120
  1502.   end
  1503.   
  1504.   #--------------------------------------------------------------------------
  1505.   # new method: screen_z
  1506.   #--------------------------------------------------------------------------
  1507.   def screen_z; return 100; end
  1508.   
  1509.   #--------------------------------------------------------------------------
  1510.   # new method: sprite
  1511.   #--------------------------------------------------------------------------
  1512.   def sprite
  1513.     index = $game_party.battle_members.index(self)
  1514.     return SceneManager.scene.spriteset.actor_sprites[index]
  1515.   end
  1516.   
  1517.   #--------------------------------------------------------------------------
  1518.   # new method: draw_mp?
  1519.   #--------------------------------------------------------------------------
  1520.   def draw_mp?
  1521.     return true unless draw_tp?
  1522.     for skill in skills
  1523.       next unless added_skill_types.include?(skill.stype_id)
  1524.       return true if skill.mp_cost > 0
  1525.     end
  1526.     return false
  1527.   end
  1528.   
  1529.   #--------------------------------------------------------------------------
  1530.   # new method: draw_tp?
  1531.   #--------------------------------------------------------------------------
  1532.   def draw_tp?
  1533.     return false unless $data_system.opt_display_tp
  1534.     for skill in skills
  1535.       next unless added_skill_types.include?(skill.stype_id)
  1536.       return true if skill.tp_cost > 0
  1537.     end
  1538.     return false
  1539.   end
  1540.   
  1541. end # Game_Actor

  1542. #==============================================================================
  1543. # ■ Game_Enemy
  1544. #==============================================================================

  1545. class Game_Enemy < Game_Battler
  1546.   
  1547.   #--------------------------------------------------------------------------
  1548.   # overwrite method: perform_damage_effect
  1549.   #--------------------------------------------------------------------------
  1550.   def perform_damage_effect
  1551.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1552.     Sound.play_enemy_damage
  1553.   end
  1554.   
  1555.   #--------------------------------------------------------------------------
  1556.   # new methods: attack_animation_id
  1557.   #--------------------------------------------------------------------------
  1558.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1559.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1560.   
  1561.   #--------------------------------------------------------------------------
  1562.   # new method: sprite
  1563.   #--------------------------------------------------------------------------
  1564.   def sprite
  1565.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1566.   end
  1567.   
  1568. end # Game_Enemy

  1569. #==============================================================================
  1570. # ■ Game_Unit
  1571. #==============================================================================

  1572. class Game_Unit
  1573.   
  1574.   #--------------------------------------------------------------------------
  1575.   # alias method: make_actions
  1576.   #--------------------------------------------------------------------------
  1577.   alias game_unit_make_actions_abe make_actions
  1578.   def make_actions
  1579.     game_unit_make_actions_abe
  1580.     refresh_autobattler_status_window
  1581.   end
  1582.   
  1583.   #--------------------------------------------------------------------------
  1584.   # new method: refresh_autobattler_status_window
  1585.   #--------------------------------------------------------------------------
  1586.   def refresh_autobattler_status_window
  1587.     return unless SceneManager.scene_is?(Scene_Battle)
  1588.     return unless self.is_a?(Game_Party)
  1589.     SceneManager.scene.refresh_autobattler_status_window
  1590.   end
  1591.   
  1592. end # Game_Unit





  1593. #==============================================================================
  1594. # ■ Window_BattleStatus
  1595. #==============================================================================

  1596. class Window_BattleStatus < Window_Selectable
  1597.   
  1598.   #--------------------------------------------------------------------------
  1599.   # overwrite method: initialize
  1600.   #--------------------------------------------------------------------------
  1601.   def initialize
  1602.     super(0, 0, window_width, window_height)
  1603.     self.openness = 0
  1604.     @party = $game_party.battle_members.clone
  1605.   end
  1606.   
  1607.   #--------------------------------------------------------------------------
  1608.   # overwrite method: col_max
  1609.   #--------------------------------------------------------------------------
  1610.   def col_max; return $game_party.max_battle_members; end
  1611.   
  1612.   #--------------------------------------------------------------------------
  1613.   # new method: battle_members
  1614.   #--------------------------------------------------------------------------
  1615.   def battle_members; return $game_party.battle_members; end
  1616.   
  1617.   #--------------------------------------------------------------------------
  1618.   # new method: actor
  1619.   #--------------------------------------------------------------------------
  1620.   def actor; return battle_members[@index]; end
  1621.   
  1622.   #--------------------------------------------------------------------------
  1623.   # overwrite method: update
  1624.   #--------------------------------------------------------------------------
  1625.   def update
  1626.     super
  1627.     return if @party == $game_party.battle_members
  1628.     @party = $game_party.battle_members.clone
  1629.     refresh
  1630.   end
  1631.   
  1632.   #--------------------------------------------------------------------------
  1633.   # overwrite method: draw_item
  1634.   #--------------------------------------------------------------------------
  1635.   def draw_item(index)
  1636.     return if index.nil?
  1637.     clear_item(index)
  1638.     actor = battle_members[index]
  1639.     rect = item_rect(index)
  1640.     return if actor.nil?
  1641.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1642.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1643.     draw_actor_action(actor, rect.x, rect.y)
  1644.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1645.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1646.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1647.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1648.     if draw_tp?(actor) && draw_mp?(actor)
  1649.       dw = rect.width/2-2
  1650.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1651.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1652.       dw = rect.width - rect.width/2 - 2
  1653.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1654.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1655.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1656.     else
  1657.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1658.     end
  1659.   end
  1660.   
  1661.   #--------------------------------------------------------------------------
  1662.   # overwrite method: item_rect
  1663.   #--------------------------------------------------------------------------
  1664.   def item_rect(index)
  1665.     rect = Rect.new
  1666.     rect.width = contents.width / $game_party.max_battle_members
  1667.     rect.height = contents.height
  1668.     rect.x = index * rect.width
  1669.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1670.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1671.     end
  1672.     rect.y = 0
  1673.     return rect
  1674.   end
  1675.   
  1676.   #--------------------------------------------------------------------------
  1677.   # overwrite method: draw_face
  1678.   #--------------------------------------------------------------------------
  1679.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1680.     bitmap = Cache.face(face_name)
  1681.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1682.     fy = face_index / 4 * 96 + 2
  1683.     fw = [item_rect(0).width - 4, 92].min
  1684.     rect = Rect.new(fx, fy, fw, 92)
  1685.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1686.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1687.     bitmap.dispose
  1688.   end
  1689.   
  1690.   #--------------------------------------------------------------------------
  1691.   # overwrite method: draw_actor_name
  1692.   #--------------------------------------------------------------------------
  1693.   def draw_actor_name(actor, dx, dy, dw = 112)
  1694.     reset_font_settings
  1695.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1696.     change_color(hp_color(actor))
  1697.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1698.   end
  1699.   
  1700.   #--------------------------------------------------------------------------
  1701.   # new method: draw_actor_action
  1702.   #--------------------------------------------------------------------------
  1703.   def draw_actor_action(actor, dx, dy)
  1704.     draw_icon(action_icon(actor), dx, dy)
  1705.   end
  1706.   
  1707.   #--------------------------------------------------------------------------
  1708.   # new method: action_icon
  1709.   #--------------------------------------------------------------------------
  1710.   def action_icon(actor)
  1711.     return Icon.no_action if actor.current_action.nil?
  1712.     return Icon.no_action if actor.current_action.item.nil?
  1713.     return actor.current_action.item.icon_index
  1714.   end
  1715.   
  1716.   #--------------------------------------------------------------------------
  1717.   # new method: draw_tp?
  1718.   #--------------------------------------------------------------------------
  1719.   def draw_tp?(actor)
  1720.     return actor.draw_tp?
  1721.   end
  1722.   
  1723.   #--------------------------------------------------------------------------
  1724.   # new method: draw_mp?
  1725.   #--------------------------------------------------------------------------
  1726.   def draw_mp?(actor)
  1727.     return actor.draw_mp?
  1728.   end
  1729.   
  1730.   #--------------------------------------------------------------------------
  1731.   # overwrite method: draw_current_and_max_values
  1732.   #--------------------------------------------------------------------------
  1733.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1734.     change_color(color1)
  1735.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1736.   end
  1737.   
  1738.   #--------------------------------------------------------------------------
  1739.   # overwrite method: draw_actor_hp
  1740.   #--------------------------------------------------------------------------
  1741.   def draw_actor_hp(actor, dx, dy, width = 124)
  1742.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1743.     change_color(system_color)
  1744.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1745.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1746.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1747.       hp_color(actor), normal_color)
  1748.     end
  1749.    
  1750.   #--------------------------------------------------------------------------
  1751.   # overwrite method: draw_actor_mp
  1752.   #--------------------------------------------------------------------------
  1753.   def draw_actor_mp(actor, dx, dy, width = 124)
  1754.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1755.     change_color(system_color)
  1756.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1757.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1758.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1759.       mp_color(actor), normal_color)
  1760.     end
  1761.    
  1762.   #--------------------------------------------------------------------------
  1763.   # overwrite method: draw_actor_tp
  1764.   #--------------------------------------------------------------------------
  1765.   def draw_actor_tp(actor, dx, dy, width = 124)
  1766.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1767.     change_color(system_color)
  1768.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1769.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1770.     change_color(tp_color(actor))
  1771.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1772.   end
  1773.   
  1774. end # Window_BattleStatus

  1775. #==============================================================================
  1776. # ■ Window_BattleActor
  1777. #==============================================================================

  1778. class Window_BattleActor < Window_BattleStatus
  1779.   
  1780.   #--------------------------------------------------------------------------
  1781.   # overwrite method: show
  1782.   #--------------------------------------------------------------------------
  1783.   def show
  1784.     create_flags
  1785.     super
  1786.   end
  1787.   
  1788.   #--------------------------------------------------------------------------
  1789.   # new method: create_flags
  1790.   #--------------------------------------------------------------------------
  1791.   def create_flags
  1792.     set_select_flag(:any)
  1793.     select(0)
  1794.     return if $game_temp.battle_aid.nil?
  1795.     if $game_temp.battle_aid.need_selection?
  1796.       select(0)
  1797.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1798.     elsif $game_temp.battle_aid.for_user?
  1799.       battler = BattleManager.actor
  1800.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1801.       select(id)
  1802.       set_select_flag(:user)
  1803.     elsif $game_temp.battle_aid.for_all?
  1804.       select(0)
  1805.       set_select_flag(:all)
  1806.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1807.     elsif $game_temp.battle_aid.for_random?
  1808.       select(0)
  1809.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1810.     end
  1811.   end
  1812.   
  1813.   #--------------------------------------------------------------------------
  1814.   # new method: set_flag
  1815.   #--------------------------------------------------------------------------
  1816.   def set_select_flag(flag)
  1817.     @select_flag = flag
  1818.     case @select_flag
  1819.     when :all, :all_dead, :random
  1820.       @cursor_all = true
  1821.     else
  1822.       @cursor_all = false
  1823.     end
  1824.   end
  1825.   
  1826.   #--------------------------------------------------------------------------
  1827.   # overwrite method: update_cursor
  1828.   #--------------------------------------------------------------------------
  1829.   def update_cursor
  1830.     if @cursor_all
  1831.       cursor_rect.set(0, 0, contents.width, contents.height)
  1832.       self.top_row = 0
  1833.     elsif @index < 0
  1834.       cursor_rect.empty
  1835.     else
  1836.       ensure_cursor_visible
  1837.       cursor_rect.set(item_rect(@index))
  1838.     end
  1839.   end
  1840.   
  1841.   #--------------------------------------------------------------------------
  1842.   # overwrite method: cursor_movable?
  1843.   #--------------------------------------------------------------------------
  1844.   def cursor_movable?
  1845.     return false if @select_flag == :user
  1846.     return super
  1847.   end
  1848.   
  1849.   #--------------------------------------------------------------------------
  1850.   # overwrite method: current_item_enabled?
  1851.   #--------------------------------------------------------------------------
  1852.   def current_item_enabled?
  1853.     return true if $game_temp.battle_aid.nil?
  1854.     if $game_temp.battle_aid.need_selection?
  1855.       member = $game_party.battle_members[@index]
  1856.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1857.     elsif $game_temp.battle_aid.for_dead_friend?
  1858.       for member in $game_party.battle_members
  1859.         return true if member.dead?
  1860.       end
  1861.       return false
  1862.     end
  1863.     return true
  1864.   end
  1865.   
  1866. end # Window_BattleActor

  1867. #==============================================================================
  1868. # ■ Window_BattleStatusAid
  1869. #==============================================================================

  1870. class Window_BattleStatusAid < Window_BattleStatus
  1871.   
  1872.   #--------------------------------------------------------------------------
  1873.   # public instance variables
  1874.   #--------------------------------------------------------------------------
  1875.   attr_accessor :status_window
  1876.   
  1877.   #--------------------------------------------------------------------------
  1878.   # overwrite method: initialize
  1879.   #--------------------------------------------------------------------------
  1880.   def initialize
  1881.     super
  1882.     self.visible = false
  1883.     self.openness = 255
  1884.   end
  1885.   
  1886.   #--------------------------------------------------------------------------
  1887.   # overwrite method: window_width
  1888.   #--------------------------------------------------------------------------
  1889.   def window_width; return 128; end
  1890.   
  1891.   #--------------------------------------------------------------------------
  1892.   # overwrite method: show
  1893.   #--------------------------------------------------------------------------
  1894.   def show
  1895.     super
  1896.     refresh
  1897.   end
  1898.   
  1899.   #--------------------------------------------------------------------------
  1900.   # overwrite method: refresh
  1901.   #--------------------------------------------------------------------------
  1902.   def refresh
  1903.     contents.clear
  1904.     return if @status_window.nil?
  1905.     draw_item(@status_window.index)
  1906.   end
  1907.   
  1908.   #--------------------------------------------------------------------------
  1909.   # overwrite method: item_rect
  1910.   #--------------------------------------------------------------------------
  1911.   def item_rect(index)
  1912.     return Rect.new(0, 0, contents.width, contents.height)
  1913.   end
  1914.   
  1915. end # Window_BattleStatusAid

  1916. #==============================================================================
  1917. # ■ Window_BattleEnemy
  1918. #==============================================================================

  1919. class Window_BattleEnemy < Window_Selectable
  1920.   
  1921.   #--------------------------------------------------------------------------
  1922.   # overwrite method: initialize
  1923.   #--------------------------------------------------------------------------
  1924.   def initialize(info_viewport)
  1925.     super(0, Graphics.height, window_width, fitting_height(1))
  1926.     refresh
  1927.     self.visible = false
  1928.     @info_viewport = info_viewport
  1929.   end
  1930.   
  1931.   #--------------------------------------------------------------------------
  1932.   # overwrite method: col_max
  1933.   #--------------------------------------------------------------------------
  1934.   def col_max; return item_max; end
  1935.   
  1936.   #--------------------------------------------------------------------------
  1937.   # overwrite method: show
  1938.   #--------------------------------------------------------------------------
  1939.   def show
  1940.     create_flags
  1941.     super
  1942.   end
  1943.   
  1944.   #--------------------------------------------------------------------------
  1945.   # new method: create_flags
  1946.   #--------------------------------------------------------------------------
  1947.   def create_flags
  1948.     set_select_flag(:any)
  1949.     select(0)
  1950.     return if $game_temp.battle_aid.nil?
  1951.     if $game_temp.battle_aid.need_selection?
  1952.       select(0)
  1953.     elsif $game_temp.battle_aid.for_all?
  1954.       select(0)
  1955.       set_select_flag(:all)
  1956.     elsif $game_temp.battle_aid.for_random?
  1957.       select(0)
  1958.       set_select_flag(:random)
  1959.     end
  1960.   end
  1961.   
  1962.   #--------------------------------------------------------------------------
  1963.   # new method: set_flag
  1964.   #--------------------------------------------------------------------------
  1965.   def set_select_flag(flag)
  1966.     @select_flag = flag
  1967.     case @select_flag
  1968.     when :all, :random
  1969.       @cursor_all = true
  1970.     else
  1971.       @cursor_all = false
  1972.     end
  1973.   end
  1974.   
  1975.   #--------------------------------------------------------------------------
  1976.   # new method: select_all?
  1977.   #--------------------------------------------------------------------------
  1978.   def select_all?
  1979.     return true if @select_flag == :all
  1980.     return true if @select_flag == :random
  1981.     return false
  1982.   end
  1983.   
  1984.   #--------------------------------------------------------------------------
  1985.   # overwrite method: update_cursor
  1986.   #--------------------------------------------------------------------------
  1987.   def update_cursor
  1988.     if @cursor_all
  1989.       cursor_rect.set(0, 0, contents.width, contents.height)
  1990.       self.top_row = 0
  1991.     elsif @index < 0
  1992.       cursor_rect.empty
  1993.     else
  1994.       ensure_cursor_visible
  1995.       cursor_rect.set(item_rect(@index))
  1996.     end
  1997.   end
  1998.   
  1999.   #--------------------------------------------------------------------------
  2000.   # overwrite method: cursor_movable?
  2001.   #--------------------------------------------------------------------------
  2002.   def cursor_movable?
  2003.     return false if @select_flag == :user
  2004.     return super
  2005.   end
  2006.   
  2007.   #--------------------------------------------------------------------------
  2008.   # overwrite method: current_item_enabled?
  2009.   #--------------------------------------------------------------------------
  2010.   def current_item_enabled?
  2011.     return true if $game_temp.battle_aid.nil?
  2012.     if $game_temp.battle_aid.need_selection?
  2013.       member = $game_party.battle_members[@index]
  2014.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2015.     elsif $game_temp.battle_aid.for_dead_friend?
  2016.       for member in $game_party.battle_members
  2017.         return true if member.dead?
  2018.       end
  2019.       return false
  2020.     end
  2021.     return true
  2022.   end
  2023.   
  2024.   #--------------------------------------------------------------------------
  2025.   # overwrite method: enemy
  2026.   #--------------------------------------------------------------------------
  2027.   def enemy; @data[index]; end
  2028.   
  2029.   #--------------------------------------------------------------------------
  2030.   # overwrite method: refresh
  2031.   #--------------------------------------------------------------------------
  2032.   def refresh
  2033.     make_item_list
  2034.     create_contents
  2035.     draw_all_items
  2036.   end
  2037.   
  2038.   #--------------------------------------------------------------------------
  2039.   # overwrite method: make_item_list
  2040.   #--------------------------------------------------------------------------
  2041.   def make_item_list
  2042.     @data = $game_troop.alive_members
  2043.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2044.   end
  2045.   
  2046.   #--------------------------------------------------------------------------
  2047.   # overwrite method: draw_item
  2048.   #--------------------------------------------------------------------------
  2049.   def draw_item(index); return; end
  2050.   
  2051.   #--------------------------------------------------------------------------
  2052.   # overwrite method: update
  2053.   #--------------------------------------------------------------------------
  2054.   def update
  2055.     super
  2056.     return unless active
  2057.     enemy.sprite_effect_type = :whiten
  2058.     return unless select_all?
  2059.     for enemy in $game_troop.alive_members
  2060.       enemy.sprite_effect_type = :whiten
  2061.     end
  2062.   end
  2063.   
  2064. end # Window_BattleEnemy

  2065. #==============================================================================
  2066. # ■ Window_BattleHelp
  2067. #==============================================================================

  2068. class Window_BattleHelp < Window_Help
  2069.   
  2070.   #--------------------------------------------------------------------------
  2071.   # public instance variables
  2072.   #--------------------------------------------------------------------------
  2073.   attr_accessor :actor_window
  2074.   attr_accessor :enemy_window
  2075.   
  2076.   #--------------------------------------------------------------------------
  2077.   # update
  2078.   #--------------------------------------------------------------------------
  2079.   def update
  2080.     super
  2081.     if !self.visible and @text != ""
  2082.       @text = ""
  2083.       return refresh
  2084.     end
  2085.     update_battler_name
  2086.   end
  2087.   
  2088.   #--------------------------------------------------------------------------
  2089.   # update_battler_name
  2090.   #--------------------------------------------------------------------------
  2091.   def update_battler_name
  2092.     return unless @actor_window.active || @enemy_window.active
  2093.     if @actor_window.active
  2094.       battler = $game_party.battle_members[@actor_window.index]
  2095.     elsif @enemy_window.active
  2096.       battler = @enemy_window.enemy
  2097.     end
  2098.     if special_display?
  2099.       refresh_special_case(battler)
  2100.     else
  2101.       refresh_battler_name(battler) if battler_name(battler) != @text
  2102.     end
  2103.   end
  2104.   
  2105.   #--------------------------------------------------------------------------
  2106.   # battler_name
  2107.   #--------------------------------------------------------------------------
  2108.   def battler_name(battler)
  2109.     text = battler.name.clone
  2110.     return text
  2111.   end
  2112.   
  2113.   #--------------------------------------------------------------------------
  2114.   # refresh_battler_name
  2115.   #--------------------------------------------------------------------------
  2116.   def refresh_battler_name(battler)
  2117.     contents.clear
  2118.     reset_font_settings
  2119.     change_color(normal_color)
  2120.     @text = battler_name(battler)
  2121.     icons = battler.state_icons + battler.buff_icons
  2122.     dy = icons.size <= 0 ? line_height / 2 : 0
  2123.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2124.     dx = (contents.width - (icons.size * 24)) / 2
  2125.     draw_actor_icons(battler, dx, line_height, contents.width)
  2126.   end
  2127.   
  2128.   #--------------------------------------------------------------------------
  2129.   # special_display?
  2130.   #--------------------------------------------------------------------------
  2131.   def special_display?
  2132.     return false if $game_temp.battle_aid.nil?
  2133.     return false if $game_temp.battle_aid.for_user?
  2134.     return !$game_temp.battle_aid.need_selection?
  2135.   end
  2136.   
  2137.   #--------------------------------------------------------------------------
  2138.   # refresh_special_case
  2139.   #--------------------------------------------------------------------------
  2140.   def refresh_special_case(battler)
  2141.     if $game_temp.battle_aid.for_opponent?
  2142.       if $game_temp.battle_aid.for_all?
  2143.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2144.       else
  2145.         case $game_temp.battle_aid.number_of_targets
  2146.         when 1
  2147.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2148.         else
  2149.           number = $game_temp.battle_aid.number_of_targets
  2150.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2151.         end
  2152.       end
  2153.     else # $game_temp.battle_aid.for_friend?
  2154.       if $game_temp.battle_aid.for_dead_friend?
  2155.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2156.       elsif $game_temp.battle_aid.for_random?
  2157.         case $game_temp.battle_aid.number_of_targets
  2158.         when 1
  2159.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2160.         else
  2161.           number = $game_temp.battle_aid.number_of_targets
  2162.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2163.         end
  2164.       else
  2165.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2166.       end
  2167.     end
  2168.     return if text == @text
  2169.     @text = text
  2170.     contents.clear
  2171.     reset_font_settings
  2172.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2173.   end
  2174.   
  2175. end # Window_BattleHelp

  2176. #==============================================================================
  2177. # ■ Window_BattleLog
  2178. #==============================================================================

  2179. class Window_BattleLog < Window_Selectable
  2180.   
  2181.   #--------------------------------------------------------------------------
  2182.   # alias method: display_current_state
  2183.   #--------------------------------------------------------------------------
  2184.   alias window_battlelog_display_current_state_abe display_current_state
  2185.   def display_current_state(subject)
  2186.     subject.make_during_state_popup
  2187.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2188.     window_battlelog_display_current_state_abe(subject)
  2189.   end
  2190.   
  2191.   #--------------------------------------------------------------------------
  2192.   # alias method: display_use_item
  2193.   #--------------------------------------------------------------------------
  2194.   alias window_battlelog_display_use_item_abe display_use_item
  2195.   def display_use_item(subject, item)
  2196.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2197.     window_battlelog_display_use_item_abe(subject, item)
  2198.   end
  2199.   
  2200.   #--------------------------------------------------------------------------
  2201.   # alias method: display_counter
  2202.   #--------------------------------------------------------------------------
  2203.   alias window_battlelog_display_counter_abe display_counter
  2204.   def display_counter(target, item)
  2205.     if YEA::BATTLE::MSG_COUNTERATTACK
  2206.       window_battlelog_display_counter_abe(target, item)
  2207.     else
  2208.       Sound.play_evasion
  2209.     end
  2210.   end
  2211.   
  2212.   #--------------------------------------------------------------------------
  2213.   # alias method: display_reflection
  2214.   #--------------------------------------------------------------------------
  2215.   alias window_battlelog_display_reflection_abe display_reflection
  2216.   def display_reflection(target, item)
  2217.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2218.       window_battlelog_display_reflection_abe(target, item)
  2219.     else
  2220.       Sound.play_reflection
  2221.     end
  2222.   end
  2223.   
  2224.   #--------------------------------------------------------------------------
  2225.   # alias method: display_substitute
  2226.   #--------------------------------------------------------------------------
  2227.   alias window_battlelog_display_substitute_abe display_substitute
  2228.   def display_substitute(substitute, target)
  2229.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2230.     window_battlelog_display_substitute_abe(substitute, target)
  2231.   end
  2232.   
  2233.   #--------------------------------------------------------------------------
  2234.   # alias method: display_failure
  2235.   #--------------------------------------------------------------------------
  2236.   alias window_battlelog_display_failure_abe display_failure
  2237.   def display_failure(target, item)
  2238.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2239.     window_battlelog_display_failure_abe(target, item)
  2240.   end
  2241.   
  2242.   #--------------------------------------------------------------------------
  2243.   # alias method: display_critical
  2244.   #--------------------------------------------------------------------------
  2245.   alias window_battlelog_display_critical_abe display_critical
  2246.   def display_critical(target, item)
  2247.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2248.     window_battlelog_display_critical_abe(target, item)
  2249.   end
  2250.   
  2251.   #--------------------------------------------------------------------------
  2252.   # alias method: display_miss
  2253.   #--------------------------------------------------------------------------
  2254.   alias window_battlelog_display_miss_abe display_miss
  2255.   def display_miss(target, item)
  2256.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2257.     window_battlelog_display_miss_abe(target, item)
  2258.   end
  2259.   
  2260.   #--------------------------------------------------------------------------
  2261.   # alias method: display_evasion
  2262.   #--------------------------------------------------------------------------
  2263.   alias window_battlelog_display_evasion_abe display_evasion
  2264.   def display_evasion(target, item)
  2265.     if YEA::BATTLE::MSG_EVASION
  2266.       window_battlelog_display_evasion_abe(target, item)
  2267.     else
  2268.       if !item || item.physical?
  2269.         Sound.play_evasion
  2270.       else
  2271.         Sound.play_magic_evasion
  2272.       end
  2273.     end
  2274.   end
  2275.   
  2276.   #--------------------------------------------------------------------------
  2277.   # overwrite method: display_hp_damage
  2278.   #--------------------------------------------------------------------------
  2279.   def display_hp_damage(target, item)
  2280.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2281.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2282.       target.perform_damage_effect
  2283.     end
  2284.     Sound.play_recovery if target.result.hp_damage < 0
  2285.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2286.     add_text(target.result.hp_damage_text)
  2287.     wait
  2288.   end
  2289.   
  2290.   #--------------------------------------------------------------------------
  2291.   # overwrite method: display_mp_damage
  2292.   #--------------------------------------------------------------------------
  2293.   def display_mp_damage(target, item)
  2294.     return if target.dead? || target.result.mp_damage == 0
  2295.     Sound.play_recovery if target.result.mp_damage < 0
  2296.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2297.     add_text(target.result.mp_damage_text)
  2298.     wait
  2299.   end
  2300.   
  2301.   #--------------------------------------------------------------------------
  2302.   # overwrite method: display_tp_damage
  2303.   #--------------------------------------------------------------------------
  2304.   def display_tp_damage(target, item)
  2305.     return if target.dead? || target.result.tp_damage == 0
  2306.     Sound.play_recovery if target.result.tp_damage < 0
  2307.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2308.     add_text(target.result.tp_damage_text)
  2309.     wait
  2310.   end
  2311.   
  2312.   #--------------------------------------------------------------------------
  2313.   # alias method: display_added_states
  2314.   #--------------------------------------------------------------------------
  2315.   alias window_battlelog_display_added_states_abe display_added_states
  2316.   def display_added_states(target)
  2317.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2318.     window_battlelog_display_added_states_abe(target)
  2319.   end
  2320.   
  2321.   #--------------------------------------------------------------------------
  2322.   # alias method: display_removed_states
  2323.   #--------------------------------------------------------------------------
  2324.   alias window_battlelog_display_removed_states_abe display_removed_states
  2325.   def display_removed_states(target)
  2326.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2327.     window_battlelog_display_removed_states_abe(target)
  2328.   end
  2329.   
  2330.   #--------------------------------------------------------------------------
  2331.   # alias method: display_changed_buffs
  2332.   #--------------------------------------------------------------------------
  2333.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2334.   def display_changed_buffs(target)
  2335.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2336.     window_battlelog_display_changed_buffs_abe(target)
  2337.   end
  2338.   
  2339. end # Window_BattleLog

  2340. #==============================================================================
  2341. # ■ Window_SkillList
  2342. #==============================================================================

  2343. class Window_SkillList < Window_Selectable
  2344.   
  2345.   #--------------------------------------------------------------------------
  2346.   # overwrite method: spacing
  2347.   #--------------------------------------------------------------------------
  2348.   def spacing
  2349.     return 8 if $game_party.in_battle
  2350.     return super
  2351.   end
  2352.   
  2353. end # Window_SkillList

  2354. #==============================================================================
  2355. # ■ Window_ItemList
  2356. #==============================================================================

  2357. class Window_ItemList < Window_Selectable
  2358.   
  2359.   #--------------------------------------------------------------------------
  2360.   # overwrite method: spacing
  2361.   #--------------------------------------------------------------------------
  2362.   def spacing
  2363.     return 8 if $game_party.in_battle
  2364.     return super
  2365.   end
  2366.   
  2367. end # Window_ItemList

  2368. #==============================================================================
  2369. # ■ Scene_Battle
  2370. #==============================================================================

  2371. class Scene_Battle < Scene_Base
  2372.   
  2373.   #--------------------------------------------------------------------------
  2374.   # public instance variables
  2375.   #--------------------------------------------------------------------------
  2376.   attr_accessor :enemy_window
  2377.   attr_accessor :info_viewport
  2378.   attr_accessor :spriteset
  2379.   attr_accessor :status_window
  2380.   attr_accessor :status_aid_window
  2381.   attr_accessor :subject
  2382.   
  2383.   #--------------------------------------------------------------------------
  2384.   # alias method: create_spriteset
  2385.   #--------------------------------------------------------------------------
  2386.   alias scene_battle_create_spriteset_abe create_spriteset
  2387.   def create_spriteset
  2388.     BattleManager.init_battle_type
  2389.     scene_battle_create_spriteset_abe
  2390.   end
  2391.   
  2392.   #--------------------------------------------------------------------------
  2393.   # alias method: update_basic
  2394.   #--------------------------------------------------------------------------
  2395.   alias scene_battle_update_basic_abe update_basic
  2396.   def update_basic
  2397.     scene_battle_update_basic_abe
  2398.     update_debug
  2399.   end
  2400.   
  2401.   #--------------------------------------------------------------------------
  2402.   # new method: update_debug
  2403.   #--------------------------------------------------------------------------
  2404.   def update_debug
  2405.     return unless $TEST || $BTEST
  2406.     debug_heal_party if Input.trigger?(:F5)
  2407.     debug_damage_party if Input.trigger?(:F6)
  2408.     debug_fill_tp if Input.trigger?(:F7)
  2409.     debug_kill_all if Input.trigger?(:F8)
  2410.   end
  2411.   
  2412.   #--------------------------------------------------------------------------
  2413.   # new method: debug_heal_party
  2414.   #--------------------------------------------------------------------------
  2415.   def debug_heal_party
  2416.     Sound.play_recovery
  2417.     for member in $game_party.battle_members
  2418.       member.recover_all
  2419.     end
  2420.     @status_window.refresh
  2421.   end
  2422.   
  2423.   #--------------------------------------------------------------------------
  2424.   # new method: debug_damage_party
  2425.   #--------------------------------------------------------------------------
  2426.   def debug_damage_party
  2427.     Sound.play_actor_damage
  2428.     for member in $game_party.alive_members
  2429.       member.hp = 1
  2430.       member.mp = 0
  2431.       member.tp = 0
  2432.     end
  2433.     @status_window.refresh
  2434.   end
  2435.   
  2436.   #--------------------------------------------------------------------------
  2437.   # new method: debug_fill_tp
  2438.   #--------------------------------------------------------------------------
  2439.   def debug_fill_tp
  2440.     Sound.play_recovery
  2441.     for member in $game_party.alive_members
  2442.       member.tp = member.max_tp
  2443.     end
  2444.     @status_window.refresh
  2445.   end
  2446.   
  2447.   #--------------------------------------------------------------------------
  2448.   # new method: debug_kill_all
  2449.   #--------------------------------------------------------------------------
  2450.   def debug_kill_all
  2451.     for enemy in $game_troop.alive_members
  2452.       enemy.hp = 0
  2453.       enemy.perform_collapse_effect
  2454.     end
  2455.     BattleManager.judge_win_loss
  2456.     @log_window.wait
  2457.     @log_window.wait_for_effect
  2458.   end
  2459.   
  2460.   #--------------------------------------------------------------------------
  2461.   # alias method: create_all_windows
  2462.   #--------------------------------------------------------------------------
  2463.   alias scene_battle_create_all_windows_abe create_all_windows
  2464.   def create_all_windows
  2465.     scene_battle_create_all_windows_abe
  2466.     create_battle_status_aid_window
  2467.     set_help_window
  2468.   end
  2469.   
  2470.   #--------------------------------------------------------------------------
  2471.   # alias method: create_info_viewport
  2472.   #--------------------------------------------------------------------------
  2473.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2474.   def create_info_viewport
  2475.     scene_battle_create_info_viewport_abe
  2476.     @status_window.refresh
  2477.   end
  2478.   
  2479.   #--------------------------------------------------------------------------
  2480.   # new method: create_battle_status_aid_window
  2481.   #--------------------------------------------------------------------------
  2482.   def create_battle_status_aid_window
  2483.     @status_aid_window = Window_BattleStatusAid.new
  2484.     @status_aid_window.status_window = @status_window
  2485.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2486.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2487.   end
  2488.   
  2489.   #--------------------------------------------------------------------------
  2490.   # overwrite method: create_help_window
  2491.   #--------------------------------------------------------------------------
  2492.   def create_help_window
  2493.     @help_window = Window_BattleHelp.new
  2494.     @help_window.hide
  2495.   end
  2496.   
  2497.   #--------------------------------------------------------------------------
  2498.   # new method: set_help_window
  2499.   #--------------------------------------------------------------------------
  2500.   def set_help_window
  2501.     @help_window.actor_window = @actor_window
  2502.     @help_window.enemy_window = @enemy_window
  2503.   end
  2504.   
  2505.   #--------------------------------------------------------------------------
  2506.   # alias method: create_party_command_window
  2507.   #--------------------------------------------------------------------------
  2508.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2509.   def create_party_command_window
  2510.     scene_battle_create_party_command_window_abe

  2511.   end
  2512.   
  2513.   #--------------------------------------------------------------------------
  2514.   # alias method: create_actor_command_window
  2515.   #--------------------------------------------------------------------------
  2516.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2517.   def create_actor_command_window
  2518.     scene_battle_create_actor_command_window_abe

  2519.   end
  2520.   
  2521.   #--------------------------------------------------------------------------
  2522.   # alias method: create_skill_window
  2523.   #--------------------------------------------------------------------------
  2524.   alias scene_battle_create_skill_window_abe create_skill_window
  2525.   def create_skill_window
  2526.     scene_battle_create_skill_window_abe
  2527.     @skill_window.height = @info_viewport.rect.height
  2528.     @skill_window.width = Graphics.width - @actor_command_window.width
  2529.     @skill_window.y = Graphics.height - @skill_window.height
  2530.   end
  2531.   
  2532.   #--------------------------------------------------------------------------
  2533.   # alias method: create_item_window
  2534.   #--------------------------------------------------------------------------
  2535.   alias scene_battle_create_item_window_abe create_item_window
  2536.   def create_item_window
  2537.     scene_battle_create_item_window_abe
  2538.     @item_window.height = @skill_window.height
  2539.     @item_window.width = @skill_window.width
  2540.     @item_window.y = Graphics.height - @item_window.height
  2541.   end
  2542.   
  2543.   #--------------------------------------------------------------------------
  2544.   # alias method: show_fast?
  2545.   #--------------------------------------------------------------------------
  2546.   alias scene_battle_show_fast_abe show_fast?
  2547.   def show_fast?
  2548.     return true if YEA::BATTLE::AUTO_FAST
  2549.     return scene_battle_show_fast_abe
  2550.   end
  2551.   
  2552.   #--------------------------------------------------------------------------
  2553.   # alias method: next_command
  2554.   #--------------------------------------------------------------------------
  2555.   alias scene_battle_next_command_abe next_command
  2556.   def next_command
  2557.     @status_window.show
  2558.     redraw_current_status
  2559.     @actor_command_window.show
  2560.     @status_aid_window.hide
  2561.     scene_battle_next_command_abe
  2562.   end
  2563.   
  2564.   #--------------------------------------------------------------------------
  2565.   # alias method: prior_command
  2566.   #--------------------------------------------------------------------------
  2567.   alias scene_battle_prior_command_abe prior_command
  2568.   def prior_command
  2569.     redraw_current_status
  2570.     scene_battle_prior_command_abe
  2571.   end
  2572.   
  2573.   #--------------------------------------------------------------------------
  2574.   # new method: redraw_current_status
  2575.   #--------------------------------------------------------------------------
  2576.   def redraw_current_status
  2577.     return if @status_window.index < 0
  2578.     @status_window.draw_item(@status_window.index)
  2579.   end
  2580.   
  2581.   #--------------------------------------------------------------------------
  2582.   # alias method: command_attack
  2583.   #--------------------------------------------------------------------------
  2584.   alias scene_battle_command_attack_abe command_attack
  2585.   def command_attack
  2586.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2587.     scene_battle_command_attack_abe
  2588.   end
  2589.   
  2590.   #--------------------------------------------------------------------------
  2591.   # alias method: command_skill
  2592.   #--------------------------------------------------------------------------
  2593.   alias scene_battle_command_skill_abe command_skill
  2594.   def command_skill
  2595.     scene_battle_command_skill_abe
  2596.     @status_window.hide
  2597.     @actor_command_window.hide
  2598.     @status_aid_window.show
  2599.   end
  2600.   
  2601.   #--------------------------------------------------------------------------
  2602.   # alias method: command_item
  2603.   #--------------------------------------------------------------------------
  2604.   alias scene_battle_command_item_abe command_item
  2605.   def command_item
  2606.     scene_battle_command_item_abe
  2607.     @status_window.hide
  2608.     @actor_command_window.hide
  2609.     @status_aid_window.show
  2610.   end
  2611.   
  2612.   #--------------------------------------------------------------------------
  2613.   # overwrite method: on_skill_ok
  2614.   #--------------------------------------------------------------------------
  2615.   def on_skill_ok
  2616.     @skill = @skill_window.item
  2617.     $game_temp.battle_aid = @skill
  2618.     BattleManager.actor.input.set_skill(@skill.id)
  2619.     BattleManager.actor.last_skill.object = @skill
  2620.     if @skill.for_opponent?
  2621.       select_enemy_selection
  2622.     elsif @skill.for_friend?
  2623.       select_actor_selection
  2624.     else
  2625.       @skill_window.hide
  2626.       next_command
  2627.       $game_temp.battle_aid = nil
  2628.     end
  2629.   end
  2630.   
  2631.   #--------------------------------------------------------------------------
  2632.   # alias method: on_skill_cancel
  2633.   #--------------------------------------------------------------------------
  2634.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2635.   def on_skill_cancel
  2636.     scene_battle_on_skill_cancel_abe
  2637.     @status_window.show
  2638.     @actor_command_window.show
  2639.     @status_aid_window.hide
  2640.   end
  2641.   
  2642.   #--------------------------------------------------------------------------
  2643.   # overwrite method: on_item_ok
  2644.   #--------------------------------------------------------------------------
  2645.   def on_item_ok
  2646.     @item = @item_window.item
  2647.     $game_temp.battle_aid = @item
  2648.     BattleManager.actor.input.set_item(@item.id)
  2649.     if @item.for_opponent?
  2650.       select_enemy_selection
  2651.     elsif @item.for_friend?
  2652.       select_actor_selection
  2653.     else
  2654.       @item_window.hide
  2655.       next_command
  2656.       $game_temp.battle_aid = nil
  2657.     end
  2658.     $game_party.last_item.object = @item
  2659.   end
  2660.   
  2661.   #--------------------------------------------------------------------------
  2662.   # alias method: on_item_cancel
  2663.   #--------------------------------------------------------------------------
  2664.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2665.   def on_item_cancel
  2666.     scene_battle_on_item_cancel_abe
  2667.     @status_window.show
  2668.     @actor_command_window.show
  2669.     @status_aid_window.hide
  2670.   end
  2671.   
  2672.   #--------------------------------------------------------------------------
  2673.   # alias method: select_actor_selection
  2674.   #--------------------------------------------------------------------------
  2675.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2676.   def select_actor_selection
  2677.     @status_aid_window.refresh
  2678.     scene_battle_select_actor_selection_abe
  2679.     @status_window.hide
  2680.     @skill_window.hide
  2681.     @item_window.hide
  2682.     @help_window.show
  2683.   end
  2684.   
  2685.   #--------------------------------------------------------------------------
  2686.   # alias method: on_actor_ok
  2687.   #--------------------------------------------------------------------------
  2688.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2689.   def on_actor_ok
  2690.     $game_temp.battle_aid = nil
  2691.     scene_battle_on_actor_ok_abe
  2692.     @status_window.show
  2693.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2694.       @actor_command_window.visible = !@confirm_command_window.visible
  2695.     else
  2696.       @actor_command_window.show
  2697.     end
  2698.     @status_aid_window.hide
  2699.   end
  2700.   
  2701.   #--------------------------------------------------------------------------
  2702.   # alias method: on_actor_cancel
  2703.   #--------------------------------------------------------------------------
  2704.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2705.   def on_actor_cancel
  2706.     BattleManager.actor.input.clear
  2707.     @status_aid_window.refresh
  2708.     $game_temp.battle_aid = nil
  2709.     scene_battle_on_actor_cancel_abe
  2710.     case @actor_command_window.current_symbol
  2711.     when :skill
  2712.       @skill_window.show
  2713.     when :item
  2714.       @item_window.show
  2715.     end
  2716.   end
  2717.   
  2718.   #--------------------------------------------------------------------------
  2719.   # alias method: select_enemy_selection
  2720.   #--------------------------------------------------------------------------
  2721.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2722.   def select_enemy_selection
  2723.     @status_aid_window.refresh
  2724.     scene_battle_select_enemy_selection_abe
  2725.     @help_window.show
  2726.   end
  2727.   #--------------------------------------------------------------------------
  2728.   # alias method: on_enemy_ok
  2729.   #--------------------------------------------------------------------------
  2730.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2731.   def on_enemy_ok
  2732.     $game_temp.battle_aid = nil
  2733.     scene_battle_on_enemy_ok_abe
  2734.   end
  2735.   
  2736.   #--------------------------------------------------------------------------
  2737.   # alias method: on_enemy_cancel
  2738.   #--------------------------------------------------------------------------
  2739.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2740.   def on_enemy_cancel
  2741.     BattleManager.actor.input.clear
  2742.     @status_aid_window.refresh
  2743.     $game_temp.battle_aid = nil
  2744.     scene_battle_on_enemy_cancel_abe
  2745.     if @skill_window.visible || @item_window.visible
  2746.       @help_window.show
  2747.     else
  2748.       @help_window.hide
  2749.     end
  2750.   end
  2751.   
  2752.   #--------------------------------------------------------------------------
  2753.   # alias method: battle_start
  2754.   #--------------------------------------------------------------------------
  2755.   alias scene_battle_battle_start_abe battle_start
  2756.   def battle_start
  2757.     scene_battle_battle_start_abe
  2758.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2759.     @party_command_window.deactivate
  2760.     if BattleManager.input_start
  2761.       command_fight
  2762.     else
  2763.       turn_start
  2764.     end
  2765.   end
  2766.   
  2767.   #--------------------------------------------------------------------------
  2768.   # overwrite method: turn_end
  2769.   #--------------------------------------------------------------------------
  2770.   def turn_end
  2771.     all_battle_members.each do |battler|
  2772.       battler.on_turn_end
  2773.       status_redraw_target(battler)
  2774.       @log_window.display_auto_affected_status(battler)
  2775.       @log_window.wait_and_clear
  2776.     end
  2777.    
  2778.     BattleManager.turn_end
  2779.     process_event
  2780.     start_party_command_selection
  2781.     return if end_battle_conditions?
  2782.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2783.     if BattleManager.input_start
  2784.       @party_command_window.deactivate
  2785.       command_fight
  2786.     else
  2787.       @party_command_window.deactivate
  2788.       turn_start
  2789.     end
  2790.   end
  2791.   
  2792.   #--------------------------------------------------------------------------
  2793.   # new method: end_battle_conditions?
  2794.   #--------------------------------------------------------------------------
  2795.   def end_battle_conditions?
  2796.     return true if $game_party.members.empty?
  2797.     return true if $game_party.all_dead?
  2798.     return true if $game_troop.all_dead?
  2799.     return true if BattleManager.aborting?
  2800.     return false
  2801.   end
  2802.   
  2803.   #--------------------------------------------------------------------------
  2804.   # overwrite method: execute_action
  2805.   #--------------------------------------------------------------------------
  2806.   def execute_action
  2807.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2808.     use_item
  2809.     @log_window.wait_and_clear
  2810.   end
  2811.   
  2812.   #--------------------------------------------------------------------------
  2813.   # overwrite method: apply_item_effects
  2814.   #--------------------------------------------------------------------------
  2815.   def apply_item_effects(target, item)
  2816.     if $imported["YEA-LunaticObjects"]
  2817.       lunatic_object_effect(:prepare, item, @subject, target)
  2818.     end
  2819.     target.item_apply(@subject, item)
  2820.     status_redraw_target(@subject)
  2821.     status_redraw_target(target) unless target == @subject
  2822.     @log_window.display_action_results(target, item)
  2823.     if $imported["YEA-LunaticObjects"]
  2824.       lunatic_object_effect(:during, item, @subject, target)
  2825.     end
  2826.     perform_collapse_check(target)
  2827.   end
  2828.   
  2829.   #--------------------------------------------------------------------------
  2830.   # overwite method: invoke_counter_attack
  2831.   #--------------------------------------------------------------------------
  2832.   def invoke_counter_attack(target, item)
  2833.     @log_window.display_counter(target, item)
  2834.     attack_skill = $data_skills[target.attack_skill_id]
  2835.     @subject.item_apply(target, attack_skill)
  2836.     status_redraw_target(@subject)
  2837.     status_redraw_target(target) unless target == @subject
  2838.     @log_window.display_action_results(@subject, attack_skill)
  2839.     perform_collapse_check(target)
  2840.     perform_collapse_check(@subject)
  2841.   end
  2842.   
  2843.   #--------------------------------------------------------------------------
  2844.   # new method: perform_collapse_check
  2845.   #--------------------------------------------------------------------------
  2846.   def perform_collapse_check(target)
  2847.     return if YEA::BATTLE::MSG_ADDED_STATES
  2848.     target.perform_collapse_effect if target.can_collapse?
  2849.     @log_window.wait
  2850.     @log_window.wait_for_effect
  2851.   end
  2852.   
  2853.   #--------------------------------------------------------------------------
  2854.   # overwrite method: show_attack_animation
  2855.   #--------------------------------------------------------------------------
  2856.   def show_attack_animation(targets)
  2857.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2858.     wait_for_animation
  2859.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2860.   end
  2861.   
  2862.   #--------------------------------------------------------------------------
  2863.   # overwrite method: show_normal_animation
  2864.   #--------------------------------------------------------------------------
  2865.   def show_normal_animation(targets, animation_id, mirror = false)
  2866.     animation = $data_animations[animation_id]
  2867.     return if animation.nil?
  2868.     ani_check = false
  2869.     targets.each do |target|
  2870.       if ani_check && target.animation_id <= 0
  2871.         target.pseudo_ani_id = animation_id
  2872.       else
  2873.         target.animation_id = animation_id
  2874.       end
  2875.       target.animation_mirror = mirror
  2876.       ani_check = true if animation.to_screen?
  2877.     end
  2878.   end
  2879.   
  2880.   #--------------------------------------------------------------------------
  2881.   # overwrite method: process_action_end
  2882.   #--------------------------------------------------------------------------
  2883.   def process_action_end
  2884.     @subject.on_action_end
  2885.     status_redraw_target(@subject)
  2886.     @log_window.display_auto_affected_status(@subject)
  2887.     @log_window.wait_and_clear
  2888.     @log_window.display_current_state(@subject)
  2889.     @log_window.wait_and_clear
  2890.     BattleManager.judge_win_loss
  2891.   end
  2892.   
  2893.   #--------------------------------------------------------------------------
  2894.   # overwrite method: use_item
  2895.   #--------------------------------------------------------------------------
  2896.   def use_item
  2897.     item = @subject.current_action.item
  2898.     @log_window.display_use_item(@subject, item)
  2899.     @subject.use_item(item)
  2900.     status_redraw_target(@subject)
  2901.     if $imported["YEA-LunaticObjects"]
  2902.       lunatic_object_effect(:before, item, @subject, @subject)
  2903.     end
  2904.     process_casting_animation if $imported["YEA-CastAnimations"]
  2905.     targets = @subject.current_action.make_targets.compact rescue []
  2906.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  2907.     targets.each {|target|
  2908.       if $imported["YEA-TargetManager"]
  2909.         target = alive_random_target(target, item) if item.for_random?
  2910.       end
  2911.       item.repeats.times { invoke_item(target, item) } }
  2912.     if $imported["YEA-LunaticObjects"]
  2913.       lunatic_object_effect(:after, item, @subject, @subject)
  2914.     end
  2915.   end
  2916.   
  2917.   #--------------------------------------------------------------------------
  2918.   # alias method: invoke_item
  2919.   #--------------------------------------------------------------------------
  2920.   alias scene_battle_invoke_item_abe invoke_item
  2921.   def invoke_item(target, item)
  2922.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  2923.     if target.dead? != item.for_dead_friend?
  2924.       @subject.last_target_index = target.index
  2925.       return
  2926.     end
  2927.     scene_battle_invoke_item_abe(target, item)
  2928.   end
  2929.   
  2930.   #--------------------------------------------------------------------------
  2931.   # new method: show_all_animation?
  2932.   #--------------------------------------------------------------------------
  2933.   def show_all_animation?(item)
  2934.     return true if item.one_animation
  2935.     return false if $data_animations[item.animation_id].nil?
  2936.     return false unless $data_animations[item.animation_id].to_screen?
  2937.     return true
  2938.   end
  2939.   
  2940.   #--------------------------------------------------------------------------
  2941.   # new method: separate_ani?
  2942.   #--------------------------------------------------------------------------
  2943.   def separate_ani?(target, item)
  2944.     return false if item.one_animation
  2945.     return false if $data_animations[item.animation_id].nil?
  2946.     return false if $data_animations[item.animation_id].to_screen?
  2947.     return target.dead? == item.for_dead_friend?
  2948.   end
  2949.   
  2950.   #--------------------------------------------------------------------------
  2951.   # new method: status_redraw_target
  2952.   #--------------------------------------------------------------------------
  2953.   def status_redraw_target(target)
  2954.     return unless target.actor?
  2955.     @status_window.draw_item($game_party.battle_members.index(target))
  2956.   end
  2957.   
  2958.   #--------------------------------------------------------------------------
  2959.   # alias method: start_party_command_selection
  2960.   #--------------------------------------------------------------------------
  2961.   alias start_party_command_selection_abe start_party_command_selection
  2962.   def start_party_command_selection
  2963.     @status_window.refresh unless scene_changing?
  2964.     start_party_command_selection_abe
  2965.   end
  2966.   
  2967.   #--------------------------------------------------------------------------
  2968.   # overwrite method: refresh_status
  2969.   #--------------------------------------------------------------------------
  2970.   def refresh_status; return; end
  2971.   
  2972.   #--------------------------------------------------------------------------
  2973.   # new method: refresh_autobattler_status_window
  2974.   #--------------------------------------------------------------------------
  2975.   def refresh_autobattler_status_window
  2976.     for member in $game_party.battle_members
  2977.       next unless member.auto_battle?
  2978.       @status_window.draw_item(member.index)
  2979.     end
  2980.   end
  2981.   
  2982.   #--------------------------------------------------------------------------
  2983.   # new method: hide_extra_gauges
  2984.   #--------------------------------------------------------------------------
  2985.   def hide_extra_gauges
  2986.     # Made for compatibility
  2987.   end
  2988.   
  2989.   #--------------------------------------------------------------------------
  2990.   # new method: show_extra_gauges
  2991.   #--------------------------------------------------------------------------
  2992.   def show_extra_gauges
  2993.     # Made for compatibility
  2994.   end
  2995.   
  2996. end # Scene_Battle

  2997. #==============================================================================
  2998. #
  2999. # ▼ End of File
  3000. #
  3001. #==============================================================================
复制代码
我用这个没发现问题

点评

我用了....但也是没有tp栏?可以请大大放张图上来看看你运行时的情况吗?而且虽然是1.21.....但这个连ATB都不是.....我在用1.18的...  发表于 2012-6-1 14:11
回复 支持 反对

使用道具 举报

Lv1.梦旅人

失忆的幽灵

梦石
0
星屑
50
在线时间
504 小时
注册时间
2009-12-14
帖子
501

贵宾

4
发表于 2012-6-1 14:26:16 | 只看该作者
请把乃的脚本发上来看看
如果我能遗忘掉一件事物,我希望遗忘掉我自己
最初你觉得这是一个梦想,最终这只是个妄想
即使你认为你自己是黑暗,即使你认为你自己站在黑暗,但看的见你的人只有我!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
739 小时
注册时间
2011-11-24
帖子
341
5
 楼主| 发表于 2012-6-1 14:45:21 | 只看该作者
本帖最后由 kapoleo 于 2012-6-1 14:59 编辑
Raiku 发表于 2012-6-1 14:26
请把乃的脚本发上来看看


這裡...謝謝了~~~
RUBY 代码复制
  1. #==============================================================================
  2.     #
  3.     # ▼ Yanfly Engine Ace - Ace Battle Engine v1.18
  4.     # -- Last Updated: 2012.01.24
  5.     # -- Level: Normal, Hard
  6.     # -- Requires: n/a
  7.     #
  8.     #==============================================================================
  9.  
  10.     $imported = {} if $imported.nil?
  11.     $imported["YEA-BattleEngine"] = true
  12.  
  13.     #==============================================================================
  14.     # ▼ Updates
  15.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16.     # 2012.01.24 - Compatibility Update: Enemy Levels
  17.     # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  18.     # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  19.     #              animation only once.
  20.     #            - Reduced lag from battle system constantly recreating bitmaps.
  21.     # 2012.01.10 - Compatibility Update: Battle System FTB
  22.     # 2012.01.09 - Anticrash methods implemented.
  23.     #            - Damage Popups are now separate for damage formulas and recovery.
  24.     # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  25.     # 2012.01.02 - Compatibility Update: Target Manager
  26.     #            - Added Option: AUTO_FAST
  27.     #            - Random hits now show animations individually.
  28.     # 2011.12.30 - Compatibility Update: Enemy Levels
  29.     #            - Added Option to center the actors in the HUD.
  30.     # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  31.     #            - Default battle system bug fixes are now included from YEA's Ace
  32.     #              Core Engine.
  33.     #            - Groundwork is also made to support future battle system types.
  34.     #            - Multi-hit actions no longer linger when a target dies during the
  35.     #              middle of one of the hits.
  36.     #            - Compatibility Update: Lunatic Objects v1.02
  37.     # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  38.     # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  39.     # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  40.     #            - Bug fixed: During State popup fix.
  41.     #            - Added HIDE_POPUP_SWITCH.
  42.     # 2011.12.17 - Compatibiilty Update: Cast Animations
  43.     # 2011.12.15 - Compatibility Update: Battle Command List
  44.     # 2011.12.14 - Compatibility Update: Lunatic Objects
  45.     # 2011.12.13 - Compatibility Update: Command Party
  46.     # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  47.     # 2011.12.10 - Compatibility update for Automatic Party HUD.
  48.     #            - Popup graphical bug fixed.
  49.     #            - Bug fixed: Didn't wait for boss dead animations.
  50.     #            - Bug fixed: Surprise attacks that froze the game.
  51.     #            - Bug fixed: Popups didn't show for straight recovery effects.
  52.     # 2011.12.08 - Finished Script.
  53.     # 2011.12.04 - Started Script.
  54.     #
  55.     #==============================================================================
  56.     # ▼ Introduction
  57.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  58.     # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  59.     # allows for easier management of the battle engine without adding too many
  60.     # features, allowing users to customize what they want as they see fit. While
  61.     # the Ace Battle Engine isn't an entirely new engine, it gives users control
  62.     # that RPG Maker VX Ace didn't originally give them.
  63.     #
  64.     # Furthermore, this script provides some new features. They are as follows:
  65.     #
  66.     # -----------------------------------------------------------------------------
  67.     # Animation Fixes
  68.     # -----------------------------------------------------------------------------
  69.     # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  70.     # these fixes are included in this script as well to ensure it's working for
  71.     # the battle script in the event someone chooses not to work with the Ace Core
  72.     # Engine script. The animation fixes prevent excessive animation overlaying
  73.     # (and making the screen look really ugly) and prevents animation clashing
  74.     # between two dual wielding normal attack animations.
  75.     #
  76.     # -----------------------------------------------------------------------------
  77.     # Enemy Animations
  78.     # -----------------------------------------------------------------------------
  79.     # Enemies now show battle animations when they deliver attacks and skills
  80.     # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  81.     # than just sound effects and the screen shaking. Now, animations play where
  82.     # the status window is and relative to the position of each party member.
  83.     #
  84.     # -----------------------------------------------------------------------------
  85.     # Left/Right Command Selection
  86.     # -----------------------------------------------------------------------------
  87.     # While choosing actions, the player can press Left or Right to move freely
  88.     # between (alive) actors to change their skills. Players no longer have to
  89.     # cancel all the way back to change one person's skill and reselect everything.
  90.     # On that note, there is now the option that when a battle starts or at the
  91.     # end of a turn, players will start immediately at command selection rather
  92.     # than needing to select "Fight" in the Party Command Window.
  93.     #
  94.     # -----------------------------------------------------------------------------
  95.     # Popups
  96.     # -----------------------------------------------------------------------------
  97.     # Dealing damage, inflicting states, adding buffs, landing critical hits,
  98.     # striking weaknesses, missing attacks, you name it, there's probably a popup
  99.     # for it. Popups deliver information to the player in a quick or orderly
  100.     # fashion without requiring the player to read lines of text.
  101.     #
  102.     # -----------------------------------------------------------------------------
  103.     # Targeting Window
  104.     # -----------------------------------------------------------------------------
  105.     # When targeting enemies, the window is no longer displayed. Instead, the
  106.     # targeted enemies are highlighted and their names are shown at the top of the
  107.     # screen in a help window. Another thing that's changed is when skills that
  108.     # target multiple targets are selected, there is a confirmation step that the
  109.     # player must take before continuing. In this confirmation step, all of the
  110.     # multiple targets are selected and in the help window would display the scope
  111.     # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  112.     # this step by default.
  113.     #
  114.     # -----------------------------------------------------------------------------
  115.     # Toggling On and Off Special Effects and Text
  116.     # -----------------------------------------------------------------------------
  117.     # Not everybody likes having the screen shake or the enemies blink when they
  118.     # take damage. These effects can now be toggled on and off. Certain text can
  119.     # also be toggled on and off from appearing. A lot of the displayed text has
  120.     # been rendered redundant through the use of popups.
  121.     #
  122.     # -----------------------------------------------------------------------------
  123.     # Visual Battle Status Window
  124.     # -----------------------------------------------------------------------------
  125.     # Rather than just having rows of names with HP and MP bars next to them, the
  126.     # Battle Status Window now displays actors' faces and their gauges aligned at
  127.     # the bottom. More status effects can be shown in addition to showing more
  128.     # members on screen at once. The Battle Status Window is also optimized to
  129.     # refresh less (thus, removing potential lag from the system).
  130.     #
  131.     # -----------------------------------------------------------------------------
  132.     # Window Position Changes
  133.     # -----------------------------------------------------------------------------
  134.     # Windows such as the Skill Window and Item Window have been rearranged to
  135.     # always provide the player a clear view of the battlefield rather than opening
  136.     # up and covering everything. As such, the window positions are placed at the
  137.     # bottom of the screen and are repositioned.
  138.     #
  139.     #==============================================================================
  140.     # ▼ Instructions
  141.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  142.     # To install this script, open up your script editor and copy/paste this script
  143.     # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  144.     #
  145.     # -----------------------------------------------------------------------------
  146.     # Skill Notetags - These notetags go in the skills notebox in the database.
  147.     # -----------------------------------------------------------------------------
  148.     # <one animation>
  149.     # Causes the action to display the action animation only once, even if it's a
  150.     # multi-hit action. This is used primarily for non-all scope targeting.
  151.     #
  152.     # -----------------------------------------------------------------------------
  153.     # Item Notetags - These notetags go in the items notebox in the database.
  154.     # -----------------------------------------------------------------------------
  155.     # <one animation>
  156.     # Causes the action to display the action animation only once, even if it's a
  157.     # multi-hit action. This is used primarily for non-all scope targeting.
  158.     #
  159.     # -----------------------------------------------------------------------------
  160.     # Enemy Notetags - These notetags go in the enemy notebox in the database.
  161.     # -----------------------------------------------------------------------------
  162.     # <atk ani 1: x>
  163.     # <atk ani 2: x>
  164.     # Changes the normal attack animation of the particular enemy to animation x.
  165.     # Attack animation 1 is the first one that plays. If there's a second animation
  166.     # then the second one will play after in mirrored form.
  167.     #
  168.     # -----------------------------------------------------------------------------
  169.     # State Notetags - These notetags go in the state notebox in the database.
  170.     # -----------------------------------------------------------------------------
  171.     # <popup add: string>
  172.     # <popup rem: string>
  173.     # <popup dur: string>
  174.     # Status effects now create popups whenever they're inflicted. However, if you
  175.     # don't like that a certain status effect uses a particular colour setting,
  176.     # change "string" to one of the rulesets below to cause that popup to use a
  177.     # different ruleset.
  178.     #
  179.     # <popup hide add>
  180.     # <popup hide rem>
  181.     # <popup hide dur>
  182.     # Not everybody wants status effects to show popups when inflicted. When this
  183.     # is the case, insert the respective tag to hide popups from appearing when the
  184.     # state is added, removed, or during the stand-by phases.
  185.     #
  186.     # -----------------------------------------------------------------------------
  187.     # Debug Tools - These tools only work during Test Play.
  188.     # -----------------------------------------------------------------------------
  189.     # - F5 Key -
  190.     # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  191.     # All states and buffs are removed whether they are positive or negative.
  192.     #
  193.     # - F6 Key -
  194.     # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  195.     #
  196.     # - F7 Key -
  197.     # Sets all actors to have max TP. Everything else is unaffected.
  198.     #
  199.     # - F8 Key -
  200.     # Kills all enemies in battle. Ends the battle quickly.
  201.     #
  202.     #==============================================================================
  203.     # ▼ Compatibility
  204.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  205.     # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  206.     # it will run with RPG Maker VX without adjusting.
  207.     #
  208.     #==============================================================================
  209.  
  210.     module YEA
  211.       module BATTLE
  212.  
  213.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  214.         # - General Battle Settings -
  215.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  216.         # These settings are adjusted for the overall battle system. These are
  217.         # various miscellaneous options to adjust. Each of the settings below will
  218.         # explain what they do. Change default enemy battle animations here, too.
  219.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  220.         BLINK_EFFECTS      = false  # Blink sprite when damaged?
  221.         FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  222.         SCREEN_SHAKE       = false  # Shake screen in battle?
  223.         SKIP_PARTY_COMMAND = true   # Skips the Fight/Escape menu.
  224.         AUTO_FAST          = true   # Causes message windows to not wait.
  225.         ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  226.  
  227.         # If this switch is ON, popups will be hidden. If OFF, the popups will be
  228.         # shown. If you do not wish to use this switch, set it to 0.
  229.         HIDE_POPUP_SWITCH  = 0
  230.  
  231.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  232.         # - Battle Status Window -
  233.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  234.         # This sets the default battle system your game will use. If your game
  235.         # doesn't have any other battle systems installed, it will use :dtb.
  236.         #
  237.         # Battle System        Requirement
  238.         #   :dtb               - Default Turn Battle. Default system.
  239.         #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  240.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241.         DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  242.  
  243.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  244.         # - Battle Status Window -
  245.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  246.         # Here, you can adjust the settings for the battle status window. The
  247.         # battle status window, by default, will show the actor's face, HP, MP, TP
  248.         # (if viable), and any inflicted status effects.
  249.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250.         BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  251.         BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
  252.         BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  253.         BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # Y Location buffer used for HP gauge.
  254.         BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  255.  
  256.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  257.         # - Help Window Text -
  258.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  259.         # When selecting a target to attack, this is the text that will be shown
  260.         # in place of a target's name for special cases. These special cases are
  261.         # for selections that were originally non-targetable battle scopes.
  262.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  263.         HELP_TEXT_ALL_FOES        = "All Foes"
  264.         HELP_TEXT_ONE_RANDOM_FOE  = "One Random Foe"
  265.         HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  266.         HELP_TEXT_ALL_ALLIES      = "All Allies"
  267.         HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  268.         HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  269.         HELP_TEXT_RANDOM_ALLIES   = "%d Random Allies"
  270.  
  271.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  272.         # - Popup Settings -
  273.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  274.         # These settings will adjust the popups that appear in battle. Popups
  275.         # deliver information to your player as battlers deal damage, inflict
  276.         # status effects, and more.
  277.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  278.         ENABLE_POPUPS  = true     # Set this to false if you wish to disable them.
  279.         FLASH_CRITICAL = true     # Sets critical hits to flash.
  280.  
  281.         # This hash adjusts the popup settings that will govern how popups appear.
  282.         # Adjust them accordingly.
  283.         POPUP_SETTINGS ={
  284.           :offset     => -24,         # Height offset of a popup.
  285.           :fade       => 12,          # Fade rate for each popup.
  286.           :full       => 60,          # Frames before a popup fades.
  287.           :hp_dmg     => "-%s ",      # SprintF for HP damage.
  288.           :hp_heal    => "+%s ",      # SprintF for HP healing.
  289.           :mp_dmg     => "-%s SP",    # SprintF for MP damage.
  290.           :mp_heal    => "+%s SP",    # SprintF for MP healing.
  291.           :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  292.           :tp_heal    => "+%s TP",    # SprintF for MP healing.
  293.           :drained    => "DRAIN",     # Text display for draining HP/MP.
  294.           :critical   => "要害!", # Text display for critical hit.
  295.           :missed     => "落空",      # Text display for missed attack.
  296.           :evaded     => "閃避!",    # Text display for evaded attack.
  297.           :nulled     => "無效",      # Text display for nulled attack.
  298.           :failed     => "FAILED",    # Text display for a failed attack.
  299.           :add_state  => "+%s",      # SprintF for added states.
  300.           :rem_state  => "-%s",      # SprintF for removed states.
  301.           :dur_state  => "%s",        # SprintF for during states.
  302.           :ele_rates  => true,        # This will display elemental affinities.
  303.           :ele_wait   => 20,          # This is how many frames will wait.
  304.           :weakpoint  => "弱點", # Appears if foe is weak to element.
  305.           :resistant  => "耐性",    # Appears if foe is resistant to element.
  306.           :immune     => "免疫",    # Appears if foe is immune to element.
  307.           :absorbed   => "吸取",    # Appears if foe can absorb the element.
  308.           :add_buff   => "%s+",      # Appears when a positive buff is applied.
  309.           :add_debuff => "%s-",      # Appears when a negative buff is applied.
  310.         } # Do not remove this.
  311.  
  312.         # This is the default font used for the popups. Adjust them accordingly
  313.         # or even add new ones.
  314.         DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  315.  
  316.         # The following are the various rules that govern the individual popup
  317.         # types that will appear. Adjust them accordingly. Here is a list of what
  318.         # each category does.
  319.         #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  320.         #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  321.         #   Sz       The font size used for the popup text.
  322.         #   Bold     Applying bold for the popup text.
  323.         #   Italic   Applying italic for the popup text.
  324.         #   Red      The red value of the popup text.
  325.         #   Grn      The green value of the popup text.
  326.         #   Blu      The blue value of the popup text.
  327.         #   Font     The font used for the popup text.
  328.         POPUP_RULES ={
  329.           # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  330.           "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  331.           "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  332.           "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  333.           "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  334.           "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  335.           "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  336.           "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  337.           "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  338.           "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  339.           "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  340.           "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  341.           "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  342.           "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  343.           "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  344.           "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  345.           "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  346.           "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  347.           "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  348.           "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  349.           "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  350.         } # Do not remove this.
  351.  
  352.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  353.         # - Streamlined Messages -
  354.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  355.         # Want to remove some of those annoying messages that appear all the time?
  356.         # Now you can! Select which messages you want to enable or disable. Some of
  357.         # these messages will be rendered useless due to popups.
  358.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  359.         MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  360.         MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  361.         MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  362.         MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  363.         MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  364.         MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  365.         MSG_FAILURE_HIT    = false  # Show effect failed against target.
  366.         MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  367.         MSG_HIT_MISSED     = false  # Show attack missed the target.
  368.         MSG_EVASION        = false  # Show attack was evaded by the target.
  369.         MSG_HP_DAMAGE      = false  # Show HP damage to target.
  370.         MSG_MP_DAMAGE      = false  # Show MP damage to target.
  371.         MSG_TP_DAMAGE      = false  # Show TP damage to target.
  372.         MSG_ADDED_STATES   = false  # Show target's added states.
  373.         MSG_REMOVED_STATES = false  # Show target's removed states.
  374.         MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  375.  
  376.       end # BATTLE
  377.     end # YEA
  378.  
  379.     #==============================================================================
  380.     # ▼ Editting anything past this point may potentially result in causing
  381.     # computer damage, incontinence, explosion of user's head, coma, death, and/or
  382.     # halitosis so edit at your own risk.
  383.     #==============================================================================
  384.  
  385.     module YEA
  386.       module REGEXP
  387.       module ENEMY
  388.  
  389.         ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  390.         ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  391.  
  392.       end # ENEMY
  393.       module USABLEITEM
  394.  
  395.         ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  396.  
  397.       end # USABLEITEM
  398.       module STATE
  399.  
  400.         POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  401.         POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  402.         POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  403.  
  404.         HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  405.         HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  406.         HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  407.  
  408.       end # STATE
  409.       end # REGEXP
  410.     end # YEA
  411.  
  412.     #==============================================================================
  413.     # ■ Switch
  414.     #==============================================================================
  415.  
  416.     module Switch
  417.  
  418.       #--------------------------------------------------------------------------
  419.       # self.hide_popups
  420.       #--------------------------------------------------------------------------
  421.       def self.hide_popups
  422.         return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  423.         return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  424.       end
  425.  
  426.     end # Switch
  427.  
  428.     #==============================================================================
  429.     # ■ Colour
  430.     #==============================================================================
  431.  
  432.     module Colour
  433.  
  434.       #--------------------------------------------------------------------------
  435.       # self.text_colour
  436.       #--------------------------------------------------------------------------
  437.       def self.text_colour(index)
  438.         windowskin = Cache.system("Window")
  439.         x = 64 + (index % 8) * 8
  440.         y = 96 + (index / 8) * 8
  441.         return windowskin.get_pixel(x, y)
  442.       end
  443.  
  444.     end # Colour
  445.  
  446.     #==============================================================================
  447.     # ■ Icon
  448.     #==============================================================================
  449.  
  450.     module Icon
  451.  
  452.       #--------------------------------------------------------------------------
  453.       # self.no_action
  454.       #--------------------------------------------------------------------------
  455.       def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  456.  
  457.     end # Icon
  458.  
  459.     #==============================================================================
  460.     # ■ Numeric
  461.     #==============================================================================
  462.  
  463.     class Numeric
  464.  
  465.       #--------------------------------------------------------------------------
  466.       # new method: group_digits
  467.       #--------------------------------------------------------------------------
  468.       unless $imported["YEA-CoreEngine"]
  469.       def group; return self.to_s; end
  470.       end # $imported["YEA-CoreEngine"]
  471.  
  472.     end # Numeric
  473.  
  474.     #==============================================================================
  475.     # ■ DataManager
  476.     #==============================================================================
  477.  
  478.     module DataManager
  479.  
  480.       #--------------------------------------------------------------------------
  481.       # alias method: load_database
  482.       #--------------------------------------------------------------------------
  483.       class <<self; alias load_database_abe load_database; end
  484.       def self.load_database
  485.         load_database_abe
  486.         load_notetags_abe
  487.       end
  488.  
  489.       #--------------------------------------------------------------------------
  490.       # new method: load_notetags_abe
  491.       #--------------------------------------------------------------------------
  492.       def self.load_notetags_abe
  493.         groups = [$data_enemies, $data_states, $data_skills, $data_items]
  494.         for group in groups
  495.           for obj in group
  496.             next if obj.nil?
  497.             obj.load_notetags_abe
  498.           end
  499.         end
  500.       end
  501.  
  502.     end # DataManager
  503.  
  504.     #==============================================================================
  505.     # ■ RPG::UsableItem
  506.     #==============================================================================
  507.  
  508.     class RPG::UsableItem < RPG::BaseItem
  509.  
  510.       #--------------------------------------------------------------------------
  511.       # public instance variables
  512.       #--------------------------------------------------------------------------
  513.       attr_accessor :one_animation
  514.  
  515.       #--------------------------------------------------------------------------
  516.       # common cache: load_notetags_abe
  517.       #--------------------------------------------------------------------------
  518.       def load_notetags_abe
  519.         @one_animation = false
  520.         #---
  521.         self.note.split(/[\r\n]+/).each { |line|
  522.           case line
  523.           #---
  524.           when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  525.             @one_animation = true
  526.           end
  527.         } # self.note.split
  528.         #---
  529.       end
  530.  
  531.     end # RPG::UsableItem
  532.  
  533.     #==============================================================================
  534.     # ■ RPG::Enemy
  535.     #==============================================================================
  536.  
  537.     class RPG::Enemy < RPG::BaseItem
  538.  
  539.       #--------------------------------------------------------------------------
  540.       # public instance variables
  541.       #--------------------------------------------------------------------------
  542.       attr_accessor :atk_animation_id1
  543.       attr_accessor :atk_animation_id2
  544.  
  545.       #--------------------------------------------------------------------------
  546.       # common cache: load_notetags_abe
  547.       #--------------------------------------------------------------------------
  548.       def load_notetags_abe
  549.         @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  550.         @atk_animation_id2 = 0
  551.         #---
  552.         self.note.split(/[\r\n]+/).each { |line|
  553.           case line
  554.           #---
  555.           when YEA::REGEXP::ENEMY::ATK_ANI1
  556.             @atk_animation_id1 = $1.to_i
  557.           when YEA::REGEXP::ENEMY::ATK_ANI2
  558.             @atk_animation_id2 = $1.to_i
  559.           end
  560.         } # self.note.split
  561.         #---
  562.       end
  563.  
  564.     end # RPG::Enemy
  565.  
  566.     #==============================================================================
  567.     # ■ RPG::Enemy
  568.     #==============================================================================
  569.  
  570.     class RPG::State < RPG::BaseItem
  571.  
  572.       #--------------------------------------------------------------------------
  573.       # public instance variables
  574.       #--------------------------------------------------------------------------
  575.       attr_accessor :popup_rules
  576.  
  577.       #--------------------------------------------------------------------------
  578.       # common cache: load_notetags_abe
  579.       #--------------------------------------------------------------------------
  580.       def load_notetags_abe
  581.         @popup_rules = {
  582.           :add_state => "ADDSTATE",
  583.           :rem_state => "REMSTATE",
  584.           :dur_state => nil
  585.         } # Do not remove this.
  586.         #---
  587.         self.note.split(/[\r\n]+/).each { |line|
  588.           case line
  589.           #---
  590.           when YEA::REGEXP::STATE::POPUP_ADD
  591.             @popup_rules[:add_state] = $1.upcase.to_s
  592.           when YEA::REGEXP::STATE::POPUP_REM
  593.             @popup_rules[:rem_state] = $1.upcase.to_s
  594.           when YEA::REGEXP::STATE::POPUP_DUR
  595.             @popup_rules[:dur_state] = $1.upcase.to_s
  596.           when YEA::REGEXP::STATE::HIDE_ADD
  597.             @popup_rules[:add_state] = nil
  598.           when YEA::REGEXP::STATE::HIDE_REM
  599.             @popup_rules[:rem_state] = nil
  600.           when YEA::REGEXP::STATE::HIDE_DUR
  601.             @popup_rules[:dur_state] = nil
  602.           end
  603.         } # self.note.split
  604.         #---
  605.       end
  606.  
  607.     end # RPG::State
  608.  
  609.     #==============================================================================
  610.     # ■ BattleManager
  611.     #==============================================================================
  612.  
  613.     module BattleManager
  614.  
  615.       #--------------------------------------------------------------------------
  616.       # overwrite method: self.battle_start
  617.       #--------------------------------------------------------------------------
  618.       def self.battle_start
  619.         $game_system.battle_count += 1
  620.         $game_party.on_battle_start
  621.         $game_troop.on_battle_start
  622.         return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  623.         $game_troop.enemy_names.each do |name|
  624.           $game_message.add(sprintf(Vocab::Emerge, name))
  625.         end
  626.         if @preemptive
  627.           $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  628.         elsif @surprise
  629.           $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  630.         end
  631.         wait_for_message
  632.       end
  633.  
  634.       #--------------------------------------------------------------------------
  635.       # overwrite method: make_action_orders
  636.       #--------------------------------------------------------------------------
  637.       def self.make_action_orders
  638.         make_dtb_action_orders if btype?(:dtb)
  639.       end
  640.  
  641.       #--------------------------------------------------------------------------
  642.       # new method: make_dtb_action_orders
  643.       #--------------------------------------------------------------------------
  644.       def self.make_dtb_action_orders
  645.         @action_battlers = []
  646.         @action_battlers += $game_party.members unless @surprise
  647.         @action_battlers += $game_troop.members unless @preemptive
  648.         @action_battlers.each {|battler| battler.make_speed }
  649.         @action_battlers.sort! {|a,b| b.speed - a.speed }
  650.       end
  651.  
  652.       #--------------------------------------------------------------------------
  653.       # overwrite method: turn_start
  654.       #--------------------------------------------------------------------------
  655.       def self.turn_start
  656.         @phase = :turn
  657.         clear_actor
  658.         $game_troop.increase_turn
  659.         @performed_battlers = []
  660.         make_action_orders
  661.       end
  662.  
  663.       #--------------------------------------------------------------------------
  664.       # overwrite method: next_subject
  665.       #--------------------------------------------------------------------------
  666.       def self.next_subject
  667.         @performed_battlers = [] if @performed_battlers.nil?
  668.         loop do
  669.           @action_battlers -= @performed_battlers
  670.           battler = @action_battlers.shift
  671.           return nil unless battler
  672.           next unless battler.index && battler.alive?
  673.           @performed_battlers.push(battler)
  674.           return battler
  675.         end
  676.       end
  677.  
  678.       #--------------------------------------------------------------------------
  679.       # overwrite method: force_action
  680.       #--------------------------------------------------------------------------
  681.       def self.force_action(battler)
  682.         @action_forced = [] if @action_forced == nil
  683.         @action_forced.push(battler)
  684.         return unless Switch.forced_action_remove
  685.         @action_battlers.delete(battler)
  686.       end
  687.  
  688.       #--------------------------------------------------------------------------
  689.       # overwrite method: action_forced?
  690.       #--------------------------------------------------------------------------
  691.       def self.action_forced?
  692.         @action_forced != nil
  693.       end
  694.  
  695.       #--------------------------------------------------------------------------
  696.       # overwrite method: action_forced_battler
  697.       #--------------------------------------------------------------------------
  698.       def self.action_forced_battler
  699.         @action_forced.shift
  700.       end
  701.  
  702.       #--------------------------------------------------------------------------
  703.       # overwrite method: clear_action_force
  704.       #--------------------------------------------------------------------------
  705.       def self.clear_action_force
  706.         @action_forced = nil if @action_forced.empty?
  707.       end
  708.  
  709.       #--------------------------------------------------------------------------
  710.       # new method: self.init_battle_type
  711.       #--------------------------------------------------------------------------
  712.       def self.init_battle_type
  713.         set_btype($game_system.battle_system)
  714.       end
  715.  
  716.       #--------------------------------------------------------------------------
  717.       # new method: self.set_btype
  718.       #--------------------------------------------------------------------------
  719.       def self.set_btype(btype = :dtb)
  720.         @battle_type = btype
  721.       end
  722.  
  723.       #--------------------------------------------------------------------------
  724.       # new method: self.btype?
  725.       #--------------------------------------------------------------------------
  726.       def self.btype?(btype)
  727.         return @battle_type == btype
  728.       end
  729.  
  730.     end # BattleManager
  731.  
  732.     #==============================================================================
  733.     # ■ Game_System
  734.     #==============================================================================
  735.  
  736.     class Game_System
  737.  
  738.       #--------------------------------------------------------------------------
  739.       # new method: battle_system
  740.       #--------------------------------------------------------------------------
  741.       def battle_system
  742.         if @battle_system.nil?
  743.           return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  744.         else
  745.           return battle_system_corrected(@battle_system)
  746.         end
  747.       end
  748.  
  749.       #--------------------------------------------------------------------------
  750.       # new method: set_battle_system
  751.       #--------------------------------------------------------------------------
  752.       def set_battle_system(type)
  753.         case type
  754.         when :dtb; @battle_system = :dtb
  755.         when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  756.         else;      @battle_system = :dtb
  757.         end
  758.       end
  759.  
  760.       #--------------------------------------------------------------------------
  761.       # new method: battle_system_corrected
  762.       #--------------------------------------------------------------------------
  763.       def battle_system_corrected(type)
  764.         case type
  765.         when :dtb; return :dtb
  766.         when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  767.         else;      return :dtb
  768.         end
  769.       end
  770.  
  771.     end # Game_System
  772.  
  773.     #==============================================================================
  774.     # ■ Sprite_Base
  775.     #==============================================================================
  776.  
  777.     class Sprite_Base < Sprite
  778.  
  779.       #--------------------------------------------------------------------------
  780.       # new method: start_pseudo_animation
  781.       #--------------------------------------------------------------------------
  782.       unless $imported["YEA-CoreEngine"]
  783.       def start_pseudo_animation(animation, mirror = false)
  784.         dispose_animation
  785.         @animation = animation
  786.         return if @animation.nil?
  787.         @ani_mirror = mirror
  788.         set_animation_rate
  789.         @ani_duration = @animation.frame_max * @ani_rate + 1
  790.         @ani_sprites = []
  791.       end
  792.       end # $imported["YEA-CoreEngine"]
  793.  
  794.     end # Sprite_Base
  795.  
  796.     #==============================================================================
  797.     # ■ Sprite_Battler
  798.     #==============================================================================
  799.  
  800.     class Sprite_Battler < Sprite_Base
  801.  
  802.       #--------------------------------------------------------------------------
  803.       # public instance variables
  804.       #--------------------------------------------------------------------------
  805.       attr_accessor :effect_type
  806.       attr_accessor :battler_visible
  807.       attr_accessor :popups
  808.  
  809.       #--------------------------------------------------------------------------
  810.       # alias method: initialize
  811.       #--------------------------------------------------------------------------
  812.       alias sprite_battler_initialize_abe initialize
  813.       def initialize(viewport, battler = nil)
  814.         sprite_battler_initialize_abe(viewport, battler)
  815.         @popups = []
  816.         @popup_flags = []
  817.       end
  818.  
  819.       #--------------------------------------------------------------------------
  820.       # alias method: update_bitmap
  821.       #--------------------------------------------------------------------------
  822.       alias sprite_battler_update_bitmap_abe update_bitmap
  823.       def update_bitmap
  824.         return if @battler.actor? && @battler.battler_name == ""
  825.         sprite_battler_update_bitmap_abe
  826.       end
  827.  
  828.       #--------------------------------------------------------------------------
  829.       # alias method: setup_new_animation
  830.       #--------------------------------------------------------------------------
  831.       unless $imported["YEA-CoreEngine"]
  832.       alias sprite_battler_setup_new_animation_abe setup_new_animation
  833.       def setup_new_animation
  834.         sprite_battler_setup_new_animation_abe
  835.         return if @battler.pseudo_ani_id <= 0
  836.         animation = $data_animations[@battler.pseudo_ani_id]
  837.         mirror = @battler.animation_mirror
  838.         start_pseudo_animation(animation, mirror)
  839.         @battler.pseudo_ani_id = 0
  840.       end
  841.       end # $imported["YEA-CoreEngine"]
  842.  
  843.       #--------------------------------------------------------------------------
  844.       # alias method: setup_new_effect
  845.       #--------------------------------------------------------------------------
  846.       alias sprite_battler_setup_new_effect_abe setup_new_effect
  847.       def setup_new_effect
  848.         sprite_battler_setup_new_effect_abe
  849.         setup_popups
  850.       end
  851.  
  852.       #--------------------------------------------------------------------------
  853.       # new method: setup_popups
  854.       #--------------------------------------------------------------------------
  855.       def setup_popups
  856.         return unless @battler.use_sprite?
  857.         @battler.popups = [] if @battler.popups.nil?
  858.         return if @battler.popups == []
  859.         array = @battler.popups.shift
  860.         create_new_popup(array[0], array[1], array[2])
  861.       end
  862.  
  863.       #--------------------------------------------------------------------------
  864.       # new method: create_new_popup
  865.       #--------------------------------------------------------------------------
  866.       def create_new_popup(value, rules, flags)
  867.         return if @battler == nil
  868.         return if flags & @popup_flags != []
  869.         array = YEA::BATTLE::POPUP_RULES[rules]
  870.         for popup in @popups
  871.           popup.y -= 24
  872.         end
  873.         return unless SceneManager.scene.is_a?(Scene_Battle)
  874.         return if SceneManager.scene.spriteset.nil?
  875.         view = SceneManager.scene.spriteset.viewportPopups
  876.         new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  877.         @popups.push(new_popup)
  878.         @popup_flags.push("weakness") if flags.include?("weakness")
  879.         @popup_flags.push("resistant") if flags.include?("resistant")
  880.         @popup_flags.push("immune") if flags.include?("immune")
  881.         @popup_flags.push("absorbed") if flags.include?("absorbed")
  882.       end
  883.  
  884.       #--------------------------------------------------------------------------
  885.       # alias method: update_effect
  886.       #--------------------------------------------------------------------------
  887.       alias sprite_battler_update_effect_abe update_effect
  888.       def update_effect
  889.         sprite_battler_update_effect_abe
  890.         update_popups
  891.       end
  892.  
  893.       #--------------------------------------------------------------------------
  894.       # new method: update_popups
  895.       #--------------------------------------------------------------------------
  896.       def update_popups
  897.         for popup in @popups
  898.           popup.update
  899.           next unless popup.opacity <= 0
  900.           popup.bitmap.dispose
  901.           popup.dispose
  902.           @popups.delete(popup)
  903.           popup = nil
  904.         end
  905.         @popup_flags = [] if @popups == [] && @popup_flags != []
  906.         return unless SceneManager.scene_is?(Scene_Battle)
  907.         if @current_active_battler != SceneManager.scene.subject
  908.           @current_active_battler = SceneManager.scene.subject
  909.           @popup_flags = []
  910.         end
  911.       end
  912.  
  913.     end # Sprite_Battler
  914.  
  915.     #==============================================================================
  916.     # ■ Sprite_Popup
  917.     #==============================================================================
  918.  
  919.     class Sprite_Popup < Sprite_Base
  920.  
  921.       #--------------------------------------------------------------------------
  922.       # public instance variables
  923.       #--------------------------------------------------------------------------
  924.       attr_accessor :flags
  925.  
  926.       #--------------------------------------------------------------------------
  927.       # initialize
  928.       #--------------------------------------------------------------------------
  929.       def initialize(viewport, battler, value, rules, flags)
  930.         super(viewport)
  931.         @value = value
  932.         @rules = rules
  933.         @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  934.         @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  935.         @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  936.         @flags = flags
  937.         @battler = battler
  938.         create_popup_bitmap
  939.       end
  940.  
  941.       #--------------------------------------------------------------------------
  942.       # create_popup_bitmap
  943.       #--------------------------------------------------------------------------
  944.       def create_popup_bitmap
  945.         rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  946.         bw = Graphics.width
  947.         bw += 48 if @flags.include?("state")
  948.         bh = Font.default_size * 3
  949.         bitmap = Bitmap.new(bw, bh)
  950.         bitmap.font.name = rules_array[8]
  951.         size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  952.         bitmap.font.size = size
  953.         bitmap.font.bold = rules_array[3]
  954.         bitmap.font.italic = rules_array[4]
  955.         if flags.include?("critical")
  956.           crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  957.           bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  958.         else
  959.           bitmap.font.out_color.set(0, 0, 0, 255)
  960.         end
  961.         dx = 0; dy = 0; dw = 0
  962.         dx += 24 if @flags.include?("state")
  963.         dw += 24 if @flags.include?("state")
  964.         if @flags.include?("state") || @flags.include?("buff")
  965.           c_width = bitmap.text_size(@value).width
  966.           icon_bitmap = $game_temp.iconset
  967.           icon_index = flag_state_icon
  968.           rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  969.           bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  970.         end
  971.         bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  972.         bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  973.         self.bitmap = bitmap
  974.         self.x = @battler.screen_x
  975.         self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  976.         self.x -= SceneManager.scene.spriteset.viewport1.ox
  977.         self.y = @battler.screen_y - @battler.sprite.oy/2
  978.         self.y -= @battler.sprite.oy/2 if @battler.actor?
  979.         self.y -= SceneManager.scene.spriteset.viewport1.oy
  980.         self.ox = bw/2; self.oy = bh/2
  981.         self.zoom_x = self.zoom_y = rules_array[0]
  982.         if @flags.include?("no zoom")
  983.           self.zoom_x = self.zoom_y = rules_array[1]
  984.         end
  985.         @target_zoom = rules_array[1]
  986.         @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  987.         self.z = 500
  988.       end
  989.  
  990.       #--------------------------------------------------------------------------
  991.       # update
  992.       #--------------------------------------------------------------------------
  993.       def update
  994.         super
  995.         #---
  996.         if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  997.           @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  998.           @hue_duration -= 1
  999.           self.bitmap.hue_change(15) if @hue_duration <= 0
  1000.         end
  1001.         #---
  1002.         if @zoom_direction == "up"
  1003.           self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  1004.           self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  1005.         else
  1006.           self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  1007.           self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  1008.         end
  1009.         #---
  1010.         @full -= 1
  1011.         return if @full > 0
  1012.         self.y -= 1
  1013.         self.opacity -= @fade
  1014.       end
  1015.  
  1016.       #--------------------------------------------------------------------------
  1017.       # flag_state_icon
  1018.       #--------------------------------------------------------------------------
  1019.       def flag_state_icon
  1020.         for item in @flags; return item if item.is_a?(Integer); end
  1021.         return 0
  1022.       end
  1023.  
  1024.     end # Sprite_Popup
  1025.  
  1026.     #==============================================================================
  1027.     # ■ Spriteset_Battle
  1028.     #==============================================================================
  1029.  
  1030.     class Spriteset_Battle
  1031.  
  1032.       #--------------------------------------------------------------------------
  1033.       # public instance variables
  1034.       #--------------------------------------------------------------------------
  1035.       attr_accessor :actor_sprites
  1036.       attr_accessor :enemy_sprites
  1037.       attr_accessor :viewport1
  1038.       attr_accessor :viewportPopups
  1039.  
  1040.       #--------------------------------------------------------------------------
  1041.       # alias method: create_viewports
  1042.       #--------------------------------------------------------------------------
  1043.       alias spriteset_battle_create_viewports_abe create_viewports
  1044.       def create_viewports
  1045.         spriteset_battle_create_viewports_abe
  1046.         @viewportPopups = Viewport.new
  1047.         @viewportPopups.z = 200
  1048.       end
  1049.  
  1050.       #--------------------------------------------------------------------------
  1051.       # alias method: dispose_viewports
  1052.       #--------------------------------------------------------------------------
  1053.       alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1054.       def dispose_viewports
  1055.         spriteset_battle_dispose_viewports_abe
  1056.         @viewportPopups.dispose
  1057.       end
  1058.  
  1059.       #--------------------------------------------------------------------------
  1060.       # alias method: update_viewports
  1061.       #--------------------------------------------------------------------------
  1062.       alias spriteset_battle_update_viewports_abe update_viewports
  1063.       def update_viewports
  1064.         spriteset_battle_update_viewports_abe
  1065.         @viewportPopups.update
  1066.       end
  1067.  
  1068.     end # Spriteset_Battle
  1069.  
  1070.     #==============================================================================
  1071.     # ■ Game_Temp
  1072.     #==============================================================================
  1073.  
  1074.     class Game_Temp
  1075.  
  1076.       #--------------------------------------------------------------------------
  1077.       # public instance variables
  1078.       #--------------------------------------------------------------------------
  1079.       attr_accessor :battle_aid
  1080.       attr_accessor :evaluating
  1081.       attr_accessor :iconset
  1082.  
  1083.       #--------------------------------------------------------------------------
  1084.       # alias method: initialize
  1085.       #--------------------------------------------------------------------------
  1086.       alias game_temp_initialize_abe initialize
  1087.       def initialize
  1088.         game_temp_initialize_abe
  1089.         @iconset = Cache.system("Iconset")
  1090.       end
  1091.  
  1092.     end # Game_Temp
  1093.  
  1094.     #==============================================================================
  1095.     # ■ Game_Action
  1096.     #==============================================================================
  1097.  
  1098.     class Game_Action
  1099.  
  1100.       #--------------------------------------------------------------------------
  1101.       # overwrite method: speed
  1102.       #--------------------------------------------------------------------------
  1103.       def speed
  1104.         speed = subject.agi
  1105.         speed += item.speed if item
  1106.         speed += subject.atk_speed if attack?
  1107.         return speed
  1108.       end
  1109.  
  1110.       #--------------------------------------------------------------------------
  1111.       # alias method: evaluate_item_with_target
  1112.       #--------------------------------------------------------------------------
  1113.       alias evaluate_item_with_target_abe evaluate_item_with_target
  1114.       def evaluate_item_with_target(target)
  1115.         $game_temp.evaluating = true
  1116.         result = evaluate_item_with_target_abe(target)
  1117.         $game_temp.evaluating = false
  1118.         return result
  1119.       end
  1120.  
  1121.     end # Game_Action
  1122.  
  1123.     #==============================================================================
  1124.     # ■ Game_ActionResult
  1125.     #==============================================================================
  1126.  
  1127.     class Game_ActionResult
  1128.  
  1129.       #--------------------------------------------------------------------------
  1130.       # alias method: clear
  1131.       #--------------------------------------------------------------------------
  1132.       alias game_actionresult_clear_abe clear
  1133.       def clear
  1134.         game_actionresult_clear_abe
  1135.         clear_stored_damage
  1136.       end
  1137.  
  1138.       #--------------------------------------------------------------------------
  1139.       # new method: clear_stored_damage
  1140.       #--------------------------------------------------------------------------
  1141.       def clear_stored_damage
  1142.         @stored_hp_damage = 0
  1143.         @stored_mp_damage = 0
  1144.         @stored_tp_damage = 0
  1145.         @stored_hp_drain = 0
  1146.         @stored_mp_drain = 0
  1147.       end
  1148.  
  1149.       #--------------------------------------------------------------------------
  1150.       # new method: store_damage
  1151.       #--------------------------------------------------------------------------
  1152.       def store_damage
  1153.         @stored_hp_damage += @hp_damage
  1154.         @stored_mp_damage += @mp_damage
  1155.         @stored_tp_damage += @tp_damage
  1156.         @stored_hp_drain += @hp_drain
  1157.         @stored_mp_drain += @mp_drain
  1158.       end
  1159.  
  1160.       #--------------------------------------------------------------------------
  1161.       # new method: restore_damage
  1162.       #--------------------------------------------------------------------------
  1163.       def restore_damage
  1164.         @hp_damage = @stored_hp_damage
  1165.         @mp_damage = @stored_mp_damage
  1166.         @tp_damage = @stored_tp_damage
  1167.         @hp_drain = @stored_hp_drain
  1168.         @mp_drain = @stored_mp_drain
  1169.       end
  1170.  
  1171.     end # Game_ActionResult
  1172.  
  1173.     #==============================================================================
  1174.     # ■ Game_BattlerBase
  1175.     #==============================================================================
  1176.  
  1177.     class Game_BattlerBase
  1178.  
  1179.       #--------------------------------------------------------------------------
  1180.       # public instance variables
  1181.       #--------------------------------------------------------------------------
  1182.       attr_accessor :popups
  1183.  
  1184.       #--------------------------------------------------------------------------
  1185.       # new method: create_popup
  1186.       #--------------------------------------------------------------------------
  1187.       def create_popup(value, rules = "DEFAULT", flags = [])
  1188.         return unless SceneManager.scene_is?(Scene_Battle)
  1189.         return unless YEA::BATTLE::ENABLE_POPUPS
  1190.         return if Switch.hide_popups
  1191.         @popups = [] if @popups.nil?
  1192.         @popups.push([value, rules, flags])
  1193.       end
  1194.  
  1195.       #--------------------------------------------------------------------------
  1196.       # new method: make_damage_popups
  1197.       #--------------------------------------------------------------------------
  1198.       def make_damage_popups(user)
  1199.         if @result.hp_drain != 0
  1200.           text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1201.           rules = "DRAIN"
  1202.           user.create_popup(text, rules)
  1203.           setting = :hp_dmg  if @result.hp_drain < 0
  1204.           setting = :hp_heal if @result.hp_drain > 0
  1205.           rules = "HP_DMG"   if @result.hp_drain < 0
  1206.           rules = "HP_HEAL"  if @result.hp_drain > 0
  1207.           value = @result.hp_drain.abs
  1208.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1209.           user.create_popup(text, rules)
  1210.         end
  1211.         if @result.mp_drain != 0
  1212.           text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1213.           rules = "DRAIN"
  1214.           user.create_popup(text, rules)
  1215.           setting = :mp_dmg  if @result.mp_drain < 0
  1216.           setting = :mp_heal if @result.mp_drain > 0
  1217.           rules = "HP_DMG"   if @result.mp_drain < 0
  1218.           rules = "HP_HEAL"  if @result.mp_drain > 0
  1219.           value = @result.mp_drain.abs
  1220.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1221.           user.create_popup(text, rules)
  1222.         end
  1223.         #---
  1224.         flags = []
  1225.         flags.push("critical") if @result.critical
  1226.         if @result.hp_damage != 0
  1227.           setting = :hp_dmg  if @result.hp_damage > 0
  1228.           setting = :hp_heal if @result.hp_damage < 0
  1229.           rules = "HP_DMG"   if @result.hp_damage > 0
  1230.           rules = "HP_HEAL"  if @result.hp_damage < 0
  1231.           value = @result.hp_damage.abs
  1232.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1233.           create_popup(text, rules, flags)
  1234.         end
  1235.         if @result.mp_damage != 0
  1236.           setting = :mp_dmg  if @result.mp_damage > 0
  1237.           setting = :mp_heal if @result.mp_damage < 0
  1238.           rules = "MP_DMG"   if @result.mp_damage > 0
  1239.           rules = "MP_HEAL"  if @result.mp_damage < 0
  1240.           value = @result.mp_damage.abs
  1241.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1242.           create_popup(text, rules, flags)
  1243.         end
  1244.         if @result.tp_damage != 0
  1245.           setting = :tp_dmg  if @result.tp_damage > 0
  1246.           setting = :tp_heal if @result.tp_damage < 0
  1247.           rules = "TP_DMG"   if @result.tp_damage > 0
  1248.           rules = "TP_HEAL"  if @result.tp_damage < 0
  1249.           value = @result.tp_damage.abs
  1250.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1251.           create_popup(text, rules)
  1252.         end
  1253.         @result.store_damage
  1254.         @result.clear_damage_values
  1255.       end
  1256.  
  1257.       #--------------------------------------------------------------------------
  1258.       # alias method: erase_state
  1259.       #--------------------------------------------------------------------------
  1260.       alias game_battlerbase_erase_state_abe erase_state
  1261.       def erase_state(state_id)
  1262.         make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1263.         game_battlerbase_erase_state_abe(state_id)
  1264.       end
  1265.  
  1266.       #--------------------------------------------------------------------------
  1267.       # new method: make_during_state_popup
  1268.       #--------------------------------------------------------------------------
  1269.       def make_during_state_popup
  1270.         state_id = most_important_state_id
  1271.         return if state_id == 0
  1272.         make_state_popup(state_id, :dur_state)
  1273.       end
  1274.  
  1275.       #--------------------------------------------------------------------------
  1276.       # new method: most_important_state_id
  1277.       #--------------------------------------------------------------------------
  1278.       def most_important_state_id
  1279.         states.each {|state| return state.id unless state.message3.empty? }
  1280.         return 0
  1281.       end
  1282.  
  1283.       #--------------------------------------------------------------------------
  1284.       # new method: make_state_popup
  1285.       #--------------------------------------------------------------------------
  1286.       def make_state_popup(state_id, type)
  1287.         state = $data_states[state_id]
  1288.         return if state.icon_index == 0
  1289.         rules = state.popup_rules[type]
  1290.         return if rules.nil?
  1291.         text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1292.         flags = ["state", state.icon_index]
  1293.         create_popup(text, rules, flags)
  1294.       end
  1295.  
  1296.       #--------------------------------------------------------------------------
  1297.       # new method: make_miss_popups
  1298.       #--------------------------------------------------------------------------
  1299.       def make_miss_popups(user, item)
  1300.         return if dead?
  1301.         if @result.missed
  1302.           text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1303.           rules = "DEFAULT"
  1304.           create_popup(text, rules)
  1305.         end
  1306.         if @result.evaded
  1307.           text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1308.           rules = "DEFAULT"
  1309.           create_popup(text, rules)
  1310.         end
  1311.         if @result.hit? && !@result.success
  1312.           text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1313.           rules = "DEFAULT"
  1314.           create_popup(text, rules)
  1315.         end
  1316.         if @result.hit? && item.damage.to_hp?
  1317.           if @result.hp_damage == 0 && @result.hp_damage == 0
  1318.             text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1319.             rules = "DEFAULT"
  1320.             create_popup(text, rules)
  1321.           end
  1322.         end
  1323.       end
  1324.  
  1325.       #--------------------------------------------------------------------------
  1326.       # new method: make_rate_popup
  1327.       #--------------------------------------------------------------------------
  1328.       def make_rate_popup(rate)
  1329.         return if rate == 1.0
  1330.         flags = []
  1331.         if rate > 1.0
  1332.           text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1333.           rules = "WEAK_ELE"
  1334.           flags.push("weakness")
  1335.         elsif rate == 0.0
  1336.           text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1337.           rules = "IMMU_ELE"
  1338.           flags.push("immune")
  1339.         elsif rate < 0.0
  1340.           text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1341.           rules = "ABSB_ELE"
  1342.           flags.push("absorbed")
  1343.         else
  1344.           text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1345.           rules = "REST_ELE"
  1346.           flags.push("resistant")
  1347.         end
  1348.         create_popup(text, rules, flags)
  1349.       end
  1350.  
  1351.       #--------------------------------------------------------------------------
  1352.       # new method: make_buff_popup
  1353.       #--------------------------------------------------------------------------
  1354.       def make_buff_popup(param_id, positive = true)
  1355.         return unless alive?
  1356.         name = Vocab::param(param_id)
  1357.         if positive
  1358.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1359.           rules = "BUFF"
  1360.           buff_level = 1
  1361.         else
  1362.           text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1363.           rules = "DEBUFF"
  1364.           buff_level = -1
  1365.         end
  1366.         icon = buff_icon_index(buff_level, param_id)
  1367.         flags = ["buff", icon]
  1368.         create_popup(text, rules, flags)
  1369.       end
  1370.  
  1371.     end # Game_BattlerBase
  1372.  
  1373.     #==============================================================================
  1374.     # ■ Game_Battler
  1375.     #==============================================================================
  1376.  
  1377.     class Game_Battler < Game_BattlerBase
  1378.  
  1379.       #--------------------------------------------------------------------------
  1380.       # public instance variables
  1381.       #--------------------------------------------------------------------------
  1382.       attr_accessor :pseudo_ani_id
  1383.  
  1384.       #--------------------------------------------------------------------------
  1385.       # alias method: on_battle_end
  1386.       #--------------------------------------------------------------------------
  1387.       alias game_battler_on_battle_end_abe on_battle_end
  1388.       def on_battle_end
  1389.         game_battler_on_battle_end_abe
  1390.         @popups = []
  1391.       end
  1392.  
  1393.       #--------------------------------------------------------------------------
  1394.       # alias method: clear_sprite_effects
  1395.       #--------------------------------------------------------------------------
  1396.       alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1397.       def clear_sprite_effects
  1398.         game_battler_clear_sprite_effects_abe
  1399.         @pseudo_ani_id = 0
  1400.       end
  1401.  
  1402.       #--------------------------------------------------------------------------
  1403.       # alias method: item_apply
  1404.       #--------------------------------------------------------------------------
  1405.       alias game_battler_item_apply_abe item_apply
  1406.       def item_apply(user, item)
  1407.         game_battler_item_apply_abe(user, item)
  1408.         make_miss_popups(user, item)
  1409.       end
  1410.  
  1411.       #--------------------------------------------------------------------------
  1412.       # alias method: make_damage_value
  1413.       #--------------------------------------------------------------------------
  1414.       alias game_battler_make_damage_value_abe make_damage_value
  1415.       def make_damage_value(user, item)
  1416.         game_battler_make_damage_value_abe(user, item)
  1417.         rate = item_element_rate(user, item)
  1418.         make_rate_popup(rate) unless $game_temp.evaluating
  1419.       end
  1420.  
  1421.       #--------------------------------------------------------------------------
  1422.       # alias method: execute_damage
  1423.       #--------------------------------------------------------------------------
  1424.       alias game_battler_execute_damage_abe execute_damage
  1425.       def execute_damage(user)
  1426.         game_battler_execute_damage_abe(user)
  1427.         make_damage_popups(user)
  1428.       end
  1429.  
  1430.       #--------------------------------------------------------------------------
  1431.       # alias method: item_effect_recover_hp
  1432.       #--------------------------------------------------------------------------
  1433.       alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1434.       def item_effect_recover_hp(user, item, effect)
  1435.         game_battler_item_effect_recover_hp_abe(user, item, effect)
  1436.         make_damage_popups(user)
  1437.       end
  1438.  
  1439.       #--------------------------------------------------------------------------
  1440.       # alias method: item_effect_recover_mp
  1441.       #--------------------------------------------------------------------------
  1442.       alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1443.       def item_effect_recover_mp(user, item, effect)
  1444.         game_battler_item_effect_recover_mp_abe(user, item, effect)
  1445.         make_damage_popups(user)
  1446.       end
  1447.  
  1448.       #--------------------------------------------------------------------------
  1449.       # alias method: item_effect_gain_tp
  1450.       #--------------------------------------------------------------------------
  1451.       alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1452.       def item_effect_gain_tp(user, item, effect)
  1453.         game_battler_item_effect_gain_tp_abe(user, item, effect)
  1454.         make_damage_popups(user)
  1455.       end
  1456.  
  1457.       #--------------------------------------------------------------------------
  1458.       # alias method: item_user_effect
  1459.       #--------------------------------------------------------------------------
  1460.       alias game_battler_item_user_effect_abe item_user_effect
  1461.       def item_user_effect(user, item)
  1462.         game_battler_item_user_effect_abe(user, item)
  1463.         @result.restore_damage
  1464.       end
  1465.  
  1466.       #--------------------------------------------------------------------------
  1467.       # alias method: add_new_state
  1468.       #--------------------------------------------------------------------------
  1469.       alias game_battler_add_new_state_abe add_new_state
  1470.       def add_new_state(state_id)
  1471.         game_battler_add_new_state_abe(state_id)
  1472.         make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1473.       end
  1474.  
  1475.       #--------------------------------------------------------------------------
  1476.       # alias method: add_buff
  1477.       #--------------------------------------------------------------------------
  1478.       alias game_battler_add_buff_abe add_buff
  1479.       def add_buff(param_id, turns)
  1480.         make_buff_popup(param_id, true)
  1481.         game_battler_add_buff_abe(param_id, turns)
  1482.       end
  1483.  
  1484.       #--------------------------------------------------------------------------
  1485.       # alias method: add_debuff
  1486.       #--------------------------------------------------------------------------
  1487.       alias game_battler_add_debuff_abe add_debuff
  1488.       def add_debuff(param_id, turns)
  1489.         make_buff_popup(param_id, false)
  1490.         game_battler_add_debuff_abe(param_id, turns)
  1491.       end
  1492.  
  1493.       #--------------------------------------------------------------------------
  1494.       # alias method: regenerate_all
  1495.       #--------------------------------------------------------------------------
  1496.       alias game_battler_regenerate_all_abe regenerate_all
  1497.       def regenerate_all
  1498.         game_battler_regenerate_all_abe
  1499.         return unless alive?
  1500.         make_damage_popups(self)
  1501.       end
  1502.  
  1503.       #--------------------------------------------------------------------------
  1504.       # new method: can_collapse?
  1505.       #--------------------------------------------------------------------------
  1506.       def can_collapse?
  1507.         return false unless dead?
  1508.         unless actor?
  1509.           return false unless sprite.battler_visible
  1510.           array = [:collapse, :boss_collapse, :instant_collapse]
  1511.           return false if array.include?(sprite.effect_type)
  1512.         end
  1513.         return true
  1514.       end
  1515.  
  1516.       #--------------------------------------------------------------------------
  1517.       # new method: draw_mp?
  1518.       #--------------------------------------------------------------------------
  1519.       def draw_mp?; return true; end
  1520.  
  1521.       #--------------------------------------------------------------------------
  1522.       # new method: draw_tp?
  1523.       #--------------------------------------------------------------------------
  1524.       def draw_tp?
  1525.         return $data_system.opt_display_tp
  1526.       end
  1527.  
  1528.     end # Game_Battler
  1529.  
  1530.     #==============================================================================
  1531.     # ■ Game_Actor
  1532.     #==============================================================================
  1533.  
  1534.     class Game_Actor < Game_Battler
  1535.  
  1536.       #def battler_name
  1537.         #return "Slime"
  1538.       #end
  1539.  
  1540.       #def battler_hue
  1541.         #return 0
  1542.       #end
  1543.  
  1544.       #--------------------------------------------------------------------------
  1545.       # overwrite method: perform_damage_effect
  1546.       #--------------------------------------------------------------------------
  1547.       def perform_damage_effect
  1548.         $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1549.         @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1550.         Sound.play_actor_damage
  1551.       end
  1552.  
  1553.       #--------------------------------------------------------------------------
  1554.       # overwrite method: use_sprite?
  1555.       #--------------------------------------------------------------------------
  1556.       def use_sprite?; return true; end
  1557.  
  1558.       #--------------------------------------------------------------------------
  1559.       # new method: screen_x
  1560.       #--------------------------------------------------------------------------
  1561.       def screen_x
  1562.         return 0 unless SceneManager.scene_is?(Scene_Battle)
  1563.         status_window = SceneManager.scene.status_window
  1564.         return 0 if status_window.nil?
  1565.         item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1566.         ext = SceneManager.scene.info_viewport.ox
  1567.         rect = SceneManager.scene.status_window.item_rect(self.index)
  1568.         constant = 128 + 12
  1569.         return constant + rect.x + item_rect_width / 2 - ext
  1570.       end
  1571.  
  1572.       #--------------------------------------------------------------------------
  1573.       # new method: screen_y
  1574.       #--------------------------------------------------------------------------
  1575.       def screen_y
  1576.         return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1577.         return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1578.         return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  1579.       end
  1580.  
  1581.       #--------------------------------------------------------------------------
  1582.       # new method: screen_z
  1583.       #--------------------------------------------------------------------------
  1584.       def screen_z; return 100; end
  1585.  
  1586.       #--------------------------------------------------------------------------
  1587.       # new method: sprite
  1588.       #--------------------------------------------------------------------------
  1589.       def sprite
  1590.         index = $game_party.battle_members.index(self)
  1591.         return SceneManager.scene.spriteset.actor_sprites[index]
  1592.       end
  1593.  
  1594.       #--------------------------------------------------------------------------
  1595.       # new method: draw_mp?
  1596.       #--------------------------------------------------------------------------
  1597.       def draw_mp?
  1598.         return true unless draw_tp?
  1599.         for skill in skills
  1600.           next unless added_skill_types.include?(skill.stype_id)
  1601.           return true if skill.mp_cost > 0
  1602.         end
  1603.         return false
  1604.       end
  1605.  
  1606.       #--------------------------------------------------------------------------
  1607.       # new method: draw_tp?
  1608.       #--------------------------------------------------------------------------
  1609.       def draw_tp?
  1610.         return false unless $data_system.opt_display_tp
  1611.         for skill in skills
  1612.           next unless added_skill_types.include?(skill.stype_id)
  1613.           return true if skill.tp_cost > 0
  1614.         end
  1615.         return false
  1616.       end
  1617.  
  1618.     end # Game_Actor
  1619.  
  1620.     #==============================================================================
  1621.     # ■ Game_Enemy
  1622.     #==============================================================================
  1623.  
  1624.     class Game_Enemy < Game_Battler
  1625.  
  1626.       #--------------------------------------------------------------------------
  1627.       # overwrite method: perform_damage_effect
  1628.       #--------------------------------------------------------------------------
  1629.       def perform_damage_effect
  1630.         @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1631.         Sound.play_enemy_damage
  1632.       end
  1633.  
  1634.       #--------------------------------------------------------------------------
  1635.       # new methods: attack_animation_id
  1636.       #--------------------------------------------------------------------------
  1637.       def atk_animation_id1; return enemy.atk_animation_id1; end
  1638.       def atk_animation_id2; return enemy.atk_animation_id2; end
  1639.  
  1640.       #--------------------------------------------------------------------------
  1641.       # new method: sprite
  1642.       #--------------------------------------------------------------------------
  1643.       def sprite
  1644.         return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1645.       end
  1646.  
  1647.     end # Game_Enemy
  1648.  
  1649.     #==============================================================================
  1650.     # ■ Game_Unit
  1651.     #==============================================================================
  1652.  
  1653.     class Game_Unit
  1654.  
  1655.       #--------------------------------------------------------------------------
  1656.       # alias method: make_actions
  1657.       #--------------------------------------------------------------------------
  1658.       alias game_unit_make_actions_abe make_actions
  1659.       def make_actions
  1660.         game_unit_make_actions_abe
  1661.         refresh_autobattler_status_window
  1662.       end
  1663.  
  1664.       #--------------------------------------------------------------------------
  1665.       # new method: refresh_autobattler_status_window
  1666.       #--------------------------------------------------------------------------
  1667.       def refresh_autobattler_status_window
  1668.         return unless SceneManager.scene_is?(Scene_Battle)
  1669.         return unless self.is_a?(Game_Party)
  1670.         SceneManager.scene.refresh_autobattler_status_window
  1671.       end
  1672.  
  1673.     end # Game_Unit
  1674.  
  1675.     #==============================================================================
  1676.     # ■ Window_PartyCommand
  1677.     #==============================================================================
  1678.  
  1679.     class Window_PartyCommand < Window_Command
  1680.  
  1681.       #--------------------------------------------------------------------------
  1682.       # overwrite method: process_handling
  1683.       #--------------------------------------------------------------------------
  1684.       def process_handling
  1685.         return unless open? && active
  1686.         return process_dir6 if Input.repeat?(:RIGHT)
  1687.         return super
  1688.       end
  1689.  
  1690.       #--------------------------------------------------------------------------
  1691.       # new method: process_dir6
  1692.       #--------------------------------------------------------------------------
  1693.       def process_dir6
  1694.         Sound.play_cursor
  1695.         Input.update
  1696.         deactivate
  1697.         call_handler(:dir6)
  1698.       end
  1699.  
  1700.     end # Window_PartyCommand
  1701.  
  1702.     #==============================================================================
  1703.     # ■ Window_ActorCommand
  1704.     #==============================================================================
  1705.  
  1706.     class Window_ActorCommand < Window_Command
  1707.  
  1708.       #--------------------------------------------------------------------------
  1709.       # overwrite method: process_handling
  1710.       #--------------------------------------------------------------------------
  1711.       def process_handling
  1712.         return unless open? && active
  1713.         return process_dir4 if Input.repeat?(:LEFT)
  1714.         return process_dir6 if Input.repeat?(:RIGHT)
  1715.         return super
  1716.       end
  1717.  
  1718.       #--------------------------------------------------------------------------
  1719.       # new method: process_dir4
  1720.       #--------------------------------------------------------------------------
  1721.       def process_dir4
  1722.         Sound.play_cursor
  1723.         Input.update
  1724.         deactivate
  1725.         call_handler(:cancel)
  1726.       end
  1727.  
  1728.       #--------------------------------------------------------------------------
  1729.       # new method: process_dir6
  1730.       #--------------------------------------------------------------------------
  1731.       def process_dir6
  1732.         Sound.play_cursor
  1733.         Input.update
  1734.         deactivate
  1735.         call_handler(:dir6)
  1736.       end
  1737.  
  1738.     end # Window_ActorCommand
  1739.  
  1740.     #==============================================================================
  1741.     # ■ Window_BattleStatus
  1742.     #==============================================================================
  1743.  
  1744.     class Window_BattleStatus < Window_Selectable
  1745.  
  1746.       #--------------------------------------------------------------------------
  1747.       # overwrite method: initialize
  1748.       #--------------------------------------------------------------------------
  1749.       def initialize
  1750.         super(0, 0, window_width, window_height)
  1751.         self.openness = 0
  1752.         @party = $game_party.battle_members.clone
  1753.       end
  1754.  
  1755.       #--------------------------------------------------------------------------
  1756.       # overwrite method: col_max
  1757.       #--------------------------------------------------------------------------
  1758.       def col_max; return $game_party.max_battle_members; end
  1759.  
  1760.       #--------------------------------------------------------------------------
  1761.       # new method: battle_members
  1762.       #--------------------------------------------------------------------------
  1763.       def battle_members; return $game_party.battle_members; end
  1764.  
  1765.       #--------------------------------------------------------------------------
  1766.       # new method: actor
  1767.       #--------------------------------------------------------------------------
  1768.       def actor; return battle_members[@index]; end
  1769.  
  1770.       #--------------------------------------------------------------------------
  1771.       # overwrite method: update
  1772.       #--------------------------------------------------------------------------
  1773.       def update
  1774.         super
  1775.         return if @party == $game_party.battle_members
  1776.         @party = $game_party.battle_members.clone
  1777.         refresh
  1778.       end
  1779.  
  1780.       #--------------------------------------------------------------------------
  1781.       # overwrite method: draw_item
  1782.       #--------------------------------------------------------------------------
  1783.       def draw_item(index)
  1784.         return if index.nil?
  1785.         clear_item(index)
  1786.         actor = battle_members[index]
  1787.         rect = item_rect(index)
  1788.         return if actor.nil?
  1789.         draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1790.         draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1791.         draw_actor_action(actor, rect.x, rect.y)
  1792.         draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1793.         gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1794.         contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1795.         draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1796.         if draw_tp?(actor) && draw_mp?(actor)
  1797.           dw = rect.width/2-2
  1798.           dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1799.           draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1800.           dw = rect.width - rect.width/2 - 2
  1801.           draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1802.         elsif draw_tp?(actor) && !draw_mp?(actor)
  1803.           draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1804.         else
  1805.           draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1806.         end
  1807.       end
  1808.  
  1809.       #--------------------------------------------------------------------------
  1810.       # overwrite method: item_rect
  1811.       #--------------------------------------------------------------------------
  1812.       def item_rect(index)
  1813.         rect = Rect.new
  1814.         rect.width = contents.width / $game_party.max_battle_members
  1815.         rect.height = contents.height
  1816.         rect.x = index * rect.width
  1817.         if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1818.           rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1819.         end
  1820.         rect.y = 0
  1821.         return rect
  1822.       end
  1823.  
  1824.       #--------------------------------------------------------------------------
  1825.       # overwrite method: draw_face
  1826.       #--------------------------------------------------------------------------
  1827.       def draw_face(face_name, face_index, dx, dy, enabled = true)
  1828.         bitmap = Cache.face(face_name)
  1829.         fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1830.         fy = face_index / 4 * 96 + 2
  1831.         fw = [item_rect(0).width - 4, 92].min
  1832.         rect = Rect.new(fx, fy, fw, 92)
  1833.         rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1834.         contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1835.         bitmap.dispose
  1836.       end
  1837.  
  1838.       #--------------------------------------------------------------------------
  1839.       # overwrite method: draw_actor_name
  1840.       #--------------------------------------------------------------------------
  1841.       def draw_actor_name(actor, dx, dy, dw = 112)
  1842.         reset_font_settings
  1843.         contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1844.         change_color(hp_color(actor))
  1845.         draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1846.       end
  1847.  
  1848.       #--------------------------------------------------------------------------
  1849.       # new method: draw_actor_action
  1850.       #--------------------------------------------------------------------------
  1851.       def draw_actor_action(actor, dx, dy)
  1852.         draw_icon(action_icon(actor), dx, dy)
  1853.       end
  1854.  
  1855.       #--------------------------------------------------------------------------
  1856.       # new method: action_icon
  1857.       #--------------------------------------------------------------------------
  1858.       def action_icon(actor)
  1859.         return Icon.no_action if actor.current_action.nil?
  1860.         return Icon.no_action if actor.current_action.item.nil?
  1861.         return actor.current_action.item.icon_index
  1862.       end
  1863.  
  1864.       #--------------------------------------------------------------------------
  1865.       # new method: draw_tp?
  1866.       #--------------------------------------------------------------------------
  1867.       def draw_tp?(actor)
  1868.         return actor.draw_tp?
  1869.       end
  1870.  
  1871.       #--------------------------------------------------------------------------
  1872.       # new method: draw_mp?
  1873.       #--------------------------------------------------------------------------
  1874.       def draw_mp?(actor)
  1875.         return actor.draw_mp?
  1876.       end
  1877.  
  1878.       #--------------------------------------------------------------------------
  1879.       # overwrite method: draw_current_and_max_values
  1880.       #--------------------------------------------------------------------------
  1881.       def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1882.         change_color(color1)
  1883.         draw_text(dx, dy, dw, line_height, current.group, 2)
  1884.       end
  1885.  
  1886.       #--------------------------------------------------------------------------
  1887.       # overwrite method: draw_actor_hp
  1888.       #--------------------------------------------------------------------------
  1889.       def draw_actor_hp(actor, dx, dy, width = 124)
  1890.         draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1891.         change_color(system_color)
  1892.         cy = (Font.default_size - contents.font.size) / 2 + 1
  1893.         draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1894.         draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1895.           hp_color(actor), normal_color)
  1896.         end
  1897.  
  1898.       #--------------------------------------------------------------------------
  1899.       # overwrite method: draw_actor_mp
  1900.       #--------------------------------------------------------------------------
  1901.       def draw_actor_mp(actor, dx, dy, width = 124)
  1902.         draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1903.         change_color(system_color)
  1904.         cy = (Font.default_size - contents.font.size) / 2 + 1
  1905.         draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1906.         draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1907.           mp_color(actor), normal_color)
  1908.         end
  1909.  
  1910.       #--------------------------------------------------------------------------
  1911.       # overwrite method: draw_actor_tp
  1912.       #--------------------------------------------------------------------------
  1913.       def draw_actor_tp(actor, dx, dy, width = 124)
  1914.         draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1915.         change_color(system_color)
  1916.         cy = (Font.default_size - contents.font.size) / 2 + 1
  1917.         draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1918.         change_color(tp_color(actor))
  1919.         draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1920.       end
  1921.  
  1922.     end # Window_BattleStatus
  1923.  
  1924.     #==============================================================================
  1925.     # ■ Window_BattleActor
  1926.     #==============================================================================
  1927.  
  1928.     class Window_BattleActor < Window_BattleStatus
  1929.  
  1930.       #--------------------------------------------------------------------------
  1931.       # overwrite method: show
  1932.       #--------------------------------------------------------------------------
  1933.       def show
  1934.         create_flags
  1935.         super
  1936.       end
  1937.  
  1938.       #--------------------------------------------------------------------------
  1939.       # new method: create_flags
  1940.       #--------------------------------------------------------------------------
  1941.       def create_flags
  1942.         set_select_flag(:any)
  1943.         select(0)
  1944.         return if $game_temp.battle_aid.nil?
  1945.         if $game_temp.battle_aid.need_selection?
  1946.           select(0)
  1947.           set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1948.         elsif $game_temp.battle_aid.for_user?
  1949.           battler = BattleManager.actor
  1950.           id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1951.           select(id)
  1952.           set_select_flag(:user)
  1953.         elsif $game_temp.battle_aid.for_all?
  1954.           select(0)
  1955.           set_select_flag(:all)
  1956.           set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1957.         elsif $game_temp.battle_aid.for_random?
  1958.           select(0)
  1959.           set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1960.         end
  1961.       end
  1962.  
  1963.       #--------------------------------------------------------------------------
  1964.       # new method: set_flag
  1965.       #--------------------------------------------------------------------------
  1966.       def set_select_flag(flag)
  1967.         @select_flag = flag
  1968.         case @select_flag
  1969.         when :all, :all_dead, :random
  1970.           @cursor_all = true
  1971.         else
  1972.           @cursor_all = false
  1973.         end
  1974.       end
  1975.  
  1976.       #--------------------------------------------------------------------------
  1977.       # overwrite method: update_cursor
  1978.       #--------------------------------------------------------------------------
  1979.       def update_cursor
  1980.         if @cursor_all
  1981.           cursor_rect.set(0, 0, contents.width, contents.height)
  1982.           self.top_row = 0
  1983.         elsif @index < 0
  1984.           cursor_rect.empty
  1985.         else
  1986.           ensure_cursor_visible
  1987.           cursor_rect.set(item_rect(@index))
  1988.         end
  1989.       end
  1990.  
  1991.       #--------------------------------------------------------------------------
  1992.       # overwrite method: cursor_movable?
  1993.       #--------------------------------------------------------------------------
  1994.       def cursor_movable?
  1995.         return false if @select_flag == :user
  1996.         return super
  1997.       end
  1998.  
  1999.       #--------------------------------------------------------------------------
  2000.       # overwrite method: current_item_enabled?
  2001.       #--------------------------------------------------------------------------
  2002.       def current_item_enabled?
  2003.         return true if $game_temp.battle_aid.nil?
  2004.         if $game_temp.battle_aid.need_selection?
  2005.           member = $game_party.battle_members[@index]
  2006.           return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2007.         elsif $game_temp.battle_aid.for_dead_friend?
  2008.           for member in $game_party.battle_members
  2009.             return true if member.dead?
  2010.           end
  2011.           return false
  2012.         end
  2013.         return true
  2014.       end
  2015.  
  2016.     end # Window_BattleActor
  2017.  
  2018.     #==============================================================================
  2019.     # ■ Window_BattleStatusAid
  2020.     #==============================================================================
  2021.  
  2022.     class Window_BattleStatusAid < Window_BattleStatus
  2023.  
  2024.       #--------------------------------------------------------------------------
  2025.       # public instance variables
  2026.       #--------------------------------------------------------------------------
  2027.       attr_accessor :status_window
  2028.  
  2029.       #--------------------------------------------------------------------------
  2030.       # overwrite method: initialize
  2031.       #--------------------------------------------------------------------------
  2032.       def initialize
  2033.         super
  2034.         self.visible = false
  2035.         self.openness = 255
  2036.       end
  2037.  
  2038.       #--------------------------------------------------------------------------
  2039.       # overwrite method: window_width
  2040.       #--------------------------------------------------------------------------
  2041.       def window_width; return 128; end
  2042.  
  2043.       #--------------------------------------------------------------------------
  2044.       # overwrite method: show
  2045.       #--------------------------------------------------------------------------
  2046.       def show
  2047.         super
  2048.         refresh
  2049.       end
  2050.  
  2051.       #--------------------------------------------------------------------------
  2052.       # overwrite method: refresh
  2053.       #--------------------------------------------------------------------------
  2054.       def refresh
  2055.         contents.clear
  2056.         return if @status_window.nil?
  2057.         draw_item(@status_window.index)
  2058.       end
  2059.  
  2060.       #--------------------------------------------------------------------------
  2061.       # overwrite method: item_rect
  2062.       #--------------------------------------------------------------------------
  2063.       def item_rect(index)
  2064.         return Rect.new(0, 0, contents.width, contents.height)
  2065.       end
  2066.  
  2067.     end # Window_BattleStatusAid
  2068.  
  2069.     #==============================================================================
  2070.     # ■ Window_BattleEnemy
  2071.     #==============================================================================
  2072.  
  2073.     class Window_BattleEnemy < Window_Selectable
  2074.  
  2075.       #--------------------------------------------------------------------------
  2076.       # overwrite method: initialize
  2077.       #--------------------------------------------------------------------------
  2078.       def initialize(info_viewport)
  2079.         super(0, Graphics.height, window_width, fitting_height(1))
  2080.         refresh
  2081.         self.visible = false
  2082.         @info_viewport = info_viewport
  2083.       end
  2084.  
  2085.       #--------------------------------------------------------------------------
  2086.       # overwrite method: col_max
  2087.       #--------------------------------------------------------------------------
  2088.       def col_max; return item_max; end
  2089.  
  2090.       #--------------------------------------------------------------------------
  2091.       # overwrite method: show
  2092.       #--------------------------------------------------------------------------
  2093.       def show
  2094.         create_flags
  2095.         super
  2096.       end
  2097.  
  2098.       #--------------------------------------------------------------------------
  2099.       # new method: create_flags
  2100.       #--------------------------------------------------------------------------
  2101.       def create_flags
  2102.         set_select_flag(:any)
  2103.         select(0)
  2104.         return if $game_temp.battle_aid.nil?
  2105.         if $game_temp.battle_aid.need_selection?
  2106.           select(0)
  2107.         elsif $game_temp.battle_aid.for_all?
  2108.           select(0)
  2109.           set_select_flag(:all)
  2110.         elsif $game_temp.battle_aid.for_random?
  2111.           select(0)
  2112.           set_select_flag(:random)
  2113.         end
  2114.       end
  2115.  
  2116.       #--------------------------------------------------------------------------
  2117.       # new method: set_flag
  2118.       #--------------------------------------------------------------------------
  2119.       def set_select_flag(flag)
  2120.         @select_flag = flag
  2121.         case @select_flag
  2122.         when :all, :random
  2123.           @cursor_all = true
  2124.         else
  2125.           @cursor_all = false
  2126.         end
  2127.       end
  2128.  
  2129.       #--------------------------------------------------------------------------
  2130.       # new method: select_all?
  2131.       #--------------------------------------------------------------------------
  2132.       def select_all?
  2133.         return true if @select_flag == :all
  2134.         return true if @select_flag == :random
  2135.         return false
  2136.       end
  2137.  
  2138.       #--------------------------------------------------------------------------
  2139.       # overwrite method: update_cursor
  2140.       #--------------------------------------------------------------------------
  2141.       def update_cursor
  2142.         if @cursor_all
  2143.           cursor_rect.set(0, 0, contents.width, contents.height)
  2144.           self.top_row = 0
  2145.         elsif @index < 0
  2146.           cursor_rect.empty
  2147.         else
  2148.           ensure_cursor_visible
  2149.           cursor_rect.set(item_rect(@index))
  2150.         end
  2151.       end
  2152.  
  2153.       #--------------------------------------------------------------------------
  2154.       # overwrite method: cursor_movable?
  2155.       #--------------------------------------------------------------------------
  2156.       def cursor_movable?
  2157.         return false if @select_flag == :user
  2158.         return super
  2159.       end
  2160.  
  2161.       #--------------------------------------------------------------------------
  2162.       # overwrite method: current_item_enabled?
  2163.       #--------------------------------------------------------------------------
  2164.       def current_item_enabled?
  2165.         return true if $game_temp.battle_aid.nil?
  2166.         if $game_temp.battle_aid.need_selection?
  2167.           member = $game_party.battle_members[@index]
  2168.           return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2169.         elsif $game_temp.battle_aid.for_dead_friend?
  2170.           for member in $game_party.battle_members
  2171.             return true if member.dead?
  2172.           end
  2173.           return false
  2174.         end
  2175.         return true
  2176.       end
  2177.  
  2178.       #--------------------------------------------------------------------------
  2179.       # overwrite method: enemy
  2180.       #--------------------------------------------------------------------------
  2181.       def enemy; @data[index]; end
  2182.  
  2183.       #--------------------------------------------------------------------------
  2184.       # overwrite method: refresh
  2185.       #--------------------------------------------------------------------------
  2186.       def refresh
  2187.         make_item_list
  2188.         create_contents
  2189.         draw_all_items
  2190.       end
  2191.  
  2192.       #--------------------------------------------------------------------------
  2193.       # overwrite method: make_item_list
  2194.       #--------------------------------------------------------------------------
  2195.       def make_item_list
  2196.         @data = $game_troop.alive_members
  2197.         @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2198.       end
  2199.  
  2200.       #--------------------------------------------------------------------------
  2201.       # overwrite method: draw_item
  2202.       #--------------------------------------------------------------------------
  2203.       def draw_item(index); return; end
  2204.  
  2205.       #--------------------------------------------------------------------------
  2206.       # overwrite method: update
  2207.       #--------------------------------------------------------------------------
  2208.       def update
  2209.         super
  2210.         return unless active
  2211.         enemy.sprite_effect_type = :whiten
  2212.         return unless select_all?
  2213.         for enemy in $game_troop.alive_members
  2214.           enemy.sprite_effect_type = :whiten
  2215.         end
  2216.       end
  2217.  
  2218.     end # Window_BattleEnemy
  2219.  
  2220.     #==============================================================================
  2221.     # ■ Window_BattleHelp
  2222.     #==============================================================================
  2223.  
  2224.     class Window_BattleHelp < Window_Help
  2225.  
  2226.       #--------------------------------------------------------------------------
  2227.       # public instance variables
  2228.       #--------------------------------------------------------------------------
  2229.       attr_accessor :actor_window
  2230.       attr_accessor :enemy_window
  2231.  
  2232.       #--------------------------------------------------------------------------
  2233.       # update
  2234.       #--------------------------------------------------------------------------
  2235.       def update
  2236.         super
  2237.         if !self.visible and @text != ""
  2238.           @text = ""
  2239.           return refresh
  2240.         end
  2241.         update_battler_name
  2242.       end
  2243.  
  2244.       #--------------------------------------------------------------------------
  2245.       # update_battler_name
  2246.       #--------------------------------------------------------------------------
  2247.       def update_battler_name
  2248.         return unless @actor_window.active || @enemy_window.active
  2249.         if @actor_window.active
  2250.           battler = $game_party.battle_members[@actor_window.index]
  2251.         elsif @enemy_window.active
  2252.           battler = @enemy_window.enemy
  2253.         end
  2254.         if special_display?
  2255.           refresh_special_case(battler)
  2256.         else
  2257.           refresh_battler_name(battler) if battler_name(battler) != @text
  2258.         end
  2259.       end
  2260.  
  2261.       #--------------------------------------------------------------------------
  2262.       # battler_name
  2263.       #--------------------------------------------------------------------------
  2264.       def battler_name(battler)
  2265.         text = battler.name.clone
  2266.         return text
  2267.       end
  2268.  
  2269.       #--------------------------------------------------------------------------
  2270.       # refresh_battler_name
  2271.       #--------------------------------------------------------------------------
  2272.       def refresh_battler_name(battler)
  2273.         contents.clear
  2274.         reset_font_settings
  2275.         change_color(normal_color)
  2276.         @text = battler_name(battler)
  2277.         icons = battler.state_icons + battler.buff_icons
  2278.         dy = icons.size <= 0 ? line_height / 2 : 0
  2279.         draw_text(0, dy, contents.width, line_height, @text, 1)
  2280.         dx = (contents.width - (icons.size * 24)) / 2
  2281.         draw_actor_icons(battler, dx, line_height, contents.width)
  2282.       end
  2283.  
  2284.       #--------------------------------------------------------------------------
  2285.       # special_display?
  2286.       #--------------------------------------------------------------------------
  2287.       def special_display?
  2288.         return false if $game_temp.battle_aid.nil?
  2289.         return false if $game_temp.battle_aid.for_user?
  2290.         return !$game_temp.battle_aid.need_selection?
  2291.       end
  2292.  
  2293.       #--------------------------------------------------------------------------
  2294.       # refresh_special_case
  2295.       #--------------------------------------------------------------------------
  2296.       def refresh_special_case(battler)
  2297.         if $game_temp.battle_aid.for_opponent?
  2298.           if $game_temp.battle_aid.for_all?
  2299.             text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2300.           else
  2301.             case $game_temp.battle_aid.number_of_targets
  2302.             when 1
  2303.               text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2304.             else
  2305.               number = $game_temp.battle_aid.number_of_targets
  2306.               text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2307.             end
  2308.           end
  2309.         else # $game_temp.battle_aid.for_friend?
  2310.           if $game_temp.battle_aid.for_dead_friend?
  2311.             text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2312.           elsif $game_temp.battle_aid.for_random?
  2313.             case $game_temp.battle_aid.number_of_targets
  2314.             when 1
  2315.               text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2316.             else
  2317.               number = $game_temp.battle_aid.number_of_targets
  2318.               text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2319.             end
  2320.           else
  2321.             text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2322.           end
  2323.         end
  2324.         return if text == @text
  2325.         @text = text
  2326.         contents.clear
  2327.         reset_font_settings
  2328.         draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2329.       end
  2330.  
  2331.     end # Window_BattleHelp
  2332.  
  2333.     #==============================================================================
  2334.     # ■ Window_BattleLog
  2335.     #==============================================================================
  2336.  
  2337.     class Window_BattleLog < Window_Selectable
  2338.  
  2339.       #--------------------------------------------------------------------------
  2340.       # alias method: display_current_state
  2341.       #--------------------------------------------------------------------------
  2342.       alias window_battlelog_display_current_state_abe display_current_state
  2343.       def display_current_state(subject)
  2344.         subject.make_during_state_popup
  2345.         return unless YEA::BATTLE::MSG_CURRENT_STATE
  2346.         window_battlelog_display_current_state_abe(subject)
  2347.       end
  2348.  
  2349.       #--------------------------------------------------------------------------
  2350.       # alias method: display_use_item
  2351.       #--------------------------------------------------------------------------
  2352.       alias window_battlelog_display_use_item_abe display_use_item
  2353.       def display_use_item(subject, item)
  2354.         return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2355.         window_battlelog_display_use_item_abe(subject, item)
  2356.       end
  2357.  
  2358.       #--------------------------------------------------------------------------
  2359.       # alias method: display_counter
  2360.       #--------------------------------------------------------------------------
  2361.       alias window_battlelog_display_counter_abe display_counter
  2362.       def display_counter(target, item)
  2363.         if YEA::BATTLE::MSG_COUNTERATTACK
  2364.           window_battlelog_display_counter_abe(target, item)
  2365.         else
  2366.           Sound.play_evasion
  2367.         end
  2368.       end
  2369.  
  2370.       #--------------------------------------------------------------------------
  2371.       # alias method: display_reflection
  2372.       #--------------------------------------------------------------------------
  2373.       alias window_battlelog_display_reflection_abe display_reflection
  2374.       def display_reflection(target, item)
  2375.         if YEA::BATTLE::MSG_REFLECT_MAGIC
  2376.           window_battlelog_display_reflection_abe(target, item)
  2377.         else
  2378.           Sound.play_reflection
  2379.         end
  2380.       end
  2381.  
  2382.       #--------------------------------------------------------------------------
  2383.       # alias method: display_substitute
  2384.       #--------------------------------------------------------------------------
  2385.       alias window_battlelog_display_substitute_abe display_substitute
  2386.       def display_substitute(substitute, target)
  2387.         return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2388.         window_battlelog_display_substitute_abe(substitute, target)
  2389.       end
  2390.  
  2391.       #--------------------------------------------------------------------------
  2392.       # alias method: display_failure
  2393.       #--------------------------------------------------------------------------
  2394.       alias window_battlelog_display_failure_abe display_failure
  2395.       def display_failure(target, item)
  2396.         return unless YEA::BATTLE::MSG_FAILURE_HIT
  2397.         window_battlelog_display_failure_abe(target, item)
  2398.       end
  2399.  
  2400.       #--------------------------------------------------------------------------
  2401.       # alias method: display_critical
  2402.       #--------------------------------------------------------------------------
  2403.       alias window_battlelog_display_critical_abe display_critical
  2404.       def display_critical(target, item)
  2405.         return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2406.         window_battlelog_display_critical_abe(target, item)
  2407.       end
  2408.  
  2409.       #--------------------------------------------------------------------------
  2410.       # alias method: display_miss
  2411.       #--------------------------------------------------------------------------
  2412.       alias window_battlelog_display_miss_abe display_miss
  2413.       def display_miss(target, item)
  2414.         return unless YEA::BATTLE::MSG_HIT_MISSED
  2415.         window_battlelog_display_miss_abe(target, item)
  2416.       end
  2417.  
  2418.       #--------------------------------------------------------------------------
  2419.       # alias method: display_evasion
  2420.       #--------------------------------------------------------------------------
  2421.       alias window_battlelog_display_evasion_abe display_evasion
  2422.       def display_evasion(target, item)
  2423.         if YEA::BATTLE::MSG_EVASION
  2424.           window_battlelog_display_evasion_abe(target, item)
  2425.         else
  2426.           if !item || item.physical?
  2427.             Sound.play_evasion
  2428.           else
  2429.             Sound.play_magic_evasion
  2430.           end
  2431.         end
  2432.       end
  2433.  
  2434.       #--------------------------------------------------------------------------
  2435.       # overwrite method: display_hp_damage
  2436.       #--------------------------------------------------------------------------
  2437.       def display_hp_damage(target, item)
  2438.         return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2439.         if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2440.           target.perform_damage_effect
  2441.         end
  2442.         Sound.play_recovery if target.result.hp_damage < 0
  2443.         return unless YEA::BATTLE::MSG_HP_DAMAGE
  2444.         add_text(target.result.hp_damage_text)
  2445.         wait
  2446.       end
  2447.  
  2448.       #--------------------------------------------------------------------------
  2449.       # overwrite method: display_mp_damage
  2450.       #--------------------------------------------------------------------------
  2451.       def display_mp_damage(target, item)
  2452.         return if target.dead? || target.result.mp_damage == 0
  2453.         Sound.play_recovery if target.result.mp_damage < 0
  2454.         return unless YEA::BATTLE::MSG_MP_DAMAGE
  2455.         add_text(target.result.mp_damage_text)
  2456.         wait
  2457.       end
  2458.  
  2459.       #--------------------------------------------------------------------------
  2460.       # overwrite method: display_tp_damage
  2461.       #--------------------------------------------------------------------------
  2462.       def display_tp_damage(target, item)
  2463.         return if target.dead? || target.result.tp_damage == 0
  2464.         Sound.play_recovery if target.result.tp_damage < 0
  2465.         return unless YEA::BATTLE::MSG_TP_DAMAGE
  2466.         add_text(target.result.tp_damage_text)
  2467.         wait
  2468.       end
  2469.  
  2470.       #--------------------------------------------------------------------------
  2471.       # alias method: display_added_states
  2472.       #--------------------------------------------------------------------------
  2473.       alias window_battlelog_display_added_states_abe display_added_states
  2474.       def display_added_states(target)
  2475.         return unless YEA::BATTLE::MSG_ADDED_STATES
  2476.         window_battlelog_display_added_states_abe(target)
  2477.       end
  2478.  
  2479.       #--------------------------------------------------------------------------
  2480.       # alias method: display_removed_states
  2481.       #--------------------------------------------------------------------------
  2482.       alias window_battlelog_display_removed_states_abe display_removed_states
  2483.       def display_removed_states(target)
  2484.         return unless YEA::BATTLE::MSG_REMOVED_STATES
  2485.         window_battlelog_display_removed_states_abe(target)
  2486.       end
  2487.  
  2488.       #--------------------------------------------------------------------------
  2489.       # alias method: display_changed_buffs
  2490.       #--------------------------------------------------------------------------
  2491.       alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2492.       def display_changed_buffs(target)
  2493.         return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2494.         window_battlelog_display_changed_buffs_abe(target)
  2495.       end
  2496.  
  2497.     end # Window_BattleLog
  2498.  
  2499.     #==============================================================================
  2500.     # ■ Window_SkillList
  2501.     #==============================================================================
  2502.  
  2503.     class Window_SkillList < Window_Selectable
  2504.  
  2505.       #--------------------------------------------------------------------------
  2506.       # overwrite method: spacing
  2507.       #--------------------------------------------------------------------------
  2508.       def spacing
  2509.         return 8 if $game_party.in_battle
  2510.         return super
  2511.       end
  2512.  
  2513.     end # Window_SkillList
  2514.  
  2515.     #==============================================================================
  2516.     # ■ Window_ItemList
  2517.     #==============================================================================
  2518.  
  2519.     class Window_ItemList < Window_Selectable
  2520.  
  2521.       #--------------------------------------------------------------------------
  2522.       # overwrite method: spacing
  2523.       #--------------------------------------------------------------------------
  2524.       def spacing
  2525.         return 8 if $game_party.in_battle
  2526.         return super
  2527.       end
  2528.  
  2529.     end # Window_ItemList
  2530.  
  2531.     #==============================================================================
  2532.     # ■ Scene_Battle
  2533.     #==============================================================================
  2534.  
  2535.     class Scene_Battle < Scene_Base
  2536.  
  2537.       #--------------------------------------------------------------------------
  2538.       # public instance variables
  2539.       #--------------------------------------------------------------------------
  2540.       attr_accessor :enemy_window
  2541.       attr_accessor :info_viewport
  2542.       attr_accessor :spriteset
  2543.       attr_accessor :status_window
  2544.       attr_accessor :status_aid_window
  2545.       attr_accessor :subject
  2546.  
  2547.       #--------------------------------------------------------------------------
  2548.       # alias method: create_spriteset
  2549.       #--------------------------------------------------------------------------
  2550.       alias scene_battle_create_spriteset_abe create_spriteset
  2551.       def create_spriteset
  2552.         BattleManager.init_battle_type
  2553.         scene_battle_create_spriteset_abe
  2554.       end
  2555.  
  2556.       #--------------------------------------------------------------------------
  2557.       # alias method: update_basic
  2558.       #--------------------------------------------------------------------------
  2559.       alias scene_battle_update_basic_abe update_basic
  2560.       def update_basic
  2561.         scene_battle_update_basic_abe
  2562.         update_debug
  2563.       end
  2564.  
  2565.       #--------------------------------------------------------------------------
  2566.       # new method: update_debug
  2567.       #--------------------------------------------------------------------------
  2568.       def update_debug
  2569.         return unless $TEST || $BTEST
  2570.         debug_heal_party if Input.trigger?(:F5)
  2571.         debug_damage_party if Input.trigger?(:F6)
  2572.         debug_fill_tp if Input.trigger?(:F7)
  2573.         debug_kill_all if Input.trigger?(:F8)
  2574.       end
  2575.  
  2576.       #--------------------------------------------------------------------------
  2577.       # new method: debug_heal_party
  2578.       #--------------------------------------------------------------------------
  2579.       def debug_heal_party
  2580.         Sound.play_recovery
  2581.         for member in $game_party.battle_members
  2582.           member.recover_all
  2583.         end
  2584.         @status_window.refresh
  2585.       end
  2586.  
  2587.       #--------------------------------------------------------------------------
  2588.       # new method: debug_damage_party
  2589.       #--------------------------------------------------------------------------
  2590.       def debug_damage_party
  2591.         Sound.play_actor_damage
  2592.         for member in $game_party.alive_members
  2593.           member.hp = 1
  2594.           member.mp = 0
  2595.           member.tp = 0
  2596.         end
  2597.         @status_window.refresh
  2598.       end
  2599.  
  2600.       #--------------------------------------------------------------------------
  2601.       # new method: debug_fill_tp
  2602.       #--------------------------------------------------------------------------
  2603.       def debug_fill_tp
  2604.         Sound.play_recovery
  2605.         for member in $game_party.alive_members
  2606.           member.tp = member.max_tp
  2607.         end
  2608.         @status_window.refresh
  2609.       end
  2610.  
  2611.       #--------------------------------------------------------------------------
  2612.       # new method: debug_kill_all
  2613.       #--------------------------------------------------------------------------
  2614.       def debug_kill_all
  2615.         for enemy in $game_troop.alive_members
  2616.           enemy.hp = 0
  2617.           enemy.perform_collapse_effect
  2618.         end
  2619.         BattleManager.judge_win_loss
  2620.         @log_window.wait
  2621.         @log_window.wait_for_effect
  2622.       end
  2623.  
  2624.       #--------------------------------------------------------------------------
  2625.       # alias method: create_all_windows
  2626.       #--------------------------------------------------------------------------
  2627.       alias scene_battle_create_all_windows_abe create_all_windows
  2628.       def create_all_windows
  2629.         scene_battle_create_all_windows_abe
  2630.         create_battle_status_aid_window
  2631.         set_help_window
  2632.       end
  2633.  
  2634.       #--------------------------------------------------------------------------
  2635.       # alias method: create_info_viewport
  2636.       #--------------------------------------------------------------------------
  2637.       alias scene_battle_create_info_viewport_abe create_info_viewport
  2638.       def create_info_viewport
  2639.         scene_battle_create_info_viewport_abe
  2640.         @status_window.refresh
  2641.       end
  2642.  
  2643.       #--------------------------------------------------------------------------
  2644.       # new method: create_battle_status_aid_window
  2645.       #--------------------------------------------------------------------------
  2646.       def create_battle_status_aid_window
  2647.         @status_aid_window = Window_BattleStatusAid.new
  2648.         @status_aid_window.status_window = @status_window
  2649.         @status_aid_window.x = Graphics.width - @status_aid_window.width
  2650.         @status_aid_window.y = Graphics.height - @status_aid_window.height
  2651.       end
  2652.  
  2653.       #--------------------------------------------------------------------------
  2654.       # overwrite method: create_help_window
  2655.       #--------------------------------------------------------------------------
  2656.       def create_help_window
  2657.         @help_window = Window_BattleHelp.new
  2658.         @help_window.hide
  2659.       end
  2660.  
  2661.       #--------------------------------------------------------------------------
  2662.       # new method: set_help_window
  2663.       #--------------------------------------------------------------------------
  2664.       def set_help_window
  2665.         @help_window.actor_window = @actor_window
  2666.         @help_window.enemy_window = @enemy_window
  2667.       end
  2668.  
  2669.       #--------------------------------------------------------------------------
  2670.       # alias method: create_party_command_window
  2671.       #--------------------------------------------------------------------------
  2672.       alias scene_battle_create_party_command_window_abe create_party_command_window
  2673.       def create_party_command_window
  2674.         scene_battle_create_party_command_window_abe
  2675.         @party_command_window.set_handler(:dir6, method(:command_fight))
  2676.       end
  2677.  
  2678.       #--------------------------------------------------------------------------
  2679.       # alias method: create_actor_command_window
  2680.       #--------------------------------------------------------------------------
  2681.       alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2682.       def create_actor_command_window
  2683.         scene_battle_create_actor_command_window_abe
  2684.         @actor_command_window.set_handler(:dir4, method(:prior_command))
  2685.         @actor_command_window.set_handler(:dir6, method(:next_command))
  2686.       end
  2687.  
  2688.       #--------------------------------------------------------------------------
  2689.       # alias method: create_skill_window
  2690.       #--------------------------------------------------------------------------
  2691.       alias scene_battle_create_skill_window_abe create_skill_window
  2692.       def create_skill_window
  2693.         scene_battle_create_skill_window_abe
  2694.         @skill_window.height = @info_viewport.rect.height
  2695.         @skill_window.width = Graphics.width - @actor_command_window.width
  2696.         @skill_window.y = Graphics.height - @skill_window.height
  2697.       end
  2698.  
  2699.       #--------------------------------------------------------------------------
  2700.       # alias method: create_item_window
  2701.       #--------------------------------------------------------------------------
  2702.       alias scene_battle_create_item_window_abe create_item_window
  2703.       def create_item_window
  2704.         scene_battle_create_item_window_abe
  2705.         @item_window.height = @skill_window.height
  2706.         @item_window.width = @skill_window.width
  2707.         @item_window.y = Graphics.height - @item_window.height
  2708.       end
  2709.  
  2710.       #--------------------------------------------------------------------------
  2711.       # alias method: show_fast?
  2712.       #--------------------------------------------------------------------------
  2713.       alias scene_battle_show_fast_abe show_fast?
  2714.       def show_fast?
  2715.         return true if YEA::BATTLE::AUTO_FAST
  2716.         return scene_battle_show_fast_abe
  2717.       end
  2718.  
  2719.       #--------------------------------------------------------------------------
  2720.       # alias method: next_command
  2721.       #--------------------------------------------------------------------------
  2722.       alias scene_battle_next_command_abe next_command
  2723.       def next_command
  2724.         @status_window.show
  2725.         redraw_current_status
  2726.         @actor_command_window.show
  2727.         @status_aid_window.hide
  2728.         scene_battle_next_command_abe
  2729.       end
  2730.  
  2731.       #--------------------------------------------------------------------------
  2732.       # alias method: prior_command
  2733.       #--------------------------------------------------------------------------
  2734.       alias scene_battle_prior_command_abe prior_command
  2735.       def prior_command
  2736.         redraw_current_status
  2737.         scene_battle_prior_command_abe
  2738.       end
  2739.  
  2740.       #--------------------------------------------------------------------------
  2741.       # new method: redraw_current_status
  2742.       #--------------------------------------------------------------------------
  2743.       def redraw_current_status
  2744.         return if @status_window.index < 0
  2745.         @status_window.draw_item(@status_window.index)
  2746.       end
  2747.  
  2748.       #--------------------------------------------------------------------------
  2749.       # alias method: command_attack
  2750.       #--------------------------------------------------------------------------
  2751.       alias scene_battle_command_attack_abe command_attack
  2752.       def command_attack
  2753.         $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2754.         scene_battle_command_attack_abe
  2755.       end
  2756.  
  2757.       #--------------------------------------------------------------------------
  2758.       # alias method: command_skill
  2759.       #--------------------------------------------------------------------------
  2760.       alias scene_battle_command_skill_abe command_skill
  2761.       def command_skill
  2762.         scene_battle_command_skill_abe
  2763.         @status_window.hide
  2764.         @actor_command_window.hide
  2765.         @status_aid_window.show
  2766.       end
  2767.  
  2768.       #--------------------------------------------------------------------------
  2769.       # alias method: command_item
  2770.       #--------------------------------------------------------------------------
  2771.       alias scene_battle_command_item_abe command_item
  2772.       def command_item
  2773.         scene_battle_command_item_abe
  2774.         @status_window.hide
  2775.         @actor_command_window.hide
  2776.         @status_aid_window.show
  2777.       end
  2778.  
  2779.       #--------------------------------------------------------------------------
  2780.       # overwrite method: on_skill_ok
  2781.       #--------------------------------------------------------------------------
  2782.       def on_skill_ok
  2783.         @skill = @skill_window.item
  2784.         $game_temp.battle_aid = @skill
  2785.         BattleManager.actor.input.set_skill(@skill.id)
  2786.         BattleManager.actor.last_skill.object = @skill
  2787.         if @skill.for_opponent?
  2788.           select_enemy_selection
  2789.         elsif @skill.for_friend?
  2790.           select_actor_selection
  2791.         else
  2792.           @skill_window.hide
  2793.           next_command
  2794.           $game_temp.battle_aid = nil
  2795.         end
  2796.       end
  2797.  
  2798.       #--------------------------------------------------------------------------
  2799.       # alias method: on_skill_cancel
  2800.       #--------------------------------------------------------------------------
  2801.       alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2802.       def on_skill_cancel
  2803.         scene_battle_on_skill_cancel_abe
  2804.         @status_window.show
  2805.         @actor_command_window.show
  2806.         @status_aid_window.hide
  2807.       end
  2808.  
  2809.       #--------------------------------------------------------------------------
  2810.       # overwrite method: on_item_ok
  2811.       #--------------------------------------------------------------------------
  2812.       def on_item_ok
  2813.         @item = @item_window.item
  2814.         $game_temp.battle_aid = @item
  2815.         BattleManager.actor.input.set_item(@item.id)
  2816.         if @item.for_opponent?
  2817.           select_enemy_selection
  2818.         elsif @item.for_friend?
  2819.           select_actor_selection
  2820.         else
  2821.           @item_window.hide
  2822.           next_command
  2823.           $game_temp.battle_aid = nil
  2824.         end
  2825.         $game_party.last_item.object = @item
  2826.       end
  2827.  
  2828.       #--------------------------------------------------------------------------
  2829.       # alias method: on_item_cancel
  2830.       #--------------------------------------------------------------------------
  2831.       alias scene_battle_on_item_cancel_abe on_item_cancel
  2832.       def on_item_cancel
  2833.         scene_battle_on_item_cancel_abe
  2834.         @status_window.show
  2835.         @actor_command_window.show
  2836.         @status_aid_window.hide
  2837.       end
  2838.  
  2839.       #--------------------------------------------------------------------------
  2840.       # alias method: select_actor_selection
  2841.       #--------------------------------------------------------------------------
  2842.       alias scene_battle_select_actor_selection_abe select_actor_selection
  2843.       def select_actor_selection
  2844.         @status_aid_window.refresh
  2845.         scene_battle_select_actor_selection_abe
  2846.         @status_window.hide
  2847.         @skill_window.hide
  2848.         @item_window.hide
  2849.         @help_window.show
  2850.       end
  2851.  
  2852.       #--------------------------------------------------------------------------
  2853.       # alias method: on_actor_ok
  2854.       #--------------------------------------------------------------------------
  2855.       alias scene_battle_on_actor_ok_abe on_actor_ok
  2856.       def on_actor_ok
  2857.         $game_temp.battle_aid = nil
  2858.         scene_battle_on_actor_ok_abe
  2859.         @status_window.show
  2860.         if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2861.           @actor_command_window.visible = !@confirm_command_window.visible
  2862.         else
  2863.           @actor_command_window.show
  2864.         end
  2865.         @status_aid_window.hide
  2866.       end
  2867.  
  2868.       #--------------------------------------------------------------------------
  2869.       # alias method: on_actor_cancel
  2870.       #--------------------------------------------------------------------------
  2871.       alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2872.       def on_actor_cancel
  2873.         BattleManager.actor.input.clear
  2874.         @status_aid_window.refresh
  2875.         $game_temp.battle_aid = nil
  2876.         scene_battle_on_actor_cancel_abe
  2877.         case @actor_command_window.current_symbol
  2878.         when :skill
  2879.           @skill_window.show
  2880.         when :item
  2881.           @item_window.show
  2882.         end
  2883.       end
  2884.  
  2885.       #--------------------------------------------------------------------------
  2886.       # alias method: select_enemy_selection
  2887.       #--------------------------------------------------------------------------
  2888.       alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2889.       def select_enemy_selection
  2890.         @status_aid_window.refresh
  2891.         scene_battle_select_enemy_selection_abe
  2892.         @help_window.show
  2893.       end
  2894.       #--------------------------------------------------------------------------
  2895.       # alias method: on_enemy_ok
  2896.       #--------------------------------------------------------------------------
  2897.       alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2898.       def on_enemy_ok
  2899.         $game_temp.battle_aid = nil
  2900.         scene_battle_on_enemy_ok_abe
  2901.       end
  2902.  
  2903.       #--------------------------------------------------------------------------
  2904.       # alias method: on_enemy_cancel
  2905.       #--------------------------------------------------------------------------
  2906.       alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2907.       def on_enemy_cancel
  2908.         BattleManager.actor.input.clear
  2909.         @status_aid_window.refresh
  2910.         $game_temp.battle_aid = nil
  2911.         scene_battle_on_enemy_cancel_abe
  2912.         if @skill_window.visible || @item_window.visible
  2913.           @help_window.show
  2914.         else
  2915.           @help_window.hide
  2916.         end
  2917.       end
  2918.  
  2919.       #--------------------------------------------------------------------------
  2920.       # alias method: battle_start
  2921.       #--------------------------------------------------------------------------
  2922.       alias scene_battle_battle_start_abe battle_start
  2923.       def battle_start
  2924.         scene_battle_battle_start_abe
  2925.         return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2926.         @party_command_window.deactivate
  2927.         if BattleManager.input_start
  2928.           command_fight
  2929.         else
  2930.           turn_start
  2931.         end
  2932.       end
  2933.  
  2934.       #--------------------------------------------------------------------------
  2935.       # overwrite method: turn_end
  2936.       #--------------------------------------------------------------------------
  2937.       def turn_end
  2938.         all_battle_members.each do |battler|
  2939.           battler.on_turn_end
  2940.           status_redraw_target(battler)
  2941.           @log_window.display_auto_affected_status(battler)
  2942.           @log_window.wait_and_clear
  2943.         end
  2944.         update_party_cooldowns if $imported["YEA-CommandParty"]
  2945.         BattleManager.turn_end
  2946.         process_event
  2947.         start_party_command_selection
  2948.         return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2949.         if BattleManager.input_start
  2950.           @party_command_window.deactivate
  2951.           command_fight
  2952.         else
  2953.           @party_command_window.deactivate
  2954.           turn_start
  2955.         end
  2956.       end
  2957.  
  2958.       #--------------------------------------------------------------------------
  2959.       # overwrite method: execute_action
  2960.       #--------------------------------------------------------------------------
  2961.       def execute_action
  2962.         @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2963.         use_item
  2964.         @log_window.wait_and_clear
  2965.       end
  2966.  
  2967.       #--------------------------------------------------------------------------
  2968.       # overwrite method: apply_item_effects
  2969.       #--------------------------------------------------------------------------
  2970.       def apply_item_effects(target, item)
  2971.         if $imported["YEA-LunaticObjects"]
  2972.           lunatic_object_effect(:prepare, item, @subject, target)
  2973.         end
  2974.         target.item_apply(@subject, item)
  2975.         status_redraw_target(@subject)
  2976.         status_redraw_target(target) unless target == @subject
  2977.         @log_window.display_action_results(target, item)
  2978.         if $imported["YEA-LunaticObjects"]
  2979.           lunatic_object_effect(:during, item, @subject, target)
  2980.         end
  2981.         perform_collapse_check(target)
  2982.       end
  2983.  
  2984.       #--------------------------------------------------------------------------
  2985.       # overwite method: invoke_counter_attack
  2986.       #--------------------------------------------------------------------------
  2987.       def invoke_counter_attack(target, item)
  2988.         @log_window.display_counter(target, item)
  2989.         attack_skill = $data_skills[target.attack_skill_id]
  2990.         @subject.item_apply(target, attack_skill)
  2991.         status_redraw_target(@subject)
  2992.         status_redraw_target(target) unless target == @subject
  2993.         @log_window.display_action_results(@subject, attack_skill)
  2994.         perform_collapse_check(target)
  2995.         perform_collapse_check(@subject)
  2996.       end
  2997.  
  2998.       #--------------------------------------------------------------------------
  2999.       # new method: perform_collapse_check
  3000.       #--------------------------------------------------------------------------
  3001.       def perform_collapse_check(target)
  3002.         return if YEA::BATTLE::MSG_ADDED_STATES
  3003.         target.perform_collapse_effect if target.can_collapse?
  3004.         @log_window.wait
  3005.         @log_window.wait_for_effect
  3006.       end
  3007.  
  3008.       #--------------------------------------------------------------------------
  3009.       # overwrite method: show_attack_animation
  3010.       #--------------------------------------------------------------------------
  3011.       def show_attack_animation(targets)
  3012.         show_normal_animation(targets, @subject.atk_animation_id1, false)
  3013.         wait_for_animation
  3014.         show_normal_animation(targets, @subject.atk_animation_id2, true)
  3015.       end
  3016.  
  3017.       #--------------------------------------------------------------------------
  3018.       # overwrite method: show_normal_animation
  3019.       #--------------------------------------------------------------------------
  3020.       def show_normal_animation(targets, animation_id, mirror = false)
  3021.         animation = $data_animations[animation_id]
  3022.         return if animation.nil?
  3023.         ani_check = false
  3024.         targets.each do |target|
  3025.           if ani_check && target.animation_id <= 0
  3026.             target.pseudo_ani_id = animation_id
  3027.           else
  3028.             target.animation_id = animation_id
  3029.           end
  3030.           target.animation_mirror = mirror
  3031.           ani_check = true if animation.to_screen?
  3032.         end
  3033.       end
  3034.  
  3035.       #--------------------------------------------------------------------------
  3036.       # overwrite method: process_action_end
  3037.       #--------------------------------------------------------------------------
  3038.       def process_action_end
  3039.         @subject.on_action_end
  3040.         status_redraw_target(@subject)
  3041.         @log_window.display_auto_affected_status(@subject)
  3042.         @log_window.wait_and_clear
  3043.         @log_window.display_current_state(@subject)
  3044.         @log_window.wait_and_clear
  3045.         BattleManager.judge_win_loss
  3046.       end
  3047.  
  3048.       #--------------------------------------------------------------------------
  3049.       # overwrite method: use_item
  3050.       #--------------------------------------------------------------------------
  3051.       def use_item
  3052.         item = @subject.current_action.item
  3053.         @log_window.display_use_item(@subject, item)
  3054.         @subject.use_item(item)
  3055.         if item.is_a?(RPG::Skill) and item.id == 187
  3056.           Graphics.play_movie('Movies/' + "Tsubamegaeshi")
  3057.         end
  3058.     refresh_status
  3059.         status_redraw_target(@subject)
  3060.         if $imported["YEA-LunaticObjects"]
  3061.           lunatic_object_effect(:before, item, @subject, @subject)
  3062.         end
  3063.         process_casting_animation if $imported["YEA-CastAnimations"]
  3064.         targets = @subject.current_action.make_targets.compact rescue []
  3065.         show_animation(targets, item.animation_id) if show_all_animation?(item)
  3066.         targets.each {|target|
  3067.           if $imported["YEA-TargetManager"]
  3068.             target = alive_random_target(target, item) if item.for_random?
  3069.           end
  3070.           item.repeats.times { invoke_item(target, item) } }
  3071.         if $imported["YEA-LunaticObjects"]
  3072.           lunatic_object_effect(:after, item, @subject, @subject)
  3073.         end
  3074.       end
  3075.  
  3076.       #--------------------------------------------------------------------------
  3077.       # alias method: invoke_item
  3078.       #--------------------------------------------------------------------------
  3079.       alias scene_battle_invoke_item_abe invoke_item
  3080.       def invoke_item(target, item)
  3081.         show_animation([target], item.animation_id) if separate_ani?(target, item)
  3082.         if target.dead? != item.for_dead_friend?
  3083.           @subject.last_target_index = target.index
  3084.           return
  3085.         end
  3086.         scene_battle_invoke_item_abe(target, item)
  3087.       end
  3088.  
  3089.       #--------------------------------------------------------------------------
  3090.       # new method: show_all_animation?
  3091.       #--------------------------------------------------------------------------
  3092.       def show_all_animation?(item)
  3093.         return true if item.one_animation
  3094.         return false if $data_animations[item.animation_id].nil?
  3095.         return false unless $data_animations[item.animation_id].to_screen?
  3096.         return true
  3097.       end
  3098.  
  3099.       #--------------------------------------------------------------------------
  3100.       # new method: separate_ani?
  3101.       #--------------------------------------------------------------------------
  3102.       def separate_ani?(target, item)
  3103.         return false if item.one_animation
  3104.         return false if $data_animations[item.animation_id].nil?
  3105.         return false if $data_animations[item.animation_id].to_screen?
  3106.         return target.dead? == item.for_dead_friend?
  3107.       end
  3108.  
  3109.       #--------------------------------------------------------------------------
  3110.       # new method: status_redraw_target
  3111.       #--------------------------------------------------------------------------
  3112.       def status_redraw_target(target)
  3113.         return unless target.actor?
  3114.         @status_window.draw_item($game_party.battle_members.index(target))
  3115.       end
  3116.  
  3117.       #--------------------------------------------------------------------------
  3118.       # alias method: start_party_command_selection
  3119.       #--------------------------------------------------------------------------
  3120.       alias start_party_command_selection_abe start_party_command_selection
  3121.       def start_party_command_selection
  3122.         @status_window.refresh unless scene_changing?
  3123.         start_party_command_selection_abe
  3124.       end
  3125.  
  3126.       #--------------------------------------------------------------------------
  3127.       # overwrite method: refresh_status
  3128.       #--------------------------------------------------------------------------
  3129.       def refresh_status; return; end
  3130.  
  3131.       #--------------------------------------------------------------------------
  3132.       # new method: refresh_autobattler_status_window
  3133.       #--------------------------------------------------------------------------
  3134.       def refresh_autobattler_status_window
  3135.         for member in $game_party.battle_members
  3136.           next unless member.auto_battle?
  3137.           @status_window.draw_item(member.index)
  3138.         end
  3139.       end
  3140.  
  3141.       #--------------------------------------------------------------------------
  3142.       # new method: hide_extra_gauges
  3143.       #--------------------------------------------------------------------------
  3144.       def hide_extra_gauges
  3145.         # Made for compatibility
  3146.       end
  3147.  
  3148.       #--------------------------------------------------------------------------
  3149.       # new method: show_extra_gauges
  3150.       #--------------------------------------------------------------------------
  3151.       def show_extra_gauges
  3152.         # Made for compatibility
  3153.       end
  3154.  
  3155.     end # Scene_Battle
  3156.     #==============================================================================
  3157.     #
  3158.     # ▼ YSA Battle System: Classical ATB
  3159.     # -- Last Updated: 2012.01.20
  3160.     # -- Level: Easy, Normal
  3161.     # -- Requires: YEA - Ace Battle Engine v1.15+.
  3162.     #
  3163.     #==============================================================================
  3164.  
  3165.     $imported = {} if $imported.nil?
  3166.     $imported["YSA-CATB"] = true
  3167.  
  3168.     #==============================================================================
  3169.     # ▼ Updates
  3170.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3171.     # 2012.01.20 - Compatible with: Lunatic CATB Rate.
  3172.     #            - Fix a bug with first strike.
  3173.     # 2012.01.19 - Fix a small bug with Action's Icon Updating.
  3174.     #            - Fix a critical bug with target selecting.
  3175.     #            - Fix a bug with states updating.
  3176.     #            - Fix a small bug with actor's status when choosing skill/item.
  3177.     #            - Fix a critical bug with auto battle.
  3178.     # 2012.01.16 - Fix ATB speed changes when a battler's agi changes.
  3179.     #            - Add casting time.
  3180.     # 2012.01.16 - Add a function for preemptive strike and surprised.
  3181.     #            - Fix a small bug with make action.
  3182.     # 2012.01.13 - Bugfix for ATB Type Wait.
  3183.     #            - Upgrade a little ATB gauge.
  3184.     #            - Upgrade turn count.
  3185.     #            - Compatible with: Lunatic CATB Start.
  3186.     # 2012.01.12 - Started Script and Finished.
  3187.     #
  3188.     #==============================================================================
  3189.     # ▼ Introduction
  3190.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3191.     # This script will add a battle type into YEA Battle Engine Ace.
  3192.     # Battle Type: Classical ATB.
  3193.     #
  3194.     #==============================================================================
  3195.     # ▼ Instructions
  3196.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3197.     # To install this script, open up your script editor and copy/paste this script
  3198.     # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  3199.     #
  3200.     # First, set the default battle system for your game to be :catb by either going
  3201.     # to the Ace Battle Engine script and setting DEFAULT_BATTLE_SYSTEM as :catb or
  3202.     # by using the following script call:
  3203.     #
  3204.     # $game_system:set_battle_system(:catb)
  3205.     #
  3206.     # Second, you can set the default wait for your game by either setting DEFAULT_WAIT
  3207.     # or using the following script call:
  3208.     #
  3209.     # $game_system:set_catb_wait_type(wait_type)
  3210.     #
  3211.     # Which there are 4 types:
  3212.     #   - :full     : ATB always run, except when animation run
  3213.     #   - :quarter  : ATB pause when select skill/item/target
  3214.     #   - :semi     : ATB pause when select target
  3215.     #   - :wait     : ATB pause when choose action for actor
  3216.     #
  3217.     # Third, you can set the default turn counting for your game by either setting
  3218.     # DEFAULT_TURN or using the following script call:
  3219.     #
  3220.     # $game_system:set_catb_turn_type(turn_type)
  3221.     #
  3222.     # Which there are 2 types:
  3223.     #   - :tick     : Count as a turn after X frame
  3224.     #   - :action   : Count as a turn after X actions
  3225.     #
  3226.     # -----------------------------------------------------------------------------
  3227.     # Skill/Item Notetags - These notetags go in the skill/item notebox in the database.
  3228.     # -----------------------------------------------------------------------------
  3229.     # <charge rate: x%>
  3230.     # Enable casting time (skill charge) for Skill or Item. Skill/Item will be charged
  3231.     # at normal ATB filled speed * x%, which means it will be charged at x% rate.
  3232.     #
  3233.     #==============================================================================
  3234.     # ▼ Compatibility
  3235.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3236.     # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  3237.     # it will run with RPG Maker VX without adjusting.
  3238.     #
  3239.     # This script requires Yanfly Engine Ace - Ace Battle Engine v1.15+ and the
  3240.     # script must be placed under Ace Battle Engine in the script listing.
  3241.     #
  3242.     #==============================================================================
  3243.  
  3244.     #==============================================================================
  3245.     # ▼ Configuration
  3246.     #==============================================================================
  3247.  
  3248.     module YSA
  3249.       module CATB
  3250.  
  3251.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3252.         # - General Configuration -
  3253.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3254.         DEFAULT_FILL_TIME = 120 # Frames
  3255.         DEFAULT_WAIT      = :wait # :full, :semi, :quarter, :wait
  3256.         FILL_TIME_VARIABLE  = 15 # Change DEFAULT_FILL_TIME by variable.
  3257.  
  3258.         PAUSE_WHEN_ACTIVE_PARTY_COMMAND = true
  3259.  
  3260.         PREEMTIVE_ATB_ACTOR = 70
  3261.         PREEMTIVE_ATB_ENEMY = 0
  3262.         SURPRISE_ATB_ACTOR = 0
  3263.         SURPRISE_ATB_ENEMY = 70
  3264.  
  3265.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3266.         # - Turn Configuration -
  3267.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3268.         DEFAULT_TURN          = :action # :tick, :action
  3269.  
  3270.         TICK_COUNT            = 150    # Turn after TICK_COUNT
  3271.         TICK_COUNT_VARIABLE   = 16     # Change TICK_COUNT by variable.
  3272.  
  3273.         AFTER_ACTION          = 1      # Turn after AFTER_ACTION actions.
  3274.         AFTER_ACTION_VARIABLE  = 17     # Change AFTER_ACTION by variable.
  3275.  
  3276.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3277.         # - Actor ATB Gauges -
  3278.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3279.         GAUGE_COLOR1 = 32
  3280.         GAUGE_COLOR2 = 31
  3281.         CHARGE_COLOR1 = 18
  3282.         CHARGE_COLOR2 = 10
  3283.         ATB_GAUGE_Y_PLUS = 12
  3284.         ATB_PHRASE = "ATB"
  3285.  
  3286.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3287.         # - Enemy ATB Gauges -
  3288.         #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3289.         SHOW_ENEMY_ATB_GAUGE    = true  # Display Enemy HP Gauge?
  3290.         ENEMY_GAUGE_WIDTH      = 128    # How wide the enemy gauges are.
  3291.         ENEMY_GAUGE_HEIGHT     = 12     # How tall the enemy gauges are.
  3292.         ENEMY_ATB_GAUGE_COLOUR1 = 1     # Colour 1 for ATB.
  3293.         ENEMY_ATB_GAUGE_COLOUR2 = 4     # Colour 2 for ATB.
  3294.         ENEMY_BACKGAUGE_COLOUR = 19     # Gauge Back colour.
  3295.  
  3296.       end
  3297.     end
  3298.  
  3299.     #==============================================================================
  3300.     # ▼ Editting anything past this point may potentially result in causing
  3301.     # computer damage, incontinence, explosion of user's head, coma, death, and/or
  3302.     # halitosis so edit at your own risk.
  3303.     #==============================================================================
  3304.  
  3305.     module YSA
  3306.       module REGEXP
  3307.       module USABLEITEM
  3308.  
  3309.         CHARGE_RATE = /<(?:CHARGE_RATE|charge rate):[ ](\d+)?([%%])>/i
  3310.  
  3311.       end # USABLEITEM
  3312.       end # REGEXP
  3313.     end # YSA
  3314.  
  3315.     #==============================================================================
  3316.     # ■ DataManager
  3317.     #==============================================================================
  3318.  
  3319.     module DataManager
  3320.  
  3321.       #--------------------------------------------------------------------------
  3322.       # alias method: load_database
  3323.       #--------------------------------------------------------------------------
  3324.       class <<self; alias load_database_catb load_database; end
  3325.       def self.load_database
  3326.         load_database_catb
  3327.         load_notetags_catb
  3328.       end
  3329.  
  3330.       #--------------------------------------------------------------------------
  3331.       # new method: load_notetags_catb
  3332.       #--------------------------------------------------------------------------
  3333.       def self.load_notetags_catb
  3334.         groups = [$data_skills, $data_items]
  3335.         for group in groups
  3336.           for obj in group
  3337.             next if obj.nil?
  3338.             obj.load_notetags_catb
  3339.           end
  3340.         end
  3341.       end
  3342.  
  3343.     end # DataManager
  3344.  
  3345.     #==============================================================================
  3346.     # ■ RPG::UsableItem
  3347.     #==============================================================================
  3348.  
  3349.     class RPG::UsableItem < RPG::BaseItem
  3350.  
  3351.       #--------------------------------------------------------------------------
  3352.       # public instance variables
  3353.       #--------------------------------------------------------------------------
  3354.       attr_accessor :charge_rate
  3355.       attr_accessor :charge_on
  3356.  
  3357.       #--------------------------------------------------------------------------
  3358.       # common cache: load_notetags_catb
  3359.       #--------------------------------------------------------------------------
  3360.       def load_notetags_catb
  3361.         @charge_rate = 100
  3362.         @charge_on = false
  3363.         #---
  3364.         self.note.split(/[\r\n]+/).each { |line|
  3365.           case line
  3366.           #---
  3367.           when YSA::REGEXP::USABLEITEM::CHARGE_RATE
  3368.             @charge_on = true
  3369.             @charge_rate = $1.to_i
  3370.           #---
  3371.           end
  3372.         } # self.note.split
  3373.         #---
  3374.         @charge_rate = 100 if @charge_rate <= 0
  3375.       end
  3376.  
  3377.     end # RPG::UsableItem
  3378.  
  3379.     #==============================================================================
  3380.     # ■ BattleManager
  3381.     #==============================================================================
  3382.  
  3383.     module BattleManager
  3384.  
  3385.       #--------------------------------------------------------------------------
  3386.       # alias method:
  3387.       #     - make_action_orders
  3388.       #     - prior_command
  3389.       #     - next_command
  3390.       #     - in_turn?
  3391.       #     - battle_start
  3392.       #--------------------------------------------------------------------------
  3393.       class <<self
  3394.         alias catb_make_action_orders make_action_orders
  3395.         alias catb_prior_command prior_command
  3396.         alias catb_next_command next_command
  3397.         alias catb_in_turn? in_turn?
  3398.         alias catb_battle_start battle_start
  3399.       end
  3400.  
  3401.       #--------------------------------------------------------------------------
  3402.       # battle_start
  3403.       #--------------------------------------------------------------------------
  3404.       def self.battle_start
  3405.         catb_battle_start
  3406.         if btype?(:catb)
  3407.           @average_agi = 0
  3408.           make_catb_action_orders
  3409.           battler_hash = $game_party.members + $game_troop.members
  3410.           battler_hash.each { |a|
  3411.             if @preemptive
  3412.               a.make_first_catb_value(1)
  3413.             elsif @surprise
  3414.               a.make_first_catb_value(2)
  3415.             else
  3416.               a.make_first_catb_value(0)
  3417.             end
  3418.             @average_agi += a.agi
  3419.           }
  3420.           @average_agi /= battler_hash.size
  3421.         end
  3422.       end
  3423.  
  3424.       #--------------------------------------------------------------------------
  3425.       # next_command
  3426.       #--------------------------------------------------------------------------
  3427.       def self.next_command
  3428.         return false if btype?(:catb)
  3429.         catb_next_command
  3430.       end
  3431.  
  3432.       #--------------------------------------------------------------------------
  3433.       # alias method: in_turn?
  3434.       #--------------------------------------------------------------------------
  3435.       def self.in_turn?
  3436.         return true if btype?(:catb)
  3437.         return catb_in_turn?
  3438.       end
  3439.  
  3440.       #--------------------------------------------------------------------------
  3441.       # new method: make_catb_action_orders
  3442.       #--------------------------------------------------------------------------
  3443.       class <<self
  3444.       def make_catb_action_orders
  3445.         @action_actors = []
  3446.         @action_enemies = []
  3447.         @action_battlers = []
  3448.       end
  3449.       end
  3450.  
  3451.       #--------------------------------------------------------------------------
  3452.       # new method: average_agi
  3453.       #--------------------------------------------------------------------------
  3454.       class <<self
  3455.       def average_agi
  3456.         return @average_agi
  3457.       end
  3458.       end
  3459.  
  3460.       #--------------------------------------------------------------------------
  3461.       # new method: set_actor
  3462.       #--------------------------------------------------------------------------
  3463.       class <<self
  3464.       def set_actor(actor_index)
  3465.         @actor_index = actor_index
  3466.       end
  3467.       end
  3468.  
  3469.       #--------------------------------------------------------------------------
  3470.       # prior_command
  3471.       #--------------------------------------------------------------------------
  3472.       def self.prior_command
  3473.         return false if btype?(:catb)
  3474.         catb_prior_command
  3475.       end
  3476.  
  3477.       #--------------------------------------------------------------------------
  3478.       # new method: make_catb_action
  3479.       #--------------------------------------------------------------------------
  3480.       class <<self
  3481.       def make_catb_action(battler)
  3482.         make_catb_action_orders if !@action_battlers || !@action_actors || !@action_enemies
  3483.         return false if @action_battlers.include?(battler)
  3484.         @action_battlers.push(battler)
  3485.         @action_actors.push(battler) if battler.actor?
  3486.         @action_enemies.push(battler) if battler.enemy?
  3487.         return true
  3488.       end
  3489.       end
  3490.  
  3491.       #--------------------------------------------------------------------------
  3492.       # new method: delete_catb_action
  3493.       #--------------------------------------------------------------------------
  3494.       class <<self
  3495.       def delete_catb_action(battler)
  3496.         return false if !battler
  3497.         @action_battlers.delete(battler)
  3498.         @action_battlers = @action_battlers.compact
  3499.         @action_actors.delete(battler) if battler.actor?
  3500.         @action_actors = @action_actors.compact
  3501.         @action_enemies.delete(battler) if battler.enemy?
  3502.         @action_enemies = @action_enemies.compact
  3503.         return true
  3504.       end
  3505.       end
  3506.  
  3507.       #--------------------------------------------------------------------------
  3508.       # new method: action_list
  3509.       #--------------------------------------------------------------------------
  3510.       class <<self
  3511.       def action_list(type = :all)
  3512.         return @action_battlers if type == :all
  3513.         return @action_actors if type == :actor
  3514.         return @action_enemies if type = :enemy
  3515.       end
  3516.       end
  3517.  
  3518.     end # BattleManager
  3519.  
  3520.     #==============================================================================
  3521.     # ■ Game_System
  3522.     #==============================================================================
  3523.  
  3524.     class Game_System
  3525.  
  3526.       #--------------------------------------------------------------------------
  3527.       # alias method: set_battle_system
  3528.       #--------------------------------------------------------------------------
  3529.       alias qatb_set_battle_system set_battle_system
  3530.       def set_battle_system(type)
  3531.         case type
  3532.         when :catb; @battle_system = :catb
  3533.         else;       qatb_set_battle_system(type)
  3534.         end
  3535.       end
  3536.  
  3537.       #--------------------------------------------------------------------------
  3538.       # alias method: battle_system_corrected
  3539.       #--------------------------------------------------------------------------
  3540.       alias qatb_battle_system_corrected battle_system_corrected
  3541.       def battle_system_corrected(type)
  3542.         case type
  3543.         when :catb; return :catb
  3544.         else;       return qatb_battle_system_corrected(type)
  3545.         end
  3546.       end
  3547.  
  3548.       #--------------------------------------------------------------------------
  3549.       # new method: catb_fill_time
  3550.       #--------------------------------------------------------------------------
  3551.       def catb_fill_time
  3552.         return $game_variables[YSA::CATB::FILL_TIME_VARIABLE] > 0 ? $game_variables[YSA::CATB::FILL_TIME_VARIABLE] : YSA::CATB::DEFAULT_FILL_TIME
  3553.       end
  3554.  
  3555.       #--------------------------------------------------------------------------
  3556.       # new method: catb_tick_count
  3557.       #--------------------------------------------------------------------------
  3558.       def catb_tick_count
  3559.         return $game_variables[YSA::CATB::TICK_COUNT_VARIABLE] > 0 ? $game_variables[YSA::CATB::TICK_COUNT_VARIABLE] : YSA::CATB::TICK_COUNT
  3560.       end
  3561.  
  3562.       #--------------------------------------------------------------------------
  3563.       # new method: catb_after_action
  3564.       #--------------------------------------------------------------------------
  3565.       def catb_after_action
  3566.         return $game_variables[YSA::CATB::AFTER_ACTION_VARIABLE] > 0 ? $game_variables[YSA::CATB::AFTER_ACTION_VARIABLE] : YSA::CATB::AFTER_ACTION
  3567.       end
  3568.  
  3569.       #--------------------------------------------------------------------------
  3570.       # new method: catb_turn_type
  3571.       #--------------------------------------------------------------------------
  3572.       def catb_turn_type
  3573.         return @catb_turn_type ? @catb_turn_type : YSA::CATB::DEFAULT_TURN
  3574.       end
  3575.  
  3576.       #--------------------------------------------------------------------------
  3577.       # new method: catb_wait_type
  3578.       #--------------------------------------------------------------------------
  3579.       def catb_wait_type
  3580.         return @catb_wait_type ? @catb_wait_type : YSA::CATB::DEFAULT_WAIT
  3581.       end
  3582.  
  3583.       #--------------------------------------------------------------------------
  3584.       # new method: set_catb_wait_type
  3585.       #--------------------------------------------------------------------------
  3586.       def set_catb_wait_type(type = :full)
  3587.         @catb_wait_type = type
  3588.       end
  3589.  
  3590.       #--------------------------------------------------------------------------
  3591.       # new method: set_catb_turn_type
  3592.       #--------------------------------------------------------------------------
  3593.       def set_catb_turn_type(type = :tick)
  3594.         @catb_turn_type = type
  3595.       end
  3596.  
  3597.     end # Game_System
  3598.  
  3599.     #==============================================================================
  3600.     # ■ Game_Battler
  3601.     #==============================================================================
  3602.  
  3603.     class Game_Battler < Game_BattlerBase
  3604.  
  3605.       MAX_CATB_VALUE = 100000.0
  3606.  
  3607.       #--------------------------------------------------------------------------
  3608.       # alias method: initialize
  3609.       #--------------------------------------------------------------------------
  3610.       alias catb_initialize initialize
  3611.       def initialize
  3612.         catb_initialize
  3613.         @catb_value = 0
  3614.         @ct_catb_value = 0
  3615.       end
  3616.  
  3617.       #--------------------------------------------------------------------------
  3618.       # new method: base_gain_catb
  3619.       #--------------------------------------------------------------------------
  3620.       def base_gain_catb
  3621.         return MAX_CATB_VALUE / $game_system.catb_fill_time
  3622.       end
  3623.  
  3624.       #--------------------------------------------------------------------------
  3625.       # new method: real_gain_catb
  3626.       #--------------------------------------------------------------------------
  3627.       def real_gain_catb
  3628.         value = (self.agi.to_f / BattleManager.average_agi) * base_gain_catb
  3629.         return value
  3630.       end
  3631.  
  3632.       #--------------------------------------------------------------------------
  3633.       # new method: make_catb_update
  3634.       #--------------------------------------------------------------------------
  3635.       def make_catb_update
  3636.         return if @catb_value >= MAX_CATB_VALUE
  3637.         return if not normal?
  3638.         value = $imported["YSA-LunaticCATBRate"] ? lunatic_catb_rate_formula : real_gain_catb
  3639.         @catb_value += [value, MAX_CATB_VALUE - @catb_value].min
  3640.       end
  3641.  
  3642.       #--------------------------------------------------------------------------
  3643.       # new method: make_catb_action
  3644.       #--------------------------------------------------------------------------
  3645.       def make_catb_action
  3646.         return unless @catb_value >= MAX_CATB_VALUE
  3647.         return clear_catb if not normal?
  3648.         return BattleManager.make_catb_action(self)
  3649.       end
  3650.  
  3651.       #--------------------------------------------------------------------------
  3652.       # new method: make_ct_catb_update
  3653.       #--------------------------------------------------------------------------
  3654.       def make_ct_catb_update
  3655.         return if @catb_value < MAX_CATB_VALUE
  3656.         return if @ct_catb_value >= MAX_CATB_VALUE
  3657.         return if !self.current_action
  3658.         return if !self.current_action.item
  3659.         return if self.actor? && !self.current_action.confirm
  3660.         clear_catb if not normal?
  3661.         @ct_catb_value = MAX_CATB_VALUE if !self.current_action.item.charge_on
  3662.         value = $imported["YSA-LunaticCATBRate"] ? lunatic_catb_rate_formula : real_gain_catb
  3663.         @ct_catb_value += [value * self.current_action.item.charge_rate / 100, MAX_CATB_VALUE - @ct_catb_value].min
  3664.       end
  3665.  
  3666.       #--------------------------------------------------------------------------
  3667.       # new method: charge_skill_done?
  3668.       #--------------------------------------------------------------------------
  3669.       def charge_skill_done?
  3670.         return @catb_value >= MAX_CATB_VALUE && @ct_catb_value >= MAX_CATB_VALUE
  3671.       end
  3672.  
  3673.       #--------------------------------------------------------------------------
  3674.       # new method: clear_catb
  3675.       #--------------------------------------------------------------------------
  3676.       def clear_catb
  3677.         make_actions
  3678.         @catb_value = 0
  3679.         @ct_catb_value = 0
  3680.         BattleManager.clear_actor if self.actor? && BattleManager.actor == self
  3681.         BattleManager.delete_catb_action(self)
  3682.       end
  3683.  
  3684.       #--------------------------------------------------------------------------
  3685.       # new method: make_first_catb_value
  3686.       #--------------------------------------------------------------------------
  3687.       def make_first_catb_value(pre = 0)
  3688.         make_actions
  3689.         @catb_value = 0
  3690.         @catb_value = YSA::CATB::PREEMTIVE_ATB_ACTOR if self.actor? && pre == 1
  3691.         @catb_value = YSA::CATB::PREEMTIVE_ATB_ENEMY if self.enemy? && pre == 1
  3692.         @catb_value = YSA::CATB::SURPRISE_ATB_ACTOR if self.actor? && pre == 2
  3693.         @catb_value = YSA::CATB::SURPRISE_ATB_ENEMY if self.enemy? && pre == 2
  3694.         lunatic_catb_start_formula(pre) if $imported["YSA-LunaticCATBStart"]
  3695.       end
  3696.  
  3697.       #--------------------------------------------------------------------------
  3698.       # new method: catb_filled_rate
  3699.       #--------------------------------------------------------------------------
  3700.       def catb_filled_rate
  3701.         return @catb_value / MAX_CATB_VALUE
  3702.       end
  3703.  
  3704.       #--------------------------------------------------------------------------
  3705.       # new method: catb_ct_filled_rate
  3706.       #--------------------------------------------------------------------------
  3707.       def catb_ct_filled_rate
  3708.         return @catb_value < MAX_CATB_VALUE ? 0 : @ct_catb_value / MAX_CATB_VALUE
  3709.       end
  3710.  
  3711.     end # Game_Battler
  3712.  
  3713.     #==============================================================================
  3714.     # ■ Game_Action
  3715.     #==============================================================================
  3716.  
  3717.     class Game_Action
  3718.  
  3719.       #--------------------------------------------------------------------------
  3720.       # alias method: clear
  3721.       #--------------------------------------------------------------------------
  3722.       alias catb_clear clear
  3723.       def clear
  3724.         catb_clear
  3725.         @confirm = false
  3726.       end
  3727.  
  3728.       #--------------------------------------------------------------------------
  3729.       # new method: confirm=
  3730.       #--------------------------------------------------------------------------
  3731.       def confirm=(con)
  3732.         @confirm = con
  3733.       end
  3734.  
  3735.       #--------------------------------------------------------------------------
  3736.       # new method: confirm
  3737.       #--------------------------------------------------------------------------
  3738.       def confirm
  3739.         return @subject.auto_battle? ? true : @confirm
  3740.       end
  3741.  
  3742.     end # Game_Action
  3743.  
  3744.     #==============================================================================
  3745.     # ■ Window_Base
  3746.     #==============================================================================
  3747.  
  3748.     class Window_Base < Window
  3749.       #--------------------------------------------------------------------------
  3750.       # catb_gauge_color
  3751.       #--------------------------------------------------------------------------
  3752.       def catb_color1;      text_color(YSA::CATB::GAUGE_COLOR1);      end;
  3753.       def catb_color2;      text_color(YSA::CATB::GAUGE_COLOR2);      end;
  3754.       def charge_color1;      text_color(YSA::CATB::CHARGE_COLOR1);      end;
  3755.       def charge_color2;      text_color(YSA::CATB::CHARGE_COLOR2);      end;
  3756.     end # Window_Base
  3757.  
  3758.     #==============================================================================
  3759.     # ■ Window_BattleStatus
  3760.     #==============================================================================
  3761.  
  3762.     class Window_BattleStatus < Window_Selectable
  3763.  
  3764.       #--------------------------------------------------------------------------
  3765.       # alias method: draw_item
  3766.       #--------------------------------------------------------------------------
  3767.       alias catb_draw_item draw_item
  3768.       def draw_item(index)
  3769.         catb_draw_item(index)
  3770.         actor = battle_members[index]
  3771.         rect = item_rect(index)
  3772.         gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS + YSA::CATB::ATB_GAUGE_Y_PLUS
  3773.         return unless BattleManager.btype?(:catb)
  3774.         draw_actor_catb(actor, rect.x+2, line_height*1+gx, rect.width-4)
  3775.       end
  3776.  
  3777.       #--------------------------------------------------------------------------
  3778.       # new method: draw_actor_catb
  3779.       #--------------------------------------------------------------------------
  3780.       def draw_actor_catb(actor, dx, dy, width = 124)
  3781.         draw_gauge(dx, dy, width, actor.catb_filled_rate, catb_color1, catb_color2)
  3782.         if actor.catb_ct_filled_rate > 0
  3783.           draw_gauge(dx, dy, width, actor.catb_ct_filled_rate, charge_color1, charge_color2)
  3784.         end
  3785.         change_color(system_color)
  3786.         cy = (Font.default_size - contents.font.size) / 2 + 1
  3787.         draw_text(dx+2, dy+cy, 30, line_height, YSA::CATB::ATB_PHRASE)
  3788.       end
  3789.  
  3790.       #--------------------------------------------------------------------------
  3791.       # new method: draw_item_actor_catb
  3792.       #--------------------------------------------------------------------------
  3793.       def draw_item_actor_catb(index)
  3794.         return if index.nil?
  3795.         actor = battle_members[index]
  3796.         rect = item_rect(index)
  3797.         return if actor.nil?
  3798.         gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS + YSA::CATB::ATB_GAUGE_Y_PLUS
  3799.         draw_actor_catb(actor, rect.x+2, line_height*1+gx, rect.width-4)
  3800.       end
  3801.  
  3802.       #--------------------------------------------------------------------------
  3803.       # new method: refresh_catb
  3804.       #--------------------------------------------------------------------------
  3805.       def refresh_catb
  3806.         return unless BattleManager.btype?(:catb)
  3807.         item_max.times {|i| draw_item_actor_catb(i) }
  3808.       end
  3809.  
  3810.     end # Window_BattleStatus
  3811.  
  3812.     #==============================================================================
  3813.     # ■ Sprite_Battler
  3814.     #==============================================================================
  3815.  
  3816.     class Sprite_Battler < Sprite_Base
  3817.  
  3818.       #--------------------------------------------------------------------------
  3819.       # alias method: initialize
  3820.       #--------------------------------------------------------------------------
  3821.       alias sprite_battler_initialize_catb initialize
  3822.       def initialize(viewport, battler = nil)
  3823.         sprite_battler_initialize_catb(viewport, battler)
  3824.         create_enemy_gauges_catb
  3825.       end
  3826.  
  3827.       #--------------------------------------------------------------------------
  3828.       # alias method: dispose
  3829.       #--------------------------------------------------------------------------
  3830.       alias sprite_battler_dispose_catb dispose
  3831.       def dispose
  3832.         sprite_battler_dispose_catb
  3833.         dispose_enemy_gauges_catb
  3834.       end
  3835.  
  3836.       #--------------------------------------------------------------------------
  3837.       # alias method: update
  3838.       #--------------------------------------------------------------------------
  3839.       alias sprite_battler_update_catb update
  3840.       def update
  3841.         sprite_battler_update_catb
  3842.         update_enemy_gauges_catb
  3843.       end
  3844.  
  3845.       #--------------------------------------------------------------------------
  3846.       # new method: create_enemy_gauges_catb
  3847.       #--------------------------------------------------------------------------
  3848.       def create_enemy_gauges_catb
  3849.         return if @battler.nil?
  3850.         return if @battler.actor?
  3851.         return unless BattleManager.btype?(:catb)
  3852.         @catb_back_gauge_viewport = Enemy_CATB_Gauge_Viewport.new(@battler, self, :back)
  3853.         @catb_gauge_viewport = Enemy_CATB_Gauge_Viewport.new(@battler, self, :catb)
  3854.         @catb_ct_gauge_viewport = Enemy_CATB_Gauge_Viewport.new(@battler, self, :catbct)
  3855.       end
  3856.  
  3857.       #--------------------------------------------------------------------------
  3858.       # new method: dispose_enemy_gauges_catb
  3859.       #--------------------------------------------------------------------------
  3860.       def dispose_enemy_gauges_catb
  3861.         return unless BattleManager.btype?(:catb)
  3862.         @catb_back_gauge_viewport.dispose unless @catb_back_gauge_viewport.nil?
  3863.         @catb_gauge_viewport.dispose unless @catb_gauge_viewport.nil?
  3864.         @catb_ct_gauge_viewport.dispose unless @catb_ct_gauge_viewport.nil?
  3865.       end
  3866.  
  3867.       #--------------------------------------------------------------------------
  3868.       # new method: update_enemy_gauges_catb
  3869.       #--------------------------------------------------------------------------
  3870.       def update_enemy_gauges_catb
  3871.         return unless BattleManager.btype?(:catb)
  3872.         @catb_back_gauge_viewport.update unless @catb_back_gauge_viewport.nil?
  3873.         @catb_gauge_viewport.update unless @catb_gauge_viewport.nil?
  3874.         @catb_ct_gauge_viewport.update unless @catb_ct_gauge_viewport.nil?
  3875.       end
  3876.  
  3877.     end # Sprite_Battler
  3878.  
  3879.     #==============================================================================
  3880.     # ■ Enemy_CATB_Gauge_Viewport
  3881.     #==============================================================================
  3882.  
  3883.     class Enemy_CATB_Gauge_Viewport < Viewport
  3884.  
  3885.       #--------------------------------------------------------------------------
  3886.       # initialize
  3887.       #--------------------------------------------------------------------------
  3888.       def initialize(battler, sprite, type)
  3889.         @battler = battler
  3890.         @base_sprite = sprite
  3891.         @type = type
  3892.         dw = YSA::CATB::ENEMY_GAUGE_WIDTH
  3893.         dw += 2 if @type == :back
  3894.         @start_width = dw
  3895.         dh = YSA::CATB::ENEMY_GAUGE_HEIGHT
  3896.         dh += 2 if @type == :back
  3897.         rect = Rect.new(0, 0, dw, dh)
  3898.         super(rect)
  3899.         self.z = 125
  3900.         create_gauge_sprites
  3901.         self.visible = false
  3902.         update_position
  3903.       end
  3904.  
  3905.       #--------------------------------------------------------------------------
  3906.       # dispose
  3907.       #--------------------------------------------------------------------------
  3908.       def dispose
  3909.         @sprite.bitmap.dispose unless @sprite.bitmap.nil?
  3910.         @sprite.dispose
  3911.         super
  3912.       end
  3913.  
  3914.       #--------------------------------------------------------------------------
  3915.       # update
  3916.       #--------------------------------------------------------------------------
  3917.       def update
  3918.         super
  3919.         self.visible = @battler.dead? ? false : YSA::CATB::SHOW_ENEMY_ATB_GAUGE
  3920.         update_position
  3921.         update_gauge
  3922.       end
  3923.  
  3924.       #--------------------------------------------------------------------------
  3925.       # create_gauge_sprites
  3926.       #--------------------------------------------------------------------------
  3927.       def create_gauge_sprites
  3928.         @sprite = Plane.new(self)
  3929.         dw = self.rect.width * 2
  3930.         @sprite.bitmap = Bitmap.new(dw, self.rect.height)
  3931.         case @type
  3932.         when :back
  3933.           colour1 = Colour.text_colour(YSA::CATB::ENEMY_BACKGAUGE_COLOUR)
  3934.           colour2 = Colour.text_colour(YSA::CATB::ENEMY_BACKGAUGE_COLOUR)
  3935.         when :catb
  3936.           colour1 = Colour.text_colour(YSA::CATB::ENEMY_ATB_GAUGE_COLOUR1)
  3937.           colour2 = Colour.text_colour(YSA::CATB::ENEMY_ATB_GAUGE_COLOUR2)
  3938.         when :catbct
  3939.           colour1 = Colour.text_colour(YSA::CATB::CHARGE_COLOR1)
  3940.           colour2 = Colour.text_colour(YSA::CATB::CHARGE_COLOR2)
  3941.         end
  3942.         dx = 0
  3943.         dy = 0
  3944.         dw = self.rect.width
  3945.         dh = self.rect.height
  3946.         self.rect.width = target_gauge_width unless @type == :back
  3947.         @gauge_width = target_gauge_width
  3948.         @sprite.bitmap.gradient_fill_rect(dx, dy, dw, dh, colour1, colour2)
  3949.         @sprite.bitmap.gradient_fill_rect(dw, dy, dw, dh, colour2, colour1)
  3950.       end
  3951.  
  3952.       #--------------------------------------------------------------------------
  3953.       # update_position
  3954.       #--------------------------------------------------------------------------
  3955.       def update_position
  3956.         dx = @battler.screen_x - @start_width / 2
  3957.         self.rect.x = dx
  3958.         dh = self.rect.height + 1
  3959.         dh += 2 unless @type == :back
  3960.         dy = [@battler.screen_y, Graphics.height - dh - 120].min
  3961.         dy += 1 unless @type == :back
  3962.         dy -= YEA::BATTLE::ENEMY_GAUGE_HEIGHT if $imported["YEA-EnemyHPBars"]
  3963.         self.rect.y = dy
  3964.       end
  3965.  
  3966.       #--------------------------------------------------------------------------
  3967.       # update_gauge
  3968.       #--------------------------------------------------------------------------
  3969.       def update_gauge
  3970.         return if @gauge_width == target_gauge_width
  3971.         @gauge_width = target_gauge_width if @type == :catb
  3972.         @gauge_width = target_gauge_width_ct if @type == :catbct
  3973.         return if @type == :back
  3974.         self.rect.width = @gauge_width
  3975.       end
  3976.  
  3977.       #--------------------------------------------------------------------------
  3978.       # target_gauge_width
  3979.       #--------------------------------------------------------------------------
  3980.       def target_gauge_width
  3981.         return @battler.catb_filled_rate * @start_width
  3982.       end
  3983.  
  3984.       #--------------------------------------------------------------------------
  3985.       # target_gauge_width_ct
  3986.       #--------------------------------------------------------------------------
  3987.       def target_gauge_width_ct
  3988.         return @battler.catb_ct_filled_rate * @start_width
  3989.       end
  3990.  
  3991.     end # Enemy_CATB_Gauge_Viewport
  3992.  
  3993.     #==============================================================================
  3994.     # ■ Window_BattleEnemy
  3995.     #==============================================================================
  3996.  
  3997.     class Window_BattleEnemy < Window_Selectable
  3998.  
  3999.       #--------------------------------------------------------------------------
  4000.       # alias method: col_max
  4001.       #--------------------------------------------------------------------------
  4002.       alias catb_col_max col_max
  4003.       def col_max; return catb_col_max == 0 ? 1 : catb_col_max; end
  4004.  
  4005.     end # Window_BattleEnemy
  4006.  
  4007.     #==============================================================================
  4008.     # ■ Scene_Battle
  4009.     #==============================================================================
  4010.  
  4011.     class Scene_Battle < Scene_Base
  4012.  
  4013.       #--------------------------------------------------------------------------
  4014.       # alias method: process_action
  4015.       #--------------------------------------------------------------------------
  4016.       alias catb_process_action process_action
  4017.       def process_action
  4018.         process_catb
  4019.         perform_catb_action(@subject, true) if BattleManager.action_forced?
  4020.         catb_process_action unless BattleManager.btype?(:catb)
  4021.       end
  4022.  
  4023.       #--------------------------------------------------------------------------
  4024.       # new method: catb_pause?
  4025.       #--------------------------------------------------------------------------
  4026.       def catb_pause?
  4027.         return YSA::CATB::PAUSE_WHEN_ACTIVE_PARTY_COMMAND if @party_command_window.active
  4028.         return false if $game_system.catb_wait_type == :full
  4029.         return true if $game_system.catb_wait_type == :wait && (@actor_command_window.active || @skill_window.active || @item_window.active || @actor_window.active || @enemy_window.active)
  4030.         return true if $game_system.catb_wait_type == :quarter && (@skill_window.active || @item_window.active || @actor_window.active || @enemy_window.active)
  4031.         return true if $game_system.catb_wait_type == :semi && (@actor_window.active || @enemy_window.active)
  4032.       end
  4033.  
  4034.       #--------------------------------------------------------------------------
  4035.       # new method: process_catb
  4036.       #--------------------------------------------------------------------------
  4037.       def process_catb
  4038.         return unless SceneManager.scene_is?(Scene_Battle)
  4039.         return if scene_changing?
  4040.         return unless BattleManager.btype?(:catb)
  4041.         return if catb_pause?
  4042.         battler_hash = $game_party.members + $game_troop.members
  4043.         battler_hash.each { |a|
  4044.           a.make_catb_update
  4045.           a.make_catb_action
  4046.           a.make_ct_catb_update
  4047.         }
  4048.         #--- Update Tick Turn
  4049.         if $game_system.catb_turn_type == :tick
  4050.           @tick_clock = 0 if !@tick_clock
  4051.           @tick_clock += 1
  4052.           if @tick_clock >= $game_system.catb_tick_count
  4053.             @tick_clock = 0
  4054.             all_battle_members.each { |battler|
  4055.               battler.on_turn_end
  4056.             }
  4057.             @status_window.refresh
  4058.             $game_troop.increase_turn
  4059.           end
  4060.         end
  4061.         #--- Fix make action
  4062.         BattleManager.action_list(:actor).each { |battler|
  4063.           battler.make_actions if (battler.actor? && !battler.input)
  4064.         }
  4065.         #---
  4066.         @status_window.refresh_catb
  4067.         #--- Setup Actor
  4068.         @f_actor_index = 0 if !@f_actor_index || @f_actor_index < 0 || @f_actor_index + 1 > BattleManager.action_list(:actor).size
  4069.         f_actor = BattleManager.action_list(:actor)[@f_actor_index]
  4070.         @f_actor_index += 1 if (@f_actor_index + 1) < BattleManager.action_list(:actor).size && f_actor && f_actor.input && f_actor.input.item && f_actor.input.confirm
  4071.         f_actor = BattleManager.action_list(:actor)[@f_actor_index]
  4072.         if f_actor && f_actor.input && !f_actor.input.item && (!BattleManager.actor || @status_window.index != BattleManager.actor.index)
  4073.           BattleManager.set_actor(f_actor.index)
  4074.           @status_window.select(BattleManager.actor.index)
  4075.           @actor_command_window.setup(BattleManager.actor)
  4076.         end
  4077.         BattleManager.action_list.each { |battler|
  4078.           battler.make_actions if battler.enemy?
  4079.           perform_catb_action(battler) if !@subject
  4080.         }
  4081.       end
  4082.  
  4083.       #--------------------------------------------------------------------------
  4084.       # new method: perform_catb_action
  4085.       #--------------------------------------------------------------------------
  4086.       def perform_catb_action(subject, forced = false)
  4087.         return if subject && !subject.charge_skill_done?
  4088.         return if subject && subject.actor? && !forced && !subject.input
  4089.         return if subject && subject.actor? && !forced && !subject.input.item
  4090.         return if subject && subject.actor? && !forced && !subject.input.confirm
  4091.         @subject = subject if subject
  4092.         return if !@subject
  4093.         if @subject.current_action
  4094.           @subject.current_action.prepare
  4095.           execute_action
  4096.           process_event
  4097.           @status_aid_window.refresh if @status_aid_window.visible
  4098.           if $game_system.catb_turn_type == :action
  4099.             @tick_action = 0 if !@tick_action
  4100.             @tick_action += 1
  4101.             if @tick_action >= $game_system.catb_after_action
  4102.               @tick_action = 0
  4103.               all_battle_members.each { |battler|
  4104.                 battler.on_turn_end
  4105.               }
  4106.               @status_window.refresh
  4107.               $game_troop.increase_turn
  4108.             end
  4109.           end
  4110.           @subject.on_action_end
  4111.         end
  4112.         return if BattleManager.judge_win_loss
  4113.         @subject.clear_catb
  4114.         @status_window.draw_item(@subject.index) if @subject.actor?
  4115.         @subject = nil
  4116.       end
  4117.  
  4118.       #--------------------------------------------------------------------------
  4119.       # alias method: create_actor_command_window
  4120.       #--------------------------------------------------------------------------
  4121.       alias catb_create_actor_command_window create_actor_command_window
  4122.       def create_actor_command_window
  4123.         catb_create_actor_command_window
  4124.         if BattleManager.btype?(:catb)
  4125.           @actor_command_window.set_handler(:dir4, method(:prior_f_actor))
  4126.           @actor_command_window.set_handler(:dir6, method(:next_f_actor))
  4127.         end
  4128.       end
  4129.  
  4130.       #--------------------------------------------------------------------------
  4131.       # new method: prior_f_actor
  4132.       #--------------------------------------------------------------------------
  4133.       def prior_f_actor
  4134.         if @f_actor_index && BattleManager.action_list(:actor).size > 0
  4135.           @f_actor_index -= 1
  4136.           @f_actor_index = 0 if @f_actor_index < 0
  4137.           f_actor = BattleManager.action_list(:actor)[@f_actor_index]
  4138.           if f_actor
  4139.             BattleManager.set_actor(f_actor.index)
  4140.             @status_window.select(BattleManager.actor.index)
  4141.             @actor_command_window.setup(BattleManager.actor)
  4142.           end
  4143.         end
  4144.       end
  4145.  
  4146.       #--------------------------------------------------------------------------
  4147.       # new method: next_f_actor
  4148.       #--------------------------------------------------------------------------
  4149.       def next_f_actor
  4150.         if @f_actor_index && BattleManager.action_list(:actor).size > 0
  4151.           @f_actor_index += 1
  4152.           @f_actor_index = 0 if (@f_actor_index + 1) > BattleManager.action_list(:actor).size
  4153.           f_actor = BattleManager.action_list(:actor)[@f_actor_index]
  4154.           if f_actor
  4155.             BattleManager.set_actor(f_actor.index)
  4156.             @status_window.select(BattleManager.actor.index)
  4157.             @actor_command_window.setup(BattleManager.actor)
  4158.           end
  4159.         end
  4160.       end
  4161.  
  4162.       #--------------------------------------------------------------------------
  4163.       # alias method: turn_start
  4164.       #--------------------------------------------------------------------------
  4165.       alias catb_turn_start turn_start
  4166.       def turn_start
  4167.         if BattleManager.btype?(:catb)
  4168.           @party_command_window.close
  4169.           @actor_command_window.close
  4170.           @status_window.unselect
  4171.           @log_window.wait
  4172.           @log_window.clear
  4173.         else
  4174.           catb_turn_start
  4175.         end
  4176.       end
  4177.  
  4178.       #--------------------------------------------------------------------------
  4179.       # alias method: command_guard
  4180.       #--------------------------------------------------------------------------
  4181.       alias catb_command_guard command_guard
  4182.       def command_guard
  4183.         BattleManager.actor.input.confirm = true
  4184.         catb_command_guard
  4185.         @status_window.draw_item(BattleManager.actor.index)
  4186.       end
  4187.  
  4188.       #--------------------------------------------------------------------------
  4189.       # alias method: command_attack
  4190.       #--------------------------------------------------------------------------
  4191.       alias catb_command_attack command_attack
  4192.       def command_attack
  4193.         catb_command_attack
  4194.         @status_window.draw_item(BattleManager.actor.index)
  4195.       end
  4196.  
  4197.       #--------------------------------------------------------------------------
  4198.       # alias method: on_enemy_ok
  4199.       #--------------------------------------------------------------------------
  4200.       alias catb_on_enemy_ok on_enemy_ok
  4201.       def on_enemy_ok
  4202.         BattleManager.actor.input.confirm = true
  4203.         catb_on_enemy_ok
  4204.       end
  4205.  
  4206.       #--------------------------------------------------------------------------
  4207.       # alias method: on_enemy_cancel
  4208.       #--------------------------------------------------------------------------
  4209.       alias catb_on_enemy_cancel on_enemy_cancel
  4210.       def on_enemy_cancel
  4211.         BattleManager.actor.input.confirm = false
  4212.         catb_on_enemy_cancel
  4213.         @status_window.draw_item(BattleManager.actor.index)
  4214.       end
  4215.  
  4216.       #--------------------------------------------------------------------------
  4217.       # alias method: on_actor_ok
  4218.       #--------------------------------------------------------------------------
  4219.       alias catb_on_actor_ok on_actor_ok
  4220.       def on_actor_ok
  4221.         BattleManager.actor.input.confirm = true
  4222.         catb_on_actor_ok
  4223.       end
  4224.  
  4225.       #--------------------------------------------------------------------------
  4226.       # alias method: on_actor_cancel
  4227.       #--------------------------------------------------------------------------
  4228.       alias catb_on_actor_cancel on_actor_cancel
  4229.       def on_actor_cancel
  4230.         BattleManager.actor.input.confirm = false
  4231.         catb_on_actor_cancel
  4232.         @status_window.draw_item(BattleManager.actor.index)
  4233.       end
  4234.  
  4235.       #--------------------------------------------------------------------------
  4236.       # alias method: on_skill_ok
  4237.       #--------------------------------------------------------------------------
  4238.       alias catb_on_skill_ok on_skill_ok
  4239.       def on_skill_ok
  4240.         catb_on_skill_ok
  4241.         @status_window.draw_item(BattleManager.actor.index)
  4242.       end
  4243.  
  4244.       #--------------------------------------------------------------------------
  4245.       # alias method: on_item_ok
  4246.       #--------------------------------------------------------------------------
  4247.       alias catb_on_item_ok on_item_ok
  4248.       def on_item_ok
  4249.         catb_on_item_ok
  4250.         @status_window.draw_item(BattleManager.actor.index)
  4251.       end
  4252.  
  4253.       #--------------------------------------------------------------------------
  4254.       # alias method: update_info_viewport
  4255.       #--------------------------------------------------------------------------
  4256.       alias catb_update_info_viewport update_info_viewport
  4257.       def update_info_viewport
  4258.         catb_update_info_viewport
  4259.         if BattleManager.btype?(:catb)
  4260.           move_info_viewport(128) if @actor_command_window.active || @actor_window.active || @enemy_window.active || (($game_troop.all_dead? || $game_party.all_dead?)&& @bug_fix1)
  4261.           move_info_viewport(0)   if @party_command_window.active
  4262.         end
  4263.       end
  4264.  
  4265.       #--------------------------------------------------------------------------
  4266.       # rewrite method: perform_collapse_check
  4267.       #--------------------------------------------------------------------------
  4268.       def perform_collapse_check(target)
  4269.         return if YEA::BATTLE::MSG_ADDED_STATES
  4270.         if $game_troop.all_dead? || $game_party.all_dead?
  4271.           if @actor_window.active || @enemy_window.active
  4272.             @bug_fix1 = true
  4273.             @help_window.hide
  4274.             @actor_window.hide.deactivate
  4275.             @enemy_window.hide.deactivate
  4276.           end
  4277.         end
  4278.         target.perform_collapse_effect if target.can_collapse?
  4279.         @log_window.wait
  4280.       end
  4281.  
  4282.     end # Scene_Battle
  4283.     module YEA
  4284.       module BATTLE
  4285.         DEFAULT_BATTLE_SYSTEM = :catb
  4286.       end
  4287.     end
  4288.     #==============================================================================
  4289.     #
  4290.     # ▼ End of File
  4291.     #
  4292.     #==============================================================================



顺带一提...现在的情况很诡异
要么有TP没MP......要么有MP没TP(通常是这个)...............................=.=
【长期招募制作成员】
原创科幻RPG - PURIFICATION (内涵‧严肃‧认真)
https://rpg.blue/thread-371063-1-1.html
回复 支持 反对

使用道具 举报

Lv1.梦旅人

失忆的幽灵

梦石
0
星屑
50
在线时间
504 小时
注册时间
2009-12-14
帖子
501

贵宾

6
发表于 2012-6-1 15:06:43 | 只看该作者
本帖最后由 Raiku 于 2012-6-1 15:14 编辑

将1805行替换成
  1.           if $data_system.opt_display_tp
  2.             rw = rect.width / 2
  3.             draw_actor_mp(actor, rect.x+2, line_height*3, rw - 4)
  4.             draw_actor_tp(actor, rect.x+2+rw, line_height*3, rw - 4)
  5.           else
  6.             draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  7.           end
复制代码
即可

谁说横版没有ATB啦?

点评

成功了...谢谢~~~  发表于 2012-6-1 15:17
如果我能遗忘掉一件事物,我希望遗忘掉我自己
最初你觉得这是一个梦想,最终这只是个妄想
即使你认为你自己是黑暗,即使你认为你自己站在黑暗,但看的见你的人只有我!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-14 13:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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