查看: 2623|回复: 14

[已经解决] 有辦法顯示敵人攻擊動畫嗎?

[复制链接]
梦石
0
星屑
539
在线时间
120 小时
注册时间
2018-2-22
回帖
9
发表于 2018-2-22 23:25:25 | 显示全部楼层 |阅读模式

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

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

×
本人使用版本是VA

总觉得敌人攻击时没有特效少了点什么

我是用姨妈的那个战斗脚本

有办法显示敌人攻击的动画吗?
梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2018-2-23 02:23:37 | 显示全部楼层
Scene_Battle里面的这一段修改掉
  1.   def show_attack_animation(targets)
  2.     if @subject.actor?
  3.       show_normal_animation(targets, @subject.atk_animation_id1, false)
  4.       show_normal_animation(targets, @subject.atk_animation_id2, true)
  5.     else
  6.       Sound.play_enemy_attack
  7.       abs_wait_short
  8.     end
  9.   end
复制代码

这里是先判断是否是角色的行动,如果是角色的行动就在敌人身上显示动画,但是角色立绘不会显示到战斗背景中而是在选择栏里,所以敌人的行动就放个音效含含糊糊地给他混过去
还有一个Spriteset_Battle需要添加角色的相关处理(可能你的战斗脚本已经做了,如果是个类似sideview的横版战斗那角色坐标之类的就没问题了),其他的我不清楚

点评

不会不会,很感谢帮忙了  发表于 2018-2-23 14:06
是的,這裡只是其中一個要改的地方而已···我不擅長改這類所以只能幫到這了  发表于 2018-2-23 14:00
改完了之后还没有,所以是还要再改別的吗  发表于 2018-2-23 13:58
最后那个false或者true是决定动画要不要反转  发表于 2018-2-23 10:02
我只会改这段,你把else里面的两句改成show_normal_animation(targets, aid, false)就好,其中,aid需要指定一个动画,因为敌人没武器就没攻击动画  发表于 2018-2-23 10:02
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
回帖
526
发表于 2018-2-23 11:58:58 | 显示全部楼层
本帖最后由 300英雄 于 2018-2-23 12:04 编辑

