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

Project1

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

[已经解决] 求一个行动条脚本。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
帖子
16
跳转到指定楼层
1
发表于 2012-12-13 17:43:02 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
20星屑
做游戏,急需一个纵版战斗的行动条脚本,求有脚本的、会写脚本的大神们帮帮忙。

要求:
     
     1、行动条类似于“轩辕剑4”那种感觉,就是一个竖条,敌我双方的小头像从上往下走,到底战斗。(要能使用“束缚”之类的限制状态的。比如敌人1号被束缚2回合,他的小头像到底两次状态就解除)
      2、要能兼容RMVA自带功能“强制战斗”的……
      3、显示敌人攻击动画。

求好心的大神帮个忙
麻烦大家了……

最佳答案

查看完整内容

#============================================================================== # ■ CP制战斗系统 v1.00 #------------------------------------------------------------------------------ # 适用于:RPG Maker VX Ace # 说明:把脚本放在Main的前面。 # 所需素材:Graphics\Pictures\SL我方.png,SL敌方.png。 #============================================================================== #encoding: ...

Lv1.梦旅人

梦石
0
星屑
144
在线时间
628 小时
注册时间
2012-6-9
帖子
1321
2
发表于 2012-12-13 17:43:03 | 只看该作者



RUBY 代码复制
  1. #==============================================================================
  2. # ■ CP制战斗系统 v1.00
  3. #------------------------------------------------------------------------------
  4. #    适用于:RPG Maker VX Ace
  5. #    说明:把脚本放在Main的前面。
  6. #    所需素材:Graphics\Pictures\SL我方.png,SL敌方.png。
  7. #==============================================================================
  8.  
  9. #encoding:utf-8
  10. #==============================================================================
  11. # ■ Scene_Battle
  12. #------------------------------------------------------------------------------
  13. #  战斗画面
  14. #==============================================================================
  15.  
  16. class Scene_Battle < Scene_Base
  17.   attr_accessor :cp_quota
  18.   attr_accessor :rtab_wait
  19.   attr_accessor :active_members
  20.   #--------------------------------------------------------------------------
  21.   # ● 开始处理
  22.   #--------------------------------------------------------------------------
  23.   def start
  24.     super
  25.     @cp_quota = 0
  26.     create_spriteset
  27.     create_all_windows
  28.     BattleManager.method_wait_for_message = method(:wait_for_message)
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● 战斗开始
  32.   #--------------------------------------------------------------------------
  33.   def battle_start
  34.     @rtab_wait = true
  35.     @active_members = []
  36.     BattleManager.battle_start
  37.     set_cp_quota
  38.     process_event
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 获取敌我双方人物的平均行动速度并决定CP槽的Quota值
  42.   #--------------------------------------------------------------------------
  43.   def set_cp_quota
  44.     sss = 0.0
  45.     for iii in $game_party.members
  46.       sss += iii.param(6)
  47.     end
  48.     sss /= $game_party.members.size
  49.     @cp_quota = sss * 45
  50.     @spriteset.cp_quota = @cp_quota
  51.     for iii in $game_party.members + $game_troop.members
  52.       iii.cp_quota = @cp_quota
  53.     end
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 进行下一个指令输入
  57.   #--------------------------------------------------------------------------
  58.   def next_command
  59.     if BattleManager.next_command
  60.       start_actor_command_selection
  61.     else
  62.       turn_start(@active_members)
  63.     end
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● 返回上一个指令输入
  67.   #--------------------------------------------------------------------------
  68.   def prior_command
  69.     if BattleManager.prior_command
  70.       start_actor_command_selection
  71.     else
  72.       start_party_command_selection
  73.     end
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 更新画面
  77.   #--------------------------------------------------------------------------
  78.   def update
  79.     super
  80.     if BattleManager.in_turn?
  81.       process_event
  82.       process_action
  83.     else
  84.       if @rtab_wait
  85.         for iii in $game_party.members + $game_troop.members
  86.           iii.in_turn = false
  87.           iii.rtab_cp += iii.param(6)
  88.           if iii.rtab_cp >= iii.cp_quota
  89.             @active_members.push(iii)
  90.             iii.in_turn = true
  91.           end
  92.         end
  93.         if @active_members.size > 0
  94.           @rtab_wait = false
  95.           start_party_command_selection
  96.         end
  97.       end
  98.     end
  99.     BattleManager.judge_win_loss
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 回合开始
  103.   #--------------------------------------------------------------------------
  104.   def turn_start(members)
  105.     @party_command_window.close
  106.     @actor_command_window.close
  107.     @status_window.unselect
  108.     @subject = nil
  109.     BattleManager.turn_start(members)
  110.     @log_window.wait
  111.     @log_window.clear
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ● 回合结束
  115.   #--------------------------------------------------------------------------
  116.   def turn_end
  117.     @active_members.each do |battler|
  118.       battler.on_turn_end
  119.       refresh_status
  120.       @log_window.display_auto_affected_status(battler)
  121.       @log_window.wait_and_clear
  122.     end
  123.     BattleManager.turn_end
  124.     process_event
  125.     @rtab_wait = true
  126.     @active_members = []
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● 处理战斗行动
  130.   #--------------------------------------------------------------------------
  131.   def process_action
  132.     return if scene_changing?
  133.     if !@subject || !@subject.current_action
  134.       @subject = BattleManager.next_subject
  135.     end
  136.     return turn_end unless @subject
  137.     if @subject.current_action
  138.       @subject.current_action.prepare
  139.       if @subject.current_action.valid?
  140.         @status_window.open
  141.         execute_action
  142.       end
  143.       @subject.remove_current_action
  144.     end
  145.     process_action_end unless @subject.current_action
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 开始队伍指令的选择
  149.   #--------------------------------------------------------------------------
  150.   def start_party_command_selection
  151.     unless scene_changing?
  152.       refresh_status
  153.       @status_window.unselect
  154.       @status_window.open
  155.       if BattleManager.input_start
  156.         BattleManager.clear_actor
  157.         BattleManager.next_command
  158.         @status_window.select(BattleManager.actor.index)
  159.         @actor_command_window.setup(BattleManager.actor)
  160.       else
  161.         @party_command_window.deactivate
  162.         @actor_command_window.close
  163.         turn_start(@active_members)
  164.       end
  165.     end
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 生成角色指令窗口
  169.   #--------------------------------------------------------------------------
  170.   def create_actor_command_window
  171.     @actor_command_window = Window_ActorCommand.new
  172.     @actor_command_window.viewport = @info_viewport
  173.     @actor_command_window.set_handler(:attack, method(:command_attack))
  174.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  175.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  176.     @actor_command_window.set_handler(:item,   method(:command_item))
  177.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  178.     @actor_command_window.set_handler(:escape, method(:command_escape))
  179.     @actor_command_window.x = Graphics.width
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● 指令“撤退”
  183.   #--------------------------------------------------------------------------
  184.   def command_escape
  185.     unless BattleManager.process_escape
  186.       turn_start(@active_members)
  187.       for iii in @active_members
  188.         iii.rtab_cp = 0
  189.       end
  190.     end
  191.   end
  192. end
  193.  
  194. #encoding:utf-8
  195. #==============================================================================
  196. # ■ Window_ActorCommand
  197. #------------------------------------------------------------------------------
  198. #  战斗画面中,选择角色行动的窗口。
  199. #==============================================================================
  200.  
  201. class Window_ActorCommand < Window_Command
  202.   #--------------------------------------------------------------------------
  203.   # ● 生成指令列表
  204.   #--------------------------------------------------------------------------
  205.   def make_command_list
  206.     return unless @actor
  207.     add_attack_command
  208.     add_skill_commands
  209.     add_guard_command
  210.     add_item_command
  211.     add_escape_command
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● 添加撤退指令
  215.   #--------------------------------------------------------------------------
  216.   def add_escape_command
  217.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  218.   end
  219. end
  220.  
  221. #encoding:utf-8
  222. #==============================================================================
  223. # ■ BattleManager
  224. #------------------------------------------------------------------------------
  225. #  战斗过程的管理器。
  226. #==============================================================================
  227.  
  228. module BattleManager
  229.   #--------------------------------------------------------------------------
  230.   # ● 战斗开始
  231.   #--------------------------------------------------------------------------
  232.   def self.battle_start
  233.     $game_system.battle_count += 1
  234.     $game_party.on_battle_start
  235.     $game_troop.on_battle_start
  236.     $game_troop.enemy_names.each do |name|
  237.       $game_message.add(sprintf(Vocab::Emerge, name))
  238.     end
  239.     if @preemptive
  240.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  241.     elsif @surprise
  242.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  243.     end
  244.     wait_for_message
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 遇敌时的处理
  248.   #--------------------------------------------------------------------------
  249.   def self.on_encounter
  250.     @preemptive = false
  251.     @surprise = false
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 回合开始
  255.   #--------------------------------------------------------------------------
  256.   def self.turn_start(members)
  257.     @phase = :turn
  258.     clear_actor
  259.     $game_troop.increase_turn(members)
  260.     make_action_orders(members)
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 生成行动顺序
  264.   #--------------------------------------------------------------------------
  265.   def self.make_action_orders(members)
  266.     @action_battlers = []
  267.     for iii in $game_party.members
  268.       if members.include?(iii)
  269.         @action_battlers.push(iii) unless @surprise
  270.       end
  271.     end
  272.     for iii in $game_troop.members
  273.       if members.include?(iii)
  274.         @action_battlers.push(iii) unless @preemptive
  275.       end
  276.     end
  277.     @action_battlers.each {|battler| battler.make_speed }
  278.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  279.   end
  280. end
  281.  
  282. #encoding:utf-8
  283. #==============================================================================
  284. # ■ Game_Battler
  285. #------------------------------------------------------------------------------
  286. #  处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
  287. #==============================================================================
  288.  
  289. class Game_Battler < Game_BattlerBase
  290.   attr_accessor :turn_count
  291.   attr_accessor :rtab_cp
  292.   attr_accessor :cp_quota
  293.   attr_accessor :in_turn
  294.   #--------------------------------------------------------------------------
  295.   # ● 初始化对象
  296.   #--------------------------------------------------------------------------
  297.   alias neoinitialize initialize
  298.   def initialize
  299.     @turn_count = 0
  300.     @rtab_cp = 0
  301.     @cp_quota = 100
  302.     @in_turn = false
  303.     neoinitialize
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 战斗开始处理
  307.   #--------------------------------------------------------------------------
  308.   def on_battle_start
  309.     @turn_count = 0
  310.     @rtab_cp = 0
  311.     @cp_quota = 100
  312.     @in_turn = false
  313.     init_tp unless preserve_tp?
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● 处理伤害
  317.   #    调用前需要设置好
  318.   #    @result.hp_damage   @result.mp_damage
  319.   #    @result.hp_drain    @result.mp_drain
  320.   #--------------------------------------------------------------------------
  321.   def execute_damage(user)
  322.     on_damage(@result.hp_damage) if @result.hp_damage > 0
  323.     self.hp -= @result.hp_damage
  324.     self.mp -= @result.mp_damage
  325.     user.hp += @result.hp_drain
  326.     user.mp += @result.mp_drain
  327.     # 受伤后计算CP退后量
  328.     cpback = @result.hp_damage + @result.mp_damage
  329.     cpback = (cpback < 0 ? 0 : cpback)
  330.     pent = 100.0 * cpback / self.mhp
  331.     cppentback = ((5 + pent / 10) * self.cp_quota / 100).to_i
  332.     @rtab_cp -= cppentback
  333.     @rtab_cp = (@rtab_cp < 0 ? 0 : @rtab_cp)
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 判定是否可以输入指令
  337.   #--------------------------------------------------------------------------
  338.   def inputable?
  339.     normal? && !auto_battle? && @in_turn
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 回合结束处理
  343.   #--------------------------------------------------------------------------
  344.   def on_turn_end
  345.     @result.clear
  346.     regenerate_all
  347.     update_state_turns
  348.     update_buff_turns
  349.     remove_states_auto(2)
  350.     # 该角色的回合计数加1并清空CP
  351.     @turn_count += 1
  352.     @rtab_cp = 0
  353.   end
  354. end
  355.  
  356. #encoding:utf-8
  357. #==============================================================================
  358. # ■ Game_Troop
  359. #------------------------------------------------------------------------------
  360. #  管理敌群和战斗相关资料的类,也可执行如战斗事件管理之类的功能。
  361. #   本类的实例请参考 $game_troop 。
  362. #==============================================================================
  363.  
  364. class Game_Troop < Game_Unit
  365.   #--------------------------------------------------------------------------
  366.   # ● 增加回合
  367.   #--------------------------------------------------------------------------
  368.   def increase_turn(members)
  369.     troop.pages.each {|page| @event_flags[page] = false if page.span == 1 }
  370.     turnmax = []
  371.     for iii in members
  372.       turnmax.push(iii.turn_count)
  373.     end
  374.     @turn_count = turnmax.max
  375.   end
  376. end
  377.  
  378. #encoding:utf-8
  379. #==============================================================================
  380. # ■ Spriteset_Battle
  381. #------------------------------------------------------------------------------
  382. #  处理战斗画面的精灵的类。本类在 Scene_Battle 类的内部使用。
  383. #==============================================================================
  384.  
  385. class Spriteset_Battle
  386.   attr_accessor :icons
  387.   attr_accessor :cp_quota
  388.   #--------------------------------------------------------------------------
  389.   # ● 初始化对象
  390.   #--------------------------------------------------------------------------
  391.   def initialize
  392.     @cp_quota = 100
  393.     create_viewports
  394.     create_battleback1
  395.     create_battleback2
  396.     create_enemies
  397.     create_actors
  398.     create_pictures
  399.     create_timer
  400.     create_rtabcp_gauge
  401.     update
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 生成战斗CP条
  405.   #--------------------------------------------------------------------------
  406.   def create_rtabcp_gauge
  407.     @cpgauge_back = Sprite.new(@viewport3)
  408.     @cpgauge_back.bitmap = Bitmap.new(200, 8)
  409.     @cpgauge_back.bitmap.gradient_fill_rect(0, 0, 200, 16, Color.new(0, 255, 0), Color.new(255, 0, 0))
  410.     @cpgauge_back.x = 16
  411.     @cpgauge_back.y = 16
  412.     # 各个角色生成其图标
  413.     @icons = {}
  414.     for iii in $game_party.members
  415.       @icons[iii] = Sprite.new(@viewport3)
  416.       @icons[iii].bitmap = Bitmap.new("Graphics/Pictures/SL我方.png")
  417.       @icons[iii].ox = 12
  418.       @icons[iii].oy = 12
  419.       @icons[iii].x = 16
  420.       @icons[iii].y = 20
  421.     end
  422.     for iii in $game_troop.members
  423.       @icons[iii] = Sprite.new(@viewport3)
  424.       @icons[iii].bitmap = Bitmap.new("Graphics/Pictures/SL敌方.png")
  425.       @icons[iii].ox = 12
  426.       @icons[iii].oy = 12
  427.       @icons[iii].x = 16
  428.       @icons[iii].y = 20
  429.     end
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 释放
  433.   #--------------------------------------------------------------------------
  434.   def dispose
  435.     dispose_battleback1
  436.     dispose_battleback2
  437.     dispose_enemies
  438.     dispose_actors
  439.     dispose_pictures
  440.     dispose_timer
  441.     dispose_viewports
  442.     dispose_rtabcp_gauge
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● 消灭战斗CP条
  446.   #--------------------------------------------------------------------------
  447.   def dispose_rtabcp_gauge
  448.     @cpgauge_back.bitmap.dispose
  449.     @cpgauge_back.dispose
  450.     for iii in $game_party.members
  451.       @icons[iii].bitmap.dispose
  452.       @icons[iii].dispose
  453.     end
  454.     for iii in $game_troop.members
  455.       @icons[iii].bitmap.dispose
  456.       @icons[iii].dispose
  457.     end
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 更新画面
  461.   #--------------------------------------------------------------------------
  462.   def update
  463.     update_battleback1
  464.     update_battleback2
  465.     update_enemies
  466.     update_actors
  467.     update_cp
  468.     update_pictures
  469.     update_timer
  470.     update_viewports
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● 更新CP条
  474.   #--------------------------------------------------------------------------
  475.   def update_cp
  476.     for iii in $game_party.members + $game_troop.members
  477.       @icons[iii].x = 16 + 200 * iii.rtab_cp / @cp_quota
  478.       @icons[iii].visible = iii.alive?
  479.     end
  480.   end
  481. end



