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

Project1

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

[已经过期] 求修改一下yanfly大佬的这部分脚本

[复制链接]

Lv3.寻梦者

梦石
1
星屑
3913
在线时间
592 小时
注册时间
2007-8-14
帖子
182
跳转到指定楼层
1
发表于 2018-4-5 16:11:33 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x

如图,因为只有3个角色,所以每个角色所占的面积很长,不太好看
所以请问有没有方法可以把脸图替换成立绘,就像下图这样:


或者把脸图的部分替换成长条的图片,就像下图这样:



赞美灵魂……

Lv3.寻梦者

梦石
1
星屑
3913
在线时间
592 小时
注册时间
2007-8-14
帖子
182
2
 楼主| 发表于 2018-4-5 16:12:06 | 只看该作者
本帖最后由 cryhades 于 2018-4-5 16:46 编辑

忘记加脚本了……
附上脚本:
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - 战斗系统 v1.22
  4. # -- 最后更新: 2012.03.04
  5. # -- 使用难度: 普通, 困难
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-BattleEngine"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.03.04 - Bug fixed: Input crash bug.
  17. # 2012.02.13 - Bug fixed: Odd Victory game crash fixed.
  18. # 2012.02.12 - Bug fixed: Displayed damage in combat log is correct now.
  19. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  20. # 2012.01.24 - Compatibility Update: Enemy Levels
  21. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  22. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  23. #              animation only once.
  24. #            - Reduced lag from battle system constantly recreating bitmaps.
  25. # 2012.01.10 - Compatibility Update: Battle System FTB
  26. # 2012.01.09 - Anticrash methods implemented.
  27. #            - Damage Popups are now separate for damage formulas and recovery.
  28. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  29. # 2012.01.02 - Compatibility Update: Target Manager
  30. #            - Added Option: AUTO_FAST
  31. #            - Random hits now show animations individually.
  32. # 2011.12.30 - Compatibility Update: Enemy Levels
  33. #            - Added Option to center the actors in the HUD.
  34. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  35. #            - Default battle system bug fixes are now included from YEA's Ace
  36. #              Core Engine.
  37. #            - Groundwork is also made to support future battle system types.
  38. #            - Multi-hit actions no longer linger when a target dies during the
  39. #              middle of one of the hits.
  40. #            - Compatibility Update: Lunatic Objects v1.02
  41. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  42. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  43. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  44. #            - Bug fixed: During State popup fix.
  45. #            - Added HIDE_POPUP_SWITCH.
  46. # 2011.12.17 - Compatibiilty Update: Cast Animations
  47. # 2011.12.15 - Compatibility Update: Battle Command List
  48. # 2011.12.14 - Compatibility Update: Lunatic Objects
  49. # 2011.12.13 - Compatibility Update: Command Party
  50. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  51. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  52. #            - Popup graphical bug fixed.
  53. #            - Bug fixed: Didn't wait for boss dead animations.
  54. #            - Bug fixed: Surprise attacks that froze the game.
  55. #            - Bug fixed: Popups didn't show for straight recovery effects.
  56. # 2011.12.08 - Finished Script.
  57. # 2011.12.04 - Started Script.
  58. #
  59. #==============================================================================
  60. # ▼ 介绍
  61. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  62. # 本脚本可以作为默认战斗系统的一个插件,允许你更轻松的管理战斗系统,自定义各种
  63. # 功能。
  64. # 以下为本脚本提供的新功能:
  65. #
  66. # -----------------------------------------------------------------------------
  67. # 动画修复
  68. # -----------------------------------------------------------------------------
  69. # 防止过多的动画重叠(使屏幕看起来非常难看),并防止动画在两个长时间播放的双持
  70. # 攻击动画之间发生冲突。
  71. # 尽管在Yanfly Engine Ace - 核心引擎 脚本中已经包含本修复内容,在本脚本中同样添
  72. # 加了此功能,以防止某些人不使用核心引擎脚本。
  73. #
  74. # -----------------------------------------------------------------------------
  75. # 敌人动画
  76. # -----------------------------------------------------------------------------
  77. # 敌人在攻击、使用技能时可以播放一个动画,而不是像原来的只是播放技能音效+画面震
  78. # 动。现在敌人使用的技能动画将在队伍状态栏处播放,且能追踪角色目标的位置。
  79. #
  80. # -----------------------------------------------------------------------------
  81. # 左/右 选择指令
  82. # -----------------------------------------------------------------------------
  83. # 默认下当你设定好前三个角色的行动后,到最后一个人行动了,想修改之前角色的行动
  84. # 时,你需要取消之前全部角色已设定好的行动。十分麻烦浪费时间。现在你可以通过左
  85. # 右方向键来选择你想要修改行动指令的角色了,变得方便快捷。还添加了玩家无需选择
  86. # "战斗"、"撤退"指令的功能。
  87. #
  88. # -----------------------------------------------------------------------------
  89. # 弹出式信息
  90. # -----------------------------------------------------------------------------
  91. # 造成伤害、添加状态、添加能力值增益、发动暴击、触发属性弱点、攻击未命中等都可以
  92. # 弹出式显示,明快而简介,玩家无须再阅读繁杂的战斗信息。
  93. #
  94. # -----------------------------------------------------------------------------
  95. # 选择目标时隐藏窗口
  96. # -----------------------------------------------------------------------------
  97. # 选择目标时会闪光强调选中的目标,同时在画面上方显示该敌人的名字。在多个目标的
  98. # 技能中,添加了确认步骤。在确认步骤中全部目标会被强调,帮助窗口中也会显示技能
  99. # 的范围(像 "全体敌人"或"一个随机敌人").RPG Maker VX Ace默认下是跳过这一步骤的.
  100. #
  101. # -----------------------------------------------------------------------------
  102. # 开启或关闭特殊效果及文本
  103. # -----------------------------------------------------------------------------
  104. # 不是所有人都喜欢角色受伤时画面震动或敌人受伤时闪烁的。这些效果可以选择性开启
  105. # 或关闭。某些文本你也可以选择显示或隐藏。在弹出式信息中弹出太多文本会显得冗杂。
  106. #
  107. # -----------------------------------------------------------------------------
  108. # 可视战斗状态窗口
  109. # -----------------------------------------------------------------------------
  110. # 不像默认只包含角色名字、HPMP条的角色状态窗口,新的状态窗口可以显示角色脸图,
  111. # 滚动显示多个状态等。同时你还可以降低状态窗口的刷新率,避免潜在的系统卡顿。
  112. #
  113. # -----------------------------------------------------------------------------
  114. # 改变窗口位置
  115. # -----------------------------------------------------------------------------
  116. # 技能和物品窗口不会覆盖在战场上,遮挡玩家视线了,而是显示在靠下的地方。
  117. #
  118. #==============================================================================
  119. # ▼ 安装方式
  120. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  121. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  122. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  123. #
  124. # -----------------------------------------------------------------------------
  125. # 技能备注 - 在数据库-技能中可以使用的备注.
  126. # -----------------------------------------------------------------------------
  127. # <单个动画>
  128. # 可以使多目标的技能只显示一个动画.
  129. #
  130. # -----------------------------------------------------------------------------
  131. # 物品备注 - 在数据库-物品中可以使用的备注.
  132. # -----------------------------------------------------------------------------
  133. # <单个动画>
  134. # 可以使多目标的物品只显示一个动画.
  135. #
  136. # -----------------------------------------------------------------------------
  137. # 敌人备注 - 在数据库-敌人中可以使用的备注.
  138. # -----------------------------------------------------------------------------
  139. # <攻击动画1: x>
  140. # <攻击动画2: x>
  141. # 改变敌人的普通攻击动画为x号动画。如果攻击动画2存在的话,则攻击动画2会在攻击动
  142. # 画1之后显示,并且会左右镜像反转。(制造左一拳、右一拳的效果)
  143. #
  144. # -----------------------------------------------------------------------------
  145. # 状态备注 - 在数据库-状态中可以使用的备注.
  146. # -----------------------------------------------------------------------------
  147. # <添加方式: 显示方式>
  148. # <移除方式: 显示方式>
  149. # <持续方式: 显示方式>
  150. # 如果你不希望某个状态使用默认的显示方式的话,可以用以上备注来改变某个状态添加、
  151. # 移除或持续的显示方式。将"显示方式"替换为下面"POPUP_RULES"包含的显示方式。
  152. #
  153. # <不显示添加>
  154. # <不显示移除>
  155. # <不显示持续>
  156. # 使用以上备注来隐藏状态的添加、移除或持续效果。
  157. #
  158. # -----------------------------------------------------------------------------
  159. # 调试工具 - 仅在游戏测试或战斗测试中有效.
  160. # -----------------------------------------------------------------------------
  161. # - F5 键 -
  162. # 回复全部角色,使其HP、MP完全回复,TP不变,移除全部状态。
  163. #
  164. # - F6 键 -
  165. # 将全部角色设定为 1 HP, 0 MP,  0 TP.
  166. #
  167. # - F7 键 -
  168. # 将全部角色的TP值加满.
  169. #
  170. # - F8 键 -
  171. # 消灭全部敌人,迅速结束战斗.
  172. #
  173. #==============================================================================
  174. # ▼ 兼容性
  175. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  176. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  177. #
  178. #==============================================================================
  179.  
  180. module YEA
  181.   module BATTLE
  182.  
  183.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  184.     # - 通用战斗设置 -
  185.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  186.  
  187.     BLINK_EFFECTS      = false  # 是否在被伤害时闪烁?
  188.     FLASH_WHITE_EFFECT = true   # 是否在敌人发动攻击时将其闪烁?
  189.     SCREEN_SHAKE       = false  # 是否开启震动?
  190.     SKIP_PARTY_COMMAND = true   # 是否跳过 "战斗/撤退" 菜单.
  191.     AUTO_FAST          = true   # 是否加速战斗信息窗口的信息显示速度
  192.     ENEMY_ATK_ANI      = 36     # 设定敌人的普通攻击动画
  193.  
  194.     # 隐藏弹出式信息的开关,开启时隐藏,关闭时显示,不想使用这个功能的话设定为0
  195.     HIDE_POPUP_SWITCH  = 0
  196.  
  197.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  198.     # - 默认战斗系统 -
  199.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  200.     # 设定战斗系统类型,默认为回合制战斗.
  201.     #
  202.     # 战斗系统               解释
  203.     #   :dtb               - 默认的回合制战斗.
  204.     #   :ftb               - 需要脚本 YEA 战斗系统插件: 半回合制战斗(FTP)
  205.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  206.     #DEFAULT_BATTLE_SYSTEM = :dtb     # 默认战斗系统.二选一
  207.     DEFAULT_BATTLE_SYSTEM = :ftb     # 半回合战斗系统.二选一
  208.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  209.     # - 角色状态窗口 -
  210.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  211.  
  212.     BATTLESTATUS_NAME_FONT_SIZE = 20    # 名称字体大小.
  213.     BATTLESTATUS_TEXT_FONT_SIZE = 16    # HP, MP, TP的字体大小
  214.     BATTLESTATUS_NO_ACTION_ICON = 185   # 无任何行动的图标.
  215.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # HP条的Y坐标调整.
  216.     BATTLESTATUS_CENTER_FACES   = false # 是否将脸图居中.
  217.  
  218.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  219.     # - 帮助窗口文版 -
  220.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  221.     # 设定特殊技能效果范围的文本。
  222.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  223.     HELP_TEXT_ALL_FOES        = "全体敌人"
  224.     HELP_TEXT_ONE_RANDOM_FOE  = "一个随机敌人"
  225.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  226.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  227.     HELP_TEXT_ALL_DEAD_ALLIES = "全体队友(无法战斗)"
  228.     HELP_TEXT_ONE_RANDOM_ALLY = "一个随机队友"
  229.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  230.  
  231.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  232.     # - 弹出式信息显示 -
  233.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  234.  
  235.     ENABLE_POPUPS  = true     # 是否显示弹出式信息.
  236.     FLASH_CRITICAL = true     # 暴击时是否闪烁.
  237.  
  238.     # 设定弹出式信息
  239.     POPUP_SETTINGS ={
  240.       :offset     => -24,       # 高度.
  241.       :fade       => 12,        # 淡出速率.
  242.       :full       => 60,        # 淡出前的等待时间.
  243.       :hp_dmg     => "-%s ",    # HP伤害的文本.
  244.       :hp_heal    => "+%s ",    # HP回复的文本.
  245.       :mp_dmg     => "-%s MP",  # MP伤害的文本.
  246.       :mp_heal    => "+%s MP",  # MP回复的文本.
  247.       :tp_dmg     => "-%s TP",  # TP伤害的文本.
  248.       :tp_heal    => "+%s TP",  # TP回复的文本.
  249.       :drained    => "吸收",    # 吸收 HP/MP 的文本.
  250.       :critical   => "暴击!",   # 暴击的文本.
  251.       :missed     => "未命中",  # 未命中的文本
  252.       :evaded     => "闪避!",   # 闪避的文本
  253.       :nulled     => "无效果",  # 无攻击效果的文本
  254.       :failed     => "失败",    # 攻击失败的文本
  255.       :add_state  => "+%s",     # 添加状态的文本
  256.       :rem_state  => "-%s",     # 移除状态的文本
  257.       :dur_state  => "%s",      # 状态持续的文本
  258.       :ele_rates  => true,      # 是否显示属性效果.
  259.       :ele_wait   => 20,        # 属性效果的等待时间.
  260.       :weakpoint  => "弱点",    # 该属性为敌人弱点的文本
  261.       :resistant  => "抵抗",    # 该属性被敌人抵抗的文本
  262.       :immune     => "无效",    # 该属性对敌人无效的文本
  263.       :absorbed   => "吸收",    # 该属性被敌人吸收的文本
  264.       :add_buff   => "%s+",    # 强化能力的文本
  265.       :add_debuff => "%s-",    # 弱化能力的文本
  266.     } # 别动这个括号.
  267.  
  268.     # 默认字体设定
  269.     DEFAULT = ["黑体", "微软雅黑", "宋体"]
  270.  
  271.     # 以下为弹出式信息的显示方式:
  272.     #   缩放1    缩放的起始大小. 数值超过2.0可能会造成卡顿.
  273.     #   缩放2    缩放的结束大小.数值超过2.0可能会造成卡顿.
  274.     #   大小     文本字体大小.
  275.     #   加粗     字体是否加粗.
  276.     #   斜体     字体是否斜体.
  277.     #   红       字体颜色的红色值.
  278.     #   绿       字体颜色的绿色值.
  279.     #   蓝       字体颜色的蓝色值.
  280.     #   字体     使用的字体,使用默认字体则填入"DEFAULT".
  281.     POPUP_RULES ={
  282.       # 方式     => [ 缩放1, 缩放2,大小,加粗,   斜体,  红,  绿,  蓝,    字体],
  283.       "DEFAULT"  => [  2.0,   1.0,  24, true,  false, 255, 255, 255, DEFAULT],
  284.       "CRITICAL" => [  2.0,   1.0,  24, true,  false, 255,  80,  80, DEFAULT],
  285.       "HP_DMG"   => [  2.0,   1.0,  36, true,  false, 255, 255, 255, DEFAULT],
  286.       "HP_HEAL"  => [  2.0,   1.0,  36, true,  false, 130, 250, 130, DEFAULT],
  287.       "MP_DMG"   => [  2.0,   1.0,  36, true,  false, 220, 180, 255, DEFAULT],
  288.       "MP_HEAL"  => [  2.0,   1.0,  36, true,  false, 160, 230, 255, DEFAULT],
  289.       "TP_DMG"   => [  2.0,   1.0,  36, true,  false, 242, 108,  78, DEFAULT],
  290.       "TP_HEAL"  => [  2.0,   1.0,  36, true,  false, 251, 175,  92, DEFAULT],
  291.       "ADDSTATE" => [  2.0,   1.0,  24, true,  false, 240, 100, 100, DEFAULT],
  292.       "REMSTATE" => [  2.0,   1.0,  24, true,  false, 125, 170, 225, DEFAULT],
  293.       "DURSTATE" => [  2.0,   1.0,  24, true,  false, 255, 240, 150, DEFAULT],
  294.       "DRAIN"    => [  2.0,   1.0,  36, true,  false, 250, 190, 255, DEFAULT],
  295.       "POSITIVE" => [  2.0,   1.0,  24, true,  false, 110, 210, 245, DEFAULT],
  296.       "NEGATIVE" => [  2.0,   1.0,  24, true,  false, 245, 155, 195, DEFAULT],
  297.       "WEAK_ELE" => [  0.5,   1.0,  24, true,  false, 240, 110,  80, DEFAULT],
  298.       "IMMU_ELE" => [  0.5,   1.0,  24, true,  false, 185, 235, 255, DEFAULT],
  299.       "REST_ELE" => [  0.5,   1.0,  24, true,  false, 145, 230, 180, DEFAULT],
  300.       "ABSB_ELE" => [  0.5,   1.0,  24, true,  false, 250, 190, 255, DEFAULT],
  301.       "BUFF"     => [  2.0,   1.0,  24, true,  false, 255, 240, 100, DEFAULT],
  302.       "DEBUFF"   => [  2.0,   1.0,  24, true,  false, 160, 130, 200, DEFAULT],
  303.     } # 别动这个括号.
  304.  
  305.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  306.     # - 简化信息 -
  307.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  308.     # 想要移除一些冗杂烦人的弹出式信息吗?在下面设定吧!
  309.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  310.     MSG_ENEMY_APPEARS  = false  # 是否显示战斗开始时敌人出现的文本.
  311.     MSG_CURRENT_STATE  = false  # 是否显示状态的影响
  312.     MSG_CURRENT_ACTION = true   # 是否显示当前角色/敌人的行动
  313.     MSG_COUNTERATTACK  = true   # 是否显示反击的文本
  314.     MSG_REFLECT_MAGIC  = true   # 是否显示魔法反射的文本
  315.     MSG_SUBSTITUTE_HIT = true   # 是否显示替身文本
  316.     MSG_FAILURE_HIT    = false  # 是否显示效果对目标无效
  317.     MSG_CRITICAL_HIT   = false  # 是否显示暴击文本
  318.     MSG_HIT_MISSED     = false  # 是否显示未命中文本
  319.     MSG_EVASION        = false  # 是否显示闪避文本
  320.     MSG_HP_DAMAGE      = false  # 是否显示对目标造成的HP伤害
  321.     MSG_MP_DAMAGE      = false  # 是否显示对目标造成的MP伤害
  322.     MSG_TP_DAMAGE      = false  # 是否显示对目标造成的TP伤害
  323.     MSG_ADDED_STATES   = false  # 是否显示添加状态的文本
  324.     MSG_REMOVED_STATES = false  # 是否显示移除状态的文本
  325.     MSG_CHANGED_BUFFS  = false  # 是否显示状态持续的文本
  326.  
  327.   end # BATTLE
  328. end # YEA
  329.  
  330. #==============================================================================
  331. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  332. # 所以编辑了后果自负。
  333. #==============================================================================
  334.  
  335. module YEA
  336.   module REGEXP
  337.   module ENEMY
  338.  
  339.     ATK_ANI1 = /<(?:ATK_ANI_1|攻击动画1):[ ]*(\d+)>/i
  340.     ATK_ANI2 = /<(?:ATK_ANI_2|攻击动画2):[ ]*(\d+)>/i
  341.  
  342.   end # ENEMY
  343.   module USABLEITEM
  344.  
  345.     ONE_ANIMATION = /<(?:ONE_ANIMATION|单个动画)>/i
  346.  
  347.   end # USABLEITEM
  348.   module STATE
  349.  
  350.     POPUP_ADD = /<(?:POPUP_ADD_RULE|添加方式 rule|添加方式):[ ](.*)>/i
  351.     POPUP_REM = /<(?:POPUP_REM_RULE|移除方式 rule|移除方式):[ ](.*)>/i
  352.     POPUP_DUR = /<(?:POPUP_DUR_RULE|持续方式 rule|持续方式):[ ](.*)>/i
  353.  
  354.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|不显示添加|hide add)>/i
  355.     HIDE_REM  = /<(?:POPUP_HIDE_REM|不显示移除|hide rem)>/i
  356.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|不显示持续|hide dur)>/i
  357.  
  358.   end # STATE
  359.   end # REGEXP
  360. end # YEA
  361.  
  362. #==============================================================================
  363. # ■ Switch
  364. #==============================================================================
  365.  
  366. module Switch
  367.  
  368.   #--------------------------------------------------------------------------
  369.   # self.hide_popups
  370.   #--------------------------------------------------------------------------
  371.   def self.hide_popups
  372.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  373.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  374.   end
  375.  
  376. end # Switch
  377.  
  378. #==============================================================================
  379. # ■ Colour
  380. #==============================================================================
  381.  
  382. module Colour
  383.  
  384.   #--------------------------------------------------------------------------
  385.   # self.text_colour
  386.   #--------------------------------------------------------------------------
  387.   def self.text_colour(index)
  388.     windowskin = Cache.system("Window")
  389.     x = 64 + (index % 8) * 8
  390.     y = 96 + (index / 8) * 8
  391.     return windowskin.get_pixel(x, y)
  392.   end
  393.  
  394. end # Colour
  395.  
  396. #==============================================================================
  397. # ■ Icon
  398. #==============================================================================
  399.  
  400. module Icon
  401.  
  402.   #--------------------------------------------------------------------------
  403.   # self.no_action
  404.   #--------------------------------------------------------------------------
  405.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  406.  
  407. end # Icon
  408.  
  409. #==============================================================================
  410. # ■ Numeric
  411. #==============================================================================
  412.  
  413. class Numeric
  414.  
  415.   #--------------------------------------------------------------------------
  416.   # new method: group_digits
  417.   #--------------------------------------------------------------------------
  418.   unless $imported["YEA-CoreEngine"]
  419.   def group; return self.to_s; end
  420.   end # $imported["YEA-CoreEngine"]
  421.  
  422. end # Numeric
  423.  
  424. #==============================================================================
  425. # ■ DataManager
  426. #==============================================================================
  427.  
  428. module DataManager
  429.  
  430.   #--------------------------------------------------------------------------
  431.   # alias method: load_database
  432.   #--------------------------------------------------------------------------
  433.   class <<self; alias load_database_abe load_database; end
  434.   def self.load_database
  435.     load_database_abe
  436.     load_notetags_abe
  437.   end
  438.  
  439.   #--------------------------------------------------------------------------
  440.   # new method: load_notetags_abe
  441.   #--------------------------------------------------------------------------
  442.   def self.load_notetags_abe
  443.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  444.     for group in groups
  445.       for obj in group
  446.         next if obj.nil?
  447.         obj.load_notetags_abe
  448.       end
  449.     end
  450.   end
  451.  
  452. end # DataManager
  453.  
  454. #==============================================================================
  455. # ■ RPG::UsableItem
  456. #==============================================================================
  457.  
  458. class RPG::UsableItem < RPG::BaseItem
  459.  
  460.   #--------------------------------------------------------------------------
  461.   # public instance variables
  462.   #--------------------------------------------------------------------------
  463.   attr_accessor :one_animation
  464.  
  465.   #--------------------------------------------------------------------------
  466.   # common cache: load_notetags_abe
  467.   #--------------------------------------------------------------------------
  468.   def load_notetags_abe
  469.     @one_animation = false
  470.     #---
  471.     self.note.split(/[\r\n]+/).each { |line|
  472.       case line
  473.       #---
  474.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  475.         @one_animation = true
  476.       end
  477.     } # self.note.split
  478.     #---
  479.   end
  480.  
  481. end # RPG::UsableItem
  482.  
  483. #==============================================================================
  484. # ■ RPG::Enemy
  485. #==============================================================================
  486.  
  487. class RPG::Enemy < RPG::BaseItem
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # public instance variables
  491.   #--------------------------------------------------------------------------
  492.   attr_accessor :atk_animation_id1
  493.   attr_accessor :atk_animation_id2
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # common cache: load_notetags_abe
  497.   #--------------------------------------------------------------------------
  498.   def load_notetags_abe
  499.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  500.     @atk_animation_id2 = 0
  501.     #---
  502.     self.note.split(/[\r\n]+/).each { |line|
  503.       case line
  504.       #---
  505.       when YEA::REGEXP::ENEMY::ATK_ANI1
  506.         @atk_animation_id1 = $1.to_i
  507.       when YEA::REGEXP::ENEMY::ATK_ANI2
  508.         @atk_animation_id2 = $1.to_i
  509.       end
  510.     } # self.note.split
  511.     #---
  512.   end
  513.  
  514. end # RPG::Enemy
  515.  
  516. #==============================================================================
  517. # ■ RPG::Enemy
  518. #==============================================================================
  519.  
  520. class RPG::State < RPG::BaseItem
  521.  
  522.   #--------------------------------------------------------------------------
  523.   # public instance variables
  524.   #--------------------------------------------------------------------------
  525.   attr_accessor :popup_rules
  526.  
  527.   #--------------------------------------------------------------------------
  528.   # common cache: load_notetags_abe
  529.   #--------------------------------------------------------------------------
  530.   def load_notetags_abe
  531.     @popup_rules = {
  532.       :add_state => "ADDSTATE",
  533.       :rem_state => "REMSTATE",
  534.       :dur_state => nil
  535.     } # Do not remove this.
  536.     #---
  537.     self.note.split(/[\r\n]+/).each { |line|
  538.       case line
  539.       #---
  540.       when YEA::REGEXP::STATE::POPUP_ADD
  541.         @popup_rules[:add_state] = $1.upcase.to_s
  542.       when YEA::REGEXP::STATE::POPUP_REM
  543.         @popup_rules[:rem_state] = $1.upcase.to_s
  544.       when YEA::REGEXP::STATE::POPUP_DUR
  545.         @popup_rules[:dur_state] = $1.upcase.to_s
  546.       when YEA::REGEXP::STATE::HIDE_ADD
  547.         @popup_rules[:add_state] = nil
  548.       when YEA::REGEXP::STATE::HIDE_REM
  549.         @popup_rules[:rem_state] = nil
  550.       when YEA::REGEXP::STATE::HIDE_DUR
  551.         @popup_rules[:dur_state] = nil
  552.       end
  553.     } # self.note.split
  554.     #---
  555.   end
  556.  
  557. end # RPG::State
  558.  
  559. #==============================================================================
  560. # ■ BattleManager
  561. #==============================================================================
  562.  
  563. module BattleManager
  564.  
  565.   #--------------------------------------------------------------------------
  566.   # overwrite method: self.battle_start
  567.   #--------------------------------------------------------------------------
  568.   def self.battle_start
  569.     $game_system.battle_count += 1
  570.     $game_party.on_battle_start
  571.     $game_troop.on_battle_start
  572.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  573.     $game_troop.enemy_names.each do |name|
  574.       $game_message.add(sprintf(Vocab::Emerge, name))
  575.     end
  576.     if @preemptive
  577.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  578.     elsif @surprise
  579.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  580.     end
  581.     wait_for_message
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # overwrite method: make_action_orders
  586.   #--------------------------------------------------------------------------
  587.   def self.make_action_orders
  588.     make_dtb_action_orders if btype?(:dtb)
  589.   end
  590.  
  591.   #--------------------------------------------------------------------------
  592.   # new method: make_dtb_action_orders
  593.   #--------------------------------------------------------------------------
  594.   def self.make_dtb_action_orders
  595.     @action_battlers = []
  596.     @action_battlers += $game_party.members unless @surprise
  597.     @action_battlers += $game_troop.members unless @preemptive
  598.     @action_battlers.each {|battler| battler.make_speed }
  599.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  600.   end
  601.  
  602.   #--------------------------------------------------------------------------
  603.   # overwrite method: turn_start
  604.   #--------------------------------------------------------------------------
  605.   def self.turn_start
  606.     @phase = :turn
  607.     clear_actor
  608.     $game_troop.increase_turn
  609.     @performed_battlers = []
  610.     make_action_orders
  611.   end
  612.  
  613.   #--------------------------------------------------------------------------
  614.   # overwrite method: next_subject
  615.   #--------------------------------------------------------------------------
  616.   def self.next_subject
  617.     @performed_battlers = [] if @performed_battlers.nil?
  618.     loop do
  619.       @action_battlers -= @performed_battlers
  620.       battler = @action_battlers.shift
  621.       return nil unless battler
  622.       next unless battler.index && battler.alive?
  623.       @performed_battlers.push(battler)
  624.       return battler
  625.     end
  626.   end
  627.  
  628.   #--------------------------------------------------------------------------
  629.   # overwrite method: force_action
  630.   #--------------------------------------------------------------------------
  631.   def self.force_action(battler)
  632.     @action_forced = [] if @action_forced == nil
  633.     @action_forced.push(battler)
  634.     return unless Switch.forced_action_remove
  635.     @action_battlers.delete(battler)
  636.   end
  637.  
  638.   #--------------------------------------------------------------------------
  639.   # overwrite method: action_forced?
  640.   #--------------------------------------------------------------------------
  641.   def self.action_forced?
  642.     @action_forced != nil
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # overwrite method: action_forced_battler
  647.   #--------------------------------------------------------------------------
  648.   def self.action_forced_battler
  649.     @action_forced.shift
  650.   end
  651.  
  652.   #--------------------------------------------------------------------------
  653.   # overwrite method: clear_action_force
  654.   #--------------------------------------------------------------------------
  655.   def self.clear_action_force
  656.     return if @action_forced.nil?
  657.     @action_forced = nil if @action_forced.empty?
  658.   end
  659.  
  660.   #--------------------------------------------------------------------------
  661.   # new method: self.init_battle_type
  662.   #--------------------------------------------------------------------------
  663.   def self.init_battle_type
  664.     set_btype($game_system.battle_system)
  665.   end
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # new method: self.set_btype
  669.   #--------------------------------------------------------------------------
  670.   def self.set_btype(btype = :dtb)
  671.     @battle_type = btype
  672.   end
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # new method: self.btype?
  676.   #--------------------------------------------------------------------------
  677.   def self.btype?(btype)
  678.     return @battle_type == btype
  679.   end
  680.  
  681. end # BattleManager
  682.  
  683. #==============================================================================
  684. # ■ Game_System
  685. #==============================================================================
  686.  
  687. class Game_System
  688.  
  689.   #--------------------------------------------------------------------------
  690.   # new method: battle_system
  691.   #--------------------------------------------------------------------------
  692.   def battle_system
  693.     if @battle_system.nil?
  694.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  695.     else
  696.       return battle_system_corrected(@battle_system)
  697.     end
  698.   end
  699.  
  700.   #--------------------------------------------------------------------------
  701.   # new method: set_battle_system
  702.   #--------------------------------------------------------------------------
  703.   def set_battle_system(type)
  704.     case type
  705.     when :dtb; @battle_system = :dtb
  706.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  707.     else;      @battle_system = :dtb
  708.     end
  709.   end
  710.  
  711.   #--------------------------------------------------------------------------
  712.   # new method: battle_system_corrected
  713.   #--------------------------------------------------------------------------
  714.   def battle_system_corrected(type)
  715.     case type
  716.     when :dtb; return :dtb
  717.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  718.     else;      return :dtb
  719.     end
  720.   end
  721.  
  722. end # Game_System
  723.  
  724. #==============================================================================
  725. # ■ Sprite_Base
  726. #==============================================================================
  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. #==============================================================================
  748. # ■ Sprite_Battler
  749. #==============================================================================
  750.  
  751. class Sprite_Battler < Sprite_Base
  752.  
  753.   #--------------------------------------------------------------------------
  754.   # public instance variables
  755.   #--------------------------------------------------------------------------
  756.   attr_accessor :effect_type
  757.   attr_accessor :battler_visible
  758.   attr_accessor :popups
  759.  
  760.   #--------------------------------------------------------------------------
  761.   # alias method: initialize
  762.   #--------------------------------------------------------------------------
  763.   alias sprite_battler_initialize_abe initialize
  764.   def initialize(viewport, battler = nil)
  765.     sprite_battler_initialize_abe(viewport, battler)
  766.     @popups = []
  767.     @popup_flags = []
  768.   end
  769.  
  770.   #--------------------------------------------------------------------------
  771.   # alias method: update_bitmap
  772.   #--------------------------------------------------------------------------
  773.   alias sprite_battler_update_bitmap_abe update_bitmap
  774.   def update_bitmap
  775.     return if @battler.actor? && @battler.battler_name == ""
  776.     sprite_battler_update_bitmap_abe
  777.   end
  778.  
  779.   #--------------------------------------------------------------------------
  780.   # alias method: setup_new_animation
  781.   #--------------------------------------------------------------------------
  782.   unless $imported["YEA-CoreEngine"]
  783.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  784.   def setup_new_animation
  785.     sprite_battler_setup_new_animation_abe
  786.     return if @battler.pseudo_ani_id <= 0
  787.     animation = $data_animations[@battler.pseudo_ani_id]
  788.     mirror = @battler.animation_mirror
  789.     start_pseudo_animation(animation, mirror)
  790.     @battler.pseudo_ani_id = 0
  791.   end
  792.   end # $imported["YEA-CoreEngine"]
  793.  
  794.   #--------------------------------------------------------------------------
  795.   # alias method: setup_new_effect
  796.   #--------------------------------------------------------------------------
  797.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  798.   def setup_new_effect
  799.     sprite_battler_setup_new_effect_abe
  800.     setup_popups
  801.   end
  802.  
  803.   #--------------------------------------------------------------------------
  804.   # new method: setup_popups
  805.   #--------------------------------------------------------------------------
  806.   def setup_popups
  807.     return unless @battler.use_sprite?
  808.     @battler.popups = [] if @battler.popups.nil?
  809.     return if @battler.popups == []
  810.     array = @battler.popups.shift
  811.     create_new_popup(array[0], array[1], array[2])
  812.   end
  813.  
  814.   #--------------------------------------------------------------------------
  815.   # new method: create_new_popup
  816.   #--------------------------------------------------------------------------
  817.   def create_new_popup(value, rules, flags)
  818.     return if @battler == nil
  819.     return if flags & @popup_flags != []
  820.     array = YEA::BATTLE::POPUP_RULES[rules]
  821.     for popup in @popups
  822.       popup.y -= 24
  823.     end
  824.     return unless SceneManager.scene.is_a?(Scene_Battle)
  825.     return if SceneManager.scene.spriteset.nil?
  826.     view = SceneManager.scene.spriteset.viewportPopups
  827.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  828.     @popups.push(new_popup)
  829.     @popup_flags.push("weakness") if flags.include?("weakness")
  830.     @popup_flags.push("resistant") if flags.include?("resistant")
  831.     @popup_flags.push("immune") if flags.include?("immune")
  832.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  833.   end
  834.  
  835.   #--------------------------------------------------------------------------
  836.   # alias method: update_effect
  837.   #--------------------------------------------------------------------------
  838.   alias sprite_battler_update_effect_abe update_effect
  839.   def update_effect
  840.     sprite_battler_update_effect_abe
  841.     update_popups
  842.   end
  843.  
  844.   #--------------------------------------------------------------------------
  845.   # new method: update_popups
  846.   #--------------------------------------------------------------------------
  847.   def update_popups
  848.     for popup in @popups
  849.       popup.update
  850.       next unless popup.opacity <= 0
  851.       popup.bitmap.dispose
  852.       popup.dispose
  853.       @popups.delete(popup)
  854.       popup = nil
  855.     end
  856.     @popup_flags = [] if @popups == [] && @popup_flags != []
  857.     return unless SceneManager.scene_is?(Scene_Battle)
  858.     if @current_active_battler != SceneManager.scene.subject
  859.       @current_active_battler = SceneManager.scene.subject
  860.       @popup_flags = []
  861.     end
  862.   end
  863.  
  864. end # Sprite_Battler
  865.  
  866. #==============================================================================
  867. # ■ Sprite_Popup
  868. #==============================================================================
  869.  
  870. class Sprite_Popup < Sprite_Base
  871.  
  872.   #--------------------------------------------------------------------------
  873.   # public instance variables
  874.   #--------------------------------------------------------------------------
  875.   attr_accessor :flags
  876.  
  877.   #--------------------------------------------------------------------------
  878.   # initialize
  879.   #--------------------------------------------------------------------------
  880.   def initialize(viewport, battler, value, rules, flags)
  881.     super(viewport)
  882.     @value = value
  883.     @rules = rules
  884.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  885.     @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  886.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  887.     @flags = flags
  888.     @battler = battler
  889.     create_popup_bitmap
  890.   end
  891.  
  892.   #--------------------------------------------------------------------------
  893.   # create_popup_bitmap
  894.   #--------------------------------------------------------------------------
  895.   def create_popup_bitmap
  896.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  897.     bw = Graphics.width
  898.     bw += 48 if @flags.include?("state")
  899.     bh = Font.default_size * 3
  900.     bitmap = Bitmap.new(bw, bh)
  901.     bitmap.font.name = rules_array[8]
  902.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  903.     bitmap.font.size = size
  904.     bitmap.font.bold = rules_array[3]
  905.     bitmap.font.italic = rules_array[4]
  906.     if flags.include?("critical")
  907.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  908.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  909.     else
  910.       bitmap.font.out_color.set(0, 0, 0, 255)
  911.     end
  912.     dx = 0; dy = 0; dw = 0
  913.     dx += 24 if @flags.include?("state")
  914.     dw += 24 if @flags.include?("state")
  915.     if @flags.include?("state") || @flags.include?("buff")
  916.       c_width = bitmap.text_size(@value).width
  917.       icon_bitmap = $game_temp.iconset
  918.       icon_index = flag_state_icon
  919.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  920.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  921.     end
  922.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  923.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  924.     self.bitmap = bitmap
  925.     self.x = @battler.screen_x
  926.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  927.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  928.     self.y = @battler.screen_y - @battler.sprite.oy/2
  929.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  930.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  931.     self.ox = bw/2; self.oy = bh/2
  932.     self.zoom_x = self.zoom_y = rules_array[0]
  933.     if @flags.include?("no zoom")
  934.       self.zoom_x = self.zoom_y = rules_array[1]
  935.     end
  936.     @target_zoom = rules_array[1]
  937.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  938.     self.z = 500
  939.   end
  940.  
  941.   #--------------------------------------------------------------------------
  942.   # update
  943.   #--------------------------------------------------------------------------
  944.   def update
  945.     super
  946.     #---
  947.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  948.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  949.       @hue_duration -= 1
  950.       self.bitmap.hue_change(15) if @hue_duration <= 0
  951.     end
  952.     #---
  953.     if @zoom_direction == "up"
  954.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  955.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  956.     else
  957.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  958.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  959.     end
  960.     #---
  961.     @full -= 1
  962.     return if @full > 0
  963.     self.y -= 1
  964.     self.opacity -= @fade
  965.   end
  966.  
  967.   #--------------------------------------------------------------------------
  968.   # flag_state_icon
  969.   #--------------------------------------------------------------------------
  970.   def flag_state_icon
  971.     for item in @flags; return item if item.is_a?(Integer); end
  972.     return 0
  973.   end
  974.  
  975. end # Sprite_Popup
  976.  
  977. #==============================================================================
  978. # ■ Spriteset_Battle
  979. #==============================================================================
  980.  
  981. class Spriteset_Battle
  982.  
  983.   #--------------------------------------------------------------------------
  984.   # public instance variables
  985.   #--------------------------------------------------------------------------
  986.   attr_accessor :actor_sprites
  987.   attr_accessor :enemy_sprites
  988.   attr_accessor :viewport1
  989.   attr_accessor :viewportPopups
  990.  
  991.   #--------------------------------------------------------------------------
  992.   # alias method: create_viewports
  993.   #--------------------------------------------------------------------------
  994.   alias spriteset_battle_create_viewports_abe create_viewports
  995.   def create_viewports
  996.     spriteset_battle_create_viewports_abe
  997.     @viewportPopups = Viewport.new
  998.     @viewportPopups.z = 200
  999.   end
  1000.  
  1001.   #--------------------------------------------------------------------------
  1002.   # alias method: dispose_viewports
  1003.   #--------------------------------------------------------------------------
  1004.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1005.   def dispose_viewports
  1006.     spriteset_battle_dispose_viewports_abe
  1007.     @viewportPopups.dispose
  1008.   end
  1009.  
  1010.   #--------------------------------------------------------------------------
  1011.   # alias method: update_viewports
  1012.   #--------------------------------------------------------------------------
  1013.   alias spriteset_battle_update_viewports_abe update_viewports
  1014.   def update_viewports
  1015.     spriteset_battle_update_viewports_abe
  1016.     @viewportPopups.update
  1017.   end
  1018.  
  1019. end # Spriteset_Battle
  1020.  
  1021. #==============================================================================
  1022. # ■ Game_Temp
  1023. #==============================================================================
  1024.  
  1025. class Game_Temp
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # public instance variables
  1029.   #--------------------------------------------------------------------------
  1030.   attr_accessor :battle_aid
  1031.   attr_accessor :evaluating
  1032.   attr_accessor :iconset
  1033.  
  1034.   #--------------------------------------------------------------------------
  1035.   # alias method: initialize
  1036.   #--------------------------------------------------------------------------
  1037.   alias game_temp_initialize_abe initialize
  1038.   def initialize
  1039.     game_temp_initialize_abe
  1040.     @iconset = Cache.system("Iconset")
  1041.   end
  1042.  
  1043. end # Game_Temp
  1044.  
  1045. #==============================================================================
  1046. # ■ Game_Action
  1047. #==============================================================================
  1048.  
  1049. class Game_Action
  1050.  
  1051.   #--------------------------------------------------------------------------
  1052.   # overwrite method: speed
  1053.   #--------------------------------------------------------------------------
  1054.   def speed
  1055.     speed = subject.agi
  1056.     speed += item.speed if item
  1057.     speed += subject.atk_speed if attack?
  1058.     return speed
  1059.   end
  1060.  
  1061.   #--------------------------------------------------------------------------
  1062.   # alias method: evaluate_item_with_target
  1063.   #--------------------------------------------------------------------------
  1064.   alias evaluate_item_with_target_abe evaluate_item_with_target
  1065.   def evaluate_item_with_target(target)
  1066.     $game_temp.evaluating = true
  1067.     result = evaluate_item_with_target_abe(target)
  1068.     $game_temp.evaluating = false
  1069.     return result
  1070.   end
  1071.  
  1072. end # Game_Action
  1073.  
  1074. #==============================================================================
  1075. # ■ Game_ActionResult
  1076. #==============================================================================
  1077.  
  1078. class Game_ActionResult
  1079.  
  1080.   #--------------------------------------------------------------------------
  1081.   # alias method: clear
  1082.   #--------------------------------------------------------------------------
  1083.   alias game_actionresult_clear_abe clear
  1084.   def clear
  1085.     game_actionresult_clear_abe
  1086.     clear_stored_damage
  1087.   end
  1088.  
  1089.   #--------------------------------------------------------------------------
  1090.   # new method: clear_stored_damage
  1091.   #--------------------------------------------------------------------------
  1092.   def clear_stored_damage
  1093.     @stored_hp_damage = 0
  1094.     @stored_mp_damage = 0
  1095.     @stored_tp_damage = 0
  1096.     @stored_hp_drain = 0
  1097.     @stored_mp_drain = 0
  1098.   end
  1099.  
  1100.   #--------------------------------------------------------------------------
  1101.   # new method: store_damage
  1102.   #--------------------------------------------------------------------------
  1103.   def store_damage
  1104.     @stored_hp_damage += @hp_damage
  1105.     @stored_mp_damage += @mp_damage
  1106.     @stored_tp_damage += @tp_damage
  1107.     @stored_hp_drain += @hp_drain
  1108.     @stored_mp_drain += @mp_drain
  1109.   end
  1110.  
  1111.   #--------------------------------------------------------------------------
  1112.   # new method: restore_damage
  1113.   #--------------------------------------------------------------------------
  1114.   def restore_damage
  1115.     @hp_damage = @stored_hp_damage
  1116.     @mp_damage = @stored_mp_damage
  1117.     @tp_damage = @stored_tp_damage
  1118.     @hp_drain = @stored_hp_drain
  1119.     @mp_drain = @stored_mp_drain
  1120.     clear_stored_damage
  1121.   end
  1122.  
  1123. end # Game_ActionResult
  1124.  
  1125. #==============================================================================
  1126. # ■ Game_BattlerBase
  1127. #==============================================================================
  1128.  
  1129. class Game_BattlerBase
  1130.  
  1131.   #--------------------------------------------------------------------------
  1132.   # public instance variables
  1133.   #--------------------------------------------------------------------------
  1134.   attr_accessor :popups
  1135.  
  1136.   #--------------------------------------------------------------------------
  1137.   # new method: create_popup
  1138.   #--------------------------------------------------------------------------
  1139.   def create_popup(value, rules = "DEFAULT", flags = [])
  1140.     return unless SceneManager.scene_is?(Scene_Battle)
  1141.     return unless YEA::BATTLE::ENABLE_POPUPS
  1142.     return if Switch.hide_popups
  1143.     @popups = [] if @popups.nil?
  1144.     @popups.push([value, rules, flags])
  1145.   end
  1146.  
  1147.   #--------------------------------------------------------------------------
  1148.   # new method: make_damage_popups
  1149.   #--------------------------------------------------------------------------
  1150.   def make_damage_popups(user)
  1151.     if @result.hp_drain != 0
  1152.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1153.       rules = "DRAIN"
  1154.       user.create_popup(text, rules)
  1155.       setting = :hp_dmg  if @result.hp_drain < 0
  1156.       setting = :hp_heal if @result.hp_drain > 0
  1157.       rules = "HP_DMG"   if @result.hp_drain < 0
  1158.       rules = "HP_HEAL"  if @result.hp_drain > 0
  1159.       value = @result.hp_drain.abs
  1160.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1161.       user.create_popup(text, rules)
  1162.     end
  1163.     if @result.mp_drain != 0
  1164.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1165.       rules = "DRAIN"
  1166.       user.create_popup(text, rules)
  1167.       setting = :mp_dmg  if @result.mp_drain < 0
  1168.       setting = :mp_heal if @result.mp_drain > 0
  1169.       rules = "HP_DMG"   if @result.mp_drain < 0
  1170.       rules = "HP_HEAL"  if @result.mp_drain > 0
  1171.       value = @result.mp_drain.abs
  1172.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1173.       user.create_popup(text, rules)
  1174.     end
  1175.     #---
  1176.     flags = []
  1177.     flags.push("critical") if @result.critical
  1178.     if @result.hp_damage != 0
  1179.       setting = :hp_dmg  if @result.hp_damage > 0
  1180.       setting = :hp_heal if @result.hp_damage < 0
  1181.       rules = "HP_DMG"   if @result.hp_damage > 0
  1182.       rules = "HP_HEAL"  if @result.hp_damage < 0
  1183.       value = @result.hp_damage.abs
  1184.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1185.       create_popup(text, rules, flags)
  1186.     end
  1187.     if @result.mp_damage != 0
  1188.       setting = :mp_dmg  if @result.mp_damage > 0
  1189.       setting = :mp_heal if @result.mp_damage < 0
  1190.       rules = "MP_DMG"   if @result.mp_damage > 0
  1191.       rules = "MP_HEAL"  if @result.mp_damage < 0
  1192.       value = @result.mp_damage.abs
  1193.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1194.       create_popup(text, rules, flags)
  1195.     end
  1196.     if @result.tp_damage != 0
  1197.       setting = :tp_dmg  if @result.tp_damage > 0
  1198.       setting = :tp_heal if @result.tp_damage < 0
  1199.       rules = "TP_DMG"   if @result.tp_damage > 0
  1200.       rules = "TP_HEAL"  if @result.tp_damage < 0
  1201.       value = @result.tp_damage.abs
  1202.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1203.       create_popup(text, rules)
  1204.     end
  1205.     @result.store_damage
  1206.     @result.clear_damage_values
  1207.   end
  1208.  
  1209.   #--------------------------------------------------------------------------
  1210.   # alias method: erase_state
  1211.   #--------------------------------------------------------------------------
  1212.   alias game_battlerbase_erase_state_abe erase_state
  1213.   def erase_state(state_id)
  1214.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1215.     game_battlerbase_erase_state_abe(state_id)
  1216.   end
  1217.  
  1218.   #--------------------------------------------------------------------------
  1219.   # new method: make_during_state_popup
  1220.   #--------------------------------------------------------------------------
  1221.   def make_during_state_popup
  1222.     state_id = most_important_state_id
  1223.     return if state_id == 0
  1224.     make_state_popup(state_id, :dur_state)
  1225.   end
  1226.  
  1227.   #--------------------------------------------------------------------------
  1228.   # new method: most_important_state_id
  1229.   #--------------------------------------------------------------------------
  1230.   def most_important_state_id
  1231.     states.each {|state| return state.id unless state.message3.empty? }
  1232.     return 0
  1233.   end
  1234.  
  1235.   #--------------------------------------------------------------------------
  1236.   # new method: make_state_popup
  1237.   #--------------------------------------------------------------------------
  1238.   def make_state_popup(state_id, type)
  1239.     state = $data_states[state_id]
  1240.     return if state.icon_index == 0
  1241.     rules = state.popup_rules[type]
  1242.     return if rules.nil?
  1243.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1244.     flags = ["state", state.icon_index]
  1245.     create_popup(text, rules, flags)
  1246.   end
  1247.  
  1248.   #--------------------------------------------------------------------------
  1249.   # new method: make_miss_popups
  1250.   #--------------------------------------------------------------------------
  1251.   def make_miss_popups(user, item)
  1252.     return if dead?
  1253.     if @result.missed
  1254.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1255.       rules = "DEFAULT"
  1256.       create_popup(text, rules)
  1257.     end
  1258.     if @result.evaded
  1259.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1260.       rules = "DEFAULT"
  1261.       create_popup(text, rules)
  1262.     end
  1263.     if @result.hit? && !@result.success
  1264.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1265.       rules = "DEFAULT"
  1266.       create_popup(text, rules)
  1267.     end
  1268.     if @result.hit? && item.damage.to_hp?
  1269.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1270.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1271.         rules = "DEFAULT"
  1272.         create_popup(text, rules)
  1273.       end
  1274.     end
  1275.   end
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # new method: make_rate_popup
  1279.   #--------------------------------------------------------------------------
  1280.   def make_rate_popup(rate)
  1281.     return if rate == 1.0
  1282.     flags = []
  1283.     if rate > 1.0
  1284.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1285.       rules = "WEAK_ELE"
  1286.       flags.push("weakness")
  1287.     elsif rate == 0.0
  1288.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1289.       rules = "IMMU_ELE"
  1290.       flags.push("immune")
  1291.     elsif rate < 0.0
  1292.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1293.       rules = "ABSB_ELE"
  1294.       flags.push("absorbed")
  1295.     else
  1296.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1297.       rules = "REST_ELE"
  1298.       flags.push("resistant")
  1299.     end
  1300.     create_popup(text, rules, flags)
  1301.   end
  1302.  
  1303.   #--------------------------------------------------------------------------
  1304.   # new method: make_buff_popup
  1305.   #--------------------------------------------------------------------------
  1306.   def make_buff_popup(param_id, positive = true)
  1307.     return unless SceneManager.scene_is?(Scene_Battle)
  1308.     return unless alive?
  1309.     name = Vocab::param(param_id)
  1310.     if positive
  1311.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1312.       rules = "BUFF"
  1313.       buff_level = 1
  1314.     else
  1315.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1316.       rules = "DEBUFF"
  1317.       buff_level = -1
  1318.     end
  1319.     icon = buff_icon_index(buff_level, param_id)
  1320.     flags = ["buff", icon]
  1321.     return if @popups.include?([text, rules, flags])
  1322.     create_popup(text, rules, flags)
  1323.   end
  1324.  
  1325. end # Game_BattlerBase
  1326.  
  1327. #==============================================================================
  1328. # ■ Game_Battler
  1329. #==============================================================================
  1330.  
  1331. class Game_Battler < Game_BattlerBase
  1332.  
  1333.   #--------------------------------------------------------------------------
  1334.   # public instance variables
  1335.   #--------------------------------------------------------------------------
  1336.   attr_accessor :pseudo_ani_id
  1337.  
  1338.   #--------------------------------------------------------------------------
  1339.   # alias method: on_battle_end
  1340.   #--------------------------------------------------------------------------
  1341.   alias game_battler_on_battle_end_abe on_battle_end
  1342.   def on_battle_end
  1343.     game_battler_on_battle_end_abe
  1344.     @popups = []
  1345.   end
  1346.  
  1347.   #--------------------------------------------------------------------------
  1348.   # alias method: clear_sprite_effects
  1349.   #--------------------------------------------------------------------------
  1350.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1351.   def clear_sprite_effects
  1352.     game_battler_clear_sprite_effects_abe
  1353.     @pseudo_ani_id = 0
  1354.   end
  1355.  
  1356.   #--------------------------------------------------------------------------
  1357.   # alias method: item_apply
  1358.   #--------------------------------------------------------------------------
  1359.   alias game_battler_item_apply_abe item_apply
  1360.   def item_apply(user, item)
  1361.     game_battler_item_apply_abe(user, item)
  1362.     make_miss_popups(user, item)
  1363.   end
  1364.  
  1365.   #--------------------------------------------------------------------------
  1366.   # alias method: make_damage_value
  1367.   #--------------------------------------------------------------------------
  1368.   alias game_battler_make_damage_value_abe make_damage_value
  1369.   def make_damage_value(user, item)
  1370.     game_battler_make_damage_value_abe(user, item)
  1371.     rate = item_element_rate(user, item)
  1372.     make_rate_popup(rate) unless $game_temp.evaluating
  1373.   end
  1374.  
  1375.   #--------------------------------------------------------------------------
  1376.   # alias method: execute_damage
  1377.   #--------------------------------------------------------------------------
  1378.   alias game_battler_execute_damage_abe execute_damage
  1379.   def execute_damage(user)
  1380.     game_battler_execute_damage_abe(user)
  1381.     make_damage_popups(user)
  1382.   end
  1383.  
  1384.   #--------------------------------------------------------------------------
  1385.   # alias method: item_effect_recover_hp
  1386.   #--------------------------------------------------------------------------
  1387.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1388.   def item_effect_recover_hp(user, item, effect)
  1389.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1390.     make_damage_popups(user)
  1391.   end
  1392.  
  1393.   #--------------------------------------------------------------------------
  1394.   # alias method: item_effect_recover_mp
  1395.   #--------------------------------------------------------------------------
  1396.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1397.   def item_effect_recover_mp(user, item, effect)
  1398.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1399.     make_damage_popups(user)
  1400.   end
  1401.  
  1402.   #--------------------------------------------------------------------------
  1403.   # alias method: item_effect_gain_tp
  1404.   #--------------------------------------------------------------------------
  1405.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1406.   def item_effect_gain_tp(user, item, effect)
  1407.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1408.     make_damage_popups(user)
  1409.   end
  1410.  
  1411.   #--------------------------------------------------------------------------
  1412.   # alias method: item_user_effect
  1413.   #--------------------------------------------------------------------------
  1414.   alias game_battler_item_user_effect_abe item_user_effect
  1415.   def item_user_effect(user, item)
  1416.     game_battler_item_user_effect_abe(user, item)
  1417.     @result.restore_damage
  1418.   end
  1419.  
  1420.   #--------------------------------------------------------------------------
  1421.   # alias method: add_new_state
  1422.   #--------------------------------------------------------------------------
  1423.   alias game_battler_add_new_state_abe add_new_state
  1424.   def add_new_state(state_id)
  1425.     game_battler_add_new_state_abe(state_id)
  1426.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1427.   end
  1428.  
  1429.   #--------------------------------------------------------------------------
  1430.   # alias method: add_buff
  1431.   #--------------------------------------------------------------------------
  1432.   alias game_battler_add_buff_abe add_buff
  1433.   def add_buff(param_id, turns)
  1434.     make_buff_popup(param_id, true)
  1435.     game_battler_add_buff_abe(param_id, turns)
  1436.   end
  1437.  
  1438.   #--------------------------------------------------------------------------
  1439.   # alias method: add_debuff
  1440.   #--------------------------------------------------------------------------
  1441.   alias game_battler_add_debuff_abe add_debuff
  1442.   def add_debuff(param_id, turns)
  1443.     make_buff_popup(param_id, false)
  1444.     game_battler_add_debuff_abe(param_id, turns)
  1445.   end
  1446.  
  1447.   #--------------------------------------------------------------------------
  1448.   # alias method: regenerate_all
  1449.   #--------------------------------------------------------------------------
  1450.   alias game_battler_regenerate_all_abe regenerate_all
  1451.   def regenerate_all
  1452.     game_battler_regenerate_all_abe
  1453.     return unless alive?
  1454.     make_damage_popups(self)
  1455.   end
  1456.  
  1457.   #--------------------------------------------------------------------------
  1458.   # new method: can_collapse?
  1459.   #--------------------------------------------------------------------------
  1460.   def can_collapse?
  1461.     return false unless dead?
  1462.     unless actor?
  1463.       return false unless sprite.battler_visible
  1464.       array = [:collapse, :boss_collapse, :instant_collapse]
  1465.       return false if array.include?(sprite.effect_type)
  1466.     end
  1467.     return true
  1468.   end
  1469.  
  1470.   #--------------------------------------------------------------------------
  1471.   # new method: draw_mp?
  1472.   #--------------------------------------------------------------------------
  1473.   def draw_mp?; return true; end
  1474.  
  1475.   #--------------------------------------------------------------------------
  1476.   # new method: draw_tp?
  1477.   #--------------------------------------------------------------------------
  1478.   def draw_tp?
  1479.     return $data_system.opt_display_tp
  1480.   end
  1481.  
  1482. end # Game_Battler
  1483.  
  1484. #==============================================================================
  1485. # ■ Game_Actor
  1486. #==============================================================================
  1487.  
  1488. class Game_Actor < Game_Battler
  1489.  
  1490.   #--------------------------------------------------------------------------
  1491.   # overwrite method: perform_damage_effect
  1492.   #--------------------------------------------------------------------------
  1493.   def perform_damage_effect
  1494.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1495.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1496.     Sound.play_actor_damage
  1497.   end
  1498.  
  1499.   #--------------------------------------------------------------------------
  1500.   # overwrite method: use_sprite?
  1501.   #--------------------------------------------------------------------------
  1502.   def use_sprite?; return true; end
  1503.  
  1504.   #--------------------------------------------------------------------------
  1505.   # new method: screen_x
  1506.   #--------------------------------------------------------------------------
  1507.   def screen_x
  1508.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1509.     status_window = SceneManager.scene.status_window
  1510.     return 0 if status_window.nil?
  1511.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1512.     ext = SceneManager.scene.info_viewport.ox
  1513.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1514.     constant = 128 + 12
  1515.     return constant + rect.x + item_rect_width / 2 - ext
  1516.   end
  1517.  
  1518.   #--------------------------------------------------------------------------
  1519.   # new method: screen_y
  1520.   #--------------------------------------------------------------------------
  1521.   def screen_y
  1522.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1523.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1524.     return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  1525.   end
  1526.  
  1527.   #--------------------------------------------------------------------------
  1528.   # new method: screen_z
  1529.   #--------------------------------------------------------------------------
  1530.   def screen_z; return 100; end
  1531.  
  1532.   #--------------------------------------------------------------------------
  1533.   # new method: sprite
  1534.   #--------------------------------------------------------------------------
  1535.   def sprite
  1536.     index = $game_party.battle_members.index(self)
  1537.     return SceneManager.scene.spriteset.actor_sprites[index]
  1538.   end
  1539.  
  1540.   #--------------------------------------------------------------------------
  1541.   # new method: draw_mp?
  1542.   #--------------------------------------------------------------------------
  1543.   def draw_mp?
  1544.     return true unless draw_tp?
  1545.     for skill in skills
  1546.       next unless added_skill_types.include?(skill.stype_id)
  1547.       return true if skill.mp_cost > 0
  1548.     end
  1549.     return false
  1550.   end
  1551.  
  1552.   #--------------------------------------------------------------------------
  1553.   # new method: draw_tp?
  1554.   #--------------------------------------------------------------------------
  1555.   def draw_tp?
  1556.     return false unless $data_system.opt_display_tp
  1557.     for skill in skills
  1558.       next unless added_skill_types.include?(skill.stype_id)
  1559.       return true if skill.tp_cost > 0
  1560.     end
  1561.     return false
  1562.   end
  1563.  
  1564.   #--------------------------------------------------------------------------
  1565.   # alias method: input
  1566.   #--------------------------------------------------------------------------
  1567.   alias game_actor_input_abe input
  1568.   def input
  1569.     if @actions.nil?
  1570.       make_actions
  1571.       @action_input_index = 0
  1572.     end
  1573.     if @actions[@action_input_index].nil?
  1574.       @actions[@action_input_index] = Game_Action.new(self)
  1575.     end
  1576.     return game_actor_input_abe
  1577.   end
  1578.  
  1579. end # Game_Actor
  1580.  
  1581. #==============================================================================
  1582. # ■ Game_Enemy
  1583. #==============================================================================
  1584.  
  1585. class Game_Enemy < Game_Battler
  1586.  
  1587.   #--------------------------------------------------------------------------
  1588.   # overwrite method: perform_damage_effect
  1589.   #--------------------------------------------------------------------------
  1590.   def perform_damage_effect
  1591.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1592.     Sound.play_enemy_damage
  1593.   end
  1594.  
  1595.   #--------------------------------------------------------------------------
  1596.   # new methods: attack_animation_id
  1597.   #--------------------------------------------------------------------------
  1598.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1599.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1600.  
  1601.   #--------------------------------------------------------------------------
  1602.   # new method: sprite
  1603.   #--------------------------------------------------------------------------
  1604.   def sprite
  1605.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1606.   end
  1607.  
  1608. end # Game_Enemy
  1609.  
  1610. #==============================================================================
  1611. # ■ Game_Unit
  1612. #==============================================================================
  1613.  
  1614. class Game_Unit
  1615.  
  1616.   #--------------------------------------------------------------------------
  1617.   # alias method: make_actions
  1618.   #--------------------------------------------------------------------------
  1619.   alias game_unit_make_actions_abe make_actions
  1620.   def make_actions
  1621.     game_unit_make_actions_abe
  1622.     refresh_autobattler_status_window
  1623.   end
  1624.  
  1625.   #--------------------------------------------------------------------------
  1626.   # new method: refresh_autobattler_status_window
  1627.   #--------------------------------------------------------------------------
  1628.   def refresh_autobattler_status_window
  1629.     return unless SceneManager.scene_is?(Scene_Battle)
  1630.     return unless self.is_a?(Game_Party)
  1631.     SceneManager.scene.refresh_autobattler_status_window
  1632.   end
  1633.  
  1634. end # Game_Unit
  1635.  
  1636. #==============================================================================
  1637. # ■ Window_PartyCommand
  1638. #==============================================================================
  1639.  
  1640. class Window_PartyCommand < Window_Command
  1641.  
  1642.   #--------------------------------------------------------------------------
  1643.   # overwrite method: process_handling
  1644.   #--------------------------------------------------------------------------
  1645.   def process_handling
  1646.     return unless open? && active
  1647.     return process_dir6 if Input.repeat?(:RIGHT)
  1648.     return super
  1649.   end
  1650.  
  1651.   #--------------------------------------------------------------------------
  1652.   # new method: process_dir6
  1653.   #--------------------------------------------------------------------------
  1654.   def process_dir6
  1655.     Sound.play_cursor
  1656.     Input.update
  1657.     deactivate
  1658.     call_handler(:dir6)
  1659.   end
  1660.  
  1661. end # Window_PartyCommand
  1662.  
  1663. #==============================================================================
  1664. # ■ Window_ActorCommand
  1665. #==============================================================================
  1666.  
  1667. class Window_ActorCommand < Window_Command
  1668.  
  1669.   #--------------------------------------------------------------------------
  1670.   # overwrite method: process_handling
  1671.   #--------------------------------------------------------------------------
  1672.   def process_handling
  1673.     return unless open? && active
  1674.     return process_dir4 if Input.repeat?(:LEFT)
  1675.     return process_dir6 if Input.repeat?(:RIGHT)
  1676.     return super
  1677.   end
  1678.  
  1679.   #--------------------------------------------------------------------------
  1680.   # new method: process_dir4
  1681.   #--------------------------------------------------------------------------
  1682.   def process_dir4
  1683.     Sound.play_cursor
  1684.     Input.update
  1685.     deactivate
  1686.     call_handler(:cancel)
  1687.   end
  1688.  
  1689.   #--------------------------------------------------------------------------
  1690.   # new method: process_dir6
  1691.   #--------------------------------------------------------------------------
  1692.   def process_dir6
  1693.     Sound.play_cursor
  1694.     Input.update
  1695.     deactivate
  1696.     call_handler(:dir6)
  1697.   end
  1698.  
  1699. end # Window_ActorCommand
  1700.  
  1701. #==============================================================================
  1702. # ■ Window_BattleStatus
  1703. #==============================================================================
  1704.  
  1705. class Window_BattleStatus < Window_Selectable
  1706.  
  1707.   #--------------------------------------------------------------------------
  1708.   # overwrite method: initialize
  1709.   #--------------------------------------------------------------------------
  1710.   def initialize
  1711.     super(0, 0, window_width, window_height)
  1712.     self.openness = 0
  1713.     @party = $game_party.battle_members.clone
  1714.   end
  1715.  
  1716.   #--------------------------------------------------------------------------
  1717.   # overwrite method: col_max
  1718.   #--------------------------------------------------------------------------
  1719.   def col_max; return $game_party.max_battle_members; end
  1720.  
  1721.   #--------------------------------------------------------------------------
  1722.   # new method: battle_members
  1723.   #--------------------------------------------------------------------------
  1724.   def battle_members; return $game_party.battle_members; end
  1725.  
  1726.   #--------------------------------------------------------------------------
  1727.   # new method: actor
  1728.   #--------------------------------------------------------------------------
  1729.   def actor; return battle_members[@index]; end
  1730.  
  1731.   #--------------------------------------------------------------------------
  1732.   # overwrite method: update
  1733.   #--------------------------------------------------------------------------
  1734.   def update
  1735.     super
  1736.     return if @party == $game_party.battle_members
  1737.     @party = $game_party.battle_members.clone
  1738.     refresh
  1739.   end
  1740.   #--------------------------------------------------------------------------
  1741.   # overwrite method: draw_item
  1742.   #--------------------------------------------------------------------------
  1743.   def draw_item(index)
  1744.     return if index.nil?
  1745.     clear_item(index)
  1746.     actor = battle_members[index]
  1747.     rect = item_rect(index)
  1748.     return if actor.nil?
  1749.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)   
  1750.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1751.     draw_actor_action(actor, rect.x, rect.y)
  1752.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1753.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1754.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1755.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1756.     if draw_tp?(actor) && draw_mp?(actor)
  1757.       dw = rect.width/2-2
  1758.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1759.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1760.       dw = rect.width - rect.width/2 - 2
  1761.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1762.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1763.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1764.     else
  1765.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1766.     end
  1767.   end
  1768.  
  1769.   #--------------------------------------------------------------------------
  1770.   # overwrite method: item_rect
  1771.   #--------------------------------------------------------------------------
  1772.   def item_rect(index)
  1773.     rect = Rect.new
  1774.     rect.width = contents.width / $game_party.max_battle_members
  1775.     rect.height = contents.height
  1776.     rect.x = index * rect.width
  1777.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1778.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1779.     end
  1780.     rect.y = 0
  1781.     return rect
  1782.   end
  1783.  
  1784.   #--------------------------------------------------------------------------
  1785.   # overwrite method: draw_face
  1786.   #--------------------------------------------------------------------------
  1787.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1788.     bitmap = Cache.face(face_name)
  1789.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1790.     fy = face_index / 4 * 96 + 2
  1791.     fw = [item_rect(0).width - 4, 92].min
  1792.     rect = Rect.new(fx, fy, fw, 92)
  1793.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1794.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1795.     bitmap.dispose
  1796.   end
  1797.  
  1798.   #--------------------------------------------------------------------------
  1799.   # overwrite method: draw_actor_name
  1800.   #--------------------------------------------------------------------------
  1801.   def draw_actor_name(actor, dx, dy, dw = 112)
  1802.     reset_font_settings
  1803.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1804.     change_color(hp_color(actor))
  1805.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1806.   end
  1807.  
  1808.   #--------------------------------------------------------------------------
  1809.   # new method: draw_actor_action
  1810.   #--------------------------------------------------------------------------
  1811.   def draw_actor_action(actor, dx, dy)
  1812.     draw_icon(action_icon(actor), dx, dy)
  1813.   end
  1814.  
  1815.   #--------------------------------------------------------------------------
  1816.   # new method: action_icon
  1817.   #--------------------------------------------------------------------------
  1818.   def action_icon(actor)
  1819.     return Icon.no_action if actor.current_action.nil?
  1820.     return Icon.no_action if actor.current_action.item.nil?
  1821.     return actor.current_action.item.icon_index
  1822.   end
  1823.  
  1824.   #--------------------------------------------------------------------------
  1825.   # new method: draw_tp?
  1826.   #--------------------------------------------------------------------------
  1827.   def draw_tp?(actor)
  1828.     return actor.draw_tp?
  1829.   end
  1830.  
  1831.   #--------------------------------------------------------------------------
  1832.   # new method: draw_mp?
  1833.   #--------------------------------------------------------------------------
  1834.   def draw_mp?(actor)
  1835.     return actor.draw_mp?
  1836.   end
  1837.  
  1838.   #--------------------------------------------------------------------------
  1839.   # overwrite method: draw_current_and_max_values
  1840.   #--------------------------------------------------------------------------
  1841.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1842.     change_color(color1)
  1843.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1844.   end
  1845.  
  1846.   #--------------------------------------------------------------------------
  1847.   # overwrite method: draw_actor_hp
  1848.   #--------------------------------------------------------------------------
  1849.   def draw_actor_hp(actor, dx, dy, width = 124)
  1850.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1851.     change_color(system_color)
  1852.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1853.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1854.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1855.       hp_color(actor), normal_color)
  1856.     end
  1857.  
  1858.   #--------------------------------------------------------------------------
  1859.   # overwrite method: draw_actor_mp
  1860.   #--------------------------------------------------------------------------
  1861.   def draw_actor_mp(actor, dx, dy, width = 124)
  1862.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1863.     change_color(system_color)
  1864.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1865.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1866.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1867.       mp_color(actor), normal_color)
  1868.     end
  1869.  
  1870.   #--------------------------------------------------------------------------
  1871.   # overwrite method: draw_actor_tp
  1872.   #--------------------------------------------------------------------------
  1873.   def draw_actor_tp(actor, dx, dy, width = 124)
  1874.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1875.     change_color(system_color)
  1876.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1877.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1878.     change_color(tp_color(actor))
  1879.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1880.   end
  1881.  
  1882. end # Window_BattleStatus
  1883.  
  1884. #==============================================================================
  1885. # ■ Window_BattleActor
  1886. #==============================================================================
  1887.  
  1888. class Window_BattleActor < Window_BattleStatus
  1889.  
  1890.   #--------------------------------------------------------------------------
  1891.   # overwrite method: show
  1892.   #--------------------------------------------------------------------------
  1893.   def show
  1894.     create_flags
  1895.     super
  1896.   end
  1897.  
  1898.   #--------------------------------------------------------------------------
  1899.   # new method: create_flags
  1900.   #--------------------------------------------------------------------------
  1901.   def create_flags
  1902.     set_select_flag(:any)
  1903.     select(0)
  1904.     return if $game_temp.battle_aid.nil?
  1905.     if $game_temp.battle_aid.need_selection?
  1906.       select(0)
  1907.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1908.     elsif $game_temp.battle_aid.for_user?
  1909.       battler = BattleManager.actor
  1910.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1911.       select(id)
  1912.       set_select_flag(:user)
  1913.     elsif $game_temp.battle_aid.for_all?
  1914.       select(0)
  1915.       set_select_flag(:all)
  1916.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1917.     elsif $game_temp.battle_aid.for_random?
  1918.       select(0)
  1919.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1920.     end
  1921.   end
  1922.  
  1923.   #--------------------------------------------------------------------------
  1924.   # new method: set_flag
  1925.   #--------------------------------------------------------------------------
  1926.   def set_select_flag(flag)
  1927.     @select_flag = flag
  1928.     case @select_flag
  1929.     when :all, :all_dead, :random
  1930.       @cursor_all = true
  1931.     else
  1932.       @cursor_all = false
  1933.     end
  1934.   end
  1935.  
  1936.   #--------------------------------------------------------------------------
  1937.   # overwrite method: update_cursor
  1938.   #--------------------------------------------------------------------------
  1939.   def update_cursor
  1940.     if @cursor_all
  1941.       cursor_rect.set(0, 0, contents.width, contents.height)
  1942.       self.top_row = 0
  1943.     elsif @index < 0
  1944.       cursor_rect.empty
  1945.     else
  1946.       ensure_cursor_visible
  1947.       cursor_rect.set(item_rect(@index))
  1948.     end
  1949.   end
  1950.  
  1951.   #--------------------------------------------------------------------------
  1952.   # overwrite method: cursor_movable?
  1953.   #--------------------------------------------------------------------------
  1954.   def cursor_movable?
  1955.     return false if @select_flag == :user
  1956.     return super
  1957.   end
  1958.  
  1959.   #--------------------------------------------------------------------------
  1960.   # overwrite method: current_item_enabled?
  1961.   #--------------------------------------------------------------------------
  1962.   def current_item_enabled?
  1963.     return true if $game_temp.battle_aid.nil?
  1964.     if $game_temp.battle_aid.need_selection?
  1965.       member = $game_party.battle_members[@index]
  1966.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1967.     elsif $game_temp.battle_aid.for_dead_friend?
  1968.       for member in $game_party.battle_members
  1969.         return true if member.dead?
  1970.       end
  1971.       return false
  1972.     end
  1973.     return true
  1974.   end
  1975.  
  1976. end # Window_BattleActor
  1977.  
  1978. #==============================================================================
  1979. # ■ Window_BattleStatusAid
  1980. #==============================================================================
  1981.  
  1982. class Window_BattleStatusAid < Window_BattleStatus
  1983.  
  1984.   #--------------------------------------------------------------------------
  1985.   # public instance variables
  1986.   #--------------------------------------------------------------------------
  1987.   attr_accessor :status_window
  1988.  
  1989.   #--------------------------------------------------------------------------
  1990.   # overwrite method: initialize
  1991.   #--------------------------------------------------------------------------
  1992.   def initialize
  1993.     super
  1994.     self.visible = false
  1995.     self.openness = 255
  1996.   end
  1997.  
  1998.   #--------------------------------------------------------------------------
  1999.   # overwrite method: window_width
  2000.   #--------------------------------------------------------------------------
  2001.   def window_width; return 128; end
  2002.  
  2003.   #--------------------------------------------------------------------------
  2004.   # overwrite method: show
  2005.   #--------------------------------------------------------------------------
  2006.   def show
  2007.     super
  2008.     refresh
  2009.   end
  2010.  
  2011.   #--------------------------------------------------------------------------
  2012.   # overwrite method: refresh
  2013.   #--------------------------------------------------------------------------
  2014.   def refresh
  2015.     contents.clear
  2016.     return if @status_window.nil?
  2017.     draw_item(@status_window.index)
  2018.   end
  2019.  
  2020.   #--------------------------------------------------------------------------
  2021.   # overwrite method: item_rect
  2022.   #--------------------------------------------------------------------------
  2023.   def item_rect(index)
  2024.     return Rect.new(0, 0, contents.width, contents.height)
  2025.   end
  2026.  
  2027. end # Window_BattleStatusAid
  2028.  
  2029. #==============================================================================
  2030. # ■ Window_BattleEnemy
  2031. #==============================================================================
  2032.  
  2033. class Window_BattleEnemy < Window_Selectable
  2034.  
  2035.   #--------------------------------------------------------------------------
  2036.   # overwrite method: initialize
  2037.   #--------------------------------------------------------------------------
  2038.   def initialize(info_viewport)
  2039.     super(0, Graphics.height, window_width, fitting_height(1))
  2040.     refresh
  2041.     self.visible = false
  2042.     @info_viewport = info_viewport
  2043.   end
  2044.  
  2045.   #--------------------------------------------------------------------------
  2046.   # overwrite method: col_max
  2047.   #--------------------------------------------------------------------------
  2048.   def col_max; return item_max; end
  2049.  
  2050.   #--------------------------------------------------------------------------
  2051.   # overwrite method: show
  2052.   #--------------------------------------------------------------------------
  2053.   def show
  2054.     create_flags
  2055.     super
  2056.   end
  2057.  
  2058.   #--------------------------------------------------------------------------
  2059.   # new method: create_flags
  2060.   #--------------------------------------------------------------------------
  2061.   def create_flags
  2062.     set_select_flag(:any)
  2063.     select(0)
  2064.     return if $game_temp.battle_aid.nil?
  2065.     if $game_temp.battle_aid.need_selection?
  2066.       select(0)
  2067.     elsif $game_temp.battle_aid.for_all?
  2068.       select(0)
  2069.       set_select_flag(:all)
  2070.     elsif $game_temp.battle_aid.for_random?
  2071.       select(0)
  2072.       set_select_flag(:random)
  2073.     end
  2074.   end
  2075.  
  2076.   #--------------------------------------------------------------------------
  2077.   # new method: set_flag
  2078.   #--------------------------------------------------------------------------
  2079.   def set_select_flag(flag)
  2080.     @select_flag = flag
  2081.     case @select_flag
  2082.     when :all, :random
  2083.       @cursor_all = true
  2084.     else
  2085.       @cursor_all = false
  2086.     end
  2087.   end
  2088.  
  2089.   #--------------------------------------------------------------------------
  2090.   # new method: select_all?
  2091.   #--------------------------------------------------------------------------
  2092.   def select_all?
  2093.     return true if @select_flag == :all
  2094.     return true if @select_flag == :random
  2095.     return false
  2096.   end
  2097.  
  2098.   #--------------------------------------------------------------------------
  2099.   # overwrite method: update_cursor
  2100.   #--------------------------------------------------------------------------
  2101.   def update_cursor
  2102.     if @cursor_all
  2103.       cursor_rect.set(0, 0, contents.width, contents.height)
  2104.       self.top_row = 0
  2105.     elsif @index < 0
  2106.       cursor_rect.empty
  2107.     else
  2108.       ensure_cursor_visible
  2109.       cursor_rect.set(item_rect(@index))
  2110.     end
  2111.   end
  2112.  
  2113.   #--------------------------------------------------------------------------
  2114.   # overwrite method: cursor_movable?
  2115.   #--------------------------------------------------------------------------
  2116.   def cursor_movable?
  2117.     return false if @select_flag == :user
  2118.     return super
  2119.   end
  2120.  
  2121.   #--------------------------------------------------------------------------
  2122.   # overwrite method: current_item_enabled?
  2123.   #--------------------------------------------------------------------------
  2124.   def current_item_enabled?
  2125.     return true if $game_temp.battle_aid.nil?
  2126.     if $game_temp.battle_aid.need_selection?
  2127.       member = $game_party.battle_members[@index]
  2128.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2129.     elsif $game_temp.battle_aid.for_dead_friend?
  2130.       for member in $game_party.battle_members
  2131.         return true if member.dead?
  2132.       end
  2133.       return false
  2134.     end
  2135.     return true
  2136.   end
  2137.  
  2138.   #--------------------------------------------------------------------------
  2139.   # overwrite method: enemy
  2140.   #--------------------------------------------------------------------------
  2141.   def enemy; @data[index]; end
  2142.  
  2143.   #--------------------------------------------------------------------------
  2144.   # overwrite method: refresh
  2145.   #--------------------------------------------------------------------------
  2146.   def refresh
  2147.     make_item_list
  2148.     create_contents
  2149.     draw_all_items
  2150.   end
  2151.  
  2152.   #--------------------------------------------------------------------------
  2153.   # overwrite method: make_item_list
  2154.   #--------------------------------------------------------------------------
  2155.   def make_item_list
  2156.     @data = $game_troop.alive_members
  2157.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2158.   end
  2159.  
  2160.   #--------------------------------------------------------------------------
  2161.   # overwrite method: draw_item
  2162.   #--------------------------------------------------------------------------
  2163.   def draw_item(index); return; end
  2164.  
  2165.   #--------------------------------------------------------------------------
  2166.   # overwrite method: update
  2167.   #--------------------------------------------------------------------------
  2168.   def update
  2169.     super
  2170.     return unless active
  2171.     enemy.sprite_effect_type = :whiten
  2172.     return unless select_all?
  2173.     for enemy in $game_troop.alive_members
  2174.       enemy.sprite_effect_type = :whiten
  2175.     end
  2176.   end
  2177.  
  2178. end # Window_BattleEnemy
  2179.  
  2180. #==============================================================================
  2181. # ■ Window_BattleHelp
  2182. #==============================================================================
  2183.  
  2184. class Window_BattleHelp < Window_Help
  2185.  
  2186.   #--------------------------------------------------------------------------
  2187.   # public instance variables
  2188.   #--------------------------------------------------------------------------
  2189.   attr_accessor :actor_window
  2190.   attr_accessor :enemy_window
  2191.  
  2192.   #--------------------------------------------------------------------------
  2193.   # update
  2194.   #--------------------------------------------------------------------------
  2195.   def update
  2196.     super
  2197.     if !self.visible and @text != ""
  2198.       @text = ""
  2199.       return refresh
  2200.     end
  2201.     update_battler_name
  2202.   end
  2203.  
  2204.   #--------------------------------------------------------------------------
  2205.   # update_battler_name
  2206.   #--------------------------------------------------------------------------
  2207.   def update_battler_name
  2208.     return unless @actor_window.active || @enemy_window.active
  2209.     if @actor_window.active
  2210.       battler = $game_party.battle_members[@actor_window.index]
  2211.     elsif @enemy_window.active
  2212.       battler = @enemy_window.enemy
  2213.     end
  2214.     if special_display?
  2215.       refresh_special_case(battler)
  2216.     else
  2217.       refresh_battler_name(battler) if battler_name(battler) != @text
  2218.     end
  2219.   end
  2220.  
  2221.   #--------------------------------------------------------------------------
  2222.   # battler_name
  2223.   #--------------------------------------------------------------------------
  2224.   def battler_name(battler)
  2225.     text = battler.name.clone
  2226.     return text
  2227.   end
  2228.  
  2229.   #--------------------------------------------------------------------------
  2230.   # refresh_battler_name
  2231.   #--------------------------------------------------------------------------
  2232.   def refresh_battler_name(battler)
  2233.     contents.clear
  2234.     reset_font_settings
  2235.     change_color(normal_color)
  2236.     @text = battler_name(battler)
  2237.     icons = battler.state_icons + battler.buff_icons
  2238.     dy = icons.size <= 0 ? line_height / 2 : 0
  2239.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2240.     dx = (contents.width - (icons.size * 24)) / 2
  2241.     draw_actor_icons(battler, dx, line_height, contents.width)
  2242.   end
  2243.  
  2244.   #--------------------------------------------------------------------------
  2245.   # special_display?
  2246.   #--------------------------------------------------------------------------
  2247.   def special_display?
  2248.     return false if $game_temp.battle_aid.nil?
  2249.     return false if $game_temp.battle_aid.for_user?
  2250.     return !$game_temp.battle_aid.need_selection?
  2251.   end
  2252.  
  2253.   #--------------------------------------------------------------------------
  2254.   # refresh_special_case
  2255.   #--------------------------------------------------------------------------
  2256.   def refresh_special_case(battler)
  2257.     if $game_temp.battle_aid.for_opponent?
  2258.       if $game_temp.battle_aid.for_all?
  2259.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2260.       else
  2261.         case $game_temp.battle_aid.number_of_targets
  2262.         when 1
  2263.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2264.         else
  2265.           number = $game_temp.battle_aid.number_of_targets
  2266.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2267.         end
  2268.       end
  2269.     else # $game_temp.battle_aid.for_friend?
  2270.       if $game_temp.battle_aid.for_dead_friend?
  2271.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2272.       elsif $game_temp.battle_aid.for_random?
  2273.         case $game_temp.battle_aid.number_of_targets
  2274.         when 1
  2275.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2276.         else
  2277.           number = $game_temp.battle_aid.number_of_targets
  2278.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2279.         end
  2280.       else
  2281.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2282.       end
  2283.     end
  2284.     return if text == @text
  2285.     @text = text
  2286.     contents.clear
  2287.     reset_font_settings
  2288.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2289.   end
  2290.  
  2291. end # Window_BattleHelp
  2292.  
  2293. #==============================================================================
  2294. # ■ Window_BattleLog
  2295. #==============================================================================
  2296.  
  2297. class Window_BattleLog < Window_Selectable
  2298.  
  2299.   #--------------------------------------------------------------------------
  2300.   # alias method: display_current_state
  2301.   #--------------------------------------------------------------------------
  2302.   alias window_battlelog_display_current_state_abe display_current_state
  2303.   def display_current_state(subject)
  2304.     subject.make_during_state_popup
  2305.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2306.     window_battlelog_display_current_state_abe(subject)
  2307.   end
  2308.  
  2309.   #--------------------------------------------------------------------------
  2310.   # alias method: display_use_item
  2311.   #--------------------------------------------------------------------------
  2312.   alias window_battlelog_display_use_item_abe display_use_item
  2313.   def display_use_item(subject, item)
  2314.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2315.     window_battlelog_display_use_item_abe(subject, item)
  2316.   end
  2317.  
  2318.   #--------------------------------------------------------------------------
  2319.   # alias method: display_counter
  2320.   #--------------------------------------------------------------------------
  2321.   alias window_battlelog_display_counter_abe display_counter
  2322.   def display_counter(target, item)
  2323.     if YEA::BATTLE::MSG_COUNTERATTACK
  2324.       window_battlelog_display_counter_abe(target, item)
  2325.     else
  2326.       Sound.play_evasion
  2327.     end
  2328.   end
  2329.  
  2330.   #--------------------------------------------------------------------------
  2331.   # alias method: display_reflection
  2332.   #--------------------------------------------------------------------------
  2333.   alias window_battlelog_display_reflection_abe display_reflection
  2334.   def display_reflection(target, item)
  2335.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2336.       window_battlelog_display_reflection_abe(target, item)
  2337.     else
  2338.       Sound.play_reflection
  2339.     end
  2340.   end
  2341.  
  2342.   #--------------------------------------------------------------------------
  2343.   # alias method: display_substitute
  2344.   #--------------------------------------------------------------------------
  2345.   alias window_battlelog_display_substitute_abe display_substitute
  2346.   def display_substitute(substitute, target)
  2347.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2348.     window_battlelog_display_substitute_abe(substitute, target)
  2349.   end
  2350.  
  2351.   #--------------------------------------------------------------------------
  2352.   # alias method: display_failure
  2353.   #--------------------------------------------------------------------------
  2354.   alias window_battlelog_display_failure_abe display_failure
  2355.   def display_failure(target, item)
  2356.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2357.     window_battlelog_display_failure_abe(target, item)
  2358.   end
  2359.  
  2360.   #--------------------------------------------------------------------------
  2361.   # alias method: display_critical
  2362.   #--------------------------------------------------------------------------
  2363.   alias window_battlelog_display_critical_abe display_critical
  2364.   def display_critical(target, item)
  2365.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2366.     window_battlelog_display_critical_abe(target, item)
  2367.   end
  2368.  
  2369.   #--------------------------------------------------------------------------
  2370.   # alias method: display_miss
  2371.   #--------------------------------------------------------------------------
  2372.   alias window_battlelog_display_miss_abe display_miss
  2373.   def display_miss(target, item)
  2374.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2375.     window_battlelog_display_miss_abe(target, item)
  2376.   end
  2377.  
  2378.   #--------------------------------------------------------------------------
  2379.   # alias method: display_evasion
  2380.   #--------------------------------------------------------------------------
  2381.   alias window_battlelog_display_evasion_abe display_evasion
  2382.   def display_evasion(target, item)
  2383.     if YEA::BATTLE::MSG_EVASION
  2384.       window_battlelog_display_evasion_abe(target, item)
  2385.     else
  2386.       if !item || item.physical?
  2387.         Sound.play_evasion
  2388.       else
  2389.         Sound.play_magic_evasion
  2390.       end
  2391.     end
  2392.   end
  2393.  
  2394.   #--------------------------------------------------------------------------
  2395.   # overwrite method: display_hp_damage
  2396.   #--------------------------------------------------------------------------
  2397.   def display_hp_damage(target, item)
  2398.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2399.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2400.       target.perform_damage_effect
  2401.     end
  2402.     Sound.play_recovery if target.result.hp_damage < 0
  2403.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2404.     add_text(target.result.hp_damage_text)
  2405.     wait
  2406.   end
  2407.  
  2408.   #--------------------------------------------------------------------------
  2409.   # overwrite method: display_mp_damage
  2410.   #--------------------------------------------------------------------------
  2411.   def display_mp_damage(target, item)
  2412.     return if target.dead? || target.result.mp_damage == 0
  2413.     Sound.play_recovery if target.result.mp_damage < 0
  2414.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2415.     add_text(target.result.mp_damage_text)
  2416.     wait
  2417.   end
  2418.  
  2419.   #--------------------------------------------------------------------------
  2420.   # overwrite method: display_tp_damage
  2421.   #--------------------------------------------------------------------------
  2422.   def display_tp_damage(target, item)
  2423.     return if target.dead? || target.result.tp_damage == 0
  2424.     Sound.play_recovery if target.result.tp_damage < 0
  2425.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2426.     add_text(target.result.tp_damage_text)
  2427.     wait
  2428.   end
  2429.  
  2430.   #--------------------------------------------------------------------------
  2431.   # alias method: display_added_states
  2432.   #--------------------------------------------------------------------------
  2433.   alias window_battlelog_display_added_states_abe display_added_states
  2434.   def display_added_states(target)
  2435.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2436.     window_battlelog_display_added_states_abe(target)
  2437.   end
  2438.  
  2439.   #--------------------------------------------------------------------------
  2440.   # alias method: display_removed_states
  2441.   #--------------------------------------------------------------------------
  2442.   alias window_battlelog_display_removed_states_abe display_removed_states
  2443.   def display_removed_states(target)
  2444.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2445.     window_battlelog_display_removed_states_abe(target)
  2446.   end
  2447.  
  2448.   #--------------------------------------------------------------------------
  2449.   # alias method: display_changed_buffs
  2450.   #--------------------------------------------------------------------------
  2451.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2452.   def display_changed_buffs(target)
  2453.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2454.     window_battlelog_display_changed_buffs_abe(target)
  2455.   end
  2456.  
  2457. end # Window_BattleLog
  2458.  
  2459. #==============================================================================
  2460. # ■ Window_SkillList
  2461. #==============================================================================
  2462.  
  2463. class Window_SkillList < Window_Selectable
  2464.  
  2465.   #--------------------------------------------------------------------------
  2466.   # overwrite method: spacing
  2467.   #--------------------------------------------------------------------------
  2468.   def spacing
  2469.     return 8 if $game_party.in_battle
  2470.     return super
  2471.   end
  2472.  
  2473. end # Window_SkillList
  2474.  
  2475. #==============================================================================
  2476. # ■ Window_ItemList
  2477. #==============================================================================
  2478.  
  2479. class Window_ItemList < Window_Selectable
  2480.  
  2481.   #--------------------------------------------------------------------------
  2482.   # overwrite method: spacing
  2483.   #--------------------------------------------------------------------------
  2484.   def spacing
  2485.     return 8 if $game_party.in_battle
  2486.     return super
  2487.   end
  2488.  
  2489. end # Window_ItemList
  2490.  
  2491. #==============================================================================
  2492. # ■ Scene_Battle
  2493. #==============================================================================
  2494.  
  2495. class Scene_Battle < Scene_Base
  2496.  
  2497.   #--------------------------------------------------------------------------
  2498.   # public instance variables
  2499.   #--------------------------------------------------------------------------
  2500.   attr_accessor :enemy_window
  2501.   attr_accessor :info_viewport
  2502.   attr_accessor :spriteset
  2503.   attr_accessor :status_window
  2504.   attr_accessor :status_aid_window
  2505.   attr_accessor :subject
  2506.  
  2507.   #--------------------------------------------------------------------------
  2508.   # alias method: create_spriteset
  2509.   #--------------------------------------------------------------------------
  2510.   alias scene_battle_create_spriteset_abe create_spriteset
  2511.   def create_spriteset
  2512.     BattleManager.init_battle_type
  2513.     scene_battle_create_spriteset_abe
  2514.   end
  2515.  
  2516.   #--------------------------------------------------------------------------
  2517.   # alias method: update_basic
  2518.   #--------------------------------------------------------------------------
  2519.   alias scene_battle_update_basic_abe update_basic
  2520.   def update_basic
  2521.     scene_battle_update_basic_abe
  2522.     update_debug
  2523.   end
  2524.  
  2525.   #--------------------------------------------------------------------------
  2526.   # new method: update_debug
  2527.   #--------------------------------------------------------------------------
  2528.   def update_debug
  2529.     return unless $TEST || $BTEST
  2530.     debug_heal_party if Input.trigger?(:F5)
  2531.     debug_damage_party if Input.trigger?(:F6)
  2532.     debug_fill_tp if Input.trigger?(:F7)
  2533.     debug_kill_all if Input.trigger?(:F8)
  2534.   end
  2535.  
  2536.   #--------------------------------------------------------------------------
  2537.   # new method: debug_heal_party
  2538.   #--------------------------------------------------------------------------
  2539.   def debug_heal_party
  2540.     Sound.play_recovery
  2541.     for member in $game_party.battle_members
  2542.       member.recover_all
  2543.     end
  2544.     @status_window.refresh
  2545.   end
  2546.  
  2547.   #--------------------------------------------------------------------------
  2548.   # new method: debug_damage_party
  2549.   #--------------------------------------------------------------------------
  2550.   def debug_damage_party
  2551.     Sound.play_actor_damage
  2552.     for member in $game_party.alive_members
  2553.       member.hp = 1
  2554.       member.mp = 0
  2555.       member.tp = 0
  2556.     end
  2557.     @status_window.refresh
  2558.   end
  2559.  
  2560.   #--------------------------------------------------------------------------
  2561.   # new method: debug_fill_tp
  2562.   #--------------------------------------------------------------------------
  2563.   def debug_fill_tp
  2564.     Sound.play_recovery
  2565.     for member in $game_party.alive_members
  2566.       member.tp = member.max_tp
  2567.     end
  2568.     @status_window.refresh
  2569.   end
  2570.  
  2571.   #--------------------------------------------------------------------------
  2572.   # new method: debug_kill_all
  2573.   #--------------------------------------------------------------------------
  2574.   def debug_kill_all
  2575.     for enemy in $game_troop.alive_members
  2576.       enemy.hp = 0
  2577.       enemy.perform_collapse_effect
  2578.     end
  2579.     BattleManager.judge_win_loss
  2580.     @log_window.wait
  2581.     @log_window.wait_for_effect
  2582.   end
  2583.  
  2584.   #--------------------------------------------------------------------------
  2585.   # alias method: create_all_windows
  2586.   #--------------------------------------------------------------------------
  2587.   alias scene_battle_create_all_windows_abe create_all_windows
  2588.   def create_all_windows
  2589.     scene_battle_create_all_windows_abe
  2590.     create_battle_status_aid_window
  2591.     set_help_window
  2592.   end
  2593.  
  2594.   #--------------------------------------------------------------------------
  2595.   # alias method: create_info_viewport
  2596.   #--------------------------------------------------------------------------
  2597.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2598.   def create_info_viewport
  2599.     scene_battle_create_info_viewport_abe
  2600.     @status_window.refresh
  2601.   end
  2602.  
  2603.   #--------------------------------------------------------------------------
  2604.   # new method: create_battle_status_aid_window
  2605.   #--------------------------------------------------------------------------
  2606.   def create_battle_status_aid_window
  2607.     @status_aid_window = Window_BattleStatusAid.new
  2608.     @status_aid_window.status_window = @status_window
  2609.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2610.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2611.   end
  2612.  
  2613.   #--------------------------------------------------------------------------
  2614.   # overwrite method: create_help_window
  2615.   #--------------------------------------------------------------------------
  2616.   def create_help_window
  2617.     @help_window = Window_BattleHelp.new
  2618.     @help_window.hide
  2619.   end
  2620.  
  2621.   #--------------------------------------------------------------------------
  2622.   # new method: set_help_window
  2623.   #--------------------------------------------------------------------------
  2624.   def set_help_window
  2625.     @help_window.actor_window = @actor_window
  2626.     @help_window.enemy_window = @enemy_window
  2627.   end
  2628.  
  2629.   #--------------------------------------------------------------------------
  2630.   # alias method: create_party_command_window
  2631.   #--------------------------------------------------------------------------
  2632.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2633.   def create_party_command_window
  2634.     scene_battle_create_party_command_window_abe
  2635.     @party_command_window.set_handler(:dir6, method(:command_fight))
  2636.   end
  2637.  
  2638.   #--------------------------------------------------------------------------
  2639.   # alias method: create_actor_command_window
  2640.   #--------------------------------------------------------------------------
  2641.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2642.   def create_actor_command_window
  2643.     scene_battle_create_actor_command_window_abe
  2644.     @actor_command_window.set_handler(:dir4, method(:prior_command))
  2645.     @actor_command_window.set_handler(:dir6, method(:next_command))
  2646.   end
  2647.  
  2648.   #--------------------------------------------------------------------------
  2649.   # alias method: create_skill_window
  2650.   #--------------------------------------------------------------------------
  2651.   alias scene_battle_create_skill_window_abe create_skill_window
  2652.   def create_skill_window
  2653.     scene_battle_create_skill_window_abe
  2654.     @skill_window.height = @info_viewport.rect.height
  2655.     @skill_window.width = Graphics.width - @actor_command_window.width
  2656.     @skill_window.y = Graphics.height - @skill_window.height
  2657.   end
  2658.  
  2659.   #--------------------------------------------------------------------------
  2660.   # alias method: create_item_window
  2661.   #--------------------------------------------------------------------------
  2662.   alias scene_battle_create_item_window_abe create_item_window
  2663.   def create_item_window
  2664.     scene_battle_create_item_window_abe
  2665.     @item_window.height = @skill_window.height
  2666.     @item_window.width = @skill_window.width
  2667.     @item_window.y = Graphics.height - @item_window.height
  2668.   end
  2669.  
  2670.   #--------------------------------------------------------------------------
  2671.   # alias method: show_fast?
  2672.   #--------------------------------------------------------------------------
  2673.   alias scene_battle_show_fast_abe show_fast?
  2674.   def show_fast?
  2675.     return true if YEA::BATTLE::AUTO_FAST
  2676.     return scene_battle_show_fast_abe
  2677.   end
  2678.  
  2679.   #--------------------------------------------------------------------------
  2680.   # alias method: next_command
  2681.   #--------------------------------------------------------------------------
  2682.   alias scene_battle_next_command_abe next_command
  2683.   def next_command
  2684.     @status_window.show
  2685.     redraw_current_status
  2686.     @actor_command_window.show
  2687.     @status_aid_window.hide
  2688.     scene_battle_next_command_abe
  2689.   end
  2690.  
  2691.   #--------------------------------------------------------------------------
  2692.   # alias method: prior_command
  2693.   #--------------------------------------------------------------------------
  2694.   alias scene_battle_prior_command_abe prior_command
  2695.   def prior_command
  2696.     redraw_current_status
  2697.     scene_battle_prior_command_abe
  2698.   end
  2699.  
  2700.   #--------------------------------------------------------------------------
  2701.   # new method: redraw_current_status
  2702.   #--------------------------------------------------------------------------
  2703.   def redraw_current_status
  2704.     return if @status_window.index < 0
  2705.     @status_window.draw_item(@status_window.index)
  2706.   end
  2707.  
  2708.   #--------------------------------------------------------------------------
  2709.   # alias method: command_attack
  2710.   #--------------------------------------------------------------------------
  2711.   alias scene_battle_command_attack_abe command_attack
  2712.   def command_attack
  2713.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2714.     scene_battle_command_attack_abe
  2715.   end
  2716.  
  2717.   #--------------------------------------------------------------------------
  2718.   # alias method: command_skill
  2719.   #--------------------------------------------------------------------------
  2720.   alias scene_battle_command_skill_abe command_skill
  2721.   def command_skill
  2722.     scene_battle_command_skill_abe
  2723.     @status_window.hide
  2724.     @actor_command_window.hide
  2725.     @status_aid_window.show
  2726.   end
  2727.  
  2728.   #--------------------------------------------------------------------------
  2729.   # alias method: command_item
  2730.   #--------------------------------------------------------------------------
  2731.   alias scene_battle_command_item_abe command_item
  2732.   def command_item
  2733.     scene_battle_command_item_abe
  2734.     @status_window.hide
  2735.     @actor_command_window.hide
  2736.     @status_aid_window.show
  2737.   end
  2738.  
  2739.   #--------------------------------------------------------------------------
  2740.   # overwrite method: on_skill_ok
  2741.   #--------------------------------------------------------------------------
  2742.   def on_skill_ok
  2743.     @skill = @skill_window.item
  2744.     $game_temp.battle_aid = @skill
  2745.     BattleManager.actor.input.set_skill(@skill.id)
  2746.     BattleManager.actor.last_skill.object = @skill
  2747.     if @skill.for_opponent?
  2748.       select_enemy_selection
  2749.     elsif @skill.for_friend?
  2750.       select_actor_selection
  2751.     else
  2752.       @skill_window.hide
  2753.       next_command
  2754.       $game_temp.battle_aid = nil
  2755.     end
  2756.   end
  2757.  
  2758.   #--------------------------------------------------------------------------
  2759.   # alias method: on_skill_cancel
  2760.   #--------------------------------------------------------------------------
  2761.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2762.   def on_skill_cancel
  2763.     scene_battle_on_skill_cancel_abe
  2764.     @status_window.show
  2765.     @actor_command_window.show
  2766.     @status_aid_window.hide
  2767.   end
  2768.  
  2769.   #--------------------------------------------------------------------------
  2770.   # overwrite method: on_item_ok
  2771.   #--------------------------------------------------------------------------
  2772.   def on_item_ok
  2773.     @item = @item_window.item
  2774.     $game_temp.battle_aid = @item
  2775.     BattleManager.actor.input.set_item(@item.id)
  2776.     if @item.for_opponent?
  2777.       select_enemy_selection
  2778.     elsif @item.for_friend?
  2779.       select_actor_selection
  2780.     else
  2781.       @item_window.hide
  2782.       next_command
  2783.       $game_temp.battle_aid = nil
  2784.     end
  2785.     $game_party.last_item.object = @item
  2786.   end
  2787.  
  2788.   #--------------------------------------------------------------------------
  2789.   # alias method: on_item_cancel
  2790.   #--------------------------------------------------------------------------
  2791.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2792.   def on_item_cancel
  2793.     scene_battle_on_item_cancel_abe
  2794.     @status_window.show
  2795.     @actor_command_window.show
  2796.     @status_aid_window.hide
  2797.   end
  2798.  
  2799.   #--------------------------------------------------------------------------
  2800.   # alias method: select_actor_selection
  2801.   #--------------------------------------------------------------------------
  2802.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2803.   def select_actor_selection
  2804.     @status_aid_window.refresh
  2805.     scene_battle_select_actor_selection_abe
  2806.     @status_window.hide
  2807.     @skill_window.hide
  2808.     @item_window.hide
  2809.     @help_window.show
  2810.   end
  2811.  
  2812.   #--------------------------------------------------------------------------
  2813.   # alias method: on_actor_ok
  2814.   #--------------------------------------------------------------------------
  2815.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2816.   def on_actor_ok
  2817.     $game_temp.battle_aid = nil
  2818.     scene_battle_on_actor_ok_abe
  2819.     @status_window.show
  2820.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2821.       @actor_command_window.visible = !@confirm_command_window.visible
  2822.     else
  2823.       @actor_command_window.show
  2824.     end
  2825.     @status_aid_window.hide
  2826.   end
  2827.  
  2828.   #--------------------------------------------------------------------------
  2829.   # alias method: on_actor_cancel
  2830.   #--------------------------------------------------------------------------
  2831.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2832.   def on_actor_cancel
  2833.     BattleManager.actor.input.clear
  2834.     @status_aid_window.refresh
  2835.     $game_temp.battle_aid = nil
  2836.     scene_battle_on_actor_cancel_abe
  2837.     case @actor_command_window.current_symbol
  2838.     when :skill
  2839.       @skill_window.show
  2840.     when :item
  2841.       @item_window.show
  2842.     end
  2843.   end
  2844.  
  2845.   #--------------------------------------------------------------------------
  2846.   # alias method: select_enemy_selection
  2847.   #--------------------------------------------------------------------------
  2848.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2849.   def select_enemy_selection
  2850.     @status_aid_window.refresh
  2851.     scene_battle_select_enemy_selection_abe
  2852.     @help_window.show
  2853.   end
  2854.   #--------------------------------------------------------------------------
  2855.   # alias method: on_enemy_ok
  2856.   #--------------------------------------------------------------------------
  2857.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2858.   def on_enemy_ok
  2859.     $game_temp.battle_aid = nil
  2860.     scene_battle_on_enemy_ok_abe
  2861.   end
  2862.  
  2863.   #--------------------------------------------------------------------------
  2864.   # alias method: on_enemy_cancel
  2865.   #--------------------------------------------------------------------------
  2866.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2867.   def on_enemy_cancel
  2868.     BattleManager.actor.input.clear
  2869.     @status_aid_window.refresh
  2870.     $game_temp.battle_aid = nil
  2871.     scene_battle_on_enemy_cancel_abe
  2872.     if @skill_window.visible || @item_window.visible
  2873.       @help_window.show
  2874.     else
  2875.       @help_window.hide
  2876.     end
  2877.   end
  2878.  
  2879.   #--------------------------------------------------------------------------
  2880.   # alias method: battle_start
  2881.   #--------------------------------------------------------------------------
  2882.   alias scene_battle_battle_start_abe battle_start
  2883.   def battle_start
  2884.     scene_battle_battle_start_abe
  2885.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2886.     @party_command_window.deactivate
  2887.     if BattleManager.input_start
  2888.       command_fight
  2889.     else
  2890.       turn_start
  2891.     end
  2892.   end
  2893.  
  2894.   #--------------------------------------------------------------------------
  2895.   # overwrite method: turn_end
  2896.   #--------------------------------------------------------------------------
  2897.   def turn_end
  2898.     all_battle_members.each do |battler|
  2899.       battler.on_turn_end
  2900.       status_redraw_target(battler)
  2901.       @log_window.display_auto_affected_status(battler)
  2902.       @log_window.wait_and_clear
  2903.     end
  2904.     update_party_cooldowns if $imported["YEA-CommandParty"]
  2905.     BattleManager.turn_end
  2906.     process_event
  2907.     start_party_command_selection
  2908.     return if end_battle_conditions?
  2909.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2910.     if BattleManager.input_start
  2911.       @party_command_window.deactivate
  2912.       command_fight
  2913.     else
  2914.       @party_command_window.deactivate
  2915.       turn_start
  2916.     end
  2917.   end
  2918.  
  2919.   #--------------------------------------------------------------------------
  2920.   # new method: end_battle_conditions?
  2921.   #--------------------------------------------------------------------------
  2922.   def end_battle_conditions?
  2923.     return true if $game_party.members.empty?
  2924.     return true if $game_party.all_dead?
  2925.     return true if $game_troop.all_dead?
  2926.     return true if BattleManager.aborting?
  2927.     return false
  2928.   end
  2929.  
  2930.   #--------------------------------------------------------------------------
  2931.   # overwrite method: execute_action
  2932.   #--------------------------------------------------------------------------
  2933.   def execute_action
  2934.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2935.     use_item
  2936.     @log_window.wait_and_clear
  2937.   end
  2938.  
  2939.   #--------------------------------------------------------------------------
  2940.   # overwrite method: apply_item_effects
  2941.   #--------------------------------------------------------------------------
  2942.   def apply_item_effects(target, item)
  2943.     if $imported["YEA-LunaticObjects"]
  2944.       lunatic_object_effect(:prepare, item, @subject, target)
  2945.     end
  2946.     target.item_apply(@subject, item)
  2947.     status_redraw_target(@subject)
  2948.     status_redraw_target(target) unless target == @subject
  2949.     @log_window.display_action_results(target, item)
  2950.     if $imported["YEA-LunaticObjects"]
  2951.       lunatic_object_effect(:during, item, @subject, target)
  2952.     end
  2953.     perform_collapse_check(target)
  2954.   end
  2955.  
  2956.   #--------------------------------------------------------------------------
  2957.   # overwite method: invoke_counter_attack
  2958.   #--------------------------------------------------------------------------
  2959.   def invoke_counter_attack(target, item)
  2960.     @log_window.display_counter(target, item)
  2961.     attack_skill = $data_skills[target.attack_skill_id]
  2962.     @subject.item_apply(target, attack_skill)
  2963.     status_redraw_target(@subject)
  2964.     status_redraw_target(target) unless target == @subject
  2965.     @log_window.display_action_results(@subject, attack_skill)
  2966.     perform_collapse_check(target)
  2967.     perform_collapse_check(@subject)
  2968.   end
  2969.  
  2970.   #--------------------------------------------------------------------------
  2971.   # new method: perform_collapse_check
  2972.   #--------------------------------------------------------------------------
  2973.   def perform_collapse_check(target)
  2974.     return if YEA::BATTLE::MSG_ADDED_STATES
  2975.     target.perform_collapse_effect if target.can_collapse?
  2976.     @log_window.wait
  2977.     @log_window.wait_for_effect
  2978.   end
  2979.  
  2980.   #--------------------------------------------------------------------------
  2981.   # overwrite method: show_attack_animation
  2982.   #--------------------------------------------------------------------------
  2983.   def show_attack_animation(targets)
  2984.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2985.     wait_for_animation
  2986.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2987.   end
  2988.  
  2989.   #--------------------------------------------------------------------------
  2990.   # overwrite method: show_normal_animation
  2991.   #--------------------------------------------------------------------------
  2992.   def show_normal_animation(targets, animation_id, mirror = false)
  2993.     animation = $data_animations[animation_id]
  2994.     return if animation.nil?
  2995.     ani_check = false
  2996.     targets.each do |target|
  2997.       if ani_check && target.animation_id <= 0
  2998.         target.pseudo_ani_id = animation_id
  2999.       else
  3000.         target.animation_id = animation_id
  3001.       end
  3002.       target.animation_mirror = mirror
  3003.       ani_check = true if animation.to_screen?
  3004.     end
  3005.   end
  3006.  
  3007.   #--------------------------------------------------------------------------
  3008.   # overwrite method: process_action_end
  3009.   #--------------------------------------------------------------------------
  3010.   def process_action_end
  3011.     @subject.on_action_end
  3012.     status_redraw_target(@subject)
  3013.     @log_window.display_auto_affected_status(@subject)
  3014.     @log_window.wait_and_clear
  3015.     @log_window.display_current_state(@subject)
  3016.     @log_window.wait_and_clear
  3017.     BattleManager.judge_win_loss
  3018.   end
  3019.  
  3020.   #--------------------------------------------------------------------------
  3021.   # overwrite method: use_item
  3022.   #--------------------------------------------------------------------------
  3023.   def use_item
  3024.     item = @subject.current_action.item
  3025.     @log_window.display_use_item(@subject, item)
  3026.     @subject.use_item(item)
  3027.     status_redraw_target(@subject)
  3028.     if $imported["YEA-LunaticObjects"]
  3029.       lunatic_object_effect(:before, item, @subject, @subject)
  3030.     end
  3031.     process_casting_animation if $imported["YEA-CastAnimations"]
  3032.     targets = @subject.current_action.make_targets.compact rescue []
  3033.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  3034.     targets.each {|target|
  3035.       if $imported["YEA-TargetManager"]
  3036.         target = alive_random_target(target, item) if item.for_random?
  3037.       end
  3038.       item.repeats.times { invoke_item(target, item) } }
  3039.     if $imported["YEA-LunaticObjects"]
  3040.       lunatic_object_effect(:after, item, @subject, @subject)
  3041.     end
  3042.   end
  3043.  
  3044.   #--------------------------------------------------------------------------
  3045.   # alias method: invoke_item
  3046.   #--------------------------------------------------------------------------
  3047.   alias scene_battle_invoke_item_abe invoke_item
  3048.   def invoke_item(target, item)
  3049.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  3050.     if target.dead? != item.for_dead_friend?
  3051.       @subject.last_target_index = target.index
  3052.       return
  3053.     end
  3054.     scene_battle_invoke_item_abe(target, item)
  3055.   end
  3056.  
  3057.   #--------------------------------------------------------------------------
  3058.   # new method: show_all_animation?
  3059.   #--------------------------------------------------------------------------
  3060.   def show_all_animation?(item)
  3061.     return true if item.one_animation
  3062.     return false if $data_animations[item.animation_id].nil?
  3063.     return false unless $data_animations[item.animation_id].to_screen?
  3064.     return true
  3065.   end
  3066.  
  3067.   #--------------------------------------------------------------------------
  3068.   # new method: separate_ani?
  3069.   #--------------------------------------------------------------------------
  3070.   def separate_ani?(target, item)
  3071.     return false if item.one_animation
  3072.     return false if $data_animations[item.animation_id].nil?
  3073.     return false if $data_animations[item.animation_id].to_screen?
  3074.     return target.dead? == item.for_dead_friend?
  3075.   end
  3076.  
  3077.   #--------------------------------------------------------------------------
  3078.   # new method: status_redraw_target
  3079.   #--------------------------------------------------------------------------
  3080.   def status_redraw_target(target)
  3081.     return unless target.actor?
  3082.     @status_window.draw_item($game_party.battle_members.index(target))
  3083.   end
  3084.  
  3085.   #--------------------------------------------------------------------------
  3086.   # alias method: start_party_command_selection
  3087.   #--------------------------------------------------------------------------
  3088.   alias start_party_command_selection_abe start_party_command_selection
  3089.   def start_party_command_selection
  3090.     @status_window.refresh unless scene_changing?
  3091.     start_party_command_selection_abe
  3092.   end
  3093.  
  3094.   #--------------------------------------------------------------------------
  3095.   # overwrite method: refresh_status
  3096.   #--------------------------------------------------------------------------
  3097.   def refresh_status; return; end
  3098.  
  3099.   #--------------------------------------------------------------------------
  3100.   # new method: refresh_autobattler_status_window
  3101.   #--------------------------------------------------------------------------
  3102.   def refresh_autobattler_status_window
  3103.     for member in $game_party.battle_members
  3104.       next unless member.auto_battle?
  3105.       @status_window.draw_item(member.index)
  3106.     end
  3107.   end
  3108.  
  3109.   #--------------------------------------------------------------------------
  3110.   # new method: hide_extra_gauges
  3111.   #--------------------------------------------------------------------------
  3112.   def hide_extra_gauges
  3113.     # Made for compatibility
  3114.   end
  3115.  
  3116.   #--------------------------------------------------------------------------
  3117.   # new method: show_extra_gauges
  3118.   #--------------------------------------------------------------------------
  3119.   def show_extra_gauges
  3120.     # Made for compatibility
  3121.   end
  3122.  
  3123. end # Scene_Battle
  3124.  
  3125. #==============================================================================
  3126. #
  3127. # ▼ End of File
  3128. #
  3129. #==============================================================================

点评

[code]0v0[/code]或者用那个 < > 按钮  发表于 2018-4-5 16:28
赞美灵魂……
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 00:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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