楼主你要的战斗东西
ACE脚本
  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 = 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        = "所有单位"
  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       => 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 MP",    # SprintF for MP damage.
  290.       :mp_heal    => "+%s MP",    # 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   => "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     => "失败",    # 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, 24, true,  false, 255, 255, 255, DEFAULT],
  333.       "HP_HEAL"  => [   2.0,   1.0, 24, true,  false, 130, 250, 130, DEFAULT],
  334.       "MP_DMG"   => [   2.0,   1.0, 24, true,  false, 220, 180, 255, DEFAULT],
  335.       "MP_HEAL"  => [   2.0,   1.0, 24, true,  false, 160, 230, 255, DEFAULT],
  336.       "TP_DMG"   => [   2.0,   1.0, 24, true,  false, 242, 108,  78, DEFAULT],
  337.       "TP_HEAL"  => [   2.0,   1.0, 24, 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.       "火"       => [   2.0,   1.0, 24, true,  false, 240,  60,  60, DEFAULT],
  351.       "电"       => [   2.0,   1.0, 24, true,  false, 255, 255, 160, DEFAULT],
  352.       "水"       => [   2.0,   1.0, 24, true,  false,   0, 115, 180, DEFAULT],
  353.       "地"       => [   2.0,   1.0, 24, true,  false, 240, 135,  80, DEFAULT],
  354.       "风"       => [   2.0,   1.0, 24, true,  false,  60, 180,  75, DEFAULT],
  355.       "圣"       => [   2.0,   1.0, 36, true,  false, 175, 210, 255, DEFAULT],
  356.       "光"       => [   2.0,   1.0, 36, true,  false, 175, 210, 255, DEFAULT],
  357.       "暗"       => [   2.0,   1.0, 36, true,  false, 110,  80, 130, DEFAULT],


  358.     } # Do not remove this.
  359.    
  360.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  361.     # - Streamlined Messages -
  362.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  363.     # Want to remove some of those annoying messages that appear all the time?
  364.     # Now you can! Select which messages you want to enable or disable. Some of
  365.     # these messages will be rendered useless due to popups.
  366.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  367.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  368.     MSG_CURRENT_STATE  = true  # Show which states has affected battler.
  369.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  370.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  371.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  372.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  373.     MSG_FAILURE_HIT    = true  # Show effect failed against target.
  374.     MSG_CRITICAL_HIT   = true  # Show attack was a critical hit.
  375.     MSG_HIT_MISSED     = true  # Show attack missed the target.
  376.     MSG_EVASION        = true  # Show attack was evaded by the target.
  377.     MSG_HP_DAMAGE      = true  # Show HP damage to target.
  378.     MSG_MP_DAMAGE      = true  # Show MP damage to target.
  379.     MSG_TP_DAMAGE      = true  # Show TP damage to target.
  380.     MSG_ADDED_STATES   = true  # Show target's added states.
  381.     MSG_REMOVED_STATES = true  # Show target's removed states.
  382.     MSG_CHANGED_BUFFS  = true  # Show target's changed buffs.
  383.    
  384.   end # BATTLE
  385. end # YEA

  386. #==============================================================================
  387. # ▼ Editting anything past this point may potentially result in causing
  388. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  389. # halitosis so edit at your own risk.
  390. #==============================================================================

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

  417. #==============================================================================
  418. # ■ Switch
  419. #==============================================================================

  420. module Switch
  421.   
  422.   #--------------------------------------------------------------------------
  423.   # self.hide_popups
  424.   #--------------------------------------------------------------------------
  425.   def self.hide_popups
  426.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  427.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  428.   end
  429.   
  430. end # Switch

  431. #==============================================================================
  432. # ■ Colour
  433. #==============================================================================

  434. module Colour
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # self.text_colour
  438.   #--------------------------------------------------------------------------
  439.   def self.text_colour(index)
  440.     windowskin = Cache.system("Window")
  441.     x = 64 + (index % 8) * 8
  442.     y = 96 + (index / 8) * 8
  443.     return windowskin.get_pixel(x, y)
  444.   end
  445.   
  446. end # Colour

  447. #==============================================================================
  448. # ■ Icon
  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. # ■ Numeric
  460. #==============================================================================

  461. class Numeric
  462.   
  463.   #--------------------------------------------------------------------------
  464.   # new method: group_digits
  465.   #--------------------------------------------------------------------------
  466.   unless $imported["YEA-CoreEngine"]
  467.   def group; return self.to_s; end
  468.   end # $imported["YEA-CoreEngine"]
  469.    
  470. end # Numeric

  471. #==============================================================================
  472. # ■ DataManager
  473. #==============================================================================

  474. module DataManager
  475.   
  476.   #--------------------------------------------------------------------------
  477.   # alias method: load_database
  478.   #--------------------------------------------------------------------------
  479.   class <<self; alias load_database_abe load_database; end
  480.   def self.load_database
  481.     load_database_abe
  482.     load_notetags_abe
  483.   end
  484.   
  485.   #--------------------------------------------------------------------------
  486.   # new method: load_notetags_abe
  487.   #--------------------------------------------------------------------------
  488.   def self.load_notetags_abe
  489.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  490.     for group in groups
  491.       for obj in group
  492.         next if obj.nil?
  493.         obj.load_notetags_abe
  494.       end
  495.     end
  496.   end
  497.   
  498. end # DataManager

  499. #==============================================================================
  500. # ■ RPG::UsableItem
  501. #==============================================================================

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

  526. #==============================================================================
  527. # ■ RPG::Enemy
  528. #==============================================================================

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

  557. #==============================================================================
  558. # ■ RPG::Enemy
  559. #==============================================================================

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

  598. #==============================================================================
  599. # ■ BattleManager
  600. #==============================================================================

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

  690. #==============================================================================
  691. # ■ Game_System
  692. #==============================================================================

  693. class Game_System
  694.   
  695.   #--------------------------------------------------------------------------
  696.   # new method: battle_system
  697.   #--------------------------------------------------------------------------
  698.   def battle_system
  699.     if @battle_system.nil?
  700.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  701.     else
  702.       return battle_system_corrected(@battle_system)
  703.     end
  704.   end
  705.   
  706.   #--------------------------------------------------------------------------
  707.   # new method: set_battle_system
  708.   #--------------------------------------------------------------------------
  709.   def set_battle_system(type)
  710.     case type
  711.     when :dtb; @battle_system = :dtb
  712.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  713.     else;      @battle_system = :dtb
  714.     end
  715.   end
  716.   
  717.   #--------------------------------------------------------------------------
  718.   # new method: battle_system_corrected
  719.   #--------------------------------------------------------------------------
  720.   def battle_system_corrected(type)
  721.     case type
  722.     when :dtb; return :dtb
  723.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  724.     else;      return :dtb
  725.     end
  726.   end
  727.   
  728. end # Game_System

  729. #==============================================================================
  730. # ■ Sprite_Base
  731. #==============================================================================

  732. class Sprite_Base < Sprite
  733.   
  734.   #--------------------------------------------------------------------------
  735.   # new method: start_pseudo_animation
  736.   #--------------------------------------------------------------------------
  737.   unless $imported["YEA-CoreEngine"]
  738.   def start_pseudo_animation(animation, mirror = false)
  739.     dispose_animation
  740.     @animation = animation
  741.     return if @animation.nil?
  742.     @ani_mirror = mirror
  743.     set_animation_rate
  744.     @ani_duration = @animation.frame_max * @ani_rate + 1
  745.     @ani_sprites = []
  746.   end
  747.   end # $imported["YEA-CoreEngine"]
  748.   
  749. end # Sprite_Base

  750. #==============================================================================
  751. # ■ Sprite_Battler
  752. #==============================================================================

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

  867. #==============================================================================
  868. # ■ Sprite_Popup
  869. #==============================================================================

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

  976. #==============================================================================
  977. # ■ Spriteset_Battle
  978. #==============================================================================

  979. class Spriteset_Battle
  980.   
  981.   #--------------------------------------------------------------------------
  982.   # public instance variables
  983.   #--------------------------------------------------------------------------
  984.   attr_accessor :actor_sprites
  985.   attr_accessor :enemy_sprites
  986.   attr_accessor :viewport1
  987.   attr_accessor :viewportPopups
  988.   
  989.   #--------------------------------------------------------------------------
  990.   # alias method: create_viewports
  991.   #--------------------------------------------------------------------------
  992.   alias spriteset_battle_create_viewports_abe create_viewports
  993.   def create_viewports
  994.     spriteset_battle_create_viewports_abe
  995.     @viewportPopups = Viewport.new
  996.     @viewportPopups.z = 200
  997.   end
  998.   
  999.   #--------------------------------------------------------------------------
  1000.   # alias method: dispose_viewports
  1001.   #--------------------------------------------------------------------------
  1002.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1003.   def dispose_viewports
  1004.     spriteset_battle_dispose_viewports_abe
  1005.     @viewportPopups.dispose
  1006.   end
  1007.   
  1008.   #--------------------------------------------------------------------------
  1009.   # alias method: update_viewports
  1010.   #--------------------------------------------------------------------------
  1011.   alias spriteset_battle_update_viewports_abe update_viewports
  1012.   def update_viewports
  1013.     spriteset_battle_update_viewports_abe
  1014.     @viewportPopups.update
  1015.   end
  1016.   
  1017. end # Spriteset_Battle

  1018. #==============================================================================
  1019. # ■ Game_Temp
  1020. #==============================================================================

  1021. class Game_Temp
  1022.   
  1023.   #--------------------------------------------------------------------------
  1024.   # public instance variables
  1025.   #--------------------------------------------------------------------------
  1026.   attr_accessor :battle_aid
  1027.   attr_accessor :evaluating
  1028.   attr_accessor :iconset
  1029.   
  1030.   #--------------------------------------------------------------------------
  1031.   # alias method: initialize
  1032.   #--------------------------------------------------------------------------
  1033.   alias game_temp_initialize_abe initialize
  1034.   def initialize
  1035.     game_temp_initialize_abe
  1036.     @iconset = Cache.system("Iconset")
  1037.   end
  1038.   
  1039. end # Game_Temp

  1040. #==============================================================================
  1041. # ■ Game_Action
  1042. #==============================================================================

  1043. class Game_Action
  1044.   
  1045.   #--------------------------------------------------------------------------
  1046.   # overwrite method: speed
  1047.   #--------------------------------------------------------------------------
  1048.   def speed
  1049.     speed = subject.agi
  1050.     speed += item.speed if item
  1051.     speed += subject.atk_speed if attack?
  1052.     return speed
  1053.   end
  1054.   
  1055.   #--------------------------------------------------------------------------
  1056.   # alias method: evaluate_item_with_target
  1057.   #--------------------------------------------------------------------------
  1058.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1059.   def evaluate_item_with_target(target)
  1060.     $game_temp.evaluating = true
  1061.     result = evaluate_item_with_target_abe(target)
  1062.     $game_temp.evaluating = false
  1063.     return result
  1064.   end
  1065.   
  1066. end # Game_Action

  1067. #==============================================================================
  1068. # ■ Game_ActionResult
  1069. #==============================================================================

  1070. class Game_ActionResult
  1071.   
  1072.   #--------------------------------------------------------------------------
  1073.   # alias method: clear
  1074.   #--------------------------------------------------------------------------
  1075.   alias game_actionresult_clear_abe clear
  1076.   def clear
  1077.     game_actionresult_clear_abe
  1078.     clear_stored_damage
  1079.   end
  1080.   
  1081.   #--------------------------------------------------------------------------
  1082.   # new method: clear_stored_damage
  1083.   #--------------------------------------------------------------------------
  1084.   def clear_stored_damage
  1085.     @stored_hp_damage = 0
  1086.     @stored_mp_damage = 0
  1087.     @stored_tp_damage = 0
  1088.     @stored_hp_drain = 0
  1089.     @stored_mp_drain = 0
  1090.   end
  1091.   
  1092.   #--------------------------------------------------------------------------
  1093.   # new method: store_damage
  1094.   #--------------------------------------------------------------------------
  1095.   def store_damage
  1096.     @stored_hp_damage += @hp_damage
  1097.     @stored_mp_damage += @mp_damage
  1098.     @stored_tp_damage += @tp_damage
  1099.     @stored_hp_drain += @hp_drain
  1100.     @stored_mp_drain += @mp_drain
  1101.   end
  1102.   
  1103.   #--------------------------------------------------------------------------
  1104.   # new method: restore_damage
  1105.   #--------------------------------------------------------------------------
  1106.   def restore_damage
  1107.     @hp_damage = @stored_hp_damage
  1108.     @mp_damage = @stored_mp_damage
  1109.     @tp_damage = @stored_tp_damage
  1110.     @hp_drain = @stored_hp_drain
  1111.     @mp_drain = @stored_mp_drain
  1112.     clear_stored_damage
  1113.   end
  1114.   
  1115. end # Game_ActionResult

  1116. #==============================================================================
  1117. # ■ Game_BattlerBase
  1118. #==============================================================================

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

  1317. #==============================================================================
  1318. # ■ Game_Battler
  1319. #==============================================================================

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

  1472. #==============================================================================
  1473. # ■ Game_Actor
  1474. #==============================================================================

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

  1552. #==============================================================================
  1553. # ■ Game_Enemy
  1554. #==============================================================================

  1555. class Game_Enemy < Game_Battler
  1556.   
  1557.   #--------------------------------------------------------------------------
  1558.   # overwrite method: perform_damage_effect
  1559.   #--------------------------------------------------------------------------
  1560.   def perform_damage_effect
  1561.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1562.     Sound.play_enemy_damage
  1563.   end
  1564.   
  1565.   #--------------------------------------------------------------------------
  1566.   # new methods: attack_animation_id
  1567.   #--------------------------------------------------------------------------
  1568.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1569.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1570.   
  1571.   #--------------------------------------------------------------------------
  1572.   # new method: sprite
  1573.   #--------------------------------------------------------------------------
  1574.   def sprite
  1575.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1576.   end
  1577.   
  1578. end # Game_Enemy

  1579. #==============================================================================
  1580. # ■ Game_Unit
  1581. #==============================================================================

  1582. class Game_Unit
  1583.   
  1584.   #--------------------------------------------------------------------------
  1585.   # alias method: make_actions
  1586.   #--------------------------------------------------------------------------
  1587.   alias game_unit_make_actions_abe make_actions
  1588.   def make_actions
  1589.     game_unit_make_actions_abe
  1590.     refresh_autobattler_status_window
  1591.   end
  1592.   
  1593.   #--------------------------------------------------------------------------
  1594.   # new method: refresh_autobattler_status_window
  1595.   #--------------------------------------------------------------------------
  1596.   def refresh_autobattler_status_window
  1597.     return unless SceneManager.scene_is?(Scene_Battle)
  1598.     return unless self.is_a?(Game_Party)
  1599.     SceneManager.scene.refresh_autobattler_status_window
  1600.   end
  1601.   
  1602. end # Game_Unit





  1603. #==============================================================================
  1604. # ■ Window_BattleStatus
  1605. #==============================================================================

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

  1785. #==============================================================================
  1786. # ■ Window_BattleActor
  1787. #==============================================================================

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

  1877. #==============================================================================
  1878. # ■ Window_BattleStatusAid
  1879. #==============================================================================

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

  1926. #==============================================================================
  1927. # ■ Window_BattleEnemy
  1928. #==============================================================================

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

  2075. #==============================================================================
  2076. # ■ Window_BattleHelp
  2077. #==============================================================================

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

  2186. #==============================================================================
  2187. # ■ Window_BattleLog
  2188. #==============================================================================

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

  2350. #==============================================================================
  2351. # ■ Window_SkillList
  2352. #==============================================================================

  2353. class Window_SkillList < Window_Selectable
  2354.   
  2355.   #--------------------------------------------------------------------------
  2356.   # overwrite method: spacing
  2357.   #--------------------------------------------------------------------------
  2358.   def spacing
  2359.     return 8 if $game_party.in_battle
  2360.     return super
  2361.   end
  2362.   
  2363. end # Window_SkillList

  2364. #==============================================================================
  2365. # ■ Window_ItemList
  2366. #==============================================================================

  2367. class Window_ItemList < Window_Selectable
  2368.   
  2369.   #--------------------------------------------------------------------------
  2370.   # overwrite method: spacing
  2371.   #--------------------------------------------------------------------------
  2372.   def spacing
  2373.     return 8 if $game_party.in_battle
  2374.     return super
  2375.   end
  2376.   
  2377. end # Window_ItemList

  2378. #==============================================================================
  2379. # ■ Scene_Battle
  2380. #==============================================================================

  2381. class Scene_Battle < Scene_Base
  2382.   
  2383.   #--------------------------------------------------------------------------
  2384.   # public instance variables
  2385.   #--------------------------------------------------------------------------
  2386.   attr_accessor :enemy_window
  2387.   attr_accessor :info_viewport
  2388.   attr_accessor :spriteset
  2389.   attr_accessor :status_window
  2390.   attr_accessor :status_aid_window
  2391.   attr_accessor :subject
  2392.   
  2393.   #--------------------------------------------------------------------------
  2394.   # alias method: create_spriteset
  2395.   #--------------------------------------------------------------------------
  2396.   alias scene_battle_create_spriteset_abe create_spriteset
  2397.   def create_spriteset
  2398.     BattleManager.init_battle_type
  2399.     scene_battle_create_spriteset_abe
  2400.   end
  2401.   
  2402.   #--------------------------------------------------------------------------
  2403.   # alias method: update_basic
  2404.   #--------------------------------------------------------------------------
  2405.   alias scene_battle_update_basic_abe update_basic
  2406.   def update_basic
  2407.   scene_battle_update_basic_abe
  2408. #~   $game_party.gain_item($data_items[187], 1) if Input.trigger?(:$R_Key_O)
  2409. #~   $game_party.gain_item($data_items[181], 1) if Kboard.keyb($R_Key_U) or Kboard.keyb($R_Key_I)
  2410.     update_debug
  2411.   end
  2412.   
  2413.   #--------------------------------------------------------------------------
  2414.   # new method: update_debug
  2415.   #--------------------------------------------------------------------------
  2416.   def update_debug
  2417.     return unless $TEST || $BTEST
  2418.     debug_heal_party if Input.trigger?(:F5)
  2419.     $game_variables[1020] = 500 if Input.trigger?(:F7)
  2420.     $game_variables[1009] = 500 if Input.trigger?(:F7)
  2421.     $game_variables[1022] = 800 if Input.trigger?(:F7)
  2422.     $game_variables[1027] = 500 if Input.trigger?(:F7)
  2423.     $game_variables[1028] = 500 if Input.trigger?(:F7)
  2424.     $game_variables[1029] = 500 if Input.trigger?(:F7)
  2425.     $game_variables[1056] = 500 if Input.trigger?(:F7)
  2426.     $game_variables[1055] = 500 if Input.trigger?(:F7)
  2427.     $game_variables[1030] = 9 if Input.trigger?(:F7)
  2428.     $game_variables[1034] = 500 if Input.trigger?(:F7)
  2429.     $game_variables[1035] = 500000 if Input.trigger?(:F7)
  2430.     $game_variables[1060] = 500 if Input.trigger?(:F7)
  2431.     $game_variables[1062] = 54321 if Input.trigger?(:F7)
  2432.     debug_damage_party if Input.trigger?(:F6)
  2433.     debug_fill_tp if Input.trigger?(:F7)
  2434.     debug_kill_all if Input.trigger?(:F8)
  2435.     debug_fill_tp if Input.trigger?(:F9)
  2436.     debug_fill_mp if Input.trigger?(:F9)
  2437. #~     debug_fill_mp if Input.trigger?(:VK_L)
  2438.   end
  2439.   
  2440.   #--------------------------------------------------------------------------
  2441.   # new method: debug_heal_party
  2442.   #--------------------------------------------------------------------------
  2443.   def debug_heal_party
  2444.     Sound.play_recovery
  2445.     for member in $game_party.battle_members
  2446.       member.recover_all
  2447.     end
  2448.     @status_window.refresh
  2449.   end
  2450.   
  2451.   #--------------------------------------------------------------------------
  2452.   # new method: debug_damage_party
  2453.   #--------------------------------------------------------------------------
  2454.   def debug_damage_party
  2455.     Sound.play_actor_damage
  2456.     for member in $game_party.alive_members
  2457.       member.hp = 1
  2458.       member.mp = 1
  2459.       member.tp = 1
  2460.     end
  2461.     @status_window.refresh
  2462.   end
  2463.   
  2464.   #--------------------------------------------------------------------------
  2465.   # new method: debug_fill_tp
  2466.   #--------------------------------------------------------------------------
  2467.   def debug_fill_tp
  2468.     Sound.play_recovery
  2469.     for member in $game_party.alive_members
  2470.       member.tp = member.max_tp
  2471.     end
  2472.     @status_window.refresh
  2473.   end
  2474.   
  2475.   
  2476.     #--------------------------------------------------------------------------
  2477.   # new method: debug_fill_mp
  2478.   #--------------------------------------------------------------------------
  2479.   def debug_fill_mp
  2480.     Sound.play_recovery
  2481.     for member in $game_party.alive_members
  2482.       member.mp = member.mmp
  2483.     end
  2484.     @status_window.refresh
  2485.   end

  2486.   
  2487.   #--------------------------------------------------------------------------
  2488.   # new method: debug_kill_all
  2489.   #--------------------------------------------------------------------------
  2490.   def debug_kill_all
  2491.     for enemy in $game_troop.alive_members
  2492.       enemy.hp = 0
  2493.       enemy.perform_collapse_effect
  2494.     end
  2495.     BattleManager.judge_win_loss
  2496.     @log_window.wait
  2497.     @log_window.wait_for_effect
  2498.   end
  2499.   
  2500.   #--------------------------------------------------------------------------
  2501.   # alias method: create_all_windows
  2502.   #--------------------------------------------------------------------------
  2503.   alias scene_battle_create_all_windows_abe create_all_windows
  2504.   def create_all_windows
  2505.     scene_battle_create_all_windows_abe
  2506.     create_battle_status_aid_window
  2507.     set_help_window
  2508.   end
  2509.   
  2510.   #--------------------------------------------------------------------------
  2511.   # alias method: create_info_viewport
  2512.   #--------------------------------------------------------------------------
  2513.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2514.   def create_info_viewport
  2515.     scene_battle_create_info_viewport_abe
  2516.     @status_window.refresh
  2517.   end
  2518.   
  2519.   #--------------------------------------------------------------------------
  2520.   # new method: create_battle_status_aid_window
  2521.   #--------------------------------------------------------------------------
  2522.   def create_battle_status_aid_window
  2523.     @status_aid_window = Window_BattleStatusAid.new
  2524.     @status_aid_window.status_window = @status_window
  2525.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2526.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2527.   end
  2528.   
  2529.   #--------------------------------------------------------------------------
  2530.   # overwrite method: create_help_window
  2531.   #--------------------------------------------------------------------------
  2532.   def create_help_window
  2533.     @help_window = Window_BattleHelp.new
  2534.     @help_window.hide
  2535.   end
  2536.   
  2537.   #--------------------------------------------------------------------------
  2538.   # new method: set_help_window
  2539.   #--------------------------------------------------------------------------
  2540.   def set_help_window
  2541.     @help_window.actor_window = @actor_window
  2542.     @help_window.enemy_window = @enemy_window
  2543.   end
  2544.   
  2545.   #--------------------------------------------------------------------------
  2546.   # alias method: create_party_command_window
  2547.   #--------------------------------------------------------------------------
  2548.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2549.   def create_party_command_window
  2550.     scene_battle_create_party_command_window_abe

  2551.   end
  2552.   
  2553.   #--------------------------------------------------------------------------
  2554.   # alias method: create_actor_command_window
  2555.   #--------------------------------------------------------------------------
  2556.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2557.   def create_actor_command_window
  2558.     scene_battle_create_actor_command_window_abe

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

  3050. #==============================================================================
  3051. #
  3052. # ▼ End of File
  3053. #
  3054. #==============================================================================