回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
616 小时
注册时间
2010-10-29
帖子
463
3
发表于 2012-12-15 05:52:33 | 只看该作者
本帖最后由 896409879 于 2012-12-14 15:54 编辑

楼主还真是为难大家呢⋯⋯
首先,现在貌似没有这种脚本,实在不行可以 @ 一下P叔,他大概还是能写完的⋯⋯

在下有几个替代品,全部都是CP制,并且支持攻击动画哦!
1:Mog Hunter 的战斗系统

http://www.atelier-rgss.com/RGSS/Battle/ACE_BAT09.html

除了CP条是横置的之外,貌似要求都有了!

2:Yanfly的战斗系统:Ace Battle Engine + Fomar0153的Cp条或Yami的Cp条


http://www.rpgmakervxace.net/top ... __p__9954#entry9954
http://www.rpgmakervxace.net/top ... stem-classical-atb/

Yanfly的 Ace Battle Engine 本身自带有调整攻击动画,这两个是插件脚本。

第一个:一般的Cp制度
第二个:比较特殊,时间不等人的感觉。

两个都是基于Yanfly的脚本,所以需要Ace Battle Engine

Ace Battle Engine的脚本在此(其他脚本自己下载,我不能转载)(记事本打开就可以了)
Ace_Core_Engine.rb.zip (8.95 KB, 下载次数: 117) (放在上面)
Ace_Battle_Engine.rb.zip (19.47 KB, 下载次数: 104) (放在下面)

需要横板的可以继续回帖,我会给出的。
我命令你给我点下面的东西!

LBQ Works
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
帖子
16
4
 楼主| 发表于 2012-12-15 09:01:29 | 只看该作者
896409879 发表于 2012-12-15 05:52
楼主还真是为难大家呢⋯⋯
首先,现在貌似没有这种脚本,实在不行可以 @ 一下P叔,他大概还是能写完的⋯⋯
...

小白来的,给大家添麻烦了。
我现在用的就是您发的第一个脚本,一切都好,就是有两点:1、不显示文字,就是XX使用了XX技能!XX受到多少点伤害的文字。这个多少还能接受,2、敌人行动条不可见。这个真心不能接受。所以才想求大神写一个。要是能把第一个脚本改下就好了。
顺便问下,第二个脚本怎么用?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
帖子
16
5
 楼主| 发表于 2012-12-15 19:47:21 | 只看该作者
c248611 发表于 2012-12-15 18:39
#==============================================================================
# ■ CP制战斗系统 ...

谢谢大神!就是这个效果!
弱弱的问一句,能改战斗头像吗?
我想让行动条上出现的是我方角色独有的小头像,和敌方BOSS的小头像,杂兵倒是无所谓。
希望能弄出来区分一下。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
144
在线时间
628 小时
注册时间
2012-6-9
帖子
1321
6
发表于 2012-12-17 12:13:28 | 只看该作者
游系风 发表于 2012-12-15 19:47
谢谢大神!就是这个效果!
弱弱的问一句,能改战斗头像吗?
我想让行动条上出现的是我方角色独有的小头像 ...



