查看: 5202|回复: 12

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

[复制链接]
梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
回帖
12
发表于 2012-12-13 17:43:02 | 显示全部楼层 |阅读模式
悬赏20星屑已解决
做游戏,急需一个纵版战斗的行动条脚本,求有脚本的、会写脚本的大神们帮帮忙。

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

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

最佳答案

查看完整内容

[pre lang="ruby" line="1"]#============================================================================== # ■ CP制战斗系统 v1.00 #------------------------------------------------------------------------------ # 适用于:RPG Maker VX Ace # 说明:把脚本放在Main的前面。 # 所需素材:Graphics\Pictures\SL我方.png,SL敌方.png。 #================================================================ ...
梦石
0
星屑
166
在线时间
630 小时
注册时间
2012-6-9
回帖
1233
发表于 2012-12-13 17:43:03 | 显示全部楼层
SL敌方.png
SL我方.png

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

  8. #encoding:utf-8
  9. #==============================================================================
  10. # ■ Scene_Battle
  11. #------------------------------------------------------------------------------
  12. #  战斗画面
  13. #==============================================================================

  14. class Scene_Battle < Scene_Base
  15.   attr_accessor :cp_quota
  16.   attr_accessor :rtab_wait
  17.   attr_accessor :active_members
  18.   #--------------------------------------------------------------------------
  19.   # ● 开始处理
  20.   #--------------------------------------------------------------------------
  21.   def start
  22.     super
  23.     @cp_quota = 0
  24.     create_spriteset
  25.     create_all_windows
  26.     BattleManager.method_wait_for_message = method(:wait_for_message)
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 战斗开始
  30.   #--------------------------------------------------------------------------
  31.   def battle_start
  32.     @rtab_wait = true
  33.     @active_members = []
  34.     BattleManager.battle_start
  35.     set_cp_quota
  36.     process_event
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 获取敌我双方人物的平均行动速度并决定CP槽的Quota值
  40.   #--------------------------------------------------------------------------
  41.   def set_cp_quota
  42.     sss = 0.0
  43.     for iii in $game_party.members
  44.       sss += iii.param(6)
  45.     end
  46.     sss /= $game_party.members.size
  47.     @cp_quota = sss * 45
  48.     @spriteset.cp_quota = @cp_quota
  49.     for iii in $game_party.members + $game_troop.members
  50.       iii.cp_quota = @cp_quota
  51.     end
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 进行下一个指令输入
  55.   #--------------------------------------------------------------------------
  56.   def next_command
  57.     if BattleManager.next_command
  58.       start_actor_command_selection
  59.     else
  60.       turn_start(@active_members)
  61.     end
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 返回上一个指令输入
  65.   #--------------------------------------------------------------------------
  66.   def prior_command
  67.     if BattleManager.prior_command
  68.       start_actor_command_selection
  69.     else
  70.       start_party_command_selection
  71.     end
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 更新画面
  75.   #--------------------------------------------------------------------------
  76.   def update
  77.     super
  78.     if BattleManager.in_turn?
  79.       process_event
  80.       process_action
  81.     else
  82.       if @rtab_wait
  83.         for iii in $game_party.members + $game_troop.members
  84.           iii.in_turn = false
  85.           iii.rtab_cp += iii.param(6)
  86.           if iii.rtab_cp >= iii.cp_quota
  87.             @active_members.push(iii)
  88.             iii.in_turn = true
  89.           end
  90.         end
  91.         if @active_members.size > 0
  92.           @rtab_wait = false
  93.           start_party_command_selection
  94.         end
  95.       end
  96.     end
  97.     BattleManager.judge_win_loss
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 回合开始
  101.   #--------------------------------------------------------------------------
  102.   def turn_start(members)
  103.     @party_command_window.close
  104.     @actor_command_window.close
  105.     @status_window.unselect
  106.     @subject = nil
  107.     BattleManager.turn_start(members)
  108.     @log_window.wait
  109.     @log_window.clear
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # ● 回合结束
  113.   #--------------------------------------------------------------------------
  114.   def turn_end
  115.     @active_members.each do |battler|
  116.       battler.on_turn_end
  117.       refresh_status
  118.       @log_window.display_auto_affected_status(battler)
  119.       @log_window.wait_and_clear
  120.     end
  121.     BattleManager.turn_end
  122.     process_event
  123.     @rtab_wait = true
  124.     @active_members = []
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 处理战斗行动
  128.   #--------------------------------------------------------------------------
  129.   def process_action
  130.     return if scene_changing?
  131.     if !@subject || !@subject.current_action
  132.       @subject = BattleManager.next_subject
  133.     end
  134.     return turn_end unless @subject
  135.     if @subject.current_action
  136.       @subject.current_action.prepare
  137.       if @subject.current_action.valid?
  138.         @status_window.open
  139.         execute_action
  140.       end
  141.       @subject.remove_current_action
  142.     end
  143.     process_action_end unless @subject.current_action
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 开始队伍指令的选择
  147.   #--------------------------------------------------------------------------
  148.   def start_party_command_selection
  149.     unless scene_changing?
  150.       refresh_status
  151.       @status_window.unselect
  152.       @status_window.open
  153.       if BattleManager.input_start
  154.         BattleManager.clear_actor
  155.         BattleManager.next_command
  156.         @status_window.select(BattleManager.actor.index)
  157.         @actor_command_window.setup(BattleManager.actor)
  158.       else
  159.         @party_command_window.deactivate
  160.         @actor_command_window.close
  161.         turn_start(@active_members)
  162.       end
  163.     end
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● 生成角色指令窗口
  167.   #--------------------------------------------------------------------------
  168.   def create_actor_command_window
  169.     @actor_command_window = Window_ActorCommand.new
  170.     @actor_command_window.viewport = @info_viewport
  171.     @actor_command_window.set_handler(:attack, method(:command_attack))
  172.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  173.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  174.     @actor_command_window.set_handler(:item,   method(:command_item))
  175.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  176.     @actor_command_window.set_handler(:escape, method(:command_escape))
  177.     @actor_command_window.x = Graphics.width
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 指令“撤退”
  181.   #--------------------------------------------------------------------------
  182.   def command_escape
  183.     unless BattleManager.process_escape
  184.       turn_start(@active_members)
  185.       for iii in @active_members
  186.         iii.rtab_cp = 0
  187.       end
  188.     end
  189.   end
  190. end

  191. #encoding:utf-8
  192. #==============================================================================
  193. # ■ Window_ActorCommand
  194. #------------------------------------------------------------------------------
  195. #  战斗画面中,选择角色行动的窗口。
  196. #==============================================================================

  197. class Window_ActorCommand < Window_Command
  198.   #--------------------------------------------------------------------------
  199.   # ● 生成指令列表
  200.   #--------------------------------------------------------------------------
  201.   def make_command_list
  202.     return unless @actor
  203.     add_attack_command
  204.     add_skill_commands
  205.     add_guard_command
  206.     add_item_command
  207.     add_escape_command
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 添加撤退指令
  211.   #--------------------------------------------------------------------------
  212.   def add_escape_command
  213.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  214.   end
  215. end

  216. #encoding:utf-8
  217. #==============================================================================
  218. # ■ BattleManager
  219. #------------------------------------------------------------------------------
  220. #  战斗过程的管理器。
  221. #==============================================================================

  222. module BattleManager
  223.   #--------------------------------------------------------------------------
  224.   # ● 战斗开始
  225.   #--------------------------------------------------------------------------
  226.   def self.battle_start
  227.     $game_system.battle_count += 1
  228.     $game_party.on_battle_start
  229.     $game_troop.on_battle_start
  230.     $game_troop.enemy_names.each do |name|
  231.       $game_message.add(sprintf(Vocab::Emerge, name))
  232.     end
  233.     if @preemptive
  234.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  235.     elsif @surprise
  236.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  237.     end
  238.     wait_for_message
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● 遇敌时的处理
  242.   #--------------------------------------------------------------------------
  243.   def self.on_encounter
  244.     @preemptive = false
  245.     @surprise = false
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● 回合开始
  249.   #--------------------------------------------------------------------------
  250.   def self.turn_start(members)
  251.     @phase = :turn
  252.     clear_actor
  253.     $game_troop.increase_turn(members)
  254.     make_action_orders(members)
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ● 生成行动顺序
  258.   #--------------------------------------------------------------------------
  259.   def self.make_action_orders(members)
  260.     @action_battlers = []
  261.     for iii in $game_party.members
  262.       if members.include?(iii)
  263.         @action_battlers.push(iii) unless @surprise
  264.       end
  265.     end
  266.     for iii in $game_troop.members
  267.       if members.include?(iii)
  268.         @action_battlers.push(iii) unless @preemptive
  269.       end
  270.     end
  271.     @action_battlers.each {|battler| battler.make_speed }
  272.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  273.   end
  274. end

  275. #encoding:utf-8
  276. #==============================================================================
  277. # ■ Game_Battler
  278. #------------------------------------------------------------------------------
  279. #  处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
  280. #==============================================================================

  281. class Game_Battler < Game_BattlerBase
  282.   attr_accessor :turn_count
  283.   attr_accessor :rtab_cp
  284.   attr_accessor :cp_quota
  285.   attr_accessor :in_turn
  286.   #--------------------------------------------------------------------------
  287.   # ● 初始化对象
  288.   #--------------------------------------------------------------------------
  289.   alias neoinitialize initialize
  290.   def initialize
  291.     @turn_count = 0
  292.     @rtab_cp = 0
  293.     @cp_quota = 100
  294.     @in_turn = false
  295.     neoinitialize
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 战斗开始处理
  299.   #--------------------------------------------------------------------------
  300.   def on_battle_start
  301.     @turn_count = 0
  302.     @rtab_cp = 0
  303.     @cp_quota = 100
  304.     @in_turn = false
  305.     init_tp unless preserve_tp?
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 处理伤害
  309.   #    调用前需要设置好
  310.   #    @result.hp_damage   @result.mp_damage
  311.   #    @result.hp_drain    @result.mp_drain
  312.   #--------------------------------------------------------------------------
  313.   def execute_damage(user)
  314.     on_damage(@result.hp_damage) if @result.hp_damage > 0
  315.     self.hp -= @result.hp_damage
  316.     self.mp -= @result.mp_damage
  317.     user.hp += @result.hp_drain
  318.     user.mp += @result.mp_drain
  319.     # 受伤后计算CP退后量
  320.     cpback = @result.hp_damage + @result.mp_damage
  321.     cpback = (cpback < 0 ? 0 : cpback)
  322.     pent = 100.0 * cpback / self.mhp
  323.     cppentback = ((5 + pent / 10) * self.cp_quota / 100).to_i
  324.     @rtab_cp -= cppentback
  325.     @rtab_cp = (@rtab_cp < 0 ? 0 : @rtab_cp)
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 判定是否可以输入指令
  329.   #--------------------------------------------------------------------------
  330.   def inputable?
  331.     normal? && !auto_battle? && @in_turn
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● 回合结束处理
  335.   #--------------------------------------------------------------------------
  336.   def on_turn_end
  337.     @result.clear
  338.     regenerate_all
  339.     update_state_turns
  340.     update_buff_turns
  341.     remove_states_auto(2)
  342.     # 该角色的回合计数加1并清空CP
  343.     @turn_count += 1
  344.     @rtab_cp = 0
  345.   end
  346. end

  347. #encoding:utf-8
  348. #==============================================================================
  349. # ■ Game_Troop
  350. #------------------------------------------------------------------------------
  351. #  管理敌群和战斗相关资料的类,也可执行如战斗事件管理之类的功能。
  352. #   本类的实例请参考 $game_troop 。
  353. #==============================================================================

  354. class Game_Troop < Game_Unit
  355.   #--------------------------------------------------------------------------
  356.   # ● 增加回合
  357.   #--------------------------------------------------------------------------
  358.   def increase_turn(members)
  359.     troop.pages.each {|page| @event_flags= false if page.span == 1 }
  360.     turnmax = []
  361.     for iii in members
  362.       turnmax.push(iii.turn_count)
  363.     end
  364.     @turn_count = turnmax.max
  365.   end
  366. end

  367. #encoding:utf-8
  368. #==============================================================================
  369. # ■ Spriteset_Battle
  370. #------------------------------------------------------------------------------
  371. #  处理战斗画面的精灵的类。本类在 Scene_Battle 类的内部使用。
  372. #==============================================================================

  373. class Spriteset_Battle
  374.   attr_accessor :icons
  375.   attr_accessor :cp_quota
  376.   #--------------------------------------------------------------------------
  377.   # ● 初始化对象
  378.   #--------------------------------------------------------------------------
  379.   def initialize
  380.     @cp_quota = 100
  381.     create_viewports
  382.     create_battleback1
  383.     create_battleback2
  384.     create_enemies
  385.     create_actors
  386.     create_pictures
  387.     create_timer
  388.     create_rtabcp_gauge
  389.     update
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # ● 生成战斗CP条
  393.   #--------------------------------------------------------------------------
  394.   def create_rtabcp_gauge
  395.     @cpgauge_back = Sprite.new(@viewport3)
  396.     @cpgauge_back.bitmap = Bitmap.new(200, 8)
  397.     @cpgauge_back.bitmap.gradient_fill_rect(0, 0, 200, 16, Color.new(0, 255, 0), Color.new(255, 0, 0))
  398.     @cpgauge_back.x = 16
  399.     @cpgauge_back.y = 16
  400.     # 各个角色生成其图标
  401.     @icons = {}
  402.     for iii in $game_party.members
  403.       @icons[iii] = Sprite.new(@viewport3)
  404.       @icons[iii].bitmap = Bitmap.new("Graphics/Pictures/SL我方.png")
  405.       @icons[iii].ox = 12
  406.       @icons[iii].oy = 12
  407.       @icons[iii].x = 16
  408.       @icons[iii].y = 20
  409.     end
  410.     for iii in $game_troop.members
  411.       @icons[iii] = Sprite.new(@viewport3)
  412.       @icons[iii].bitmap = Bitmap.new("Graphics/Pictures/SL敌方.png")
  413.       @icons[iii].ox = 12
  414.       @icons[iii].oy = 12
  415.       @icons[iii].x = 16
  416.       @icons[iii].y = 20
  417.     end
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 释放
  421.   #--------------------------------------------------------------------------
  422.   def dispose
  423.     dispose_battleback1
  424.     dispose_battleback2
  425.     dispose_enemies
  426.     dispose_actors
  427.     dispose_pictures
  428.     dispose_timer
  429.     dispose_viewports
  430.     dispose_rtabcp_gauge
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ● 消灭战斗CP条
  434.   #--------------------------------------------------------------------------
  435.   def dispose_rtabcp_gauge
  436.     @cpgauge_back.bitmap.dispose
  437.     @cpgauge_back.dispose
  438.     for iii in $game_party.members
  439.       @icons[iii].bitmap.dispose
  440.       @icons[iii].dispose
  441.     end
  442.     for iii in $game_troop.members
  443.       @icons[iii].bitmap.dispose
  444.       @icons[iii].dispose
  445.     end
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● 更新画面
  449.   #--------------------------------------------------------------------------
  450.   def update
  451.     update_battleback1
  452.     update_battleback2
  453.     update_enemies
  454.     update_actors
  455.     update_cp
  456.     update_pictures
  457.     update_timer
  458.     update_viewports
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ● 更新CP条
  462.   #--------------------------------------------------------------------------
  463.   def update_cp
  464.     for iii in $game_party.members + $game_troop.members
  465.       @icons[iii].x = 16 + 200 * iii.rtab_cp / @cp_quota
  466.       @icons[iii].visible = iii.alive?
  467.     end
  468.   end
  469. end
