查看: 2111|回复: 18

[已经解决] 请教一下显示角色三条的问题

[复制链接]
梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
回帖
526
发表于 2017-7-18 21:43:11 | 显示全部楼层 |阅读模式

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

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

×
应该都知道角色状态和战斗有显示hp mp和tp吧,我想额外添加一个变量显示
在mp tp都0时改为显示一个变量条。请问怎么解决。我想额外显示一个变量条
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
梦石
0
星屑
6375
在线时间
1473 小时
注册时间
2015-7-25
回帖
609

极短25参与开拓者

发表于 2017-7-18 22:01:16 | 显示全部楼层
本帖最后由 魔法丶小肉包 于 2017-7-18 23:24 编辑

可以选择照着draw_actor_hp的方法来改一改写个新方法,比如
[pre lang="ruby"]class Window_Base < Window
  def draw_actor_v(actor, x, y, width = 124)
    draw_gauge(x, y, width, $game_variables[1].to_f/100, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, "变量")
    draw_current_and_max_values(x, y, width, $game_variables[1], 100,
      hp_color(actor), normal_color)
  end
end[/pre]
当然各种细节方面可以自己修改,这里只是举个变量条的简单的例子...
然后在想调用的地方调用就好了

举个例子,战斗状态界面,效果:角色mp和tp都为0时,只描绘hp和变量条
[pre lang="ruby"]class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 绘制值槽区域(包括 TP)
  #--------------------------------------------------------------------------
  def draw_gauge_area_with_tp(rect, actor)
    draw_actor_hp(actor, rect.x + 0, rect.y, 72)
    if actor.mp == 0 and actor.tp == 0 #如果mp和tp都为0
      draw_actor_v(actor, rect.x + 82, rect.y, 64) #描绘变量条
    else #否则描绘mp和tp
    draw_actor_mp(actor, rect.x + 82, rect.y, 64)
    draw_actor_tp(actor, rect.x + 156, rect.y, 64)
    end
  end
end[/pre]

点评

我不知道该什么说明,我把判定删了直接显示三条+变量。结果还是三条呢。变量没看见影子  发表于 2017-7-19 12:30
没有显示,是因为你没有把角色的mp和tp都用完(也就是0),当mp和tp都用完,就会显示  发表于 2017-7-19 12:02
新发现:即使在新建工程情况下仍旧不显示变量,所以应该是肉包兄弟哪里没弄好导致  发表于 2017-7-19 11:08
肉包兄弟看看ACE脚本,应该问题出在这里。  发表于 2017-7-19 11:07
我这边大概有7个特殊消耗角色,怎么为7个角色特别加入7个不同的变量条,而其他角色不变。  发表于 2017-7-19 06:43

评分

参与人数 1星屑 +250 收起 理由
RaidenInfinity + 250 认可答案

查看全部评分