RUBY 代码复制
  1. #==============================================================================
  2. # ■ RMVA 战斗引擎 v1.00      汉化:帝府·司令
  3. #------------------------------------------------------------------------------
  4. #    适用于:RPG Maker VX Ace
  5. #    说明:把脚本放在Main的前面。
  6. #==============================================================================
  7.  
  8. $imported = {} if $imported.nil?
  9. $imported["YEA-BattleEngine"] = true
  10.  
  11. #-----------------------------------------------------------------------------
  12. # 调试工具——这些工具只在测试游戏。
  13. # 在战斗中,用的作弊码。调试工具
  14. #-----------------------------------------------------------------------------
  15. # - F5 -
  16. # 恢复所有的角色的HP和MP。
  17. #
  18. # - F6  -
  19. # 使所有角色得HP为1,MP,TP为0。
  20. #
  21. # - F7  -
  22. # 恢复所有角色的TP。
  23. #
  24. # - F8  -
  25. # 杀死所有的敌人在战斗。战斗很快结束。
  26. #-----------------------------------------------------------------------------
  27.  
  28. module YEA
  29.   module BATTLE
  30.  
  31.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  32.     # - 一般战役设定 -
  33.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  34.     # These settings are adjusted for the overall battle system. These are
  35.     # various miscellaneous options to adjust. Each of the settings below will
  36.     # explain what they do. Change default enemy battle animations here, too.
  37.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  38.     BLINK_EFFECTS      = false  # Blink sprite when damaged?
  39.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  40.     SCREEN_SHAKE       = false  # Shake screen in battle?
  41.     SKIP_PARTY_COMMAND = false  # Skips the Fight/Escape menu.
  42.     AUTO_FAST          = true   # Causes message windows to not wait.
  43.     ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  44.  
  45.     # If this switch is ON, popups will be hidden. If OFF, the popups will be
  46.     # shown. If you do not wish to use this switch, set it to 0.
  47.     HIDE_POPUP_SWITCH  = 0
  48.  
  49.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  50.     # - Battle Status Window -
  51.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  52.     # This sets the default battle system your game will use. If your game
  53.     # doesn't have any other battle systems installed, it will use :dtb.
  54.     #
  55.     # Battle System        Requirement
  56.     #   :dtb               - Default Turn Battle. Default system.
  57.     #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  58.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59.     DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  60.  
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     # - Battle Status Window -
  63.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  64.     # Here, you can adjust the settings for the battle status window. The
  65.     # battle status window, by default, will show the actor's face, HP, MP, TP
  66.     # (if viable), and any inflicted status effects.
  67.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68.     BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  69.     BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
  70.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  71.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # Y Location buffer used for HP gauge.
  72.     BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  73.  
  74.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  75.     # - Help Window Text -
  76.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  77.     # When selecting a target to attack, this is the text that will be shown
  78.     # in place of a target's name for special cases. These special cases are
  79.     # for selections that were originally non-targetable battle scopes.
  80.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  81.     HELP_TEXT_ALL_FOES        = "All Foes"
  82.     HELP_TEXT_ONE_RANDOM_FOE  = "One Random Foe"
  83.     HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  84.     HELP_TEXT_ALL_ALLIES      = "All Allies"
  85.     HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  86.     HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  87.     HELP_TEXT_RANDOM_ALLIES   = "%d Random Allies"
  88.  
  89.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90.     # - Popup Settings -
  91.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  92.     # These settings will adjust the popups that appear in battle. Popups
  93.     # deliver information to your player as battlers deal damage, inflict
  94.     # status effects, and more.
  95.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  96.     ENABLE_POPUPS  = true     # Set this to false if you wish to disable them.
  97.     FLASH_CRITICAL = true     # Sets critical hits to flash.
  98.  
  99.     # This hash adjusts the popup settings that will govern how popups appear.
  100.     # Adjust them accordingly.
  101.     POPUP_SETTINGS ={
  102.       :offset     => -24,         # Height offset of a popup.
  103.       :fade       => 12,          # Fade rate for each popup.
  104.       :full       => 60,          # Frames before a popup fades.
  105.       :hp_dmg     => "-%s ",      # SprintF for HP damage.
  106.       :hp_heal    => "+%s ",      # SprintF for HP healing.
  107.       :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  108.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  109.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  110.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  111.       :drained    => "DRAIN",     # Text display for draining HP/MP.
  112.       :critical   => "CRITICAL!", # Text display for critical hit.
  113.       :missed     => "MISS",      # Text display for missed attack.
  114.       :evaded     => "EVADE!",    # Text display for evaded attack.
  115.       :nulled     => "NULL",      # Text display for nulled attack.
  116.       :failed     => "FAILED",    # Text display for a failed attack.
  117.       :add_state  => "+%s",      # SprintF for added states.
  118.       :rem_state  => "-%s",      # SprintF for removed states.
  119.       :dur_state  => "%s",        # SprintF for during states.
  120.       :ele_rates  => true,        # This will display elemental affinities.
  121.       :ele_wait   => 20,          # This is how many frames will wait.
  122.       :weakpoint  => "WEAKPOINT", # Appears if foe is weak to element.
  123.       :resistant  => "RESIST",    # Appears if foe is resistant to element.
  124.       :immune     => "IMMUNE",    # Appears if foe is immune to element.
  125.       :absorbed   => "ABSORB",    # Appears if foe can absorb the element.
  126.       :add_buff   => "%s+",      # Appears when a positive buff is applied.
  127.       :add_debuff => "%s-",      # Appears when a negative buff is applied.
  128.     } # Do not remove this.
  129.  
  130.     # This is the default font used for the popups. Adjust them accordingly
  131.     # or even add new ones.
  132.     DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  133.  
  134.     # The following are the various rules that govern the individual popup
  135.     # types that will appear. Adjust them accordingly. Here is a list of what
  136.     # each category does.
  137.     #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  138.     #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  139.     #   Sz       The font size used for the popup text.
  140.     #   Bold     Applying bold for the popup text.
  141.     #   Italic   Applying italic for the popup text.
  142.     #   Red      The red value of the popup text.
  143.     #   Grn      The green value of the popup text.
  144.     #   Blu      The blue value of the popup text.
  145.     #   Font     The font used for the popup text.
  146.     POPUP_RULES ={
  147.       # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  148.       "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  149.       "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  150.       "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  151.       "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  152.       "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  153.       "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  154.       "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  155.       "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  156.       "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  157.       "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  158.       "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  159.       "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  160.       "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  161.       "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  162.       "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  163.       "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  164.       "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  165.       "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  166.       "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  167.       "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  168.     } # Do not remove this.
  169.  
  170.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171.     # - Streamlined Messages -
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     # Want to remove some of those annoying messages that appear all the time?
  174.     # Now you can! Select which messages you want to enable or disable. Some of
  175.     # these messages will be rendered useless due to popups.
  176.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  177.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  178.     MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  179.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  180.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  181.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  182.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  183.     MSG_FAILURE_HIT    = false  # Show effect failed against target.
  184.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  185.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  186.     MSG_EVASION        = false  # Show attack was evaded by the target.
  187.     MSG_HP_DAMAGE      = false  # Show HP damage to target.
  188.     MSG_MP_DAMAGE      = false  # Show MP damage to target.
  189.     MSG_TP_DAMAGE      = false  # Show TP damage to target.
  190.     MSG_ADDED_STATES   = false  # Show target's added states.
  191.     MSG_REMOVED_STATES = false  # Show target's removed states.
  192.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  193.  
  194.   end # BATTLE
  195. end # YEA
  196.  
  197. #==============================================================================
  198. # ▼ Editting anything past this point may potentially result in causing
  199. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  200. # halitosis so edit at your own risk.
  201. #==============================================================================
  202.  
  203. module YEA
  204.   module REGEXP
  205.   module ENEMY
  206.  
  207.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  208.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  209.  
  210.   end # ENEMY
  211.   module USABLEITEM
  212.  
  213.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  214.  
  215.   end # USABLEITEM
  216.   module STATE
  217.  
  218.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  219.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  220.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  221.  
  222.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  223.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  224.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  225.  
  226.   end # STATE
  227.   end # REGEXP
  228. end # YEA
  229.  
  230. #==============================================================================
  231. # ■ Switch
  232. #==============================================================================
  233.  
  234. module Switch
  235.  
  236.   #--------------------------------------------------------------------------
  237.   # self.hide_popups
  238.   #--------------------------------------------------------------------------
  239.   def self.hide_popups
  240.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  241.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  242.   end
  243.  
  244. end # Switch
  245.  
  246. #==============================================================================
  247. # ■ Colour
  248. #==============================================================================
  249.  
  250. module Colour
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # self.text_colour
  254.   #--------------------------------------------------------------------------
  255.   def self.text_colour(index)
  256.     windowskin = Cache.system("Window")
  257.     x = 64 + (index % 8) * 8
  258.     y = 96 + (index / 8) * 8
  259.     return windowskin.get_pixel(x, y)
  260.   end
  261.  
  262. end # Colour
  263.  
  264. #==============================================================================
  265. # ■ Icon
  266. #==============================================================================
  267.  
  268. module Icon
  269.  
  270.   #--------------------------------------------------------------------------
  271.   # self.no_action
  272.   #--------------------------------------------------------------------------
  273.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  274.  
  275. end # Icon
  276.  
  277. #==============================================================================
  278. # ■ Numeric
  279. #==============================================================================
  280.  
  281. class Numeric
  282.  
  283.   #--------------------------------------------------------------------------
  284.   # new method: group_digits
  285.   #--------------------------------------------------------------------------
  286.   unless $imported["YEA-CoreEngine"]
  287.   def group; return self.to_s; end
  288.   end # $imported["YEA-CoreEngine"]
  289.  
  290. end # Numeric
  291.  
  292. #==============================================================================
  293. # ■ DataManager
  294. #==============================================================================
  295.  
  296. module DataManager
  297.  
  298.   #--------------------------------------------------------------------------
  299.   # alias method: load_database
  300.   #--------------------------------------------------------------------------
  301.   class <<self; alias load_database_abe load_database; end
  302.   def self.load_database
  303.     load_database_abe
  304.     load_notetags_abe
  305.   end
  306.  
  307.   #--------------------------------------------------------------------------
  308.   # new method: load_notetags_abe
  309.   #--------------------------------------------------------------------------
  310.   def self.load_notetags_abe
  311.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  312.     for group in groups
  313.       for obj in group
  314.         next if obj.nil?
  315.         obj.load_notetags_abe
  316.       end
  317.     end
  318.   end
  319.  
  320. end # DataManager
  321.  
  322. #==============================================================================
  323. # ■ RPG::UsableItem
  324. #==============================================================================
  325.  
  326. class RPG::UsableItem < RPG::BaseItem
  327.  
  328.   #--------------------------------------------------------------------------
  329.   # public instance variables
  330.   #--------------------------------------------------------------------------
  331.   attr_accessor :one_animation
  332.  
  333.   #--------------------------------------------------------------------------
  334.   # common cache: load_notetags_abe
  335.   #--------------------------------------------------------------------------
  336.   def load_notetags_abe
  337.     @one_animation = false
  338.     #---
  339.     self.note.split(/[\r\n]+/).each { |line|
  340.       case line
  341.       #---
  342.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  343.         @one_animation = true
  344.       end
  345.     } # self.note.split
  346.     #---
  347.   end
  348.  
  349. end # RPG::UsableItem
  350.  
  351. #==============================================================================
  352. # ■ RPG::Enemy
  353. #==============================================================================
  354.  
  355. class RPG::Enemy < RPG::BaseItem
  356.  
  357.   #--------------------------------------------------------------------------
  358.   # public instance variables
  359.   #--------------------------------------------------------------------------
  360.   attr_accessor :atk_animation_id1
  361.   attr_accessor :atk_animation_id2
  362.  
  363.   #--------------------------------------------------------------------------
  364.   # common cache: load_notetags_abe
  365.   #--------------------------------------------------------------------------
  366.   def load_notetags_abe
  367.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  368.     @atk_animation_id2 = 0
  369.     #---
  370.     self.note.split(/[\r\n]+/).each { |line|
  371.       case line
  372.       #---
  373.       when YEA::REGEXP::ENEMY::ATK_ANI1
  374.         @atk_animation_id1 = $1.to_i
  375.       when YEA::REGEXP::ENEMY::ATK_ANI2
  376.         @atk_animation_id2 = $1.to_i
  377.       end
  378.     } # self.note.split
  379.     #---
  380.   end
  381.  
  382. end # RPG::Enemy
  383.  
  384. #==============================================================================
  385. # ■ RPG::Enemy
  386. #==============================================================================
  387.  
  388. class RPG::State < RPG::BaseItem
  389.  
  390.   #--------------------------------------------------------------------------
  391.   # public instance variables
  392.   #--------------------------------------------------------------------------
  393.   attr_accessor :popup_rules
  394.  
  395.   #--------------------------------------------------------------------------
  396.   # common cache: load_notetags_abe
  397.   #--------------------------------------------------------------------------
  398.   def load_notetags_abe
  399.     @popup_rules = {
  400.       :add_state => "ADDSTATE",
  401.       :rem_state => "REMSTATE",
  402.       :dur_state => nil
  403.     } # Do not remove this.
  404.     #---
  405.     self.note.split(/[\r\n]+/).each { |line|
  406.       case line
  407.       #---
  408.       when YEA::REGEXP::STATE::POPUP_ADD
  409.         @popup_rules[:add_state] = $1.upcase.to_s
  410.       when YEA::REGEXP::STATE::POPUP_REM
  411.         @popup_rules[:rem_state] = $1.upcase.to_s
  412.       when YEA::REGEXP::STATE::POPUP_DUR
  413.         @popup_rules[:dur_state] = $1.upcase.to_s
  414.       when YEA::REGEXP::STATE::HIDE_ADD
  415.         @popup_rules[:add_state] = nil
  416.       when YEA::REGEXP::STATE::HIDE_REM
  417.         @popup_rules[:rem_state] = nil
  418.       when YEA::REGEXP::STATE::HIDE_DUR
  419.         @popup_rules[:dur_state] = nil
  420.       end
  421.     } # self.note.split
  422.     #---
  423.   end
  424.  
  425. end # RPG::State
  426.  
  427. #==============================================================================
  428. # ■ BattleManager
  429. #==============================================================================
  430.  
  431. module BattleManager
  432.  
  433.   #--------------------------------------------------------------------------
  434.   # overwrite method: self.battle_start
  435.   #--------------------------------------------------------------------------
  436.   def self.battle_start
  437.     $game_system.battle_count += 1
  438.     $game_party.on_battle_start
  439.     $game_troop.on_battle_start
  440.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  441.     $game_troop.enemy_names.each do |name|
  442.       $game_message.add(sprintf(Vocab::Emerge, name))
  443.     end
  444.     if @preemptive
  445.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  446.     elsif @surprise
  447.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  448.     end
  449.     wait_for_message
  450.   end
  451.  
  452.   #--------------------------------------------------------------------------
  453.   # overwrite method: make_action_orders
  454.   #--------------------------------------------------------------------------
  455.   def self.make_action_orders
  456.     make_dtb_action_orders if btype?(:dtb)
  457.   end
  458.  
  459.   #--------------------------------------------------------------------------
  460.   # new method: make_dtb_action_orders
  461.   #--------------------------------------------------------------------------
  462.   def self.make_dtb_action_orders
  463.     @action_battlers = []
  464.     @action_battlers += $game_party.members unless @surprise
  465.     @action_battlers += $game_troop.members unless @preemptive
  466.     @action_battlers.each {|battler| battler.make_speed }
  467.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  468.   end
  469.  
  470.   #--------------------------------------------------------------------------
  471.   # overwrite method: turn_start
  472.   #--------------------------------------------------------------------------
  473.   def self.turn_start
  474.     @phase = :turn
  475.     clear_actor
  476.     $game_troop.increase_turn
  477.     @performed_battlers = []
  478.     make_action_orders
  479.   end
  480.  
  481.   #--------------------------------------------------------------------------
  482.   # overwrite method: next_subject
  483.   #--------------------------------------------------------------------------
  484.   def self.next_subject
  485.     @performed_battlers = [] if @performed_battlers.nil?
  486.     loop do
  487.       @action_battlers -= @performed_battlers
  488.       battler = @action_battlers.shift
  489.       return nil unless battler
  490.       next unless battler.index && battler.alive?
  491.       @performed_battlers.push(battler)
  492.       return battler
  493.     end
  494.   end
  495.  
  496.   #--------------------------------------------------------------------------
  497.   # new method: self.init_battle_type
  498.   #--------------------------------------------------------------------------
  499.   def self.init_battle_type
  500.     set_btype($game_system.battle_system)
  501.   end
  502.  
  503.   #--------------------------------------------------------------------------
  504.   # new method: self.set_btype
  505.   #--------------------------------------------------------------------------
  506.   def self.set_btype(btype = :dtb)
  507.     @battle_type = btype
  508.   end
  509.  
  510.   #--------------------------------------------------------------------------
  511.   # new method: self.btype?
  512.   #--------------------------------------------------------------------------
  513.   def self.btype?(btype)
  514.     return @battle_type == btype
  515.   end
  516.  
  517. end # BattleManager
  518.  
  519. #==============================================================================
  520. # ■ Game_System
  521. #==============================================================================
  522.  
  523. class Game_System
  524.  
  525.   #--------------------------------------------------------------------------
  526.   # new method: battle_system
  527.   #--------------------------------------------------------------------------
  528.   def battle_system
  529.     if @battle_system.nil?
  530.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  531.     else
  532.       return battle_system_corrected(@battle_system)
  533.     end
  534.   end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # new method: set_battle_system
  538.   #--------------------------------------------------------------------------
  539.   def set_battle_system(type)
  540.     case type
  541.     when :dtb; @battle_system = :dtb
  542.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  543.     else;      @battle_system = :dtb
  544.     end
  545.   end
  546.  
  547.   #--------------------------------------------------------------------------
  548.   # new method: battle_system_corrected
  549.   #--------------------------------------------------------------------------
  550.   def battle_system_corrected(type)
  551.     case type
  552.     when :dtb; return :dtb
  553.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  554.     else;      return :dtb
  555.     end
  556.   end
  557.  
  558. end # Game_System
  559.  
  560. #==============================================================================
  561. # ■ Sprite_Base
  562. #==============================================================================
  563.  
  564. class Sprite_Base < Sprite
  565.  
  566.   #--------------------------------------------------------------------------
  567.   # new method: start_pseudo_animation
  568.   #--------------------------------------------------------------------------
  569.   unless $imported["YEA-CoreEngine"]
  570.   def start_pseudo_animation(animation, mirror = false)
  571.     dispose_animation
  572.     @animation = animation
  573.     return if @animation.nil?
  574.     @ani_mirror = mirror
  575.     set_animation_rate
  576.     @ani_duration = @animation.frame_max * @ani_rate + 1
  577.     @ani_sprites = []
  578.   end
  579.   end # $imported["YEA-CoreEngine"]
  580.  
  581. end # Sprite_Base
  582.  
  583. #==============================================================================
  584. # ■ Sprite_Battler
  585. #==============================================================================
  586.  
  587. class Sprite_Battler < Sprite_Base
  588.  
  589.   #--------------------------------------------------------------------------
  590.   # public instance variables
  591.   #--------------------------------------------------------------------------
  592.   attr_accessor :effect_type
  593.   attr_accessor :battler_visible
  594.   attr_accessor :popups
  595.  
  596.   #--------------------------------------------------------------------------
  597.   # alias method: initialize
  598.   #--------------------------------------------------------------------------
  599.   alias sprite_battler_initialize_abe initialize
  600.   def initialize(viewport, battler = nil)
  601.     sprite_battler_initialize_abe(viewport, battler)
  602.     @popups = []
  603.     @popup_flags = []
  604.   end
  605.  
  606.   #--------------------------------------------------------------------------
  607.   # alias method: update_bitmap
  608.   #--------------------------------------------------------------------------
  609.   alias sprite_battler_update_bitmap_abe update_bitmap
  610.   def update_bitmap
  611.     return if @battler.actor? && @battler.battler_name == ""
  612.     sprite_battler_update_bitmap_abe
  613.   end
  614.  
  615.   #--------------------------------------------------------------------------
  616.   # alias method: setup_new_animation
  617.   #--------------------------------------------------------------------------
  618.   unless $imported["YEA-CoreEngine"]
  619.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  620.   def setup_new_animation
  621.     sprite_battler_setup_new_animation_abe
  622.     return if @battler.pseudo_ani_id <= 0
  623.     animation = $data_animations[@battler.pseudo_ani_id]
  624.     mirror = @battler.animation_mirror
  625.     start_pseudo_animation(animation, mirror)
  626.     @battler.pseudo_ani_id = 0
  627.   end
  628.   end # $imported["YEA-CoreEngine"]
  629.  
  630.   #--------------------------------------------------------------------------
  631.   # alias method: setup_new_effect
  632.   #--------------------------------------------------------------------------
  633.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  634.   def setup_new_effect
  635.     sprite_battler_setup_new_effect_abe
  636.     setup_popups
  637.   end
  638.  
  639.   #--------------------------------------------------------------------------
  640.   # new method: setup_popups
  641.   #--------------------------------------------------------------------------
  642.   def setup_popups
  643.     return unless @battler.use_sprite?
  644.     @battler.popups = [] if @battler.popups.nil?
  645.     return if @battler.popups == []
  646.     array = @battler.popups.shift
  647.     create_new_popup(array[0], array[1], array[2])
  648.   end
  649.  
  650.   #--------------------------------------------------------------------------
  651.   # new method: create_new_popup
  652.   #--------------------------------------------------------------------------
  653.   def create_new_popup(value, rules, flags)
  654.     return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  655.     return if flags & @popup_flags != []
  656.     array = YEA::BATTLE::POPUP_RULES[rules]
  657.     for popup in @popups
  658.       popup.y -= 24
  659.     end
  660.     return unless SceneManager.scene.is_a?(Scene_Battle)
  661.     return if SceneManager.scene.spriteset.nil?
  662.     view = SceneManager.scene.spriteset.viewportPopups
  663.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  664.     @popups.push(new_popup)
  665.     @popup_flags.push("weakness") if flags.include?("weakness")
  666.     @popup_flags.push("resistant") if flags.include?("resistant")
  667.     @popup_flags.push("immune") if flags.include?("immune")
  668.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  669.   end
  670.  
  671.   #--------------------------------------------------------------------------
  672.   # alias method: update_effect
  673.   #--------------------------------------------------------------------------
  674.   alias sprite_battler_update_effect_abe update_effect
  675.   def update_effect
  676.     sprite_battler_update_effect_abe
  677.     update_popups
  678.   end
  679.  
  680.   #--------------------------------------------------------------------------
  681.   # new method: update_popups
  682.   #--------------------------------------------------------------------------
  683.   def update_popups
  684.     for popup in @popups
  685.       popup.update
  686.       next unless popup.opacity <= 0
  687.       popup.bitmap.dispose
  688.       popup.dispose
  689.       @popups.delete(popup)
  690.       popup = nil
  691.     end
  692.     @popup_flags = [] if @popups == [] && @popup_flags != []
  693.     return unless SceneManager.scene_is?(Scene_Battle)
  694.     if @current_active_battler != SceneManager.scene.subject
  695.       @current_active_battler = SceneManager.scene.subject
  696.       @popup_flags = []
  697.     end
  698.   end
  699.  
  700. end # Sprite_Battler
  701.  
  702. #==============================================================================
  703. # ■ Sprite_Popup
  704. #==============================================================================
  705.  
  706. class Sprite_Popup < Sprite_Base
  707.  
  708.   #--------------------------------------------------------------------------
  709.   # public instance variables
  710.   #--------------------------------------------------------------------------
  711.   attr_accessor :flags
  712.  
  713.   #--------------------------------------------------------------------------
  714.   # initialize
  715.   #--------------------------------------------------------------------------
  716.   def initialize(viewport, battler, value, rules, flags)
  717.     super(viewport)
  718.     @value = value
  719.     @rules = rules
  720.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  721.     [url=home.php?mod=space&uid=274289]@fade[/url] = YEA::BATTLE::POPUP_SETTINGS[:fade]
  722.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  723.     @flags = flags
  724.     @battler = battler
  725.     create_popup_bitmap
  726.   end
  727.  
  728.   #--------------------------------------------------------------------------
  729.   # create_popup_bitmap
  730.   #--------------------------------------------------------------------------
  731.   def create_popup_bitmap
  732.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  733.     bw = Graphics.width
  734.     bw += 48 if @flags.include?("state")
  735.     bh = Font.default_size * 3
  736.     bitmap = Bitmap.new(bw, bh)
  737.     bitmap.font.name = rules_array[8]
  738.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  739.     bitmap.font.size = size
  740.     bitmap.font.bold = rules_array[3]
  741.     bitmap.font.italic = rules_array[4]
  742.     if flags.include?("critical")
  743.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  744.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  745.     else
  746.       bitmap.font.out_color.set(0, 0, 0, 255)
  747.     end
  748.     dx = 0; dy = 0; dw = 0
  749.     dx += 24 if @flags.include?("state")
  750.     dw += 24 if @flags.include?("state")
  751.     if @flags.include?("state") || @flags.include?("buff")
  752.       c_width = bitmap.text_size(@value).width
  753.       icon_bitmap = $game_temp.iconset
  754.       icon_index = flag_state_icon
  755.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  756.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  757.     end
  758.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  759.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  760.     self.bitmap = bitmap
  761.     self.x = @battler.screen_x
  762.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  763.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  764.     self.y = @battler.screen_y - @battler.sprite.oy/2
  765.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  766.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  767.     self.ox = bw/2; self.oy = bh/2
  768.     self.zoom_x = self.zoom_y = rules_array[0]
  769.     if @flags.include?("no zoom")
  770.       self.zoom_x = self.zoom_y = rules_array[1]
  771.     end
  772.     @target_zoom = rules_array[1]
  773.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  774.     self.z = 500
  775.   end
  776.  
  777.   #--------------------------------------------------------------------------
  778.   # update
  779.   #--------------------------------------------------------------------------
  780.   def update
  781.     super
  782.     #---
  783.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  784.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  785.       @hue_duration -= 1
  786.       self.bitmap.hue_change(15) if @hue_duration <= 0
  787.     end
  788.     #---
  789.     if @zoom_direction == "up"
  790.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  791.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  792.     else
  793.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  794.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  795.     end
  796.     #---
  797.     @full -= 1
  798.     return if @full > 0
  799.     self.y -= 1
  800.     self.opacity -= @fade
  801.   end
  802.  
  803.   #--------------------------------------------------------------------------
  804.   # flag_state_icon
  805.   #--------------------------------------------------------------------------
  806.   def flag_state_icon
  807.     for item in @flags; return item if item.is_a?(Integer); end
  808.     return 0
  809.   end
  810.  
  811. end # Sprite_Popup
  812.  
  813. #==============================================================================
  814. # ■ Spriteset_Battle
  815. #==============================================================================
  816.  
  817. class Spriteset_Battle
  818.  
  819.   #--------------------------------------------------------------------------
  820.   # public instance variables
  821.   #--------------------------------------------------------------------------
  822.   attr_accessor :actor_sprites
  823.   attr_accessor :enemy_sprites
  824.   attr_accessor :viewport1
  825.   attr_accessor :viewportPopups
  826.  
  827.   #--------------------------------------------------------------------------
  828.   # alias method: create_viewports
  829.   #--------------------------------------------------------------------------
  830.   alias spriteset_battle_create_viewports_abe create_viewports
  831.   def create_viewports
  832.     spriteset_battle_create_viewports_abe
  833.     @viewportPopups = Viewport.new
  834.     @viewportPopups.z = 200
  835.   end
  836.  
  837.   #--------------------------------------------------------------------------
  838.   # alias method: dispose_viewports
  839.   #--------------------------------------------------------------------------
  840.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  841.   def dispose_viewports
  842.     spriteset_battle_dispose_viewports_abe
  843.     @viewportPopups.dispose
  844.   end
  845.  
  846.   #--------------------------------------------------------------------------
  847.   # alias method: update_viewports
  848.   #--------------------------------------------------------------------------
  849.   alias spriteset_battle_update_viewports_abe update_viewports
  850.   def update_viewports
  851.     spriteset_battle_update_viewports_abe
  852.     @viewportPopups.update
  853.   end
  854.  
  855. end # Spriteset_Battle
  856.  
  857. #==============================================================================
  858. # ■ Game_Temp
  859. #==============================================================================
  860.  
  861. class Game_Temp
  862.  
  863.   #--------------------------------------------------------------------------
  864.   # public instance variables
  865.   #--------------------------------------------------------------------------
  866.   attr_accessor :battle_aid
  867.   attr_accessor :evaluating
  868.   attr_accessor :iconset
  869.  
  870.   #--------------------------------------------------------------------------
  871.   # alias method: initialize
  872.   #--------------------------------------------------------------------------
  873.   alias game_temp_initialize_abe initialize
  874.   def initialize
  875.     game_temp_initialize_abe
  876.     @iconset = Cache.system("Iconset")
  877.   end
  878.  
  879. end # Game_Temp
  880.  
  881. #==============================================================================
  882. # ■ Game_Action
  883. #==============================================================================
  884.  
  885. class Game_Action
  886.  
  887.   #--------------------------------------------------------------------------
  888.   # overwrite method: speed
  889.   #--------------------------------------------------------------------------
  890.   def speed
  891.     speed = subject.agi
  892.     speed += item.speed if item
  893.     speed += subject.atk_speed if attack?
  894.     return speed
  895.   end
  896.  
  897.   #--------------------------------------------------------------------------
  898.   # alias method: evaluate_item_with_target
  899.   #--------------------------------------------------------------------------
  900.   alias evaluate_item_with_target_abe evaluate_item_with_target
  901.   def evaluate_item_with_target(target)
  902.     $game_temp.evaluating = true
  903.     result = evaluate_item_with_target_abe(target)
  904.     $game_temp.evaluating = false
  905.     return result
  906.   end
  907.  
  908. end # Game_Action
  909.  
  910. #==============================================================================
  911. # ■ Game_ActionResult
  912. #==============================================================================
  913.  
  914. class Game_ActionResult
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # alias method: clear
  918.   #--------------------------------------------------------------------------
  919.   alias game_actionresult_clear_abe clear
  920.   def clear
  921.     game_actionresult_clear_abe
  922.     clear_stored_damage
  923.   end
  924.  
  925.   #--------------------------------------------------------------------------
  926.   # new method: clear_stored_damage
  927.   #--------------------------------------------------------------------------
  928.   def clear_stored_damage
  929.     @stored_hp_damage = 0
  930.     @stored_mp_damage = 0
  931.     @stored_tp_damage = 0
  932.     @stored_hp_drain = 0
  933.     @stored_mp_drain = 0
  934.   end
  935.  
  936.   #--------------------------------------------------------------------------
  937.   # new method: store_damage
  938.   #--------------------------------------------------------------------------
  939.   def store_damage
  940.     @stored_hp_damage += @hp_damage
  941.     @stored_mp_damage += @mp_damage
  942.     @stored_tp_damage += @tp_damage
  943.     @stored_hp_drain += @hp_drain
  944.     @stored_mp_drain += @mp_drain
  945.   end
  946.  
  947.   #--------------------------------------------------------------------------
  948.   # new method: restore_damage
  949.   #--------------------------------------------------------------------------
  950.   def restore_damage
  951.     @hp_damage = @stored_hp_damage
  952.     @mp_damage = @stored_mp_damage
  953.     @tp_damage = @stored_tp_damage
  954.     @hp_drain = @stored_hp_drain
  955.     @mp_drain = @stored_mp_drain
  956.     clear_stored_damage
  957.   end
  958.  
  959. end # Game_ActionResult
  960.  
  961. #==============================================================================
  962. # ■ Game_BattlerBase
  963. #==============================================================================
  964.  
  965. class Game_BattlerBase
  966.  
  967.   #--------------------------------------------------------------------------
  968.   # public instance variables
  969.   #--------------------------------------------------------------------------
  970.   attr_accessor :popups
  971.  
  972.   #--------------------------------------------------------------------------
  973.   # new method: create_popup
  974.   #--------------------------------------------------------------------------
  975.   def create_popup(value, rules = "DEFAULT", flags = [])
  976.     return unless SceneManager.scene_is?(Scene_Battle)
  977.     return unless YEA::BATTLE::ENABLE_POPUPS
  978.     return if Switch.hide_popups
  979.     @popups = [] if @popups.nil?
  980.     @popups.push([value, rules, flags])
  981.   end
  982.  
  983.   #--------------------------------------------------------------------------
  984.   # new method: make_damage_popups
  985.   #--------------------------------------------------------------------------
  986.   def make_damage_popups(user)
  987.     if @result.hp_drain != 0
  988.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  989.       rules = "DRAIN"
  990.       user.create_popup(text, rules)
  991.       setting = :hp_dmg  if @result.hp_drain < 0
  992.       setting = :hp_heal if @result.hp_drain > 0
  993.       rules = "HP_DMG"   if @result.hp_drain < 0
  994.       rules = "HP_HEAL"  if @result.hp_drain > 0
  995.       value = @result.hp_drain.abs
  996.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  997.       user.create_popup(text, rules)
  998.     end
  999.     if @result.mp_drain != 0
  1000.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1001.       rules = "DRAIN"
  1002.       user.create_popup(text, rules)
  1003.       setting = :mp_dmg  if @result.mp_drain < 0
  1004.       setting = :mp_heal if @result.mp_drain > 0
  1005.       rules = "HP_DMG"   if @result.mp_drain < 0
  1006.       rules = "HP_HEAL"  if @result.mp_drain > 0
  1007.       value = @result.mp_drain.abs
  1008.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1009.       user.create_popup(text, rules)
  1010.     end
  1011.     #---
  1012.     flags = []
  1013.     flags.push("critical") if @result.critical
  1014.     if @result.hp_damage != 0
  1015.       setting = :hp_dmg  if @result.hp_damage > 0
  1016.       setting = :hp_heal if @result.hp_damage < 0
  1017.       rules = "HP_DMG"   if @result.hp_damage > 0
  1018.       rules = "HP_HEAL"  if @result.hp_damage < 0
  1019.       value = @result.hp_damage.abs
  1020.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1021.       create_popup(text, rules, flags)
  1022.     end
  1023.     if @result.mp_damage != 0
  1024.       setting = :mp_dmg  if @result.mp_damage > 0
  1025.       setting = :mp_heal if @result.mp_damage < 0
  1026.       rules = "MP_DMG"   if @result.mp_damage > 0
  1027.       rules = "MP_HEAL"  if @result.mp_damage < 0
  1028.       value = @result.mp_damage.abs
  1029.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1030.       create_popup(text, rules, flags)
  1031.     end
  1032.     if @result.tp_damage != 0
  1033.       setting = :tp_dmg  if @result.tp_damage > 0
  1034.       setting = :tp_heal if @result.tp_damage < 0
  1035.       rules = "TP_DMG"   if @result.tp_damage > 0
  1036.       rules = "TP_HEAL"  if @result.tp_damage < 0
  1037.       value = @result.tp_damage.abs
  1038.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1039.       create_popup(text, rules)
  1040.     end
  1041.     @result.store_damage
  1042.     @result.clear_damage_values
  1043.   end
  1044.  
  1045.   #--------------------------------------------------------------------------
  1046.   # alias method: erase_state
  1047.   #--------------------------------------------------------------------------
  1048.   alias game_battlerbase_erase_state_abe erase_state
  1049.   def erase_state(state_id)
  1050.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1051.     game_battlerbase_erase_state_abe(state_id)
  1052.   end
  1053.  
  1054.   #--------------------------------------------------------------------------
  1055.   # new method: make_during_state_popup
  1056.   #--------------------------------------------------------------------------
  1057.   def make_during_state_popup
  1058.     state_id = most_important_state_id
  1059.     return if state_id == 0
  1060.     make_state_popup(state_id, :dur_state)
  1061.   end
  1062.  
  1063.   #--------------------------------------------------------------------------
  1064.   # new method: most_important_state_id
  1065.   #--------------------------------------------------------------------------
  1066.   def most_important_state_id
  1067.     states.each {|state| return state.id unless state.message3.empty? }
  1068.     return 0
  1069.   end
  1070.  
  1071.   #--------------------------------------------------------------------------
  1072.   # new method: make_state_popup
  1073.   #--------------------------------------------------------------------------
  1074.   def make_state_popup(state_id, type)
  1075.     state = $data_states[state_id]
  1076.     return if state.icon_index == 0
  1077.     rules = state.popup_rules[type]
  1078.     return if rules.nil?
  1079.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1080.     flags = ["state", state.icon_index]
  1081.     create_popup(text, rules, flags)
  1082.   end
  1083.  
  1084.   #--------------------------------------------------------------------------
  1085.   # new method: make_miss_popups
  1086.   #--------------------------------------------------------------------------
  1087.   def make_miss_popups(user, item)
  1088.     return if dead?
  1089.     if @result.missed
  1090.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1091.       rules = "DEFAULT"
  1092.       create_popup(text, rules)
  1093.     end
  1094.     if @result.evaded
  1095.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1096.       rules = "DEFAULT"
  1097.       create_popup(text, rules)
  1098.     end
  1099.     if @result.hit? && !@result.success
  1100.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1101.       rules = "DEFAULT"
  1102.       create_popup(text, rules)
  1103.     end
  1104.     if @result.hit? && item.damage.to_hp?
  1105.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1106.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1107.         rules = "DEFAULT"
  1108.         create_popup(text, rules)
  1109.       end
  1110.     end
  1111.   end
  1112.  
  1113.   #--------------------------------------------------------------------------
  1114.   # new method: make_rate_popup
  1115.   #--------------------------------------------------------------------------
  1116.   def make_rate_popup(rate)
  1117.     return if rate == 1.0
  1118.     flags = []
  1119.     if rate > 1.0
  1120.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1121.       rules = "WEAK_ELE"
  1122.       flags.push("weakness")
  1123.     elsif rate == 0.0
  1124.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1125.       rules = "IMMU_ELE"
  1126.       flags.push("immune")
  1127.     elsif rate < 0.0
  1128.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1129.       rules = "ABSB_ELE"
  1130.       flags.push("absorbed")
  1131.     else
  1132.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1133.       rules = "REST_ELE"
  1134.       flags.push("resistant")
  1135.     end
  1136.     create_popup(text, rules, flags)
  1137.   end
  1138.  
  1139.   #--------------------------------------------------------------------------
  1140.   # new method: make_buff_popup
  1141.   #--------------------------------------------------------------------------
  1142.   def make_buff_popup(param_id, positive = true)
  1143.     return unless SceneManager.scene_is?(Scene_Battle)
  1144.     return unless alive?
  1145.     name = Vocab::param(param_id)
  1146.     if positive
  1147.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1148.       rules = "BUFF"
  1149.       buff_level = 1
  1150.     else
  1151.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1152.       rules = "DEBUFF"
  1153.       buff_level = -1
  1154.     end
  1155.     icon = buff_icon_index(buff_level, param_id)
  1156.     flags = ["buff", icon]
  1157.     return if @popups.include?([text, rules, flags])
  1158.     create_popup(text, rules, flags)
  1159.   end
  1160.  
  1161. end # Game_BattlerBase
  1162.  
  1163. #==============================================================================
  1164. # ■ Game_Battler
  1165. #==============================================================================
  1166.  
  1167. class Game_Battler < Game_BattlerBase
  1168.  
  1169.   #--------------------------------------------------------------------------
  1170.   # public instance variables
  1171.   #--------------------------------------------------------------------------
  1172.   attr_accessor :pseudo_ani_id
  1173.  
  1174.   #--------------------------------------------------------------------------
  1175.   # alias method: on_battle_end
  1176.   #--------------------------------------------------------------------------
  1177.   alias game_battler_on_battle_end_abe on_battle_end
  1178.   def on_battle_end
  1179.     game_battler_on_battle_end_abe
  1180.     @popups = []
  1181.   end
  1182.  
  1183.   #--------------------------------------------------------------------------
  1184.   # alias method: clear_sprite_effects
  1185.   #--------------------------------------------------------------------------
  1186.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1187.   def clear_sprite_effects
  1188.     game_battler_clear_sprite_effects_abe
  1189.     @pseudo_ani_id = 0
  1190.   end
  1191.  
  1192.   #--------------------------------------------------------------------------
  1193.   # alias method: item_apply
  1194.   #--------------------------------------------------------------------------
  1195.   alias game_battler_item_apply_abe item_apply
  1196.   def item_apply(user, item)
  1197.     game_battler_item_apply_abe(user, item)
  1198.     make_miss_popups(user, item)
  1199.   end
  1200.  
  1201.   #--------------------------------------------------------------------------
  1202.   # alias method: make_damage_value
  1203.   #--------------------------------------------------------------------------
  1204.   alias game_battler_make_damage_value_abe make_damage_value
  1205.   def make_damage_value(user, item)
  1206.     game_battler_make_damage_value_abe(user, item)
  1207.     rate = item_element_rate(user, item)
  1208.     make_rate_popup(rate) unless $game_temp.evaluating
  1209.   end
  1210.  
  1211.   #--------------------------------------------------------------------------
  1212.   # alias method: execute_damage
  1213.   #--------------------------------------------------------------------------
  1214.   alias game_battler_execute_damage_abe execute_damage
  1215.   def execute_damage(user)
  1216.     game_battler_execute_damage_abe(user)
  1217.     make_damage_popups(user)
  1218.   end
  1219.  
  1220.   #--------------------------------------------------------------------------
  1221.   # alias method: item_effect_recover_hp
  1222.   #--------------------------------------------------------------------------
  1223.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1224.   def item_effect_recover_hp(user, item, effect)
  1225.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1226.     make_damage_popups(user)
  1227.   end
  1228.  
  1229.   #--------------------------------------------------------------------------
  1230.   # alias method: item_effect_recover_mp
  1231.   #--------------------------------------------------------------------------
  1232.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1233.   def item_effect_recover_mp(user, item, effect)
  1234.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1235.     make_damage_popups(user)
  1236.   end
  1237.  
  1238.   #--------------------------------------------------------------------------
  1239.   # alias method: item_effect_gain_tp
  1240.   #--------------------------------------------------------------------------
  1241.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1242.   def item_effect_gain_tp(user, item, effect)
  1243.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1244.     make_damage_popups(user)
  1245.   end
  1246.  
  1247.   #--------------------------------------------------------------------------
  1248.   # alias method: item_user_effect
  1249.   #--------------------------------------------------------------------------
  1250.   alias game_battler_item_user_effect_abe item_user_effect
  1251.   def item_user_effect(user, item)
  1252.     game_battler_item_user_effect_abe(user, item)
  1253.     @result.restore_damage
  1254.   end
  1255.  
  1256.   #--------------------------------------------------------------------------
  1257.   # alias method: add_new_state
  1258.   #--------------------------------------------------------------------------
  1259.   alias game_battler_add_new_state_abe add_new_state
  1260.   def add_new_state(state_id)
  1261.     game_battler_add_new_state_abe(state_id)
  1262.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1263.   end
  1264.  
  1265.   #--------------------------------------------------------------------------
  1266.   # alias method: add_buff
  1267.   #--------------------------------------------------------------------------
  1268.   alias game_battler_add_buff_abe add_buff
  1269.   def add_buff(param_id, turns)
  1270.     make_buff_popup(param_id, true)
  1271.     game_battler_add_buff_abe(param_id, turns)
  1272.   end
  1273.  
  1274.   #--------------------------------------------------------------------------
  1275.   # alias method: add_debuff
  1276.   #--------------------------------------------------------------------------
  1277.   alias game_battler_add_debuff_abe add_debuff
  1278.   def add_debuff(param_id, turns)
  1279.     make_buff_popup(param_id, false)
  1280.     game_battler_add_debuff_abe(param_id, turns)
  1281.   end
  1282.  
  1283.   #--------------------------------------------------------------------------
  1284.   # alias method: regenerate_all
  1285.   #--------------------------------------------------------------------------
  1286.   alias game_battler_regenerate_all_abe regenerate_all
  1287.   def regenerate_all
  1288.     game_battler_regenerate_all_abe
  1289.     return unless alive?
  1290.     make_damage_popups(self)
  1291.   end
  1292.  
  1293.   #--------------------------------------------------------------------------
  1294.   # new method: can_collapse?
  1295.   #--------------------------------------------------------------------------
  1296.   def can_collapse?
  1297.     return false unless dead?
  1298.     unless actor?
  1299.       return false unless sprite.battler_visible
  1300.       array = [:collapse, :boss_collapse, :instant_collapse]
  1301.       return false if array.include?(sprite.effect_type)
  1302.     end
  1303.     return true
  1304.   end
  1305.  
  1306.   #--------------------------------------------------------------------------
  1307.   # new method: draw_mp?
  1308.   #--------------------------------------------------------------------------
  1309.   def draw_mp?; return true; end
  1310.  
  1311.   #--------------------------------------------------------------------------
  1312.   # new method: draw_tp?
  1313.   #--------------------------------------------------------------------------
  1314.   def draw_tp?
  1315.     return $data_system.opt_display_tp
  1316.   end
  1317.  
  1318. end # Game_Battler
  1319.  
  1320. #==============================================================================
  1321. # ■ Game_Actor
  1322. #==============================================================================
  1323.  
  1324. class Game_Actor < Game_Battler
  1325.  
  1326.   #--------------------------------------------------------------------------
  1327.   # overwrite method: perform_damage_effect
  1328.   #--------------------------------------------------------------------------
  1329.   def perform_damage_effect
  1330.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1331.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1332.     Sound.play_actor_damage
  1333.   end
  1334.  
  1335.   #--------------------------------------------------------------------------
  1336.   # overwrite method: use_sprite?
  1337.   #--------------------------------------------------------------------------
  1338.   def use_sprite?; return true; end
  1339.  
  1340.   #--------------------------------------------------------------------------
  1341.   # new method: screen_x
  1342.   #--------------------------------------------------------------------------
  1343.   def screen_x
  1344.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1345.     status_window = SceneManager.scene.status_window
  1346.     return 0 if status_window.nil?
  1347.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1348.     ext = SceneManager.scene.info_viewport.ox
  1349.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1350.     constant = 128 + 12
  1351.     return constant + rect.x + item_rect_width / 2 - ext
  1352.   end
  1353.  
  1354.   #--------------------------------------------------------------------------
  1355.   # new method: screen_y
  1356.   #--------------------------------------------------------------------------
  1357.   def screen_y
  1358.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1359.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1360.     return Graphics.height - 120
  1361.   end
  1362.  
  1363.   #--------------------------------------------------------------------------
  1364.   # new method: screen_z
  1365.   #--------------------------------------------------------------------------
  1366.   def screen_z; return 100; end
  1367.  
  1368.   #--------------------------------------------------------------------------
  1369.   # new method: sprite
  1370.   #--------------------------------------------------------------------------
  1371.   def sprite
  1372.     index = $game_party.battle_members.index(self)
  1373.     return SceneManager.scene.spriteset.actor_sprites[index]
  1374.   end
  1375.  
  1376.   #--------------------------------------------------------------------------
  1377.   # new method: draw_mp?
  1378.   #--------------------------------------------------------------------------
  1379.   def draw_mp?
  1380.     return true unless draw_tp?
  1381.     for skill in skills
  1382.       next unless added_skill_types.include?(skill.stype_id)
  1383.       return true if skill.mp_cost > 0
  1384.     end
  1385.     return false
  1386.   end
  1387.  
  1388.   #--------------------------------------------------------------------------
  1389.   # new method: draw_tp?
  1390.   #--------------------------------------------------------------------------
  1391.   def draw_tp?
  1392.     return false unless $data_system.opt_display_tp
  1393.     for skill in skills
  1394.       next unless added_skill_types.include?(skill.stype_id)
  1395.       return true if skill.tp_cost > 0
  1396.     end
  1397.     return false
  1398.   end
  1399.  
  1400. end # Game_Actor
  1401.  
  1402. #==============================================================================
  1403. # ■ Game_Enemy
  1404. #==============================================================================
  1405.  
  1406. class Game_Enemy < Game_Battler
  1407.  
  1408.   #--------------------------------------------------------------------------
  1409.   # overwrite method: perform_damage_effect
  1410.   #--------------------------------------------------------------------------
  1411.   def perform_damage_effect
  1412.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1413.     Sound.play_enemy_damage
  1414.   end
  1415.  
  1416.   #--------------------------------------------------------------------------
  1417.   # new methods: attack_animation_id
  1418.   #--------------------------------------------------------------------------
  1419.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1420.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1421.  
  1422.   #--------------------------------------------------------------------------
  1423.   # new method: sprite
  1424.   #--------------------------------------------------------------------------
  1425.   def sprite
  1426.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1427.   end
  1428.  
  1429. end # Game_Enemy
  1430.  
  1431. #==============================================================================
  1432. # ■ Game_Unit
  1433. #==============================================================================
  1434.  
  1435. class Game_Unit
  1436.  
  1437.   #--------------------------------------------------------------------------
  1438.   # alias method: make_actions
  1439.   #--------------------------------------------------------------------------
  1440.   alias game_unit_make_actions_abe make_actions
  1441.   def make_actions
  1442.     game_unit_make_actions_abe
  1443.     refresh_autobattler_status_window
  1444.   end
  1445.  
  1446.   #--------------------------------------------------------------------------
  1447.   # new method: refresh_autobattler_status_window
  1448.   #--------------------------------------------------------------------------
  1449.   def refresh_autobattler_status_window
  1450.     return unless SceneManager.scene_is?(Scene_Battle)
  1451.     return unless self.is_a?(Game_Party)
  1452.     SceneManager.scene.refresh_autobattler_status_window
  1453.   end
  1454.  
  1455. end # Game_Unit
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461. #==============================================================================
  1462. # ■ Window_BattleStatus
  1463. #==============================================================================
  1464.  
  1465. class Window_BattleStatus < Window_Selectable
  1466.  
  1467.   #--------------------------------------------------------------------------
  1468.   # overwrite method: initialize
  1469.   #--------------------------------------------------------------------------
  1470.   def initialize
  1471.     super(0, 0, window_width, window_height)
  1472.     self.openness = 0
  1473.     @party = $game_party.battle_members.clone
  1474.   end
  1475.  
  1476.   #--------------------------------------------------------------------------
  1477.   # overwrite method: col_max
  1478.   #--------------------------------------------------------------------------
  1479.   def col_max; return $game_party.max_battle_members; end
  1480.  
  1481.   #--------------------------------------------------------------------------
  1482.   # new method: battle_members
  1483.   #--------------------------------------------------------------------------
  1484.   def battle_members; return $game_party.battle_members; end
  1485.  
  1486.   #--------------------------------------------------------------------------
  1487.   # new method: actor
  1488.   #--------------------------------------------------------------------------
  1489.   def actor; return battle_members[@index]; end
  1490.  
  1491.   #--------------------------------------------------------------------------
  1492.   # overwrite method: update
  1493.   #--------------------------------------------------------------------------
  1494.   def update
  1495.     super
  1496.     return if @party == $game_party.battle_members
  1497.     @party = $game_party.battle_members.clone
  1498.     refresh
  1499.   end
  1500.  
  1501.   #--------------------------------------------------------------------------
  1502.   # overwrite method: draw_item
  1503.   #--------------------------------------------------------------------------
  1504.   def draw_item(index)
  1505.     return if index.nil?
  1506.     clear_item(index)
  1507.     actor = battle_members[index]
  1508.     rect = item_rect(index)
  1509.     return if actor.nil?
  1510.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1511.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1512.     draw_actor_action(actor, rect.x, rect.y)
  1513.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1514.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1515.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1516.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1517.     if draw_tp?(actor) && draw_mp?(actor)
  1518.       dw = rect.width/2-2
  1519.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1520.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1521.       dw = rect.width - rect.width/2 - 2
  1522.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1523.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1524.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1525.     else
  1526.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1527.     end
  1528.   end
  1529.  
  1530.   #--------------------------------------------------------------------------
  1531.   # overwrite method: item_rect
  1532.   #--------------------------------------------------------------------------
  1533.   def item_rect(index)
  1534.     rect = Rect.new
  1535.     rect.width = contents.width / $game_party.max_battle_members
  1536.     rect.height = contents.height
  1537.     rect.x = index * rect.width
  1538.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1539.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1540.     end
  1541.     rect.y = 0
  1542.     return rect
  1543.   end
  1544.  
  1545.   #--------------------------------------------------------------------------
  1546.   # overwrite method: draw_face
  1547.   #--------------------------------------------------------------------------
  1548.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1549.     bitmap = Cache.face(face_name)
  1550.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1551.     fy = face_index / 4 * 96 + 2
  1552.     fw = [item_rect(0).width - 4, 92].min
  1553.     rect = Rect.new(fx, fy, fw, 92)
  1554.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1555.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1556.     bitmap.dispose
  1557.   end
  1558.  
  1559.   #--------------------------------------------------------------------------
  1560.   # overwrite method: draw_actor_name
  1561.   #--------------------------------------------------------------------------
  1562.   def draw_actor_name(actor, dx, dy, dw = 112)
  1563.     reset_font_settings
  1564.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1565.     change_color(hp_color(actor))
  1566.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1567.   end
  1568.  
  1569.   #--------------------------------------------------------------------------
  1570.   # new method: draw_actor_action
  1571.   #--------------------------------------------------------------------------
  1572.   def draw_actor_action(actor, dx, dy)
  1573.     draw_icon(action_icon(actor), dx, dy)
  1574.   end
  1575.  
  1576.   #--------------------------------------------------------------------------
  1577.   # new method: action_icon
  1578.   #--------------------------------------------------------------------------
  1579.   def action_icon(actor)
  1580.     return Icon.no_action if actor.current_action.nil?
  1581.     return Icon.no_action if actor.current_action.item.nil?
  1582.     return actor.current_action.item.icon_index
  1583.   end
  1584.  
  1585.   #--------------------------------------------------------------------------
  1586.   # new method: draw_tp?
  1587.   #--------------------------------------------------------------------------
  1588.   def draw_tp?(actor)
  1589.     return actor.draw_tp?
  1590.   end
  1591.  
  1592.   #--------------------------------------------------------------------------
  1593.   # new method: draw_mp?
  1594.   #--------------------------------------------------------------------------
  1595.   def draw_mp?(actor)
  1596.     return actor.draw_mp?
  1597.   end
  1598.  
  1599.   #--------------------------------------------------------------------------
  1600.   # overwrite method: draw_current_and_max_values
  1601.   #--------------------------------------------------------------------------
  1602.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1603.     change_color(color1)
  1604.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1605.   end
  1606.  
  1607.   #--------------------------------------------------------------------------
  1608.   # overwrite method: draw_actor_hp
  1609.   #--------------------------------------------------------------------------
  1610.   def draw_actor_hp(actor, dx, dy, width = 124)
  1611.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1612.     change_color(system_color)
  1613.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1614.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1615.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1616.       hp_color(actor), normal_color)
  1617.     end
  1618.  
  1619.   #--------------------------------------------------------------------------
  1620.   # overwrite method: draw_actor_mp
  1621.   #--------------------------------------------------------------------------
  1622.   def draw_actor_mp(actor, dx, dy, width = 124)
  1623.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1624.     change_color(system_color)
  1625.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1626.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1627.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1628.       mp_color(actor), normal_color)
  1629.     end
  1630.  
  1631.   #--------------------------------------------------------------------------
  1632.   # overwrite method: draw_actor_tp
  1633.   #--------------------------------------------------------------------------
  1634.   def draw_actor_tp(actor, dx, dy, width = 124)
  1635.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1636.     change_color(system_color)
  1637.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1638.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1639.     change_color(tp_color(actor))
  1640.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1641.   end
  1642.  
  1643. end # Window_BattleStatus
  1644.  
  1645. #==============================================================================
  1646. # ■ Window_BattleActor
  1647. #==============================================================================
  1648.  
  1649. class Window_BattleActor < Window_BattleStatus
  1650.  
  1651.   #--------------------------------------------------------------------------
  1652.   # overwrite method: show
  1653.   #--------------------------------------------------------------------------
  1654.   def show
  1655.     create_flags
  1656.     super
  1657.   end
  1658.  
  1659.   #--------------------------------------------------------------------------
  1660.   # new method: create_flags
  1661.   #--------------------------------------------------------------------------
  1662.   def create_flags
  1663.     set_select_flag(:any)
  1664.     select(0)
  1665.     return if $game_temp.battle_aid.nil?
  1666.     if $game_temp.battle_aid.need_selection?
  1667.       select(0)
  1668.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1669.     elsif $game_temp.battle_aid.for_user?
  1670.       battler = BattleManager.actor
  1671.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1672.       select(id)
  1673.       set_select_flag(:user)
  1674.     elsif $game_temp.battle_aid.for_all?
  1675.       select(0)
  1676.       set_select_flag(:all)
  1677.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1678.     elsif $game_temp.battle_aid.for_random?
  1679.       select(0)
  1680.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1681.     end
  1682.   end
  1683.  
  1684.   #--------------------------------------------------------------------------
  1685.   # new method: set_flag
  1686.   #--------------------------------------------------------------------------
  1687.   def set_select_flag(flag)
  1688.     @select_flag = flag
  1689.     case @select_flag
  1690.     when :all, :all_dead, :random
  1691.       @cursor_all = true
  1692.     else
  1693.       @cursor_all = false
  1694.     end
  1695.   end
  1696.  
  1697.   #--------------------------------------------------------------------------
  1698.   # overwrite method: update_cursor
  1699.   #--------------------------------------------------------------------------
  1700.   def update_cursor
  1701.     if @cursor_all
  1702.       cursor_rect.set(0, 0, contents.width, contents.height)
  1703.       self.top_row = 0
  1704.     elsif @index < 0
  1705.       cursor_rect.empty
  1706.     else
  1707.       ensure_cursor_visible
  1708.       cursor_rect.set(item_rect(@index))
  1709.     end
  1710.   end
  1711.  
  1712.   #--------------------------------------------------------------------------
  1713.   # overwrite method: cursor_movable?
  1714.   #--------------------------------------------------------------------------
  1715.   def cursor_movable?
  1716.     return false if @select_flag == :user
  1717.     return super
  1718.   end
  1719.  
  1720.   #--------------------------------------------------------------------------
  1721.   # overwrite method: current_item_enabled?
  1722.   #--------------------------------------------------------------------------
  1723.   def current_item_enabled?
  1724.     return true if $game_temp.battle_aid.nil?
  1725.     if $game_temp.battle_aid.need_selection?
  1726.       member = $game_party.battle_members[@index]
  1727.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1728.     elsif $game_temp.battle_aid.for_dead_friend?
  1729.       for member in $game_party.battle_members
  1730.         return true if member.dead?
  1731.       end
  1732.       return false
  1733.     end
  1734.     return true
  1735.   end
  1736.  
  1737. end # Window_BattleActor
  1738.  
  1739. #==============================================================================
  1740. # ■ Window_BattleStatusAid
  1741. #==============================================================================
  1742.  
  1743. class Window_BattleStatusAid < Window_BattleStatus
  1744.  
  1745.   #--------------------------------------------------------------------------
  1746.   # public instance variables
  1747.   #--------------------------------------------------------------------------
  1748.   attr_accessor :status_window
  1749.  
  1750.   #--------------------------------------------------------------------------
  1751.   # overwrite method: initialize
  1752.   #--------------------------------------------------------------------------
  1753.   def initialize
  1754.     super
  1755.     self.visible = false
  1756.     self.openness = 255
  1757.   end
  1758.  
  1759.   #--------------------------------------------------------------------------
  1760.   # overwrite method: window_width
  1761.   #--------------------------------------------------------------------------
  1762.   def window_width; return 128; end
  1763.  
  1764.   #--------------------------------------------------------------------------
  1765.   # overwrite method: show
  1766.   #--------------------------------------------------------------------------
  1767.   def show
  1768.     super
  1769.     refresh
  1770.   end
  1771.  
  1772.   #--------------------------------------------------------------------------
  1773.   # overwrite method: refresh
  1774.   #--------------------------------------------------------------------------
  1775.   def refresh
  1776.     contents.clear
  1777.     return if @status_window.nil?
  1778.     draw_item(@status_window.index)
  1779.   end
  1780.  
  1781.   #--------------------------------------------------------------------------
  1782.   # overwrite method: item_rect
  1783.   #--------------------------------------------------------------------------
  1784.   def item_rect(index)
  1785.     return Rect.new(0, 0, contents.width, contents.height)
  1786.   end
  1787.  
  1788. end # Window_BattleStatusAid
  1789.  
  1790. #==============================================================================
  1791. # ■ Window_BattleEnemy
  1792. #==============================================================================
  1793.  
  1794. class Window_BattleEnemy < Window_Selectable
  1795.  
  1796.   #--------------------------------------------------------------------------
  1797.   # overwrite method: initialize
  1798.   #--------------------------------------------------------------------------
  1799.   def initialize(info_viewport)
  1800.     super(0, Graphics.height, window_width, fitting_height(1))
  1801.     refresh
  1802.     self.visible = false
  1803.     @info_viewport = info_viewport
  1804.   end
  1805.  
  1806.   #--------------------------------------------------------------------------
  1807.   # overwrite method: col_max
  1808.   #--------------------------------------------------------------------------
  1809.   def col_max; return item_max; end
  1810.  
  1811.   #--------------------------------------------------------------------------
  1812.   # overwrite method: show
  1813.   #--------------------------------------------------------------------------
  1814.   def show
  1815.     create_flags
  1816.     super
  1817.   end
  1818.  
  1819.   #--------------------------------------------------------------------------
  1820.   # new method: create_flags
  1821.   #--------------------------------------------------------------------------
  1822.   def create_flags
  1823.     set_select_flag(:any)
  1824.     select(0)
  1825.     return if $game_temp.battle_aid.nil?
  1826.     if $game_temp.battle_aid.need_selection?
  1827.       select(0)
  1828.     elsif $game_temp.battle_aid.for_all?
  1829.       select(0)
  1830.       set_select_flag(:all)
  1831.     elsif $game_temp.battle_aid.for_random?
  1832.       select(0)
  1833.       set_select_flag(:random)
  1834.     end
  1835.   end
  1836.  
  1837.   #--------------------------------------------------------------------------
  1838.   # new method: set_flag
  1839.   #--------------------------------------------------------------------------
  1840.   def set_select_flag(flag)
  1841.     @select_flag = flag
  1842.     case @select_flag
  1843.     when :all, :random
  1844.       @cursor_all = true
  1845.     else
  1846.       @cursor_all = false
  1847.     end
  1848.   end
  1849.  
  1850.   #--------------------------------------------------------------------------
  1851.   # new method: select_all?
  1852.   #--------------------------------------------------------------------------
  1853.   def select_all?
  1854.     return true if @select_flag == :all
  1855.     return true if @select_flag == :random
  1856.     return false
  1857.   end
  1858.  
  1859.   #--------------------------------------------------------------------------
  1860.   # overwrite method: update_cursor
  1861.   #--------------------------------------------------------------------------
  1862.   def update_cursor
  1863.     if @cursor_all
  1864.       cursor_rect.set(0, 0, contents.width, contents.height)
  1865.       self.top_row = 0
  1866.     elsif @index < 0
  1867.       cursor_rect.empty
  1868.     else
  1869.       ensure_cursor_visible
  1870.       cursor_rect.set(item_rect(@index))
  1871.     end
  1872.   end
  1873.  
  1874.   #--------------------------------------------------------------------------
  1875.   # overwrite method: cursor_movable?
  1876.   #--------------------------------------------------------------------------
  1877.   def cursor_movable?
  1878.     return false if @select_flag == :user
  1879.     return super
  1880.   end
  1881.  
  1882.   #--------------------------------------------------------------------------
  1883.   # overwrite method: current_item_enabled?
  1884.   #--------------------------------------------------------------------------
  1885.   def current_item_enabled?
  1886.     return true if $game_temp.battle_aid.nil?
  1887.     if $game_temp.battle_aid.need_selection?
  1888.       member = $game_party.battle_members[@index]
  1889.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1890.     elsif $game_temp.battle_aid.for_dead_friend?
  1891.       for member in $game_party.battle_members
  1892.         return true if member.dead?
  1893.       end
  1894.       return false
  1895.     end
  1896.     return true
  1897.   end
  1898.  
  1899.   #--------------------------------------------------------------------------
  1900.   # overwrite method: enemy
  1901.   #--------------------------------------------------------------------------
  1902.   def enemy; @data[index]; end
  1903.  
  1904.   #--------------------------------------------------------------------------
  1905.   # overwrite method: refresh
  1906.   #--------------------------------------------------------------------------
  1907.   def refresh
  1908.     make_item_list
  1909.     create_contents
  1910.     draw_all_items
  1911.   end
  1912.  
  1913.   #--------------------------------------------------------------------------
  1914.   # overwrite method: make_item_list
  1915.   #--------------------------------------------------------------------------
  1916.   def make_item_list
  1917.     @data = $game_troop.alive_members
  1918.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  1919.   end
  1920.  
  1921.   #--------------------------------------------------------------------------
  1922.   # overwrite method: draw_item
  1923.   #--------------------------------------------------------------------------
  1924.   def draw_item(index); return; end
  1925.  
  1926.   #--------------------------------------------------------------------------
  1927.   # overwrite method: update
  1928.   #--------------------------------------------------------------------------
  1929.   def update
  1930.     super
  1931.     return unless active
  1932.     enemy.sprite_effect_type = :whiten
  1933.     return unless select_all?
  1934.     for enemy in $game_troop.alive_members
  1935.       enemy.sprite_effect_type = :whiten
  1936.     end
  1937.   end
  1938.  
  1939. end # Window_BattleEnemy
  1940.  
  1941. #==============================================================================
  1942. # ■ Window_BattleHelp
  1943. #==============================================================================
  1944.  
  1945. class Window_BattleHelp < Window_Help
  1946.  
  1947.   #--------------------------------------------------------------------------
  1948.   # public instance variables
  1949.   #--------------------------------------------------------------------------
  1950.   attr_accessor :actor_window
  1951.   attr_accessor :enemy_window
  1952.  
  1953.   #--------------------------------------------------------------------------
  1954.   # update
  1955.   #--------------------------------------------------------------------------
  1956.   def update
  1957.     super
  1958.     if !self.visible and @text != ""
  1959.       @text = ""
  1960.       return refresh
  1961.     end
  1962.     update_battler_name
  1963.   end
  1964.  
  1965.   #--------------------------------------------------------------------------
  1966.   # update_battler_name
  1967.   #--------------------------------------------------------------------------
  1968.   def update_battler_name
  1969.     return unless @actor_window.active || @enemy_window.active
  1970.     if @actor_window.active
  1971.       battler = $game_party.battle_members[@actor_window.index]
  1972.     elsif @enemy_window.active
  1973.       battler = @enemy_window.enemy
  1974.     end
  1975.     if special_display?
  1976.       refresh_special_case(battler)
  1977.     else
  1978.       refresh_battler_name(battler) if battler_name(battler) != @text
  1979.     end
  1980.   end
  1981.  
  1982.   #--------------------------------------------------------------------------
  1983.   # battler_name
  1984.   #--------------------------------------------------------------------------
  1985.   def battler_name(battler)
  1986.     text = battler.name.clone
  1987.     return text
  1988.   end
  1989.  
  1990.   #--------------------------------------------------------------------------
  1991.   # refresh_battler_name
  1992.   #--------------------------------------------------------------------------
  1993.   def refresh_battler_name(battler)
  1994.     contents.clear
  1995.     reset_font_settings
  1996.     change_color(normal_color)
  1997.     @text = battler_name(battler)
  1998.     icons = battler.state_icons + battler.buff_icons
  1999.     dy = icons.size <= 0 ? line_height / 2 : 0
  2000.     draw_text(0, dy, contents.width, line_height, @text, 1)
  2001.     dx = (contents.width - (icons.size * 24)) / 2
  2002.     draw_actor_icons(battler, dx, line_height, contents.width)
  2003.   end
  2004.  
  2005.   #--------------------------------------------------------------------------
  2006.   # special_display?
  2007.   #--------------------------------------------------------------------------
  2008.   def special_display?
  2009.     return false if $game_temp.battle_aid.nil?
  2010.     return false if $game_temp.battle_aid.for_user?
  2011.     return !$game_temp.battle_aid.need_selection?
  2012.   end
  2013.  
  2014.   #--------------------------------------------------------------------------
  2015.   # refresh_special_case
  2016.   #--------------------------------------------------------------------------
  2017.   def refresh_special_case(battler)
  2018.     if $game_temp.battle_aid.for_opponent?
  2019.       if $game_temp.battle_aid.for_all?
  2020.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2021.       else
  2022.         case $game_temp.battle_aid.number_of_targets
  2023.         when 1
  2024.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2025.         else
  2026.           number = $game_temp.battle_aid.number_of_targets
  2027.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2028.         end
  2029.       end
  2030.     else # $game_temp.battle_aid.for_friend?
  2031.       if $game_temp.battle_aid.for_dead_friend?
  2032.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2033.       elsif $game_temp.battle_aid.for_random?
  2034.         case $game_temp.battle_aid.number_of_targets
  2035.         when 1
  2036.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2037.         else
  2038.           number = $game_temp.battle_aid.number_of_targets
  2039.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2040.         end
  2041.       else
  2042.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2043.       end
  2044.     end
  2045.     return if text == @text
  2046.     @text = text
  2047.     contents.clear
  2048.     reset_font_settings
  2049.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2050.   end
  2051.  
  2052. end # Window_BattleHelp
  2053.  
  2054. #==============================================================================
  2055. # ■ Window_BattleLog
  2056. #==============================================================================
  2057.  
  2058. class Window_BattleLog < Window_Selectable
  2059.  
  2060.   #--------------------------------------------------------------------------
  2061.   # alias method: display_current_state
  2062.   #--------------------------------------------------------------------------
  2063.   alias window_battlelog_display_current_state_abe display_current_state
  2064.   def display_current_state(subject)
  2065.     subject.make_during_state_popup
  2066.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2067.     window_battlelog_display_current_state_abe(subject)
  2068.   end
  2069.  
  2070.   #--------------------------------------------------------------------------
  2071.   # alias method: display_use_item
  2072.   #--------------------------------------------------------------------------
  2073.   alias window_battlelog_display_use_item_abe display_use_item
  2074.   def display_use_item(subject, item)
  2075.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2076.     window_battlelog_display_use_item_abe(subject, item)
  2077.   end
  2078.  
  2079.   #--------------------------------------------------------------------------
  2080.   # alias method: display_counter
  2081.   #--------------------------------------------------------------------------
  2082.   alias window_battlelog_display_counter_abe display_counter
  2083.   def display_counter(target, item)
  2084.     if YEA::BATTLE::MSG_COUNTERATTACK
  2085.       window_battlelog_display_counter_abe(target, item)
  2086.     else
  2087.       Sound.play_evasion
  2088.     end
  2089.   end
  2090.  
  2091.   #--------------------------------------------------------------------------
  2092.   # alias method: display_reflection
  2093.   #--------------------------------------------------------------------------
  2094.   alias window_battlelog_display_reflection_abe display_reflection
  2095.   def display_reflection(target, item)
  2096.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2097.       window_battlelog_display_reflection_abe(target, item)
  2098.     else
  2099.       Sound.play_reflection
  2100.     end
  2101.   end
  2102.  
  2103.   #--------------------------------------------------------------------------
  2104.   # alias method: display_substitute
  2105.   #--------------------------------------------------------------------------
  2106.   alias window_battlelog_display_substitute_abe display_substitute
  2107.   def display_substitute(substitute, target)
  2108.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2109.     window_battlelog_display_substitute_abe(substitute, target)
  2110.   end
  2111.  
  2112.   #--------------------------------------------------------------------------
  2113.   # alias method: display_failure
  2114.   #--------------------------------------------------------------------------
  2115.   alias window_battlelog_display_failure_abe display_failure
  2116.   def display_failure(target, item)
  2117.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2118.     window_battlelog_display_failure_abe(target, item)
  2119.   end
  2120.  
  2121.   #--------------------------------------------------------------------------
  2122.   # alias method: display_critical
  2123.   #--------------------------------------------------------------------------
  2124.   alias window_battlelog_display_critical_abe display_critical
  2125.   def display_critical(target, item)
  2126.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2127.     window_battlelog_display_critical_abe(target, item)
  2128.   end
  2129.  
  2130.   #--------------------------------------------------------------------------
  2131.   # alias method: display_miss
  2132.   #--------------------------------------------------------------------------
  2133.   alias window_battlelog_display_miss_abe display_miss
  2134.   def display_miss(target, item)
  2135.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2136.     window_battlelog_display_miss_abe(target, item)
  2137.   end
  2138.  
  2139.   #--------------------------------------------------------------------------
  2140.   # alias method: display_evasion
  2141.   #--------------------------------------------------------------------------
  2142.   alias window_battlelog_display_evasion_abe display_evasion
  2143.   def display_evasion(target, item)
  2144.     if YEA::BATTLE::MSG_EVASION
  2145.       window_battlelog_display_evasion_abe(target, item)
  2146.     else
  2147.       if !item || item.physical?
  2148.         Sound.play_evasion
  2149.       else
  2150.         Sound.play_magic_evasion
  2151.       end
  2152.     end
  2153.   end
  2154.  
  2155.   #--------------------------------------------------------------------------
  2156.   # overwrite method: display_hp_damage
  2157.   #--------------------------------------------------------------------------
  2158.   def display_hp_damage(target, item)
  2159.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2160.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2161.       target.perform_damage_effect
  2162.     end
  2163.     Sound.play_recovery if target.result.hp_damage < 0
  2164.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2165.     add_text(target.result.hp_damage_text)
  2166.     wait
  2167.   end
  2168.  
  2169.   #--------------------------------------------------------------------------
  2170.   # overwrite method: display_mp_damage
  2171.   #--------------------------------------------------------------------------
  2172.   def display_mp_damage(target, item)
  2173.     return if target.dead? || target.result.mp_damage == 0
  2174.     Sound.play_recovery if target.result.mp_damage < 0
  2175.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2176.     add_text(target.result.mp_damage_text)
  2177.     wait
  2178.   end
  2179.  
  2180.   #--------------------------------------------------------------------------
  2181.   # overwrite method: display_tp_damage
  2182.   #--------------------------------------------------------------------------
  2183.   def display_tp_damage(target, item)
  2184.     return if target.dead? || target.result.tp_damage == 0
  2185.     Sound.play_recovery if target.result.tp_damage < 0
  2186.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2187.     add_text(target.result.tp_damage_text)
  2188.     wait
  2189.   end
  2190.  
  2191.   #--------------------------------------------------------------------------
  2192.   # alias method: display_added_states
  2193.   #--------------------------------------------------------------------------
  2194.   alias window_battlelog_display_added_states_abe display_added_states
  2195.   def display_added_states(target)
  2196.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2197.     window_battlelog_display_added_states_abe(target)
  2198.   end
  2199.  
  2200.   #--------------------------------------------------------------------------
  2201.   # alias method: display_removed_states
  2202.   #--------------------------------------------------------------------------
  2203.   alias window_battlelog_display_removed_states_abe display_removed_states
  2204.   def display_removed_states(target)
  2205.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2206.     window_battlelog_display_removed_states_abe(target)
  2207.   end
  2208.  
  2209.   #--------------------------------------------------------------------------
  2210.   # alias method: display_changed_buffs
  2211.   #--------------------------------------------------------------------------
  2212.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2213.   def display_changed_buffs(target)
  2214.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2215.     window_battlelog_display_changed_buffs_abe(target)
  2216.   end
  2217.  
  2218. end # Window_BattleLog
  2219.  
  2220. #==============================================================================
  2221. # ■ Window_SkillList
  2222. #==============================================================================
  2223.  
  2224. class Window_SkillList < Window_Selectable
  2225.  
  2226.   #--------------------------------------------------------------------------
  2227.   # overwrite method: spacing
  2228.   #--------------------------------------------------------------------------
  2229.   def spacing
  2230.     return 8 if $game_party.in_battle
  2231.     return super
  2232.   end
  2233.  
  2234. end # Window_SkillList
  2235.  
  2236. #==============================================================================
  2237. # ■ Window_ItemList
  2238. #==============================================================================
  2239.  
  2240. class Window_ItemList < Window_Selectable
  2241.  
  2242.   #--------------------------------------------------------------------------
  2243.   # overwrite method: spacing
  2244.   #--------------------------------------------------------------------------
  2245.   def spacing
  2246.     return 8 if $game_party.in_battle
  2247.     return super
  2248.   end
  2249.  
  2250. end # Window_ItemList
  2251.  
  2252. #==============================================================================
  2253. # ■ Scene_Battle
  2254. #==============================================================================
  2255.  
  2256. class Scene_Battle < Scene_Base
  2257.  
  2258.   #--------------------------------------------------------------------------
  2259.   # public instance variables
  2260.   #--------------------------------------------------------------------------
  2261.   attr_accessor :enemy_window
  2262.   attr_accessor :info_viewport
  2263.   attr_accessor :spriteset
  2264.   attr_accessor :status_window
  2265.   attr_accessor :status_aid_window
  2266.   attr_accessor :subject
  2267.  
  2268.   #--------------------------------------------------------------------------
  2269.   # alias method: create_spriteset
  2270.   #--------------------------------------------------------------------------
  2271.   alias scene_battle_create_spriteset_abe create_spriteset
  2272.   def create_spriteset
  2273.     BattleManager.init_battle_type
  2274.     scene_battle_create_spriteset_abe
  2275.   end
  2276.  
  2277.   #--------------------------------------------------------------------------
  2278.   # alias method: update_basic
  2279.   #--------------------------------------------------------------------------
  2280.   alias scene_battle_update_basic_abe update_basic
  2281.   def update_basic
  2282.     scene_battle_update_basic_abe
  2283.     update_debug
  2284.   end
  2285.  
  2286.   #--------------------------------------------------------------------------
  2287.   # new method: update_debug
  2288.   #--------------------------------------------------------------------------
  2289.   def update_debug
  2290.     return unless $TEST || $BTEST
  2291.     debug_heal_party if Input.trigger?(:F5)
  2292.     debug_damage_party if Input.trigger?(:F6)
  2293.     debug_fill_tp if Input.trigger?(:F7)
  2294.     debug_kill_all if Input.trigger?(:F8)
  2295.   end
  2296.  
  2297.   #--------------------------------------------------------------------------
  2298.   # new method: debug_heal_party
  2299.   #--------------------------------------------------------------------------
  2300.   def debug_heal_party
  2301.     Sound.play_recovery
  2302.     for member in $game_party.battle_members
  2303.       member.recover_all
  2304.     end
  2305.     @status_window.refresh
  2306.   end
  2307.  
  2308.   #--------------------------------------------------------------------------
  2309.   # new method: debug_damage_party
  2310.   #--------------------------------------------------------------------------
  2311.   def debug_damage_party
  2312.     Sound.play_actor_damage
  2313.     for member in $game_party.alive_members
  2314.       member.hp = 1
  2315.       member.mp = 0
  2316.       member.tp = 0
  2317.     end
  2318.     @status_window.refresh
  2319.   end
  2320.  
  2321.   #--------------------------------------------------------------------------
  2322.   # new method: debug_fill_tp
  2323.   #--------------------------------------------------------------------------
  2324.   def debug_fill_tp
  2325.     Sound.play_recovery
  2326.     for member in $game_party.alive_members
  2327.       member.tp = member.max_tp
  2328.     end
  2329.     @status_window.refresh
  2330.   end
  2331.  
  2332.   #--------------------------------------------------------------------------
  2333.   # new method: debug_kill_all
  2334.   #--------------------------------------------------------------------------
  2335.   def debug_kill_all
  2336.     for enemy in $game_troop.alive_members
  2337.       enemy.hp = 0
  2338.       enemy.perform_collapse_effect
  2339.     end
  2340.     BattleManager.judge_win_loss
  2341.     @log_window.wait
  2342.     @log_window.wait_for_effect
  2343.   end
  2344.  
  2345.   #--------------------------------------------------------------------------
  2346.   # alias method: create_all_windows
  2347.   #--------------------------------------------------------------------------
  2348.   alias scene_battle_create_all_windows_abe create_all_windows
  2349.   def create_all_windows
  2350.     scene_battle_create_all_windows_abe
  2351.     create_battle_status_aid_window
  2352.     set_help_window
  2353.   end
  2354.  
  2355.   #--------------------------------------------------------------------------
  2356.   # alias method: create_info_viewport
  2357.   #--------------------------------------------------------------------------
  2358.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2359.   def create_info_viewport
  2360.     scene_battle_create_info_viewport_abe
  2361.     @status_window.refresh
  2362.   end
  2363.  
  2364.   #--------------------------------------------------------------------------
  2365.   # new method: create_battle_status_aid_window
  2366.   #--------------------------------------------------------------------------
  2367.   def create_battle_status_aid_window
  2368.     @status_aid_window = Window_BattleStatusAid.new
  2369.     @status_aid_window.status_window = @status_window
  2370.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2371.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2372.   end
  2373.  
  2374.   #--------------------------------------------------------------------------
  2375.   # overwrite method: create_help_window
  2376.   #--------------------------------------------------------------------------
  2377.   def create_help_window
  2378.     @help_window = Window_BattleHelp.new
  2379.     @help_window.hide
  2380.   end
  2381.  
  2382.   #--------------------------------------------------------------------------
  2383.   # new method: set_help_window
  2384.   #--------------------------------------------------------------------------
  2385.   def set_help_window
  2386.     @help_window.actor_window = @actor_window
  2387.     @help_window.enemy_window = @enemy_window
  2388.   end
  2389.  
  2390.   #--------------------------------------------------------------------------
  2391.   # alias method: create_party_command_window
  2392.   #--------------------------------------------------------------------------
  2393.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2394.   def create_party_command_window
  2395.     scene_battle_create_party_command_window_abe
  2396.  
  2397.   end
  2398.  
  2399.   #--------------------------------------------------------------------------
  2400.   # alias method: create_actor_command_window
  2401.   #--------------------------------------------------------------------------
  2402.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2403.   def create_actor_command_window
  2404.     scene_battle_create_actor_command_window_abe
  2405.  
  2406.   end
  2407.  
  2408.   #--------------------------------------------------------------------------
  2409.   # alias method: create_skill_window
  2410.   #--------------------------------------------------------------------------
  2411.   alias scene_battle_create_skill_window_abe create_skill_window
  2412.   def create_skill_window
  2413.     scene_battle_create_skill_window_abe
  2414.     @skill_window.height = @info_viewport.rect.height
  2415.     @skill_window.width = Graphics.width - @actor_command_window.width
  2416.     @skill_window.y = Graphics.height - @skill_window.height
  2417.   end
  2418.  
  2419.   #--------------------------------------------------------------------------
  2420.   # alias method: create_item_window
  2421.   #--------------------------------------------------------------------------
  2422.   alias scene_battle_create_item_window_abe create_item_window
  2423.   def create_item_window
  2424.     scene_battle_create_item_window_abe
  2425.     @item_window.height = @skill_window.height
  2426.     @item_window.width = @skill_window.width
  2427.     @item_window.y = Graphics.height - @item_window.height
  2428.   end
  2429.  
  2430.   #--------------------------------------------------------------------------
  2431.   # alias method: show_fast?
  2432.   #--------------------------------------------------------------------------
  2433.   alias scene_battle_show_fast_abe show_fast?
  2434.   def show_fast?
  2435.     return true if YEA::BATTLE::AUTO_FAST
  2436.     return scene_battle_show_fast_abe
  2437.   end
  2438.  
  2439.   #--------------------------------------------------------------------------
  2440.   # alias method: next_command
  2441.   #--------------------------------------------------------------------------
  2442.   alias scene_battle_next_command_abe next_command
  2443.   def next_command
  2444.     @status_window.show
  2445.     redraw_current_status
  2446.     @actor_command_window.show
  2447.     @status_aid_window.hide
  2448.     scene_battle_next_command_abe
  2449.   end
  2450.  
  2451.   #--------------------------------------------------------------------------
  2452.   # alias method: prior_command
  2453.   #--------------------------------------------------------------------------
  2454.   alias scene_battle_prior_command_abe prior_command
  2455.   def prior_command
  2456.     redraw_current_status
  2457.     scene_battle_prior_command_abe
  2458.   end
  2459.  
  2460.   #--------------------------------------------------------------------------
  2461.   # new method: redraw_current_status
  2462.   #--------------------------------------------------------------------------
  2463.   def redraw_current_status
  2464.     return if @status_window.index < 0
  2465.     @status_window.draw_item(@status_window.index)
  2466.   end
  2467.  
  2468.   #--------------------------------------------------------------------------
  2469.   # alias method: command_attack
  2470.   #--------------------------------------------------------------------------
  2471.   alias scene_battle_command_attack_abe command_attack
  2472.   def command_attack
  2473.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2474.     scene_battle_command_attack_abe
  2475.   end
  2476.  
  2477.   #--------------------------------------------------------------------------
  2478.   # alias method: command_skill
  2479.   #--------------------------------------------------------------------------
  2480.   alias scene_battle_command_skill_abe command_skill
  2481.   def command_skill
  2482.     scene_battle_command_skill_abe
  2483.     @status_window.hide
  2484.     @actor_command_window.hide
  2485.     @status_aid_window.show
  2486.   end
  2487.  
  2488.   #--------------------------------------------------------------------------
  2489.   # alias method: command_item
  2490.   #--------------------------------------------------------------------------
  2491.   alias scene_battle_command_item_abe command_item
  2492.   def command_item
  2493.     scene_battle_command_item_abe
  2494.     @status_window.hide
  2495.     @actor_command_window.hide
  2496.     @status_aid_window.show
  2497.   end
  2498.  
  2499.   #--------------------------------------------------------------------------
  2500.   # overwrite method: on_skill_ok
  2501.   #--------------------------------------------------------------------------
  2502.   def on_skill_ok
  2503.     @skill = @skill_window.item
  2504.     $game_temp.battle_aid = @skill
  2505.     BattleManager.actor.input.set_skill(@skill.id)
  2506.     BattleManager.actor.last_skill.object = @skill
  2507.     if @skill.for_opponent?
  2508.       select_enemy_selection
  2509.     elsif @skill.for_friend?
  2510.       select_actor_selection
  2511.     else
  2512.       @skill_window.hide
  2513.       next_command
  2514.       $game_temp.battle_aid = nil
  2515.     end
  2516.   end
  2517.  
  2518.   #--------------------------------------------------------------------------
  2519.   # alias method: on_skill_cancel
  2520.   #--------------------------------------------------------------------------
  2521.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2522.   def on_skill_cancel
  2523.     scene_battle_on_skill_cancel_abe
  2524.     @status_window.show
  2525.     @actor_command_window.show
  2526.     @status_aid_window.hide
  2527.   end
  2528.  
  2529.   #--------------------------------------------------------------------------
  2530.   # overwrite method: on_item_ok
  2531.   #--------------------------------------------------------------------------
  2532.   def on_item_ok
  2533.     @item = @item_window.item
  2534.     $game_temp.battle_aid = @item
  2535.     BattleManager.actor.input.set_item(@item.id)
  2536.     if @item.for_opponent?
  2537.       select_enemy_selection
  2538.     elsif @item.for_friend?
  2539.       select_actor_selection
  2540.     else
  2541.       @item_window.hide
  2542.       next_command
  2543.       $game_temp.battle_aid = nil
  2544.     end
  2545.     $game_party.last_item.object = @item
  2546.   end
  2547.  
  2548.   #--------------------------------------------------------------------------
  2549.   # alias method: on_item_cancel
  2550.   #--------------------------------------------------------------------------
  2551.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2552.   def on_item_cancel
  2553.     scene_battle_on_item_cancel_abe
  2554.     @status_window.show
  2555.     @actor_command_window.show
  2556.     @status_aid_window.hide
  2557.   end
  2558.  
  2559.   #--------------------------------------------------------------------------
  2560.   # alias method: select_actor_selection
  2561.   #--------------------------------------------------------------------------
  2562.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2563.   def select_actor_selection
  2564.     @status_aid_window.refresh
  2565.     scene_battle_select_actor_selection_abe
  2566.     @status_window.hide
  2567.     @skill_window.hide
  2568.     @item_window.hide
  2569.     @help_window.show
  2570.   end
  2571.  
  2572.   #--------------------------------------------------------------------------
  2573.   # alias method: on_actor_ok
  2574.   #--------------------------------------------------------------------------
  2575.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2576.   def on_actor_ok
  2577.     $game_temp.battle_aid = nil
  2578.     scene_battle_on_actor_ok_abe
  2579.     @status_window.show
  2580.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2581.       @actor_command_window.visible = !@confirm_command_window.visible
  2582.     else
  2583.       @actor_command_window.show
  2584.     end
  2585.     @status_aid_window.hide
  2586.   end
  2587.  
  2588.   #--------------------------------------------------------------------------
  2589.   # alias method: on_actor_cancel
  2590.   #--------------------------------------------------------------------------
  2591.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2592.   def on_actor_cancel
  2593.     BattleManager.actor.input.clear
  2594.     @status_aid_window.refresh
  2595.     $game_temp.battle_aid = nil
  2596.     scene_battle_on_actor_cancel_abe
  2597.     case @actor_command_window.current_symbol
  2598.     when :skill
  2599.       @skill_window.show
  2600.     when :item
  2601.       @item_window.show
  2602.     end
  2603.   end
  2604.  
  2605.   #--------------------------------------------------------------------------
  2606.   # alias method: select_enemy_selection
  2607.   #--------------------------------------------------------------------------
  2608.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2609.   def select_enemy_selection
  2610.     @status_aid_window.refresh
  2611.     scene_battle_select_enemy_selection_abe
  2612.     @help_window.show
  2613.   end
  2614.   #--------------------------------------------------------------------------
  2615.   # alias method: on_enemy_ok
  2616.   #--------------------------------------------------------------------------
  2617.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2618.   def on_enemy_ok
  2619.     $game_temp.battle_aid = nil
  2620.     scene_battle_on_enemy_ok_abe
  2621.   end
  2622.  
  2623.   #--------------------------------------------------------------------------
  2624.   # alias method: on_enemy_cancel
  2625.   #--------------------------------------------------------------------------
  2626.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2627.   def on_enemy_cancel
  2628.     BattleManager.actor.input.clear
  2629.     @status_aid_window.refresh
  2630.     $game_temp.battle_aid = nil
  2631.     scene_battle_on_enemy_cancel_abe
  2632.     if @skill_window.visible || @item_window.visible
  2633.       @help_window.show
  2634.     else
  2635.       @help_window.hide
  2636.     end
  2637.   end
  2638.  
  2639.   #--------------------------------------------------------------------------
  2640.   # alias method: battle_start
  2641.   #--------------------------------------------------------------------------
  2642.   alias scene_battle_battle_start_abe battle_start
  2643.   def battle_start
  2644.     scene_battle_battle_start_abe
  2645.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2646.     @party_command_window.deactivate
  2647.     if BattleManager.input_start
  2648.       command_fight
  2649.     else
  2650.       turn_start
  2651.     end
  2652.   end
  2653.  
  2654.   #--------------------------------------------------------------------------
  2655.   # overwrite method: turn_end
  2656.   #--------------------------------------------------------------------------
  2657.   def turn_end
  2658.     all_battle_members.each do |battler|
  2659.       battler.on_turn_end
  2660.       status_redraw_target(battler)
  2661.       @log_window.display_auto_affected_status(battler)
  2662.       @log_window.wait_and_clear
  2663.     end
  2664.  
  2665.     BattleManager.turn_end
  2666.     process_event
  2667.     start_party_command_selection
  2668.     return if end_battle_conditions?
  2669.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2670.     if BattleManager.input_start
  2671.       @party_command_window.deactivate
  2672.       command_fight
  2673.     else
  2674.       @party_command_window.deactivate
  2675.       turn_start
  2676.     end
  2677.   end
  2678.  
  2679.   #--------------------------------------------------------------------------
  2680.   # new method: end_battle_conditions?
  2681.   #--------------------------------------------------------------------------
  2682.   def end_battle_conditions?
  2683.     return true if $game_party.members.empty?
  2684.     return true if $game_party.all_dead?
  2685.     return true if $game_troop.all_dead?
  2686.     return true if BattleManager.aborting?
  2687.     return false
  2688.   end
  2689.  
  2690.   #--------------------------------------------------------------------------
  2691.   # overwrite method: execute_action
  2692.   #--------------------------------------------------------------------------
  2693.   def execute_action
  2694.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2695.     use_item
  2696.     @log_window.wait_and_clear
  2697.   end
  2698.  
  2699.   #--------------------------------------------------------------------------
  2700.   # overwrite method: apply_item_effects
  2701.   #--------------------------------------------------------------------------
  2702.   def apply_item_effects(target, item)
  2703.     if $imported["YEA-LunaticObjects"]
  2704.       lunatic_object_effect(:prepare, item, @subject, target)
  2705.     end
  2706.     target.item_apply(@subject, item)
  2707.     status_redraw_target(@subject)
  2708.     status_redraw_target(target) unless target == @subject
  2709.     @log_window.display_action_results(target, item)
  2710.     if $imported["YEA-LunaticObjects"]
  2711.       lunatic_object_effect(:during, item, @subject, target)
  2712.     end
  2713.     perform_collapse_check(target)
  2714.   end
  2715.  
  2716.   #--------------------------------------------------------------------------
  2717.   # overwite method: invoke_counter_attack
  2718.   #--------------------------------------------------------------------------
  2719.   def invoke_counter_attack(target, item)
  2720.     @log_window.display_counter(target, item)
  2721.     attack_skill = $data_skills[target.attack_skill_id]
  2722.     @subject.item_apply(target, attack_skill)
  2723.     status_redraw_target(@subject)
  2724.     status_redraw_target(target) unless target == @subject
  2725.     @log_window.display_action_results(@subject, attack_skill)
  2726.     perform_collapse_check(target)
  2727.     perform_collapse_check(@subject)
  2728.   end
  2729.  
  2730.   #--------------------------------------------------------------------------
  2731.   # new method: perform_collapse_check
  2732.   #--------------------------------------------------------------------------
  2733.   def perform_collapse_check(target)
  2734.     return if YEA::BATTLE::MSG_ADDED_STATES
  2735.     target.perform_collapse_effect if target.can_collapse?
  2736.     @log_window.wait
  2737.     @log_window.wait_for_effect
  2738.   end
  2739.  
  2740.   #--------------------------------------------------------------------------
  2741.   # overwrite method: show_attack_animation
  2742.   #--------------------------------------------------------------------------
  2743.   def show_attack_animation(targets)
  2744.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2745.     wait_for_animation
  2746.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2747.   end
  2748.  
  2749.   #--------------------------------------------------------------------------
  2750.   # overwrite method: show_normal_animation
  2751.   #--------------------------------------------------------------------------
  2752.   def show_normal_animation(targets, animation_id, mirror = false)
  2753.     animation = $data_animations[animation_id]
  2754.     return if animation.nil?
  2755.     ani_check = false
  2756.     targets.each do |target|
  2757.       if ani_check && target.animation_id <= 0
  2758.         target.pseudo_ani_id = animation_id
  2759.       else
  2760.         target.animation_id = animation_id
  2761.       end
  2762.       target.animation_mirror = mirror
  2763.       ani_check = true if animation.to_screen?
  2764.     end
  2765.   end
  2766.  
  2767.   #--------------------------------------------------------------------------
  2768.   # overwrite method: process_action_end
  2769.   #--------------------------------------------------------------------------
  2770.   def process_action_end
  2771.     @subject.on_action_end
  2772.     status_redraw_target(@subject)
  2773.     @log_window.display_auto_affected_status(@subject)
  2774.     @log_window.wait_and_clear
  2775.     @log_window.display_current_state(@subject)
  2776.     @log_window.wait_and_clear
  2777.     BattleManager.judge_win_loss
  2778.   end
  2779.  
  2780.   #--------------------------------------------------------------------------
  2781.   # overwrite method: use_item
  2782.   #--------------------------------------------------------------------------
  2783.   def use_item
  2784.     item = @subject.current_action.item
  2785.     @log_window.display_use_item(@subject, item)
  2786.     @subject.use_item(item)
  2787.     status_redraw_target(@subject)
  2788.     if $imported["YEA-LunaticObjects"]
  2789.       lunatic_object_effect(:before, item, @subject, @subject)
  2790.     end
  2791.     process_casting_animation if $imported["YEA-CastAnimations"]
  2792.     targets = @subject.current_action.make_targets.compact rescue []
  2793.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  2794.     targets.each {|target|
  2795.       if $imported["YEA-TargetManager"]
  2796.         target = alive_random_target(target, item) if item.for_random?
  2797.       end
  2798.       item.repeats.times { invoke_item(target, item) } }
  2799.     if $imported["YEA-LunaticObjects"]
  2800.       lunatic_object_effect(:after, item, @subject, @subject)
  2801.     end
  2802.   end
  2803.  
  2804.   #--------------------------------------------------------------------------
  2805.   # alias method: invoke_item
  2806.   #--------------------------------------------------------------------------
  2807.   alias scene_battle_invoke_item_abe invoke_item
  2808.   def invoke_item(target, item)
  2809.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  2810.     if target.dead? != item.for_dead_friend?
  2811.       @subject.last_target_index = target.index
  2812.       return
  2813.     end
  2814.     scene_battle_invoke_item_abe(target, item)
  2815.   end
  2816.  
  2817.   #--------------------------------------------------------------------------
  2818.   # new method: show_all_animation?
  2819.   #--------------------------------------------------------------------------
  2820.   def show_all_animation?(item)
  2821.     return true if item.one_animation
  2822.     return false if $data_animations[item.animation_id].nil?
  2823.     return false unless $data_animations[item.animation_id].to_screen?
  2824.     return true
  2825.   end
  2826.  
  2827.   #--------------------------------------------------------------------------
  2828.   # new method: separate_ani?
  2829.   #--------------------------------------------------------------------------
  2830.   def separate_ani?(target, item)
  2831.     return false if item.one_animation
  2832.     return false if $data_animations[item.animation_id].nil?
  2833.     return false if $data_animations[item.animation_id].to_screen?
  2834.     return target.dead? == item.for_dead_friend?
  2835.   end
  2836.  
  2837.   #--------------------------------------------------------------------------
  2838.   # new method: status_redraw_target
  2839.   #--------------------------------------------------------------------------
  2840.   def status_redraw_target(target)
  2841.     return unless target.actor?
  2842.     @status_window.draw_item($game_party.battle_members.index(target))
  2843.   end
  2844.  
  2845.   #--------------------------------------------------------------------------
  2846.   # alias method: start_party_command_selection
  2847.   #--------------------------------------------------------------------------
  2848.   alias start_party_command_selection_abe start_party_command_selection
  2849.   def start_party_command_selection
  2850.     @status_window.refresh unless scene_changing?
  2851.     start_party_command_selection_abe
  2852.   end
  2853.  
  2854.   #--------------------------------------------------------------------------
  2855.   # overwrite method: refresh_status
  2856.   #--------------------------------------------------------------------------
  2857.   def refresh_status; return; end
  2858.  
  2859.   #--------------------------------------------------------------------------
  2860.   # new method: refresh_autobattler_status_window
  2861.   #--------------------------------------------------------------------------
  2862.   def refresh_autobattler_status_window
  2863.     for member in $game_party.battle_members
  2864.       next unless member.auto_battle?
  2865.       @status_window.draw_item(member.index)
  2866.     end
  2867.   end
  2868.  
  2869.   #--------------------------------------------------------------------------
  2870.   # new method: hide_extra_gauges
  2871.   #--------------------------------------------------------------------------
  2872.   def hide_extra_gauges
  2873.     # Made for compatibility
  2874.   end
  2875.  
  2876.   #--------------------------------------------------------------------------
  2877.   # new method: show_extra_gauges
  2878.   #--------------------------------------------------------------------------
  2879.   def show_extra_gauges
  2880.     # Made for compatibility
  2881.   end
  2882.  
  2883. end
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
帖子
16
7
 楼主| 发表于 2012-12-17 12:21:54 | 只看该作者