复制代码


范例图1.png
范例图2.png
回复

使用道具 举报

梦石
0
星屑
50
在线时间
616 小时
注册时间
2010-10-29
回帖
411
发表于 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, 下载次数: 118) (放在上面)
Ace_Battle_Engine.rb.zip (19.47 KB, 下载次数: 105) (放在下面)

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

LBQ Works
回复

使用道具 举报

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

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

使用道具 举报

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
回帖
12
 楼主| 发表于 2012-12-15 19:47:21 | 显示全部楼层
c248611 发表于 2012-12-15 18:39
#==============================================================================
# ■ CP制战斗系统 ...

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

使用道具 举报

梦石
0
星屑
166
在线时间
630 小时
注册时间
2012-6-9
回帖
1233
发表于 2012-12-17 12:13:28 | 显示全部楼层
游系风 发表于 2012-12-15 19:47
谢谢大神!就是这个效果!
弱弱的问一句,能改战斗头像吗?
我想让行动条上出现的是我方角色独有的小头像 ...

范例图1.png
范例图2.png

  1. #==============================================================================
  2. # ■ RMVA 战斗引擎 v1.00      汉化:帝府·司令
  3. #------------------------------------------------------------------------------
  4. #    适用于:RPG Maker VX Ace
  5. #    说明:把脚本放在Main的前面。
  6. #==============================================================================

  7. $imported = {} if $imported.nil?
  8. $imported["YEA-BattleEngine"] = true

  9. #-----------------------------------------------------------------------------
  10. # 调试工具——这些工具只在测试游戏。
  11. # 在战斗中,用的作弊码。调试工具
  12. #-----------------------------------------------------------------------------
  13. # - F5 -
  14. # 恢复所有的角色的HP和MP。
  15. #
  16. # - F6  -
  17. # 使所有角色得HP为1,MP,TP为0。
  18. #
  19. # - F7  -
  20. # 恢复所有角色的TP。
  21. #
  22. # - F8  -
  23. # 杀死所有的敌人在战斗。战斗很快结束。
  24. #-----------------------------------------------------------------------------

  25. module YEA
  26.   module BATTLE
  27.    
  28.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.     # - 一般战役设定 -
  30.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  31.     # These settings are adjusted for the overall battle system. These are
  32.     # various miscellaneous options to adjust. Each of the settings below will
  33.     # explain what they do. Change default enemy battle animations here, too.
  34.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  35.     BLINK_EFFECTS      = false  # Blink sprite when damaged?
  36.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  37.     SCREEN_SHAKE       = false  # Shake screen in battle?
  38.     SKIP_PARTY_COMMAND = false  # Skips the Fight/Escape menu.
  39.     AUTO_FAST          = true   # Causes message windows to not wait.
  40.     ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  41.    
  42.     # If this switch is ON, popups will be hidden. If OFF, the popups will be
  43.     # shown. If you do not wish to use this switch, set it to 0.
  44.     HIDE_POPUP_SWITCH  = 0
  45.    
  46.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  47.     # - Battle Status Window -
  48.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  49.     # This sets the default battle system your game will use. If your game
  50.     # doesn't have any other battle systems installed, it will use :dtb.
  51.     #
  52.     # Battle System        Requirement
  53.     #   :dtb               - Default Turn Battle. Default system.
  54.     #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  55.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.     DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  57.    
  58.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59.     # - Battle Status Window -
  60.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  61.     # Here, you can adjust the settings for the battle status window. The
  62.     # battle status window, by default, will show the actor's face, HP, MP, TP
  63.     # (if viable), and any inflicted status effects.
  64.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65.     BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  66.     BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
  67.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  68.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # Y Location buffer used for HP gauge.
  69.     BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  70.    
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     # - Help Window Text -
  73.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  74.     # When selecting a target to attack, this is the text that will be shown
  75.     # in place of a target's name for special cases. These special cases are
  76.     # for selections that were originally non-targetable battle scopes.
  77.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  78.     HELP_TEXT_ALL_FOES        = "All Foes"
  79.     HELP_TEXT_ONE_RANDOM_FOE  = "One Random Foe"
  80.     HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  81.     HELP_TEXT_ALL_ALLIES      = "All Allies"
  82.     HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  83.     HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  84.     HELP_TEXT_RANDOM_ALLIES   = "%d Random Allies"
  85.    
  86.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87.     # - Popup Settings -
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     # These settings will adjust the popups that appear in battle. Popups
  90.     # deliver information to your player as battlers deal damage, inflict
  91.     # status effects, and more.
  92.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  93.     ENABLE_POPUPS  = true     # Set this to false if you wish to disable them.
  94.     FLASH_CRITICAL = true     # Sets critical hits to flash.
  95.    
  96.     # This hash adjusts the popup settings that will govern how popups appear.
  97.     # Adjust them accordingly.
  98.     POPUP_SETTINGS ={
  99.       :offset     => -24,         # Height offset of a popup.
  100.       :fade       => 12,          # Fade rate for each popup.
  101.       :full       => 60,          # Frames before a popup fades.
  102.       :hp_dmg     => "-%s ",      # SprintF for HP damage.
  103.       :hp_heal    => "+%s ",      # SprintF for HP healing.
  104.       :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  105.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  106.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  107.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  108.       :drained    => "DRAIN",     # Text display for draining HP/MP.
  109.       :critical   => "CRITICAL!", # Text display for critical hit.
  110.       :missed     => "MISS",      # Text display for missed attack.
  111.       :evaded     => "EVADE!",    # Text display for evaded attack.
  112.       :nulled     => "NULL",      # Text display for nulled attack.
  113.       :failed     => "FAILED",    # Text display for a failed attack.
  114.       :add_state  => "+%s",      # SprintF for added states.
  115.       :rem_state  => "-%s",      # SprintF for removed states.
  116.       :dur_state  => "%s",        # SprintF for during states.
  117.       :ele_rates  => true,        # This will display elemental affinities.
  118.       :ele_wait   => 20,          # This is how many frames will wait.
  119.       :weakpoint  => "WEAKPOINT", # Appears if foe is weak to element.
  120.       :resistant  => "RESIST",    # Appears if foe is resistant to element.
  121.       :immune     => "IMMUNE",    # Appears if foe is immune to element.
  122.       :absorbed   => "ABSORB",    # Appears if foe can absorb the element.
  123.       :add_buff   => "%s+",      # Appears when a positive buff is applied.
  124.       :add_debuff => "%s-",      # Appears when a negative buff is applied.
  125.     } # Do not remove this.
  126.    
  127.     # This is the default font used for the popups. Adjust them accordingly
  128.     # or even add new ones.
  129.     DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  130.    
  131.     # The following are the various rules that govern the individual popup
  132.     # types that will appear. Adjust them accordingly. Here is a list of what
  133.     # each category does.
  134.     #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  135.     #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  136.     #   Sz       The font size used for the popup text.
  137.     #   Bold     Applying bold for the popup text.
  138.     #   Italic   Applying italic for the popup text.
  139.     #   Red      The red value of the popup text.
  140.     #   Grn      The green value of the popup text.
  141.     #   Blu      The blue value of the popup text.
  142.     #   Font     The font used for the popup text.
  143.     POPUP_RULES ={
  144.       # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  145.       "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  146.       "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  147.       "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  148.       "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  149.       "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  150.       "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  151.       "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  152.       "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  153.       "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  154.       "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  155.       "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  156.       "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  157.       "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  158.       "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  159.       "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  160.       "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  161.       "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  162.       "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  163.       "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  164.       "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  165.     } # Do not remove this.
  166.    
  167.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  168.     # - Streamlined Messages -
  169.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170.     # Want to remove some of those annoying messages that appear all the time?
  171.     # Now you can! Select which messages you want to enable or disable. Some of
  172.     # these messages will be rendered useless due to popups.
  173.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  174.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  175.     MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  176.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  177.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  178.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  179.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  180.     MSG_FAILURE_HIT    = false  # Show effect failed against target.
  181.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  182.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  183.     MSG_EVASION        = false  # Show attack was evaded by the target.
  184.     MSG_HP_DAMAGE      = false  # Show HP damage to target.
  185.     MSG_MP_DAMAGE      = false  # Show MP damage to target.
  186.     MSG_TP_DAMAGE      = false  # Show TP damage to target.
  187.     MSG_ADDED_STATES   = false  # Show target's added states.
  188.     MSG_REMOVED_STATES = false  # Show target's removed states.
  189.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  190.    
  191.   end # BATTLE
  192. end # YEA

  193. #==============================================================================
  194. # ▼ Editting anything past this point may potentially result in causing
  195. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  196. # halitosis so edit at your own risk.
  197. #==============================================================================

  198. module YEA
  199.   module REGEXP
  200.   module ENEMY
  201.    
  202.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  203.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  204.    
  205.   end # ENEMY
  206.   module USABLEITEM
  207.    
  208.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  209.    
  210.   end # USABLEITEM
  211.   module STATE
  212.    
  213.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  214.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  215.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  216.    
  217.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  218.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  219.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  220.    
  221.   end # STATE
  222.   end # REGEXP
  223. end # YEA

  224. #==============================================================================
  225. # ■ Switch
  226. #==============================================================================

  227. module Switch
  228.   
  229.   #--------------------------------------------------------------------------
  230.   # self.hide_popups
  231.   #--------------------------------------------------------------------------
  232.   def self.hide_popups
  233.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  234.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  235.   end
  236.   
  237. end # Switch

  238. #==============================================================================
  239. # ■ Colour
  240. #==============================================================================

  241. module Colour
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # self.text_colour
  245.   #--------------------------------------------------------------------------
  246.   def self.text_colour(index)
  247.     windowskin = Cache.system("Window")
  248.     x = 64 + (index % 8) * 8
  249.     y = 96 + (index / 8) * 8
  250.     return windowskin.get_pixel(x, y)
  251.   end
  252.   
  253. end # Colour

  254. #==============================================================================
  255. # ■ Icon
  256. #==============================================================================

  257. module Icon
  258.   
  259.   #--------------------------------------------------------------------------
  260.   # self.no_action
  261.   #--------------------------------------------------------------------------
  262.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  263.    
  264. end # Icon

  265. #==============================================================================
  266. # ■ Numeric
  267. #==============================================================================

  268. class Numeric
  269.   
  270.   #--------------------------------------------------------------------------
  271.   # new method: group_digits
  272.   #--------------------------------------------------------------------------
  273.   unless $imported["YEA-CoreEngine"]
  274.   def group; return self.to_s; end
  275.   end # $imported["YEA-CoreEngine"]
  276.    
  277. end # Numeric

  278. #==============================================================================
  279. # ■ DataManager
  280. #==============================================================================

  281. module DataManager
  282.   
  283.   #--------------------------------------------------------------------------
  284.   # alias method: load_database
  285.   #--------------------------------------------------------------------------
  286.   class <<self; alias load_database_abe load_database; end
  287.   def self.load_database
  288.     load_database_abe
  289.     load_notetags_abe
  290.   end
  291.   
  292.   #--------------------------------------------------------------------------
  293.   # new method: load_notetags_abe
  294.   #--------------------------------------------------------------------------
  295.   def self.load_notetags_abe
  296.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  297.     for group in groups
  298.       for obj in group
  299.         next if obj.nil?
  300.         obj.load_notetags_abe
  301.       end
  302.     end
  303.   end
  304.   
  305. end # DataManager

  306. #==============================================================================
  307. # ■ RPG::UsableItem
  308. #==============================================================================

  309. class RPG::UsableItem < RPG::BaseItem
  310.   
  311.   #--------------------------------------------------------------------------
  312.   # public instance variables
  313.   #--------------------------------------------------------------------------
  314.   attr_accessor :one_animation
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # common cache: load_notetags_abe
  318.   #--------------------------------------------------------------------------
  319.   def load_notetags_abe
  320.     @one_animation = false
  321.     #---
  322.     self.note.split(/[\r\n]+/).each { |line|
  323.       case line
  324.       #---
  325.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  326.         @one_animation = true
  327.       end
  328.     } # self.note.split
  329.     #---
  330.   end
  331.   
  332. end # RPG::UsableItem

  333. #==============================================================================
  334. # ■ RPG::Enemy
  335. #==============================================================================

  336. class RPG::Enemy < RPG::BaseItem
  337.   
  338.   #--------------------------------------------------------------------------
  339.   # public instance variables
  340.   #--------------------------------------------------------------------------
  341.   attr_accessor :atk_animation_id1
  342.   attr_accessor :atk_animation_id2
  343.   
  344.   #--------------------------------------------------------------------------
  345.   # common cache: load_notetags_abe
  346.   #--------------------------------------------------------------------------
  347.   def load_notetags_abe
  348.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  349.     @atk_animation_id2 = 0
  350.     #---
  351.     self.note.split(/[\r\n]+/).each { |line|
  352.       case line
  353.       #---
  354.       when YEA::REGEXP::ENEMY::ATK_ANI1
  355.         @atk_animation_id1 = $1.to_i
  356.       when YEA::REGEXP::ENEMY::ATK_ANI2
  357.         @atk_animation_id2 = $1.to_i
  358.       end
  359.     } # self.note.split
  360.     #---
  361.   end
  362.   
  363. end # RPG::Enemy

  364. #==============================================================================
  365. # ■ RPG::Enemy
  366. #==============================================================================

  367. class RPG::State < RPG::BaseItem
  368.   
  369.   #--------------------------------------------------------------------------
  370.   # public instance variables
  371.   #--------------------------------------------------------------------------
  372.   attr_accessor :popup_rules
  373.   
  374.   #--------------------------------------------------------------------------
  375.   # common cache: load_notetags_abe
  376.   #--------------------------------------------------------------------------
  377.   def load_notetags_abe
  378.     @popup_rules = {
  379.       :add_state => "ADDSTATE",
  380.       :rem_state => "REMSTATE",
  381.       :dur_state => nil
  382.     } # Do not remove this.
  383.     #---
  384.     self.note.split(/[\r\n]+/).each { |line|
  385.       case line
  386.       #---
  387.       when YEA::REGEXP::STATE::POPUP_ADD
  388.         @popup_rules[:add_state] = $1.upcase.to_s
  389.       when YEA::REGEXP::STATE::POPUP_REM
  390.         @popup_rules[:rem_state] = $1.upcase.to_s
  391.       when YEA::REGEXP::STATE::POPUP_DUR
  392.         @popup_rules[:dur_state] = $1.upcase.to_s
  393.       when YEA::REGEXP::STATE::HIDE_ADD
  394.         @popup_rules[:add_state] = nil
  395.       when YEA::REGEXP::STATE::HIDE_REM
  396.         @popup_rules[:rem_state] = nil
  397.       when YEA::REGEXP::STATE::HIDE_DUR
  398.         @popup_rules[:dur_state] = nil
  399.       end
  400.     } # self.note.split
  401.     #---
  402.   end
  403.   
  404. end # RPG::State

  405. #==============================================================================
  406. # ■ BattleManager
  407. #==============================================================================

  408. module BattleManager
  409.   
  410.   #--------------------------------------------------------------------------
  411.   # overwrite method: self.battle_start
  412.   #--------------------------------------------------------------------------
  413.   def self.battle_start
  414.     $game_system.battle_count += 1
  415.     $game_party.on_battle_start
  416.     $game_troop.on_battle_start
  417.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  418.     $game_troop.enemy_names.each do |name|
  419.       $game_message.add(sprintf(Vocab::Emerge, name))
  420.     end
  421.     if @preemptive
  422.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  423.     elsif @surprise
  424.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  425.     end
  426.     wait_for_message
  427.   end
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # overwrite method: make_action_orders
  431.   #--------------------------------------------------------------------------
  432.   def self.make_action_orders
  433.     make_dtb_action_orders if btype?(:dtb)
  434.   end
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # new method: make_dtb_action_orders
  438.   #--------------------------------------------------------------------------
  439.   def self.make_dtb_action_orders
  440.     @action_battlers = []
  441.     @action_battlers += $game_party.members unless @surprise
  442.     @action_battlers += $game_troop.members unless @preemptive
  443.     @action_battlers.each {|battler| battler.make_speed }
  444.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  445.   end
  446.   
  447.   #--------------------------------------------------------------------------
  448.   # overwrite method: turn_start
  449.   #--------------------------------------------------------------------------
  450.   def self.turn_start
  451.     @phase = :turn
  452.     clear_actor
  453.     $game_troop.increase_turn
  454.     @performed_battlers = []
  455.     make_action_orders
  456.   end
  457.   
  458.   #--------------------------------------------------------------------------
  459.   # overwrite method: next_subject
  460.   #--------------------------------------------------------------------------
  461.   def self.next_subject
  462.     @performed_battlers = [] if @performed_battlers.nil?
  463.     loop do
  464.       @action_battlers -= @performed_battlers
  465.       battler = @action_battlers.shift
  466.       return nil unless battler
  467.       next unless battler.index && battler.alive?
  468.       @performed_battlers.push(battler)
  469.       return battler
  470.     end
  471.   end
  472.   
  473.   #--------------------------------------------------------------------------
  474.   # new method: self.init_battle_type
  475.   #--------------------------------------------------------------------------
  476.   def self.init_battle_type
  477.     set_btype($game_system.battle_system)
  478.   end
  479.   
  480.   #--------------------------------------------------------------------------
  481.   # new method: self.set_btype
  482.   #--------------------------------------------------------------------------
  483.   def self.set_btype(btype = :dtb)
  484.     @battle_type = btype
  485.   end
  486.   
  487.   #--------------------------------------------------------------------------
  488.   # new method: self.btype?
  489.   #--------------------------------------------------------------------------
  490.   def self.btype?(btype)
  491.     return @battle_type == btype
  492.   end
  493.   
  494. end # BattleManager

  495. #==============================================================================
  496. # ■ Game_System
  497. #==============================================================================

  498. class Game_System
  499.   
  500.   #--------------------------------------------------------------------------
  501.   # new method: battle_system
  502.   #--------------------------------------------------------------------------
  503.   def battle_system
  504.     if @battle_system.nil?
  505.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  506.     else
  507.       return battle_system_corrected(@battle_system)
  508.     end
  509.   end
  510.   
  511.   #--------------------------------------------------------------------------
  512.   # new method: set_battle_system
  513.   #--------------------------------------------------------------------------
  514.   def set_battle_system(type)
  515.     case type
  516.     when :dtb; @battle_system = :dtb
  517.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  518.     else;      @battle_system = :dtb
  519.     end
  520.   end
  521.   
  522.   #--------------------------------------------------------------------------
  523.   # new method: battle_system_corrected
  524.   #--------------------------------------------------------------------------
  525.   def battle_system_corrected(type)
  526.     case type
  527.     when :dtb; return :dtb
  528.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  529.     else;      return :dtb
  530.     end
  531.   end
  532.   
  533. end # Game_System

  534. #==============================================================================
  535. # ■ Sprite_Base
  536. #==============================================================================

  537. class Sprite_Base < Sprite
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # new method: start_pseudo_animation
  541.   #--------------------------------------------------------------------------
  542.   unless $imported["YEA-CoreEngine"]
  543.   def start_pseudo_animation(animation, mirror = false)
  544.     dispose_animation
  545.     @animation = animation
  546.     return if @animation.nil?
  547.     @ani_mirror = mirror
  548.     set_animation_rate
  549.     @ani_duration = @animation.frame_max * @ani_rate + 1
  550.     @ani_sprites = []
  551.   end
  552.   end # $imported["YEA-CoreEngine"]
  553.   
  554. end # Sprite_Base

  555. #==============================================================================
  556. # ■ Sprite_Battler
  557. #==============================================================================

  558. class Sprite_Battler < Sprite_Base
  559.   
  560.   #--------------------------------------------------------------------------
  561.   # public instance variables
  562.   #--------------------------------------------------------------------------
  563.   attr_accessor :effect_type
  564.   attr_accessor :battler_visible
  565.   attr_accessor :popups
  566.   
  567.   #--------------------------------------------------------------------------
  568.   # alias method: initialize
  569.   #--------------------------------------------------------------------------
  570.   alias sprite_battler_initialize_abe initialize
  571.   def initialize(viewport, battler = nil)
  572.     sprite_battler_initialize_abe(viewport, battler)
  573.     @popups = []
  574.     @popup_flags = []
  575.   end
  576.   
  577.   #--------------------------------------------------------------------------
  578.   # alias method: update_bitmap
  579.   #--------------------------------------------------------------------------
  580.   alias sprite_battler_update_bitmap_abe update_bitmap
  581.   def update_bitmap
  582.     return if @battler.actor? && @battler.battler_name == ""
  583.     sprite_battler_update_bitmap_abe
  584.   end
  585.   
  586.   #--------------------------------------------------------------------------
  587.   # alias method: setup_new_animation
  588.   #--------------------------------------------------------------------------
  589.   unless $imported["YEA-CoreEngine"]
  590.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  591.   def setup_new_animation
  592.     sprite_battler_setup_new_animation_abe
  593.     return if @battler.pseudo_ani_id <= 0
  594.     animation = $data_animations[@battler.pseudo_ani_id]
  595.     mirror = @battler.animation_mirror
  596.     start_pseudo_animation(animation, mirror)
  597.     @battler.pseudo_ani_id = 0
  598.   end
  599.   end # $imported["YEA-CoreEngine"]
  600.   
  601.   #--------------------------------------------------------------------------
  602.   # alias method: setup_new_effect
  603.   #--------------------------------------------------------------------------
  604.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  605.   def setup_new_effect
  606.     sprite_battler_setup_new_effect_abe
  607.     setup_popups
  608.   end
  609.   
  610.   #--------------------------------------------------------------------------
  611.   # new method: setup_popups
  612.   #--------------------------------------------------------------------------
  613.   def setup_popups
  614.     return unless @battler.use_sprite?
  615.     @battler.popups = [] if @battler.popups.nil?
  616.     return if @battler.popups == []
  617.     array = @battler.popups.shift
  618.     create_new_popup(array[0], array[1], array[2])
  619.   end
  620.   
  621.   #--------------------------------------------------------------------------
  622.   # new method: create_new_popup
  623.   #--------------------------------------------------------------------------
  624.   def create_new_popup(value, rules, flags)
  625.     return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  626.     return if flags & @popup_flags != []
  627.     array = YEA::BATTLE::POPUP_RULES[rules]
  628.     for popup in @popups
  629.       popup.y -= 24
  630.     end
  631.     return unless SceneManager.scene.is_a?(Scene_Battle)
  632.     return if SceneManager.scene.spriteset.nil?
  633.     view = SceneManager.scene.spriteset.viewportPopups
  634.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  635.     @popups.push(new_popup)
  636.     @popup_flags.push("weakness") if flags.include?("weakness")
  637.     @popup_flags.push("resistant") if flags.include?("resistant")
  638.     @popup_flags.push("immune") if flags.include?("immune")
  639.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  640.   end
  641.   
  642.   #--------------------------------------------------------------------------
  643.   # alias method: update_effect
  644.   #--------------------------------------------------------------------------
  645.   alias sprite_battler_update_effect_abe update_effect
  646.   def update_effect
  647.     sprite_battler_update_effect_abe
  648.     update_popups
  649.   end
  650.   
  651.   #--------------------------------------------------------------------------
  652.   # new method: update_popups
  653.   #--------------------------------------------------------------------------
  654.   def update_popups
  655.     for popup in @popups
  656.       popup.update
  657.       next unless popup.opacity <= 0
  658.       popup.bitmap.dispose
  659.       popup.dispose
  660.       @popups.delete(popup)
  661.       popup = nil
  662.     end
  663.     @popup_flags = [] if @popups == [] && @popup_flags != []
  664.     return unless SceneManager.scene_is?(Scene_Battle)
  665.     if @current_active_battler != SceneManager.scene.subject
  666.       @current_active_battler = SceneManager.scene.subject
  667.       @popup_flags = []
  668.     end
  669.   end
  670.   
  671. end # Sprite_Battler

  672. #==============================================================================
  673. # ■ Sprite_Popup
  674. #==============================================================================

  675. class Sprite_Popup < Sprite_Base
  676.   
  677.   #--------------------------------------------------------------------------
  678.   # public instance variables
  679.   #--------------------------------------------------------------------------
  680.   attr_accessor :flags
  681.   
  682.   #--------------------------------------------------------------------------
  683.   # initialize
  684.   #--------------------------------------------------------------------------
  685.   def initialize(viewport, battler, value, rules, flags)
  686.     super(viewport)
  687.     @value = value
  688.     @rules = rules
  689.     @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  690.     [url=home.php?mod=space&uid=274289]@fade[/url] = YEA::BATTLE::POPUP_SETTINGS[:fade]
  691.     @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  692.     @flags = flags
  693.     @battler = battler
  694.     create_popup_bitmap
  695.   end
  696.   
  697.   #--------------------------------------------------------------------------
  698.   # create_popup_bitmap
  699.   #--------------------------------------------------------------------------
  700.   def create_popup_bitmap
  701.     rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  702.     bw = Graphics.width
  703.     bw += 48 if @flags.include?("state")
  704.     bh = Font.default_size * 3
  705.     bitmap = Bitmap.new(bw, bh)
  706.     bitmap.font.name = rules_array[8]
  707.     size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  708.     bitmap.font.size = size
  709.     bitmap.font.bold = rules_array[3]
  710.     bitmap.font.italic = rules_array[4]
  711.     if flags.include?("critical")
  712.       crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  713.       bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  714.     else
  715.       bitmap.font.out_color.set(0, 0, 0, 255)
  716.     end
  717.     dx = 0; dy = 0; dw = 0
  718.     dx += 24 if @flags.include?("state")
  719.     dw += 24 if @flags.include?("state")
  720.     if @flags.include?("state") || @flags.include?("buff")
  721.       c_width = bitmap.text_size(@value).width
  722.       icon_bitmap = $game_temp.iconset
  723.       icon_index = flag_state_icon
  724.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  725.       bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  726.     end
  727.     bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  728.     bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  729.     self.bitmap = bitmap
  730.     self.x = @battler.screen_x
  731.     self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  732.     self.x -= SceneManager.scene.spriteset.viewport1.ox
  733.     self.y = @battler.screen_y - @battler.sprite.oy/2
  734.     self.y -= @battler.sprite.oy/2 if @battler.actor?
  735.     self.y -= SceneManager.scene.spriteset.viewport1.oy
  736.     self.ox = bw/2; self.oy = bh/2
  737.     self.zoom_x = self.zoom_y = rules_array[0]
  738.     if @flags.include?("no zoom")
  739.       self.zoom_x = self.zoom_y = rules_array[1]
  740.     end
  741.     @target_zoom = rules_array[1]
  742.     @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  743.     self.z = 500
  744.   end
  745.   
  746.   #--------------------------------------------------------------------------
  747.   # update
  748.   #--------------------------------------------------------------------------
  749.   def update
  750.     super
  751.     #---
  752.     if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  753.       @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  754.       @hue_duration -= 1
  755.       self.bitmap.hue_change(15) if @hue_duration <= 0
  756.     end
  757.     #---
  758.     if @zoom_direction == "up"
  759.       self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  760.       self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  761.     else
  762.       self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  763.       self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  764.     end
  765.     #---
  766.     @full -= 1
  767.     return if @full > 0
  768.     self.y -= 1
  769.     self.opacity -= @fade
  770.   end
  771.   
  772.   #--------------------------------------------------------------------------
  773.   # flag_state_icon
  774.   #--------------------------------------------------------------------------
  775.   def flag_state_icon
  776.     for item in @flags; return item if item.is_a?(Integer); end
  777.     return 0
  778.   end
  779.   
  780. end # Sprite_Popup

  781. #==============================================================================
  782. # ■ Spriteset_Battle
  783. #==============================================================================

  784. class Spriteset_Battle
  785.   
  786.   #--------------------------------------------------------------------------
  787.   # public instance variables
  788.   #--------------------------------------------------------------------------
  789.   attr_accessor :actor_sprites
  790.   attr_accessor :enemy_sprites
  791.   attr_accessor :viewport1
  792.   attr_accessor :viewportPopups
  793.   
  794.   #--------------------------------------------------------------------------
  795.   # alias method: create_viewports
  796.   #--------------------------------------------------------------------------
  797.   alias spriteset_battle_create_viewports_abe create_viewports
  798.   def create_viewports
  799.     spriteset_battle_create_viewports_abe
  800.     @viewportPopups = Viewport.new
  801.     @viewportPopups.z = 200
  802.   end
  803.   
  804.   #--------------------------------------------------------------------------
  805.   # alias method: dispose_viewports
  806.   #--------------------------------------------------------------------------
  807.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  808.   def dispose_viewports
  809.     spriteset_battle_dispose_viewports_abe
  810.     @viewportPopups.dispose
  811.   end
  812.   
  813.   #--------------------------------------------------------------------------
  814.   # alias method: update_viewports
  815.   #--------------------------------------------------------------------------
  816.   alias spriteset_battle_update_viewports_abe update_viewports
  817.   def update_viewports
  818.     spriteset_battle_update_viewports_abe
  819.     @viewportPopups.update
  820.   end
  821.   
  822. end # Spriteset_Battle

  823. #==============================================================================
  824. # ■ Game_Temp
  825. #==============================================================================

  826. class Game_Temp
  827.   
  828.   #--------------------------------------------------------------------------
  829.   # public instance variables
  830.   #--------------------------------------------------------------------------
  831.   attr_accessor :battle_aid
  832.   attr_accessor :evaluating
  833.   attr_accessor :iconset
  834.   
  835.   #--------------------------------------------------------------------------
  836.   # alias method: initialize
  837.   #--------------------------------------------------------------------------
  838.   alias game_temp_initialize_abe initialize
  839.   def initialize
  840.     game_temp_initialize_abe
  841.     @iconset = Cache.system("Iconset")
  842.   end
  843.   
  844. end # Game_Temp

  845. #==============================================================================
  846. # ■ Game_Action
  847. #==============================================================================

  848. class Game_Action
  849.   
  850.   #--------------------------------------------------------------------------
  851.   # overwrite method: speed
  852.   #--------------------------------------------------------------------------
  853.   def speed
  854.     speed = subject.agi
  855.     speed += item.speed if item
  856.     speed += subject.atk_speed if attack?
  857.     return speed
  858.   end
  859.   
  860.   #--------------------------------------------------------------------------
  861.   # alias method: evaluate_item_with_target
  862.   #--------------------------------------------------------------------------
  863.   alias evaluate_item_with_target_abe evaluate_item_with_target
  864.   def evaluate_item_with_target(target)
  865.     $game_temp.evaluating = true
  866.     result = evaluate_item_with_target_abe(target)
  867.     $game_temp.evaluating = false
  868.     return result
  869.   end
  870.   
  871. end # Game_Action

  872. #==============================================================================
  873. # ■ Game_ActionResult
  874. #==============================================================================

  875. class Game_ActionResult
  876.   
  877.   #--------------------------------------------------------------------------
  878.   # alias method: clear
  879.   #--------------------------------------------------------------------------
  880.   alias game_actionresult_clear_abe clear
  881.   def clear
  882.     game_actionresult_clear_abe
  883.     clear_stored_damage
  884.   end
  885.   
  886.   #--------------------------------------------------------------------------
  887.   # new method: clear_stored_damage
  888.   #--------------------------------------------------------------------------
  889.   def clear_stored_damage
  890.     @stored_hp_damage = 0
  891.     @stored_mp_damage = 0
  892.     @stored_tp_damage = 0
  893.     @stored_hp_drain = 0
  894.     @stored_mp_drain = 0
  895.   end
  896.   
  897.   #--------------------------------------------------------------------------
  898.   # new method: store_damage
  899.   #--------------------------------------------------------------------------
  900.   def store_damage
  901.     @stored_hp_damage += @hp_damage
  902.     @stored_mp_damage += @mp_damage
  903.     @stored_tp_damage += @tp_damage
  904.     @stored_hp_drain += @hp_drain
  905.     @stored_mp_drain += @mp_drain
  906.   end
  907.   
  908.   #--------------------------------------------------------------------------
  909.   # new method: restore_damage
  910.   #--------------------------------------------------------------------------
  911.   def restore_damage
  912.     @hp_damage = @stored_hp_damage
  913.     @mp_damage = @stored_mp_damage
  914.     @tp_damage = @stored_tp_damage
  915.     @hp_drain = @stored_hp_drain
  916.     @mp_drain = @stored_mp_drain
  917.     clear_stored_damage
  918.   end
  919.   
  920. end # Game_ActionResult

  921. #==============================================================================
  922. # ■ Game_BattlerBase
  923. #==============================================================================

  924. class Game_BattlerBase
  925.   
  926.   #--------------------------------------------------------------------------
  927.   # public instance variables
  928.   #--------------------------------------------------------------------------
  929.   attr_accessor :popups
  930.   
  931.   #--------------------------------------------------------------------------
  932.   # new method: create_popup
  933.   #--------------------------------------------------------------------------
  934.   def create_popup(value, rules = "DEFAULT", flags = [])
  935.     return unless SceneManager.scene_is?(Scene_Battle)
  936.     return unless YEA::BATTLE::ENABLE_POPUPS
  937.     return if Switch.hide_popups
  938.     @popups = [] if @popups.nil?
  939.     @popups.push([value, rules, flags])
  940.   end
  941.   
  942.   #--------------------------------------------------------------------------
  943.   # new method: make_damage_popups
  944.   #--------------------------------------------------------------------------
  945.   def make_damage_popups(user)
  946.     if @result.hp_drain != 0
  947.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  948.       rules = "DRAIN"
  949.       user.create_popup(text, rules)
  950.       setting = :hp_dmg  if @result.hp_drain < 0
  951.       setting = :hp_heal if @result.hp_drain > 0
  952.       rules = "HP_DMG"   if @result.hp_drain < 0
  953.       rules = "HP_HEAL"  if @result.hp_drain > 0
  954.       value = @result.hp_drain.abs
  955.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  956.       user.create_popup(text, rules)
  957.     end
  958.     if @result.mp_drain != 0
  959.       text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  960.       rules = "DRAIN"
  961.       user.create_popup(text, rules)
  962.       setting = :mp_dmg  if @result.mp_drain < 0
  963.       setting = :mp_heal if @result.mp_drain > 0
  964.       rules = "HP_DMG"   if @result.mp_drain < 0
  965.       rules = "HP_HEAL"  if @result.mp_drain > 0
  966.       value = @result.mp_drain.abs
  967.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  968.       user.create_popup(text, rules)
  969.     end
  970.     #---
  971.     flags = []
  972.     flags.push("critical") if @result.critical
  973.     if @result.hp_damage != 0
  974.       setting = :hp_dmg  if @result.hp_damage > 0
  975.       setting = :hp_heal if @result.hp_damage < 0
  976.       rules = "HP_DMG"   if @result.hp_damage > 0
  977.       rules = "HP_HEAL"  if @result.hp_damage < 0
  978.       value = @result.hp_damage.abs
  979.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  980.       create_popup(text, rules, flags)
  981.     end
  982.     if @result.mp_damage != 0
  983.       setting = :mp_dmg  if @result.mp_damage > 0
  984.       setting = :mp_heal if @result.mp_damage < 0
  985.       rules = "MP_DMG"   if @result.mp_damage > 0
  986.       rules = "MP_HEAL"  if @result.mp_damage < 0
  987.       value = @result.mp_damage.abs
  988.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  989.       create_popup(text, rules, flags)
  990.     end
  991.     if @result.tp_damage != 0
  992.       setting = :tp_dmg  if @result.tp_damage > 0
  993.       setting = :tp_heal if @result.tp_damage < 0
  994.       rules = "TP_DMG"   if @result.tp_damage > 0
  995.       rules = "TP_HEAL"  if @result.tp_damage < 0
  996.       value = @result.tp_damage.abs
  997.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  998.       create_popup(text, rules)
  999.     end
  1000.     @result.store_damage
  1001.     @result.clear_damage_values
  1002.   end
  1003.   
  1004.   #--------------------------------------------------------------------------
  1005.   # alias method: erase_state
  1006.   #--------------------------------------------------------------------------
  1007.   alias game_battlerbase_erase_state_abe erase_state
  1008.   def erase_state(state_id)
  1009.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1010.     game_battlerbase_erase_state_abe(state_id)
  1011.   end
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # new method: make_during_state_popup
  1015.   #--------------------------------------------------------------------------
  1016.   def make_during_state_popup
  1017.     state_id = most_important_state_id
  1018.     return if state_id == 0
  1019.     make_state_popup(state_id, :dur_state)
  1020.   end
  1021.   
  1022.   #--------------------------------------------------------------------------
  1023.   # new method: most_important_state_id
  1024.   #--------------------------------------------------------------------------
  1025.   def most_important_state_id
  1026.     states.each {|state| return state.id unless state.message3.empty? }
  1027.     return 0
  1028.   end
  1029.   
  1030.   #--------------------------------------------------------------------------
  1031.   # new method: make_state_popup
  1032.   #--------------------------------------------------------------------------
  1033.   def make_state_popup(state_id, type)
  1034.     state = $data_states[state_id]
  1035.     return if state.icon_index == 0
  1036.     rules = state.popup_rules[type]
  1037.     return if rules.nil?
  1038.     text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1039.     flags = ["state", state.icon_index]
  1040.     create_popup(text, rules, flags)
  1041.   end
  1042.   
  1043.   #--------------------------------------------------------------------------
  1044.   # new method: make_miss_popups
  1045.   #--------------------------------------------------------------------------
  1046.   def make_miss_popups(user, item)
  1047.     return if dead?
  1048.     if @result.missed
  1049.       text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1050.       rules = "DEFAULT"
  1051.       create_popup(text, rules)
  1052.     end
  1053.     if @result.evaded
  1054.       text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1055.       rules = "DEFAULT"
  1056.       create_popup(text, rules)
  1057.     end
  1058.     if @result.hit? && !@result.success
  1059.       text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1060.       rules = "DEFAULT"
  1061.       create_popup(text, rules)
  1062.     end
  1063.     if @result.hit? && item.damage.to_hp?
  1064.       if @result.hp_damage == 0 && @result.hp_damage == 0
  1065.         text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1066.         rules = "DEFAULT"
  1067.         create_popup(text, rules)
  1068.       end
  1069.     end
  1070.   end
  1071.   
  1072.   #--------------------------------------------------------------------------
  1073.   # new method: make_rate_popup
  1074.   #--------------------------------------------------------------------------
  1075.   def make_rate_popup(rate)
  1076.     return if rate == 1.0
  1077.     flags = []
  1078.     if rate > 1.0
  1079.       text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1080.       rules = "WEAK_ELE"
  1081.       flags.push("weakness")
  1082.     elsif rate == 0.0
  1083.       text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1084.       rules = "IMMU_ELE"
  1085.       flags.push("immune")
  1086.     elsif rate < 0.0
  1087.       text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1088.       rules = "ABSB_ELE"
  1089.       flags.push("absorbed")
  1090.     else
  1091.       text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1092.       rules = "REST_ELE"
  1093.       flags.push("resistant")
  1094.     end
  1095.     create_popup(text, rules, flags)
  1096.   end
  1097.   
  1098.   #--------------------------------------------------------------------------
  1099.   # new method: make_buff_popup
  1100.   #--------------------------------------------------------------------------
  1101.   def make_buff_popup(param_id, positive = true)
  1102.     return unless SceneManager.scene_is?(Scene_Battle)
  1103.     return unless alive?
  1104.     name = Vocab::param(param_id)
  1105.     if positive
  1106.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1107.       rules = "BUFF"
  1108.       buff_level = 1
  1109.     else
  1110.       text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1111.       rules = "DEBUFF"
  1112.       buff_level = -1
  1113.     end
  1114.     icon = buff_icon_index(buff_level, param_id)
  1115.     flags = ["buff", icon]
  1116.     return if @popups.include?([text, rules, flags])
  1117.     create_popup(text, rules, flags)
  1118.   end
  1119.   
  1120. end # Game_BattlerBase

  1121. #==============================================================================
  1122. # ■ Game_Battler
  1123. #==============================================================================

  1124. class Game_Battler < Game_BattlerBase
  1125.   
  1126.   #--------------------------------------------------------------------------
  1127.   # public instance variables
  1128.   #--------------------------------------------------------------------------
  1129.   attr_accessor :pseudo_ani_id
  1130.   
  1131.   #--------------------------------------------------------------------------
  1132.   # alias method: on_battle_end
  1133.   #--------------------------------------------------------------------------
  1134.   alias game_battler_on_battle_end_abe on_battle_end
  1135.   def on_battle_end
  1136.     game_battler_on_battle_end_abe
  1137.     @popups = []
  1138.   end
  1139.   
  1140.   #--------------------------------------------------------------------------
  1141.   # alias method: clear_sprite_effects
  1142.   #--------------------------------------------------------------------------
  1143.   alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1144.   def clear_sprite_effects
  1145.     game_battler_clear_sprite_effects_abe
  1146.     @pseudo_ani_id = 0
  1147.   end
  1148.   
  1149.   #--------------------------------------------------------------------------
  1150.   # alias method: item_apply
  1151.   #--------------------------------------------------------------------------
  1152.   alias game_battler_item_apply_abe item_apply
  1153.   def item_apply(user, item)
  1154.     game_battler_item_apply_abe(user, item)
  1155.     make_miss_popups(user, item)
  1156.   end
  1157.   
  1158.   #--------------------------------------------------------------------------
  1159.   # alias method: make_damage_value
  1160.   #--------------------------------------------------------------------------
  1161.   alias game_battler_make_damage_value_abe make_damage_value
  1162.   def make_damage_value(user, item)
  1163.     game_battler_make_damage_value_abe(user, item)
  1164.     rate = item_element_rate(user, item)
  1165.     make_rate_popup(rate) unless $game_temp.evaluating
  1166.   end
  1167.   
  1168.   #--------------------------------------------------------------------------
  1169.   # alias method: execute_damage
  1170.   #--------------------------------------------------------------------------
  1171.   alias game_battler_execute_damage_abe execute_damage
  1172.   def execute_damage(user)
  1173.     game_battler_execute_damage_abe(user)
  1174.     make_damage_popups(user)
  1175.   end
  1176.   
  1177.   #--------------------------------------------------------------------------
  1178.   # alias method: item_effect_recover_hp
  1179.   #--------------------------------------------------------------------------
  1180.   alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1181.   def item_effect_recover_hp(user, item, effect)
  1182.     game_battler_item_effect_recover_hp_abe(user, item, effect)
  1183.     make_damage_popups(user)
  1184.   end
  1185.   
  1186.   #--------------------------------------------------------------------------
  1187.   # alias method: item_effect_recover_mp
  1188.   #--------------------------------------------------------------------------
  1189.   alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1190.   def item_effect_recover_mp(user, item, effect)
  1191.     game_battler_item_effect_recover_mp_abe(user, item, effect)
  1192.     make_damage_popups(user)
  1193.   end
  1194.   
  1195.   #--------------------------------------------------------------------------
  1196.   # alias method: item_effect_gain_tp
  1197.   #--------------------------------------------------------------------------
  1198.   alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1199.   def item_effect_gain_tp(user, item, effect)
  1200.     game_battler_item_effect_gain_tp_abe(user, item, effect)
  1201.     make_damage_popups(user)
  1202.   end
  1203.   
  1204.   #--------------------------------------------------------------------------
  1205.   # alias method: item_user_effect
  1206.   #--------------------------------------------------------------------------
  1207.   alias game_battler_item_user_effect_abe item_user_effect
  1208.   def item_user_effect(user, item)
  1209.     game_battler_item_user_effect_abe(user, item)
  1210.     @result.restore_damage
  1211.   end
  1212.   
  1213.   #--------------------------------------------------------------------------
  1214.   # alias method: add_new_state
  1215.   #--------------------------------------------------------------------------
  1216.   alias game_battler_add_new_state_abe add_new_state
  1217.   def add_new_state(state_id)
  1218.     game_battler_add_new_state_abe(state_id)
  1219.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  1220.   end
  1221.   
  1222.   #--------------------------------------------------------------------------
  1223.   # alias method: add_buff
  1224.   #--------------------------------------------------------------------------
  1225.   alias game_battler_add_buff_abe add_buff
  1226.   def add_buff(param_id, turns)
  1227.     make_buff_popup(param_id, true)
  1228.     game_battler_add_buff_abe(param_id, turns)
  1229.   end
  1230.   
  1231.   #--------------------------------------------------------------------------
  1232.   # alias method: add_debuff
  1233.   #--------------------------------------------------------------------------
  1234.   alias game_battler_add_debuff_abe add_debuff
  1235.   def add_debuff(param_id, turns)
  1236.     make_buff_popup(param_id, false)
  1237.     game_battler_add_debuff_abe(param_id, turns)
  1238.   end
  1239.   
  1240.   #--------------------------------------------------------------------------
  1241.   # alias method: regenerate_all
  1242.   #--------------------------------------------------------------------------
  1243.   alias game_battler_regenerate_all_abe regenerate_all
  1244.   def regenerate_all
  1245.     game_battler_regenerate_all_abe
  1246.     return unless alive?
  1247.     make_damage_popups(self)
  1248.   end
  1249.   
  1250.   #--------------------------------------------------------------------------
  1251.   # new method: can_collapse?
  1252.   #--------------------------------------------------------------------------
  1253.   def can_collapse?
  1254.     return false unless dead?
  1255.     unless actor?
  1256.       return false unless sprite.battler_visible
  1257.       array = [:collapse, :boss_collapse, :instant_collapse]
  1258.       return false if array.include?(sprite.effect_type)
  1259.     end
  1260.     return true
  1261.   end
  1262.   
  1263.   #--------------------------------------------------------------------------
  1264.   # new method: draw_mp?
  1265.   #--------------------------------------------------------------------------
  1266.   def draw_mp?; return true; end
  1267.   
  1268.   #--------------------------------------------------------------------------
  1269.   # new method: draw_tp?
  1270.   #--------------------------------------------------------------------------
  1271.   def draw_tp?
  1272.     return $data_system.opt_display_tp
  1273.   end
  1274.   
  1275. end # Game_Battler

  1276. #==============================================================================
  1277. # ■ Game_Actor
  1278. #==============================================================================

  1279. class Game_Actor < Game_Battler
  1280.   
  1281.   #--------------------------------------------------------------------------
  1282.   # overwrite method: perform_damage_effect
  1283.   #--------------------------------------------------------------------------
  1284.   def perform_damage_effect
  1285.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1286.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1287.     Sound.play_actor_damage
  1288.   end
  1289.   
  1290.   #--------------------------------------------------------------------------
  1291.   # overwrite method: use_sprite?
  1292.   #--------------------------------------------------------------------------
  1293.   def use_sprite?; return true; end
  1294.    
  1295.   #--------------------------------------------------------------------------
  1296.   # new method: screen_x
  1297.   #--------------------------------------------------------------------------
  1298.   def screen_x
  1299.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1300.     status_window = SceneManager.scene.status_window
  1301.     return 0 if status_window.nil?
  1302.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1303.     ext = SceneManager.scene.info_viewport.ox
  1304.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1305.     constant = 128 + 12
  1306.     return constant + rect.x + item_rect_width / 2 - ext
  1307.   end
  1308.   
  1309.   #--------------------------------------------------------------------------
  1310.   # new method: screen_y
  1311.   #--------------------------------------------------------------------------
  1312.   def screen_y
  1313.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1314.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1315.     return Graphics.height - 120
  1316.   end
  1317.   
  1318.   #--------------------------------------------------------------------------
  1319.   # new method: screen_z
  1320.   #--------------------------------------------------------------------------
  1321.   def screen_z; return 100; end
  1322.   
  1323.   #--------------------------------------------------------------------------
  1324.   # new method: sprite
  1325.   #--------------------------------------------------------------------------
  1326.   def sprite
  1327.     index = $game_party.battle_members.index(self)
  1328.     return SceneManager.scene.spriteset.actor_sprites[index]
  1329.   end
  1330.   
  1331.   #--------------------------------------------------------------------------
  1332.   # new method: draw_mp?
  1333.   #--------------------------------------------------------------------------
  1334.   def draw_mp?
  1335.     return true unless draw_tp?
  1336.     for skill in skills
  1337.       next unless added_skill_types.include?(skill.stype_id)
  1338.       return true if skill.mp_cost > 0
  1339.     end
  1340.     return false
  1341.   end
  1342.   
  1343.   #--------------------------------------------------------------------------
  1344.   # new method: draw_tp?
  1345.   #--------------------------------------------------------------------------
  1346.   def draw_tp?
  1347.     return false unless $data_system.opt_display_tp
  1348.     for skill in skills
  1349.       next unless added_skill_types.include?(skill.stype_id)
  1350.       return true if skill.tp_cost > 0
  1351.     end
  1352.     return false
  1353.   end
  1354.   
  1355. end # Game_Actor

  1356. #==============================================================================
  1357. # ■ Game_Enemy
  1358. #==============================================================================

  1359. class Game_Enemy < Game_Battler
  1360.   
  1361.   #--------------------------------------------------------------------------
  1362.   # overwrite method: perform_damage_effect
  1363.   #--------------------------------------------------------------------------
  1364.   def perform_damage_effect
  1365.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1366.     Sound.play_enemy_damage
  1367.   end
  1368.   
  1369.   #--------------------------------------------------------------------------
  1370.   # new methods: attack_animation_id
  1371.   #--------------------------------------------------------------------------
  1372.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1373.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1374.   
  1375.   #--------------------------------------------------------------------------
  1376.   # new method: sprite
  1377.   #--------------------------------------------------------------------------
  1378.   def sprite
  1379.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1380.   end
  1381.   
  1382. end # Game_Enemy

  1383. #==============================================================================
  1384. # ■ Game_Unit
  1385. #==============================================================================

  1386. class Game_Unit
  1387.   
  1388.   #--------------------------------------------------------------------------
  1389.   # alias method: make_actions
  1390.   #--------------------------------------------------------------------------
  1391.   alias game_unit_make_actions_abe make_actions
  1392.   def make_actions
  1393.     game_unit_make_actions_abe
  1394.     refresh_autobattler_status_window
  1395.   end
  1396.   
  1397.   #--------------------------------------------------------------------------
  1398.   # new method: refresh_autobattler_status_window
  1399.   #--------------------------------------------------------------------------
  1400.   def refresh_autobattler_status_window
  1401.     return unless SceneManager.scene_is?(Scene_Battle)
  1402.     return unless self.is_a?(Game_Party)
  1403.     SceneManager.scene.refresh_autobattler_status_window
  1404.   end
  1405.   
  1406. end # Game_Unit





  1407. #==============================================================================
  1408. # ■ Window_BattleStatus
  1409. #==============================================================================

  1410. class Window_BattleStatus < Window_Selectable
  1411.   
  1412.   #--------------------------------------------------------------------------
  1413.   # overwrite method: initialize
  1414.   #--------------------------------------------------------------------------
  1415.   def initialize
  1416.     super(0, 0, window_width, window_height)
  1417.     self.openness = 0
  1418.     @party = $game_party.battle_members.clone
  1419.   end
  1420.   
  1421.   #--------------------------------------------------------------------------
  1422.   # overwrite method: col_max
  1423.   #--------------------------------------------------------------------------
  1424.   def col_max; return $game_party.max_battle_members; end
  1425.   
  1426.   #--------------------------------------------------------------------------
  1427.   # new method: battle_members
  1428.   #--------------------------------------------------------------------------
  1429.   def battle_members; return $game_party.battle_members; end
  1430.   
  1431.   #--------------------------------------------------------------------------
  1432.   # new method: actor
  1433.   #--------------------------------------------------------------------------
  1434.   def actor; return battle_members[@index]; end
  1435.   
  1436.   #--------------------------------------------------------------------------
  1437.   # overwrite method: update
  1438.   #--------------------------------------------------------------------------
  1439.   def update
  1440.     super
  1441.     return if @party == $game_party.battle_members
  1442.     @party = $game_party.battle_members.clone
  1443.     refresh
  1444.   end
  1445.   
  1446.   #--------------------------------------------------------------------------
  1447.   # overwrite method: draw_item
  1448.   #--------------------------------------------------------------------------
  1449.   def draw_item(index)
  1450.     return if index.nil?
  1451.     clear_item(index)
  1452.     actor = battle_members[index]
  1453.     rect = item_rect(index)
  1454.     return if actor.nil?
  1455.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  1456.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  1457.     draw_actor_action(actor, rect.x, rect.y)
  1458.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  1459.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  1460.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  1461.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  1462.     if draw_tp?(actor) && draw_mp?(actor)
  1463.       dw = rect.width/2-2
  1464.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  1465.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  1466.       dw = rect.width - rect.width/2 - 2
  1467.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  1468.     elsif draw_tp?(actor) && !draw_mp?(actor)
  1469.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  1470.     else
  1471.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  1472.     end
  1473.   end
  1474.   
  1475.   #--------------------------------------------------------------------------
  1476.   # overwrite method: item_rect
  1477.   #--------------------------------------------------------------------------
  1478.   def item_rect(index)
  1479.     rect = Rect.new
  1480.     rect.width = contents.width / $game_party.max_battle_members
  1481.     rect.height = contents.height
  1482.     rect.x = index * rect.width
  1483.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  1484.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  1485.     end
  1486.     rect.y = 0
  1487.     return rect
  1488.   end
  1489.   
  1490.   #--------------------------------------------------------------------------
  1491.   # overwrite method: draw_face
  1492.   #--------------------------------------------------------------------------
  1493.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  1494.     bitmap = Cache.face(face_name)
  1495.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  1496.     fy = face_index / 4 * 96 + 2
  1497.     fw = [item_rect(0).width - 4, 92].min
  1498.     rect = Rect.new(fx, fy, fw, 92)
  1499.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  1500.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  1501.     bitmap.dispose
  1502.   end
  1503.   
  1504.   #--------------------------------------------------------------------------
  1505.   # overwrite method: draw_actor_name
  1506.   #--------------------------------------------------------------------------
  1507.   def draw_actor_name(actor, dx, dy, dw = 112)
  1508.     reset_font_settings
  1509.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  1510.     change_color(hp_color(actor))
  1511.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  1512.   end
  1513.   
  1514.   #--------------------------------------------------------------------------
  1515.   # new method: draw_actor_action
  1516.   #--------------------------------------------------------------------------
  1517.   def draw_actor_action(actor, dx, dy)
  1518.     draw_icon(action_icon(actor), dx, dy)
  1519.   end
  1520.   
  1521.   #--------------------------------------------------------------------------
  1522.   # new method: action_icon
  1523.   #--------------------------------------------------------------------------
  1524.   def action_icon(actor)
  1525.     return Icon.no_action if actor.current_action.nil?
  1526.     return Icon.no_action if actor.current_action.item.nil?
  1527.     return actor.current_action.item.icon_index
  1528.   end
  1529.   
  1530.   #--------------------------------------------------------------------------
  1531.   # new method: draw_tp?
  1532.   #--------------------------------------------------------------------------
  1533.   def draw_tp?(actor)
  1534.     return actor.draw_tp?
  1535.   end
  1536.   
  1537.   #--------------------------------------------------------------------------
  1538.   # new method: draw_mp?
  1539.   #--------------------------------------------------------------------------
  1540.   def draw_mp?(actor)
  1541.     return actor.draw_mp?
  1542.   end
  1543.   
  1544.   #--------------------------------------------------------------------------
  1545.   # overwrite method: draw_current_and_max_values
  1546.   #--------------------------------------------------------------------------
  1547.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  1548.     change_color(color1)
  1549.     draw_text(dx, dy, dw, line_height, current.group, 2)
  1550.   end
  1551.   
  1552.   #--------------------------------------------------------------------------
  1553.   # overwrite method: draw_actor_hp
  1554.   #--------------------------------------------------------------------------
  1555.   def draw_actor_hp(actor, dx, dy, width = 124)
  1556.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  1557.     change_color(system_color)
  1558.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1559.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  1560.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  1561.       hp_color(actor), normal_color)
  1562.     end
  1563.    
  1564.   #--------------------------------------------------------------------------
  1565.   # overwrite method: draw_actor_mp
  1566.   #--------------------------------------------------------------------------
  1567.   def draw_actor_mp(actor, dx, dy, width = 124)
  1568.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  1569.     change_color(system_color)
  1570.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1571.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  1572.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  1573.       mp_color(actor), normal_color)
  1574.     end
  1575.    
  1576.   #--------------------------------------------------------------------------
  1577.   # overwrite method: draw_actor_tp
  1578.   #--------------------------------------------------------------------------
  1579.   def draw_actor_tp(actor, dx, dy, width = 124)
  1580.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  1581.     change_color(system_color)
  1582.     cy = (Font.default_size - contents.font.size) / 2 + 1
  1583.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  1584.     change_color(tp_color(actor))
  1585.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  1586.   end
  1587.   
  1588. end # Window_BattleStatus

  1589. #==============================================================================
  1590. # ■ Window_BattleActor
  1591. #==============================================================================

  1592. class Window_BattleActor < Window_BattleStatus
  1593.   
  1594.   #--------------------------------------------------------------------------
  1595.   # overwrite method: show
  1596.   #--------------------------------------------------------------------------
  1597.   def show
  1598.     create_flags
  1599.     super
  1600.   end
  1601.   
  1602.   #--------------------------------------------------------------------------
  1603.   # new method: create_flags
  1604.   #--------------------------------------------------------------------------
  1605.   def create_flags
  1606.     set_select_flag(:any)
  1607.     select(0)
  1608.     return if $game_temp.battle_aid.nil?
  1609.     if $game_temp.battle_aid.need_selection?
  1610.       select(0)
  1611.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1612.     elsif $game_temp.battle_aid.for_user?
  1613.       battler = BattleManager.actor
  1614.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1615.       select(id)
  1616.       set_select_flag(:user)
  1617.     elsif $game_temp.battle_aid.for_all?
  1618.       select(0)
  1619.       set_select_flag(:all)
  1620.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1621.     elsif $game_temp.battle_aid.for_random?
  1622.       select(0)
  1623.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1624.     end
  1625.   end
  1626.   
  1627.   #--------------------------------------------------------------------------
  1628.   # new method: set_flag
  1629.   #--------------------------------------------------------------------------
  1630.   def set_select_flag(flag)
  1631.     @select_flag = flag
  1632.     case @select_flag
  1633.     when :all, :all_dead, :random
  1634.       @cursor_all = true
  1635.     else
  1636.       @cursor_all = false
  1637.     end
  1638.   end
  1639.   
  1640.   #--------------------------------------------------------------------------
  1641.   # overwrite method: update_cursor
  1642.   #--------------------------------------------------------------------------
  1643.   def update_cursor
  1644.     if @cursor_all
  1645.       cursor_rect.set(0, 0, contents.width, contents.height)
  1646.       self.top_row = 0
  1647.     elsif @index < 0
  1648.       cursor_rect.empty
  1649.     else
  1650.       ensure_cursor_visible
  1651.       cursor_rect.set(item_rect(@index))
  1652.     end
  1653.   end
  1654.   
  1655.   #--------------------------------------------------------------------------
  1656.   # overwrite method: cursor_movable?
  1657.   #--------------------------------------------------------------------------
  1658.   def cursor_movable?
  1659.     return false if @select_flag == :user
  1660.     return super
  1661.   end
  1662.   
  1663.   #--------------------------------------------------------------------------
  1664.   # overwrite method: current_item_enabled?
  1665.   #--------------------------------------------------------------------------
  1666.   def current_item_enabled?
  1667.     return true if $game_temp.battle_aid.nil?
  1668.     if $game_temp.battle_aid.need_selection?
  1669.       member = $game_party.battle_members[@index]
  1670.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1671.     elsif $game_temp.battle_aid.for_dead_friend?
  1672.       for member in $game_party.battle_members
  1673.         return true if member.dead?
  1674.       end
  1675.       return false
  1676.     end
  1677.     return true
  1678.   end
  1679.   
  1680. end # Window_BattleActor

  1681. #==============================================================================
  1682. # ■ Window_BattleStatusAid
  1683. #==============================================================================

  1684. class Window_BattleStatusAid < Window_BattleStatus
  1685.   
  1686.   #--------------------------------------------------------------------------
  1687.   # public instance variables
  1688.   #--------------------------------------------------------------------------
  1689.   attr_accessor :status_window
  1690.   
  1691.   #--------------------------------------------------------------------------
  1692.   # overwrite method: initialize
  1693.   #--------------------------------------------------------------------------
  1694.   def initialize
  1695.     super
  1696.     self.visible = false
  1697.     self.openness = 255
  1698.   end
  1699.   
  1700.   #--------------------------------------------------------------------------
  1701.   # overwrite method: window_width
  1702.   #--------------------------------------------------------------------------
  1703.   def window_width; return 128; end
  1704.   
  1705.   #--------------------------------------------------------------------------
  1706.   # overwrite method: show
  1707.   #--------------------------------------------------------------------------
  1708.   def show
  1709.     super
  1710.     refresh
  1711.   end
  1712.   
  1713.   #--------------------------------------------------------------------------
  1714.   # overwrite method: refresh
  1715.   #--------------------------------------------------------------------------
  1716.   def refresh
  1717.     contents.clear
  1718.     return if @status_window.nil?
  1719.     draw_item(@status_window.index)
  1720.   end
  1721.   
  1722.   #--------------------------------------------------------------------------
  1723.   # overwrite method: item_rect
  1724.   #--------------------------------------------------------------------------
  1725.   def item_rect(index)
  1726.     return Rect.new(0, 0, contents.width, contents.height)
  1727.   end
  1728.   
  1729. end # Window_BattleStatusAid

  1730. #==============================================================================
  1731. # ■ Window_BattleEnemy
  1732. #==============================================================================

  1733. class Window_BattleEnemy < Window_Selectable
  1734.   
  1735.   #--------------------------------------------------------------------------
  1736.   # overwrite method: initialize
  1737.   #--------------------------------------------------------------------------
  1738.   def initialize(info_viewport)
  1739.     super(0, Graphics.height, window_width, fitting_height(1))
  1740.     refresh
  1741.     self.visible = false
  1742.     @info_viewport = info_viewport
  1743.   end
  1744.   
  1745.   #--------------------------------------------------------------------------
  1746.   # overwrite method: col_max
  1747.   #--------------------------------------------------------------------------
  1748.   def col_max; return item_max; end
  1749.   
  1750.   #--------------------------------------------------------------------------
  1751.   # overwrite method: show
  1752.   #--------------------------------------------------------------------------
  1753.   def show
  1754.     create_flags
  1755.     super
  1756.   end
  1757.   
  1758.   #--------------------------------------------------------------------------
  1759.   # new method: create_flags
  1760.   #--------------------------------------------------------------------------
  1761.   def create_flags
  1762.     set_select_flag(:any)
  1763.     select(0)
  1764.     return if $game_temp.battle_aid.nil?
  1765.     if $game_temp.battle_aid.need_selection?
  1766.       select(0)
  1767.     elsif $game_temp.battle_aid.for_all?
  1768.       select(0)
  1769.       set_select_flag(:all)
  1770.     elsif $game_temp.battle_aid.for_random?
  1771.       select(0)
  1772.       set_select_flag(:random)
  1773.     end
  1774.   end
  1775.   
  1776.   #--------------------------------------------------------------------------
  1777.   # new method: set_flag
  1778.   #--------------------------------------------------------------------------
  1779.   def set_select_flag(flag)
  1780.     @select_flag = flag
  1781.     case @select_flag
  1782.     when :all, :random
  1783.       @cursor_all = true
  1784.     else
  1785.       @cursor_all = false
  1786.     end
  1787.   end
  1788.   
  1789.   #--------------------------------------------------------------------------
  1790.   # new method: select_all?
  1791.   #--------------------------------------------------------------------------
  1792.   def select_all?
  1793.     return true if @select_flag == :all
  1794.     return true if @select_flag == :random
  1795.     return false
  1796.   end
  1797.   
  1798.   #--------------------------------------------------------------------------
  1799.   # overwrite method: update_cursor
  1800.   #--------------------------------------------------------------------------
  1801.   def update_cursor
  1802.     if @cursor_all
  1803.       cursor_rect.set(0, 0, contents.width, contents.height)
  1804.       self.top_row = 0
  1805.     elsif @index < 0
  1806.       cursor_rect.empty
  1807.     else
  1808.       ensure_cursor_visible
  1809.       cursor_rect.set(item_rect(@index))
  1810.     end
  1811.   end
  1812.   
  1813.   #--------------------------------------------------------------------------
  1814.   # overwrite method: cursor_movable?
  1815.   #--------------------------------------------------------------------------
  1816.   def cursor_movable?
  1817.     return false if @select_flag == :user
  1818.     return super
  1819.   end
  1820.   
  1821.   #--------------------------------------------------------------------------
  1822.   # overwrite method: current_item_enabled?
  1823.   #--------------------------------------------------------------------------
  1824.   def current_item_enabled?
  1825.     return true if $game_temp.battle_aid.nil?
  1826.     if $game_temp.battle_aid.need_selection?
  1827.       member = $game_party.battle_members[@index]
  1828.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1829.     elsif $game_temp.battle_aid.for_dead_friend?
  1830.       for member in $game_party.battle_members
  1831.         return true if member.dead?
  1832.       end
  1833.       return false
  1834.     end
  1835.     return true
  1836.   end
  1837.   
  1838.   #--------------------------------------------------------------------------
  1839.   # overwrite method: enemy
  1840.   #--------------------------------------------------------------------------
  1841.   def enemy; @data[index]; end
  1842.   
  1843.   #--------------------------------------------------------------------------
  1844.   # overwrite method: refresh
  1845.   #--------------------------------------------------------------------------
  1846.   def refresh
  1847.     make_item_list
  1848.     create_contents
  1849.     draw_all_items
  1850.   end
  1851.   
  1852.   #--------------------------------------------------------------------------
  1853.   # overwrite method: make_item_list
  1854.   #--------------------------------------------------------------------------
  1855.   def make_item_list
  1856.     @data = $game_troop.alive_members
  1857.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  1858.   end
  1859.   
  1860.   #--------------------------------------------------------------------------
  1861.   # overwrite method: draw_item
  1862.   #--------------------------------------------------------------------------
  1863.   def draw_item(index); return; end
  1864.   
  1865.   #--------------------------------------------------------------------------
  1866.   # overwrite method: update
  1867.   #--------------------------------------------------------------------------
  1868.   def update
  1869.     super
  1870.     return unless active
  1871.     enemy.sprite_effect_type = :whiten
  1872.     return unless select_all?
  1873.     for enemy in $game_troop.alive_members
  1874.       enemy.sprite_effect_type = :whiten
  1875.     end
  1876.   end
  1877.   
  1878. end # Window_BattleEnemy

  1879. #==============================================================================
  1880. # ■ Window_BattleHelp
  1881. #==============================================================================

  1882. class Window_BattleHelp < Window_Help
  1883.   
  1884.   #--------------------------------------------------------------------------
  1885.   # public instance variables
  1886.   #--------------------------------------------------------------------------
  1887.   attr_accessor :actor_window
  1888.   attr_accessor :enemy_window
  1889.   
  1890.   #--------------------------------------------------------------------------
  1891.   # update
  1892.   #--------------------------------------------------------------------------
  1893.   def update
  1894.     super
  1895.     if !self.visible and @text != ""
  1896.       @text = ""
  1897.       return refresh
  1898.     end
  1899.     update_battler_name
  1900.   end
  1901.   
  1902.   #--------------------------------------------------------------------------
  1903.   # update_battler_name
  1904.   #--------------------------------------------------------------------------
  1905.   def update_battler_name
  1906.     return unless @actor_window.active || @enemy_window.active
  1907.     if @actor_window.active
  1908.       battler = $game_party.battle_members[@actor_window.index]
  1909.     elsif @enemy_window.active
  1910.       battler = @enemy_window.enemy
  1911.     end
  1912.     if special_display?
  1913.       refresh_special_case(battler)
  1914.     else
  1915.       refresh_battler_name(battler) if battler_name(battler) != @text
  1916.     end
  1917.   end
  1918.   
  1919.   #--------------------------------------------------------------------------
  1920.   # battler_name
  1921.   #--------------------------------------------------------------------------
  1922.   def battler_name(battler)
  1923.     text = battler.name.clone
  1924.     return text
  1925.   end
  1926.   
  1927.   #--------------------------------------------------------------------------
  1928.   # refresh_battler_name
  1929.   #--------------------------------------------------------------------------
  1930.   def refresh_battler_name(battler)
  1931.     contents.clear
  1932.     reset_font_settings
  1933.     change_color(normal_color)
  1934.     @text = battler_name(battler)
  1935.     icons = battler.state_icons + battler.buff_icons
  1936.     dy = icons.size <= 0 ? line_height / 2 : 0
  1937.     draw_text(0, dy, contents.width, line_height, @text, 1)
  1938.     dx = (contents.width - (icons.size * 24)) / 2
  1939.     draw_actor_icons(battler, dx, line_height, contents.width)
  1940.   end
  1941.   
  1942.   #--------------------------------------------------------------------------
  1943.   # special_display?
  1944.   #--------------------------------------------------------------------------
  1945.   def special_display?
  1946.     return false if $game_temp.battle_aid.nil?
  1947.     return false if $game_temp.battle_aid.for_user?
  1948.     return !$game_temp.battle_aid.need_selection?
  1949.   end
  1950.   
  1951.   #--------------------------------------------------------------------------
  1952.   # refresh_special_case
  1953.   #--------------------------------------------------------------------------
  1954.   def refresh_special_case(battler)
  1955.     if $game_temp.battle_aid.for_opponent?
  1956.       if $game_temp.battle_aid.for_all?
  1957.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  1958.       else
  1959.         case $game_temp.battle_aid.number_of_targets
  1960.         when 1
  1961.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  1962.         else
  1963.           number = $game_temp.battle_aid.number_of_targets
  1964.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  1965.         end
  1966.       end
  1967.     else # $game_temp.battle_aid.for_friend?
  1968.       if $game_temp.battle_aid.for_dead_friend?
  1969.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  1970.       elsif $game_temp.battle_aid.for_random?
  1971.         case $game_temp.battle_aid.number_of_targets
  1972.         when 1
  1973.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  1974.         else
  1975.           number = $game_temp.battle_aid.number_of_targets
  1976.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  1977.         end
  1978.       else
  1979.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  1980.       end
  1981.     end
  1982.     return if text == @text
  1983.     @text = text
  1984.     contents.clear
  1985.     reset_font_settings
  1986.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  1987.   end
  1988.   
  1989. end # Window_BattleHelp

  1990. #==============================================================================
  1991. # ■ Window_BattleLog
  1992. #==============================================================================

  1993. class Window_BattleLog < Window_Selectable
  1994.   
  1995.   #--------------------------------------------------------------------------
  1996.   # alias method: display_current_state
  1997.   #--------------------------------------------------------------------------
  1998.   alias window_battlelog_display_current_state_abe display_current_state
  1999.   def display_current_state(subject)
  2000.     subject.make_during_state_popup
  2001.     return unless YEA::BATTLE::MSG_CURRENT_STATE
  2002.     window_battlelog_display_current_state_abe(subject)
  2003.   end
  2004.   
  2005.   #--------------------------------------------------------------------------
  2006.   # alias method: display_use_item
  2007.   #--------------------------------------------------------------------------
  2008.   alias window_battlelog_display_use_item_abe display_use_item
  2009.   def display_use_item(subject, item)
  2010.     return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2011.     window_battlelog_display_use_item_abe(subject, item)
  2012.   end
  2013.   
  2014.   #--------------------------------------------------------------------------
  2015.   # alias method: display_counter
  2016.   #--------------------------------------------------------------------------
  2017.   alias window_battlelog_display_counter_abe display_counter
  2018.   def display_counter(target, item)
  2019.     if YEA::BATTLE::MSG_COUNTERATTACK
  2020.       window_battlelog_display_counter_abe(target, item)
  2021.     else
  2022.       Sound.play_evasion
  2023.     end
  2024.   end
  2025.   
  2026.   #--------------------------------------------------------------------------
  2027.   # alias method: display_reflection
  2028.   #--------------------------------------------------------------------------
  2029.   alias window_battlelog_display_reflection_abe display_reflection
  2030.   def display_reflection(target, item)
  2031.     if YEA::BATTLE::MSG_REFLECT_MAGIC
  2032.       window_battlelog_display_reflection_abe(target, item)
  2033.     else
  2034.       Sound.play_reflection
  2035.     end
  2036.   end
  2037.   
  2038.   #--------------------------------------------------------------------------
  2039.   # alias method: display_substitute
  2040.   #--------------------------------------------------------------------------
  2041.   alias window_battlelog_display_substitute_abe display_substitute
  2042.   def display_substitute(substitute, target)
  2043.     return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2044.     window_battlelog_display_substitute_abe(substitute, target)
  2045.   end
  2046.   
  2047.   #--------------------------------------------------------------------------
  2048.   # alias method: display_failure
  2049.   #--------------------------------------------------------------------------
  2050.   alias window_battlelog_display_failure_abe display_failure
  2051.   def display_failure(target, item)
  2052.     return unless YEA::BATTLE::MSG_FAILURE_HIT
  2053.     window_battlelog_display_failure_abe(target, item)
  2054.   end
  2055.   
  2056.   #--------------------------------------------------------------------------
  2057.   # alias method: display_critical
  2058.   #--------------------------------------------------------------------------
  2059.   alias window_battlelog_display_critical_abe display_critical
  2060.   def display_critical(target, item)
  2061.     return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2062.     window_battlelog_display_critical_abe(target, item)
  2063.   end
  2064.   
  2065.   #--------------------------------------------------------------------------
  2066.   # alias method: display_miss
  2067.   #--------------------------------------------------------------------------
  2068.   alias window_battlelog_display_miss_abe display_miss
  2069.   def display_miss(target, item)
  2070.     return unless YEA::BATTLE::MSG_HIT_MISSED
  2071.     window_battlelog_display_miss_abe(target, item)
  2072.   end
  2073.   
  2074.   #--------------------------------------------------------------------------
  2075.   # alias method: display_evasion
  2076.   #--------------------------------------------------------------------------
  2077.   alias window_battlelog_display_evasion_abe display_evasion
  2078.   def display_evasion(target, item)
  2079.     if YEA::BATTLE::MSG_EVASION
  2080.       window_battlelog_display_evasion_abe(target, item)
  2081.     else
  2082.       if !item || item.physical?
  2083.         Sound.play_evasion
  2084.       else
  2085.         Sound.play_magic_evasion
  2086.       end
  2087.     end
  2088.   end
  2089.   
  2090.   #--------------------------------------------------------------------------
  2091.   # overwrite method: display_hp_damage
  2092.   #--------------------------------------------------------------------------
  2093.   def display_hp_damage(target, item)
  2094.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  2095.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  2096.       target.perform_damage_effect
  2097.     end
  2098.     Sound.play_recovery if target.result.hp_damage < 0
  2099.     return unless YEA::BATTLE::MSG_HP_DAMAGE
  2100.     add_text(target.result.hp_damage_text)
  2101.     wait
  2102.   end
  2103.   
  2104.   #--------------------------------------------------------------------------
  2105.   # overwrite method: display_mp_damage
  2106.   #--------------------------------------------------------------------------
  2107.   def display_mp_damage(target, item)
  2108.     return if target.dead? || target.result.mp_damage == 0
  2109.     Sound.play_recovery if target.result.mp_damage < 0
  2110.     return unless YEA::BATTLE::MSG_MP_DAMAGE
  2111.     add_text(target.result.mp_damage_text)
  2112.     wait
  2113.   end
  2114.   
  2115.   #--------------------------------------------------------------------------
  2116.   # overwrite method: display_tp_damage
  2117.   #--------------------------------------------------------------------------
  2118.   def display_tp_damage(target, item)
  2119.     return if target.dead? || target.result.tp_damage == 0
  2120.     Sound.play_recovery if target.result.tp_damage < 0
  2121.     return unless YEA::BATTLE::MSG_TP_DAMAGE
  2122.     add_text(target.result.tp_damage_text)
  2123.     wait
  2124.   end
  2125.   
  2126.   #--------------------------------------------------------------------------
  2127.   # alias method: display_added_states
  2128.   #--------------------------------------------------------------------------
  2129.   alias window_battlelog_display_added_states_abe display_added_states
  2130.   def display_added_states(target)
  2131.     return unless YEA::BATTLE::MSG_ADDED_STATES
  2132.     window_battlelog_display_added_states_abe(target)
  2133.   end
  2134.   
  2135.   #--------------------------------------------------------------------------
  2136.   # alias method: display_removed_states
  2137.   #--------------------------------------------------------------------------
  2138.   alias window_battlelog_display_removed_states_abe display_removed_states
  2139.   def display_removed_states(target)
  2140.     return unless YEA::BATTLE::MSG_REMOVED_STATES
  2141.     window_battlelog_display_removed_states_abe(target)
  2142.   end
  2143.   
  2144.   #--------------------------------------------------------------------------
  2145.   # alias method: display_changed_buffs
  2146.   #--------------------------------------------------------------------------
  2147.   alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  2148.   def display_changed_buffs(target)
  2149.     return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  2150.     window_battlelog_display_changed_buffs_abe(target)
  2151.   end
  2152.   
  2153. end # Window_BattleLog

  2154. #==============================================================================
  2155. # ■ Window_SkillList
  2156. #==============================================================================

  2157. class Window_SkillList < Window_Selectable
  2158.   
  2159.   #--------------------------------------------------------------------------
  2160.   # overwrite method: spacing
  2161.   #--------------------------------------------------------------------------
  2162.   def spacing
  2163.     return 8 if $game_party.in_battle
  2164.     return super
  2165.   end
  2166.   
  2167. end # Window_SkillList

  2168. #==============================================================================
  2169. # ■ Window_ItemList
  2170. #==============================================================================

  2171. class Window_ItemList < Window_Selectable
  2172.   
  2173.   #--------------------------------------------------------------------------
  2174.   # overwrite method: spacing
  2175.   #--------------------------------------------------------------------------
  2176.   def spacing
  2177.     return 8 if $game_party.in_battle
  2178.     return super
  2179.   end
  2180.   
  2181. end # Window_ItemList

  2182. #==============================================================================
  2183. # ■ Scene_Battle
  2184. #==============================================================================

  2185. class Scene_Battle < Scene_Base
  2186.   
  2187.   #--------------------------------------------------------------------------
  2188.   # public instance variables
  2189.   #--------------------------------------------------------------------------
  2190.   attr_accessor :enemy_window
  2191.   attr_accessor :info_viewport
  2192.   attr_accessor :spriteset
  2193.   attr_accessor :status_window
  2194.   attr_accessor :status_aid_window
  2195.   attr_accessor :subject
  2196.   
  2197.   #--------------------------------------------------------------------------
  2198.   # alias method: create_spriteset
  2199.   #--------------------------------------------------------------------------
  2200.   alias scene_battle_create_spriteset_abe create_spriteset
  2201.   def create_spriteset
  2202.     BattleManager.init_battle_type
  2203.     scene_battle_create_spriteset_abe
  2204.   end
  2205.   
  2206.   #--------------------------------------------------------------------------
  2207.   # alias method: update_basic
  2208.   #--------------------------------------------------------------------------
  2209.   alias scene_battle_update_basic_abe update_basic
  2210.   def update_basic
  2211.     scene_battle_update_basic_abe
  2212.     update_debug
  2213.   end
  2214.   
  2215.   #--------------------------------------------------------------------------
  2216.   # new method: update_debug
  2217.   #--------------------------------------------------------------------------
  2218.   def update_debug
  2219.     return unless $TEST || $BTEST
  2220.     debug_heal_party if Input.trigger?(:F5)
  2221.     debug_damage_party if Input.trigger?(:F6)
  2222.     debug_fill_tp if Input.trigger?(:F7)
  2223.     debug_kill_all if Input.trigger?(:F8)
  2224.   end
  2225.   
  2226.   #--------------------------------------------------------------------------
  2227.   # new method: debug_heal_party
  2228.   #--------------------------------------------------------------------------
  2229.   def debug_heal_party
  2230.     Sound.play_recovery
  2231.     for member in $game_party.battle_members
  2232.       member.recover_all
  2233.     end
  2234.     @status_window.refresh
  2235.   end
  2236.   
  2237.   #--------------------------------------------------------------------------
  2238.   # new method: debug_damage_party
  2239.   #--------------------------------------------------------------------------
  2240.   def debug_damage_party
  2241.     Sound.play_actor_damage
  2242.     for member in $game_party.alive_members
  2243.       member.hp = 1
  2244.       member.mp = 0
  2245.       member.tp = 0
  2246.     end
  2247.     @status_window.refresh
  2248.   end
  2249.   
  2250.   #--------------------------------------------------------------------------
  2251.   # new method: debug_fill_tp
  2252.   #--------------------------------------------------------------------------
  2253.   def debug_fill_tp
  2254.     Sound.play_recovery
  2255.     for member in $game_party.alive_members
  2256.       member.tp = member.max_tp
  2257.     end
  2258.     @status_window.refresh
  2259.   end
  2260.   
  2261.   #--------------------------------------------------------------------------
  2262.   # new method: debug_kill_all
  2263.   #--------------------------------------------------------------------------
  2264.   def debug_kill_all
  2265.     for enemy in $game_troop.alive_members
  2266.       enemy.hp = 0
  2267.       enemy.perform_collapse_effect
  2268.     end
  2269.     BattleManager.judge_win_loss
  2270.     @log_window.wait
  2271.     @log_window.wait_for_effect
  2272.   end
  2273.   
  2274.   #--------------------------------------------------------------------------
  2275.   # alias method: create_all_windows
  2276.   #--------------------------------------------------------------------------
  2277.   alias scene_battle_create_all_windows_abe create_all_windows
  2278.   def create_all_windows
  2279.     scene_battle_create_all_windows_abe
  2280.     create_battle_status_aid_window
  2281.     set_help_window
  2282.   end
  2283.   
  2284.   #--------------------------------------------------------------------------
  2285.   # alias method: create_info_viewport
  2286.   #--------------------------------------------------------------------------
  2287.   alias scene_battle_create_info_viewport_abe create_info_viewport
  2288.   def create_info_viewport
  2289.     scene_battle_create_info_viewport_abe
  2290.     @status_window.refresh
  2291.   end
  2292.   
  2293.   #--------------------------------------------------------------------------
  2294.   # new method: create_battle_status_aid_window
  2295.   #--------------------------------------------------------------------------
  2296.   def create_battle_status_aid_window
  2297.     @status_aid_window = Window_BattleStatusAid.new
  2298.     @status_aid_window.status_window = @status_window
  2299.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  2300.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  2301.   end
  2302.   
  2303.   #--------------------------------------------------------------------------
  2304.   # overwrite method: create_help_window
  2305.   #--------------------------------------------------------------------------
  2306.   def create_help_window
  2307.     @help_window = Window_BattleHelp.new
  2308.     @help_window.hide
  2309.   end
  2310.   
  2311.   #--------------------------------------------------------------------------
  2312.   # new method: set_help_window
  2313.   #--------------------------------------------------------------------------
  2314.   def set_help_window
  2315.     @help_window.actor_window = @actor_window
  2316.     @help_window.enemy_window = @enemy_window
  2317.   end
  2318.   
  2319.   #--------------------------------------------------------------------------
  2320.   # alias method: create_party_command_window
  2321.   #--------------------------------------------------------------------------
  2322.   alias scene_battle_create_party_command_window_abe create_party_command_window
  2323.   def create_party_command_window
  2324.     scene_battle_create_party_command_window_abe

  2325.   end
  2326.   
  2327.   #--------------------------------------------------------------------------
  2328.   # alias method: create_actor_command_window
  2329.   #--------------------------------------------------------------------------
  2330.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2331.   def create_actor_command_window
  2332.     scene_battle_create_actor_command_window_abe

  2333.   end
  2334.   
  2335.   #--------------------------------------------------------------------------
  2336.   # alias method: create_skill_window
  2337.   #--------------------------------------------------------------------------
  2338.   alias scene_battle_create_skill_window_abe create_skill_window
  2339.   def create_skill_window
  2340.     scene_battle_create_skill_window_abe
  2341.     @skill_window.height = @info_viewport.rect.height
  2342.     @skill_window.width = Graphics.width - @actor_command_window.width
  2343.     @skill_window.y = Graphics.height - @skill_window.height
  2344.   end
  2345.   
  2346.   #--------------------------------------------------------------------------
  2347.   # alias method: create_item_window
  2348.   #--------------------------------------------------------------------------
  2349.   alias scene_battle_create_item_window_abe create_item_window
  2350.   def create_item_window
  2351.     scene_battle_create_item_window_abe
  2352.     @item_window.height = @skill_window.height
  2353.     @item_window.width = @skill_window.width
  2354.     @item_window.y = Graphics.height - @item_window.height
  2355.   end
  2356.   
  2357.   #--------------------------------------------------------------------------
  2358.   # alias method: show_fast?
  2359.   #--------------------------------------------------------------------------
  2360.   alias scene_battle_show_fast_abe show_fast?
  2361.   def show_fast?
  2362.     return true if YEA::BATTLE::AUTO_FAST
  2363.     return scene_battle_show_fast_abe
  2364.   end
  2365.   
  2366.   #--------------------------------------------------------------------------
  2367.   # alias method: next_command
  2368.   #--------------------------------------------------------------------------
  2369.   alias scene_battle_next_command_abe next_command
  2370.   def next_command
  2371.     @status_window.show
  2372.     redraw_current_status
  2373.     @actor_command_window.show
  2374.     @status_aid_window.hide
  2375.     scene_battle_next_command_abe
  2376.   end
  2377.   
  2378.   #--------------------------------------------------------------------------
  2379.   # alias method: prior_command
  2380.   #--------------------------------------------------------------------------
  2381.   alias scene_battle_prior_command_abe prior_command
  2382.   def prior_command
  2383.     redraw_current_status
  2384.     scene_battle_prior_command_abe
  2385.   end
  2386.   
  2387.   #--------------------------------------------------------------------------
  2388.   # new method: redraw_current_status
  2389.   #--------------------------------------------------------------------------
  2390.   def redraw_current_status
  2391.     return if @status_window.index < 0
  2392.     @status_window.draw_item(@status_window.index)
  2393.   end
  2394.   
  2395.   #--------------------------------------------------------------------------
  2396.   # alias method: command_attack
  2397.   #--------------------------------------------------------------------------
  2398.   alias scene_battle_command_attack_abe command_attack
  2399.   def command_attack
  2400.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  2401.     scene_battle_command_attack_abe
  2402.   end
  2403.   
  2404.   #--------------------------------------------------------------------------
  2405.   # alias method: command_skill
  2406.   #--------------------------------------------------------------------------
  2407.   alias scene_battle_command_skill_abe command_skill
  2408.   def command_skill
  2409.     scene_battle_command_skill_abe
  2410.     @status_window.hide
  2411.     @actor_command_window.hide
  2412.     @status_aid_window.show
  2413.   end
  2414.   
  2415.   #--------------------------------------------------------------------------
  2416.   # alias method: command_item
  2417.   #--------------------------------------------------------------------------
  2418.   alias scene_battle_command_item_abe command_item
  2419.   def command_item
  2420.     scene_battle_command_item_abe
  2421.     @status_window.hide
  2422.     @actor_command_window.hide
  2423.     @status_aid_window.show
  2424.   end
  2425.   
  2426.   #--------------------------------------------------------------------------
  2427.   # overwrite method: on_skill_ok
  2428.   #--------------------------------------------------------------------------
  2429.   def on_skill_ok
  2430.     @skill = @skill_window.item
  2431.     $game_temp.battle_aid = @skill
  2432.     BattleManager.actor.input.set_skill(@skill.id)
  2433.     BattleManager.actor.last_skill.object = @skill
  2434.     if @skill.for_opponent?
  2435.       select_enemy_selection
  2436.     elsif @skill.for_friend?
  2437.       select_actor_selection
  2438.     else
  2439.       @skill_window.hide
  2440.       next_command
  2441.       $game_temp.battle_aid = nil
  2442.     end
  2443.   end
  2444.   
  2445.   #--------------------------------------------------------------------------
  2446.   # alias method: on_skill_cancel
  2447.   #--------------------------------------------------------------------------
  2448.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  2449.   def on_skill_cancel
  2450.     scene_battle_on_skill_cancel_abe
  2451.     @status_window.show
  2452.     @actor_command_window.show
  2453.     @status_aid_window.hide
  2454.   end
  2455.   
  2456.   #--------------------------------------------------------------------------
  2457.   # overwrite method: on_item_ok
  2458.   #--------------------------------------------------------------------------
  2459.   def on_item_ok
  2460.     @item = @item_window.item
  2461.     $game_temp.battle_aid = @item
  2462.     BattleManager.actor.input.set_item(@item.id)
  2463.     if @item.for_opponent?
  2464.       select_enemy_selection
  2465.     elsif @item.for_friend?
  2466.       select_actor_selection
  2467.     else
  2468.       @item_window.hide
  2469.       next_command
  2470.       $game_temp.battle_aid = nil
  2471.     end
  2472.     $game_party.last_item.object = @item
  2473.   end
  2474.   
  2475.   #--------------------------------------------------------------------------
  2476.   # alias method: on_item_cancel
  2477.   #--------------------------------------------------------------------------
  2478.   alias scene_battle_on_item_cancel_abe on_item_cancel
  2479.   def on_item_cancel
  2480.     scene_battle_on_item_cancel_abe
  2481.     @status_window.show
  2482.     @actor_command_window.show
  2483.     @status_aid_window.hide
  2484.   end
  2485.   
  2486.   #--------------------------------------------------------------------------
  2487.   # alias method: select_actor_selection
  2488.   #--------------------------------------------------------------------------
  2489.   alias scene_battle_select_actor_selection_abe select_actor_selection
  2490.   def select_actor_selection
  2491.     @status_aid_window.refresh
  2492.     scene_battle_select_actor_selection_abe
  2493.     @status_window.hide
  2494.     @skill_window.hide
  2495.     @item_window.hide
  2496.     @help_window.show
  2497.   end
  2498.   
  2499.   #--------------------------------------------------------------------------
  2500.   # alias method: on_actor_ok
  2501.   #--------------------------------------------------------------------------
  2502.   alias scene_battle_on_actor_ok_abe on_actor_ok
  2503.   def on_actor_ok
  2504.     $game_temp.battle_aid = nil
  2505.     scene_battle_on_actor_ok_abe
  2506.     @status_window.show
  2507.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  2508.       @actor_command_window.visible = !@confirm_command_window.visible
  2509.     else
  2510.       @actor_command_window.show
  2511.     end
  2512.     @status_aid_window.hide
  2513.   end
  2514.   
  2515.   #--------------------------------------------------------------------------
  2516.   # alias method: on_actor_cancel
  2517.   #--------------------------------------------------------------------------
  2518.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  2519.   def on_actor_cancel
  2520.     BattleManager.actor.input.clear
  2521.     @status_aid_window.refresh
  2522.     $game_temp.battle_aid = nil
  2523.     scene_battle_on_actor_cancel_abe
  2524.     case @actor_command_window.current_symbol
  2525.     when :skill
  2526.       @skill_window.show
  2527.     when :item
  2528.       @item_window.show
  2529.     end
  2530.   end
  2531.   
  2532.   #--------------------------------------------------------------------------
  2533.   # alias method: select_enemy_selection
  2534.   #--------------------------------------------------------------------------
  2535.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  2536.   def select_enemy_selection
  2537.     @status_aid_window.refresh
  2538.     scene_battle_select_enemy_selection_abe
  2539.     @help_window.show
  2540.   end
  2541.   #--------------------------------------------------------------------------
  2542.   # alias method: on_enemy_ok
  2543.   #--------------------------------------------------------------------------
  2544.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  2545.   def on_enemy_ok
  2546.     $game_temp.battle_aid = nil
  2547.     scene_battle_on_enemy_ok_abe
  2548.   end
  2549.   
  2550.   #--------------------------------------------------------------------------
  2551.   # alias method: on_enemy_cancel
  2552.   #--------------------------------------------------------------------------
  2553.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  2554.   def on_enemy_cancel
  2555.     BattleManager.actor.input.clear
  2556.     @status_aid_window.refresh
  2557.     $game_temp.battle_aid = nil
  2558.     scene_battle_on_enemy_cancel_abe
  2559.     if @skill_window.visible || @item_window.visible
  2560.       @help_window.show
  2561.     else
  2562.       @help_window.hide
  2563.     end
  2564.   end
  2565.   
  2566.   #--------------------------------------------------------------------------
  2567.   # alias method: battle_start
  2568.   #--------------------------------------------------------------------------
  2569.   alias scene_battle_battle_start_abe battle_start
  2570.   def battle_start
  2571.     scene_battle_battle_start_abe
  2572.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2573.     @party_command_window.deactivate
  2574.     if BattleManager.input_start
  2575.       command_fight
  2576.     else
  2577.       turn_start
  2578.     end
  2579.   end
  2580.   
  2581.   #--------------------------------------------------------------------------
  2582.   # overwrite method: turn_end
  2583.   #--------------------------------------------------------------------------
  2584.   def turn_end
  2585.     all_battle_members.each do |battler|
  2586.       battler.on_turn_end
  2587.       status_redraw_target(battler)
  2588.       @log_window.display_auto_affected_status(battler)
  2589.       @log_window.wait_and_clear
  2590.     end
  2591.    
  2592.     BattleManager.turn_end
  2593.     process_event
  2594.     start_party_command_selection
  2595.     return if end_battle_conditions?
  2596.     return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  2597.     if BattleManager.input_start
  2598.       @party_command_window.deactivate
  2599.       command_fight
  2600.     else
  2601.       @party_command_window.deactivate
  2602.       turn_start
  2603.     end
  2604.   end
  2605.   
  2606.   #--------------------------------------------------------------------------
  2607.   # new method: end_battle_conditions?
  2608.   #--------------------------------------------------------------------------
  2609.   def end_battle_conditions?
  2610.     return true if $game_party.members.empty?
  2611.     return true if $game_party.all_dead?
  2612.     return true if $game_troop.all_dead?
  2613.     return true if BattleManager.aborting?
  2614.     return false
  2615.   end
  2616.   
  2617.   #--------------------------------------------------------------------------
  2618.   # overwrite method: execute_action
  2619.   #--------------------------------------------------------------------------
  2620.   def execute_action
  2621.     @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  2622.     use_item
  2623.     @log_window.wait_and_clear
  2624.   end
  2625.   
  2626.   #--------------------------------------------------------------------------
  2627.   # overwrite method: apply_item_effects
  2628.   #--------------------------------------------------------------------------
  2629.   def apply_item_effects(target, item)
  2630.     if $imported["YEA-LunaticObjects"]
  2631.       lunatic_object_effect(:prepare, item, @subject, target)
  2632.     end
  2633.     target.item_apply(@subject, item)
  2634.     status_redraw_target(@subject)
  2635.     status_redraw_target(target) unless target == @subject
  2636.     @log_window.display_action_results(target, item)
  2637.     if $imported["YEA-LunaticObjects"]
  2638.       lunatic_object_effect(:during, item, @subject, target)
  2639.     end
  2640.     perform_collapse_check(target)
  2641.   end
  2642.   
  2643.   #--------------------------------------------------------------------------
  2644.   # overwite method: invoke_counter_attack
  2645.   #--------------------------------------------------------------------------
  2646.   def invoke_counter_attack(target, item)
  2647.     @log_window.display_counter(target, item)
  2648.     attack_skill = $data_skills[target.attack_skill_id]
  2649.     @subject.item_apply(target, attack_skill)
  2650.     status_redraw_target(@subject)
  2651.     status_redraw_target(target) unless target == @subject
  2652.     @log_window.display_action_results(@subject, attack_skill)
  2653.     perform_collapse_check(target)
  2654.     perform_collapse_check(@subject)
  2655.   end
  2656.   
  2657.   #--------------------------------------------------------------------------
  2658.   # new method: perform_collapse_check
  2659.   #--------------------------------------------------------------------------
  2660.   def perform_collapse_check(target)
  2661.     return if YEA::BATTLE::MSG_ADDED_STATES
  2662.     target.perform_collapse_effect if target.can_collapse?
  2663.     @log_window.wait
  2664.     @log_window.wait_for_effect
  2665.   end
  2666.   
  2667.   #--------------------------------------------------------------------------
  2668.   # overwrite method: show_attack_animation
  2669.   #--------------------------------------------------------------------------
  2670.   def show_attack_animation(targets)
  2671.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  2672.     wait_for_animation
  2673.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  2674.   end
  2675.   
  2676.   #--------------------------------------------------------------------------
  2677.   # overwrite method: show_normal_animation
  2678.   #--------------------------------------------------------------------------
  2679.   def show_normal_animation(targets, animation_id, mirror = false)
  2680.     animation = $data_animations[animation_id]
  2681.     return if animation.nil?
  2682.     ani_check = false
  2683.     targets.each do |target|
  2684.       if ani_check && target.animation_id <= 0
  2685.         target.pseudo_ani_id = animation_id
  2686.       else
  2687.         target.animation_id = animation_id
  2688.       end
  2689.       target.animation_mirror = mirror
  2690.       ani_check = true if animation.to_screen?
  2691.     end
  2692.   end
  2693.   
  2694.   #--------------------------------------------------------------------------
  2695.   # overwrite method: process_action_end
  2696.   #--------------------------------------------------------------------------
  2697.   def process_action_end
  2698.     @subject.on_action_end
  2699.     status_redraw_target(@subject)
  2700.     @log_window.display_auto_affected_status(@subject)
  2701.     @log_window.wait_and_clear
  2702.     @log_window.display_current_state(@subject)
  2703.     @log_window.wait_and_clear
  2704.     BattleManager.judge_win_loss
  2705.   end
  2706.   
  2707.   #--------------------------------------------------------------------------
  2708.   # overwrite method: use_item
  2709.   #--------------------------------------------------------------------------
  2710.   def use_item
  2711.     item = @subject.current_action.item
  2712.     @log_window.display_use_item(@subject, item)
  2713.     @subject.use_item(item)
  2714.     status_redraw_target(@subject)
  2715.     if $imported["YEA-LunaticObjects"]
  2716.       lunatic_object_effect(:before, item, @subject, @subject)
  2717.     end
  2718.     process_casting_animation if $imported["YEA-CastAnimations"]
  2719.     targets = @subject.current_action.make_targets.compact rescue []
  2720.     show_animation(targets, item.animation_id) if show_all_animation?(item)
  2721.     targets.each {|target|
  2722.       if $imported["YEA-TargetManager"]
  2723.         target = alive_random_target(target, item) if item.for_random?
  2724.       end
  2725.       item.repeats.times { invoke_item(target, item) } }
  2726.     if $imported["YEA-LunaticObjects"]
  2727.       lunatic_object_effect(:after, item, @subject, @subject)
  2728.     end
  2729.   end
  2730.   
  2731.   #--------------------------------------------------------------------------
  2732.   # alias method: invoke_item
  2733.   #--------------------------------------------------------------------------
  2734.   alias scene_battle_invoke_item_abe invoke_item
  2735.   def invoke_item(target, item)
  2736.     show_animation([target], item.animation_id) if separate_ani?(target, item)
  2737.     if target.dead? != item.for_dead_friend?
  2738.       @subject.last_target_index = target.index
  2739.       return
  2740.     end
  2741.     scene_battle_invoke_item_abe(target, item)
  2742.   end
  2743.   
  2744.   #--------------------------------------------------------------------------
  2745.   # new method: show_all_animation?
  2746.   #--------------------------------------------------------------------------
  2747.   def show_all_animation?(item)
  2748.     return true if item.one_animation
  2749.     return false if $data_animations[item.animation_id].nil?
  2750.     return false unless $data_animations[item.animation_id].to_screen?
  2751.     return true
  2752.   end
  2753.   
  2754.   #--------------------------------------------------------------------------
  2755.   # new method: separate_ani?
  2756.   #--------------------------------------------------------------------------
  2757.   def separate_ani?(target, item)
  2758.     return false if item.one_animation
  2759.     return false if $data_animations[item.animation_id].nil?
  2760.     return false if $data_animations[item.animation_id].to_screen?
  2761.     return target.dead? == item.for_dead_friend?
  2762.   end
  2763.   
  2764.   #--------------------------------------------------------------------------
  2765.   # new method: status_redraw_target
  2766.   #--------------------------------------------------------------------------
  2767.   def status_redraw_target(target)
  2768.     return unless target.actor?
  2769.     @status_window.draw_item($game_party.battle_members.index(target))
  2770.   end
  2771.   
  2772.   #--------------------------------------------------------------------------
  2773.   # alias method: start_party_command_selection
  2774.   #--------------------------------------------------------------------------
  2775.   alias start_party_command_selection_abe start_party_command_selection
  2776.   def start_party_command_selection
  2777.     @status_window.refresh unless scene_changing?
  2778.     start_party_command_selection_abe
  2779.   end
  2780.   
  2781.   #--------------------------------------------------------------------------
  2782.   # overwrite method: refresh_status
  2783.   #--------------------------------------------------------------------------
  2784.   def refresh_status; return; end
  2785.   
  2786.   #--------------------------------------------------------------------------
  2787.   # new method: refresh_autobattler_status_window
  2788.   #--------------------------------------------------------------------------
  2789.   def refresh_autobattler_status_window
  2790.     for member in $game_party.battle_members
  2791.       next unless member.auto_battle?
  2792.       @status_window.draw_item(member.index)
  2793.     end
  2794.   end
  2795.   
  2796.   #--------------------------------------------------------------------------
  2797.   # new method: hide_extra_gauges
  2798.   #--------------------------------------------------------------------------
  2799.   def hide_extra_gauges
  2800.     # Made for compatibility
  2801.   end
  2802.   
  2803.   #--------------------------------------------------------------------------
  2804.   # new method: show_extra_gauges
  2805.   #--------------------------------------------------------------------------
  2806.   def show_extra_gauges
  2807.     # Made for compatibility
  2808.   end
  2809.   
  2810. end
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-10-27
回帖
12
 楼主| 发表于 2012-12-17 12:21:54 | 显示全部楼层
c248611 发表于 2012-12-17 12:13
#==============================================================================
# ■ RMVA 战斗 ...

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

使用道具 举报

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

使用道具 举报

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

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

使用道具 举报

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
回帖
176
发表于 2012-12-17 14:07:34 | 显示全部楼层
游系风 发表于 2012-12-17 13:26
谢谢!我去看看,本人脚本小白,希望能看得懂怎么改吧……

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部