复制代码




点评

他已經用了一個戰鬥腳本了···不過姨媽腳本我是沒聽過╮(╯*╰)╭  发表于 2018-2-23 14:08
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复 1 0

使用道具 举报

梦石
0
星屑
539
在线时间
120 小时
注册时间
2018-2-22
回帖
9
 楼主| 发表于 2018-2-23 14:05:37 | 显示全部楼层
300英雄 发表于 2018-2-23 11:58
楼主你要的战斗东西
[fold= ACE脚本]
#================================================================ ...

这好像是独立的战斗系统,可能用不到但还是谢大大

点评

这就是脸图战斗脚本,双方都有动画。。。。  发表于 2018-2-23 23:07
那用楼下的,但是要注意,角色坐标(也就是显示动画的位置screen_x、screen_y)你要自己改  发表于 2018-2-23 20:56
回复

使用道具 举报

梦石
8
星屑
4809
在线时间
1568 小时
注册时间
2014-1-9
回帖
373

开拓者

发表于 2018-2-23 19:52:16 | 显示全部楼层
  1. class Game_Actor < Game_Battler
  2.   
  3.   def use_sprite?
  4.     return true
  5.   end
  6.   
  7.   def screen_x
  8.     Graphics.width / 2
  9.   end
  10.   
  11.   def screen_y
  12.     Graphics.height
  13.   end
  14.   
  15.   def screen_z
  16.     100
  17.   end
  18.   
  19. end

  20. class Scene_Battle < Scene_Base

  21.   def show_attack_animation(targets)
  22.     if @subject.actor?
  23.       show_normal_animation(targets, @subject.atk_animation_id1, false)
  24.       show_normal_animation(targets, @subject.atk_animation_id2, true)
  25.     else
  26.       show_normal_animation(targets, 1)#1为动画ID,也可以调成其他的
  27.       abs_wait_short
  28.     end
  29.   end
  30.   
  31. end
复制代码
插到main之前,几乎都是重定义,可能会跟你的脚本冲突

评分

参与人数 2赞 +2 收起 理由
alaga1119 + 1 认可答案
chd114 + 1 认可答案

查看全部评分

回复 2 0

使用道具 举报

梦石
0
星屑
539
在线时间
120 小时
注册时间
2018-2-22
回帖
9
 楼主| 发表于 2018-2-24 13:31:00 | 显示全部楼层
余音·魔眼 发表于 2018-2-23 19:52
插到main之前,几乎都是重定义,可能会跟你的脚本冲突

這個效果很好,感謝大大
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部