c248611 发表于 2012-12-17 12:13
#==============================================================================
# ■ RMVA 战斗 ...

这个、实在是抱歉啊,怪我没说清楚。
我有“脸图战斗”的脚本,我想要的是您第一个给我的脚本,里面敌人都是一个图标,我方都是一个图标。
这样过了3、4回合,就没法分清楚到底是谁先谁后了,我是想让“行动条”上面能显示我方和敌方部分人物的特定图标,请问能设置它吗?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
帖子
208
8
发表于 2012-12-17 13:16:51 | 只看该作者
楼主可以参考技术发布区的仿空轨系统,没记错的话里面是可以设置小兵BOSS和队友在CP条上的小头像的
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
帖子
16
9
 楼主| 发表于 2012-12-17 13:26:27 | 只看该作者
cjlzbb 发表于 2012-12-17 13:16
楼主可以参考技术发布区的仿空轨系统,没记错的话里面是可以设置小兵BOSS和队友在CP条上的小头像的 ...

谢谢!我去看看,本人脚本小白,希望能看得懂怎么改吧……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
帖子
208
10
发表于 2012-12-17 14:07:34 | 只看该作者
游系风 发表于 2012-12-17 13:26
谢谢!我去看看,本人脚本小白,希望能看得懂怎么改吧……

那个是战棋来着,不过只留下CP的脚本应该可以吧……同小白╮(╯_╰)╭
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 14:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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