笨肉包的游戏讨论群932812135 (实时更新) 喜欢的话欢迎加入~
目前的坑
??? #像素风OC游戏 准备中 短篇-约5小时
花城梦之心 #像素风OC游戏 系统开发+素材绘制中
【不可思议的迷宫】幽灵契约外传:歌莉娅 v0.4 游戏文件已更新
同时更新中~ (沉迷摸鱼中~更新速度较慢请见谅w)
这是属于笨肉包一个人的旅行~(这只肉包又在摸鱼!
旅途的最终目标~ ???(保密~
回复

使用道具 举报

梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
回帖
526
 楼主| 发表于 2017-7-19 08:35:13 | 显示全部楼层
本帖最后由 300英雄 于 2017-7-19 11:09 编辑

QQ截图20170719083440.png 并没有发现变量1的显示,请问肉包兄弟是怎么回事@魔法丶小肉包 QQ截图20170719110947.png

点评

二图是把判定给删了也就是MP=0andTP=0这种判定删了。还是不显示  发表于 2017-7-19 12:28
看截图很明显,mp和tp都有剩余,不为0,那么变量就不会显示  发表于 2017-7-19 12:04
我觉得现在来看肉包兄弟的脚本修改有误哪里看错了,没写可能。我这是完整复制+新建工程。  发表于 2017-7-19 11:10
话说能否解决呢脚本附上了  发表于 2017-7-19 10:44
多半是你用的脸图脚本新写了一个HPMPTP的显示。你全局搜索下看看脚本里面没有“绘制”,全局搜不到可能是名字都不一样,就只能手动进去一个个找  发表于 2017-7-19 09:30
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复

使用道具 举报

梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
回帖
526
 楼主| 发表于 2017-7-19 10:39:32 | 显示全部楼层
本帖最后由 300英雄 于 2017-7-19 10:44 编辑

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, 36, true,  false, 240,  60,  60, DEFAULT],
  351.       "电"       => [   2.0,   1.0, 36, true,  false, 255, 255, 160, DEFAULT],
  352.       "水"       => [   2.0,   1.0, 36, true,  false,   0, 115, 180, DEFAULT],
  353.       "地"       => [   2.0,   1.0, 36, true,  false, 240, 135,  80, DEFAULT],
  354.       "风"       => [   2.0,   1.0, 36, true,  false,  60, 180,  75, DEFAULT],

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

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

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

  414. #==============================================================================
  415. # ■ Switch
  416. #==============================================================================

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

  428. #==============================================================================
  429. # ■ Colour
  430. #==============================================================================

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

  444. #==============================================================================
  445. # ■ Icon
  446. #==============================================================================

  447. module Icon
  448.   
  449.   #--------------------------------------------------------------------------
  450.   # self.no_action
  451.   #--------------------------------------------------------------------------
  452.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  453.    
  454. end # Icon

  455. #==============================================================================
  456. # ■ Numeric
  457. #==============================================================================

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

  468. #==============================================================================
  469. # ■ DataManager
  470. #==============================================================================

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

  496. #==============================================================================
  497. # ■ RPG::UsableItem
  498. #==============================================================================

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

  523. #==============================================================================
  524. # ■ RPG::Enemy
  525. #==============================================================================

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

  554. #==============================================================================
  555. # ■ RPG::Enemy
  556. #==============================================================================

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

  595. #==============================================================================
  596. # ■ BattleManager
  597. #==============================================================================

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

  686. #==============================================================================
  687. # ■ Game_System
  688. #==============================================================================

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

  725. #==============================================================================
  726. # ■ Sprite_Base
  727. #==============================================================================

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

  746. #==============================================================================
  747. # ■ Sprite_Battler
  748. #==============================================================================

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

  863. #==============================================================================
  864. # ■ Sprite_Popup
  865. #==============================================================================

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

  972. #==============================================================================
  973. # ■ Spriteset_Battle
  974. #==============================================================================

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

  1014. #==============================================================================
  1015. # ■ Game_Temp
  1016. #==============================================================================

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

  1036. #==============================================================================
  1037. # ■ Game_Action
  1038. #==============================================================================

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

  1063. #==============================================================================
  1064. # ■ Game_ActionResult
  1065. #==============================================================================

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

  1112. #==============================================================================
  1113. # ■ Game_BattlerBase
  1114. #==============================================================================

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

  1313. #==============================================================================
  1314. # ■ Game_Battler
  1315. #==============================================================================

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

  1468. #==============================================================================
  1469. # ■ Game_Actor
  1470. #==============================================================================

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

  1548. #==============================================================================
  1549. # ■ Game_Enemy
  1550. #==============================================================================

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

  1575. #==============================================================================
  1576. # ■ Game_Unit
  1577. #==============================================================================

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





  1599. #==============================================================================
  1600. # ■ Window_BattleStatus
  1601. #==============================================================================

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

  1781. #==============================================================================
  1782. # ■ Window_BattleActor
  1783. #==============================================================================

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

  1873. #==============================================================================
  1874. # ■ Window_BattleStatusAid
  1875. #==============================================================================

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

  1922. #==============================================================================
  1923. # ■ Window_BattleEnemy
  1924. #==============================================================================

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

  2071. #==============================================================================
  2072. # ■ Window_BattleHelp
  2073. #==============================================================================

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

  2182. #==============================================================================
  2183. # ■ Window_BattleLog
  2184. #==============================================================================

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

  2346. #==============================================================================
  2347. # ■ Window_SkillList
  2348. #==============================================================================

  2349. class Window_SkillList < Window_Selectable
  2350.   
  2351.   #--------------------------------------------------------------------------
  2352.   # overwrite method: spacing
  2353.   #--------------------------------------------------------------------------
  2354.   def spacing
  2355.     return 8 if $game_party.in_battle
  2356.     return super
  2357.   end
  2358.   
  2359. end # Window_SkillList

  2360. #==============================================================================
  2361. # ■ Window_ItemList
  2362. #==============================================================================

  2363. class Window_ItemList < Window_Selectable
  2364.   
  2365.   #--------------------------------------------------------------------------
  2366.   # overwrite method: spacing
  2367.   #--------------------------------------------------------------------------
  2368.   def spacing
  2369.     return 8 if $game_party.in_battle
  2370.     return super
  2371.   end
  2372.   
  2373. end # Window_ItemList

  2374. #==============================================================================
  2375. # ■ Scene_Battle
  2376. #==============================================================================

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

  2525.   end
  2526.   
  2527.   #--------------------------------------------------------------------------
  2528.   # alias method: create_actor_command_window
  2529.   #--------------------------------------------------------------------------
  2530.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2531.   def create_actor_command_window
  2532.     scene_battle_create_actor_command_window_abe

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

  3013. #==============================================================================
  3014. #
  3015. # ▼ End of File
  3016. #
  3017. #==============================================================================
复制代码

P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部