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

Project1

 找回密码
 注册会员
搜索
楼主: wyongcan2008
打印 上一主题 下一主题

[RMVA发布] 装备系统增强1.0版(装备强化,随机属性,帮助增强等)

  [复制链接]

Lv1.梦旅人

梦石
0
星屑
60
在线时间
80 小时
注册时间
2011-1-21
帖子
85
51
发表于 2012-7-30 16:53:38 | 只看该作者
下载了  不是RAR格式。。。解压不利啊。。。。白买了吗?

点评

我也遇到过这种情况,点右键,目标另存为,别用迅雷  发表于 2012-7-30 17:59
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
145
在线时间
95 小时
注册时间
2012-4-30
帖子
53
52
发表于 2012-7-31 17:27:23 | 只看该作者
有趣,有用,太感谢LZ
回复 支持 反对

使用道具 举报

Lv1.梦旅人

小黑

梦石
0
星屑
50
在线时间
140 小时
注册时间
2011-8-23
帖子
536
53
发表于 2012-7-31 19:21:02 | 只看该作者
强化+品质+随机。喜欢,品质融合了强化。
起码对得起自己。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
145
在线时间
95 小时
注册时间
2012-4-30
帖子
53
54
发表于 2012-8-5 16:33:58 | 只看该作者
用魔法时报错。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
164 小时
注册时间
2011-8-15
帖子
238
55
发表于 2012-8-5 16:57:22 | 只看该作者
想问下LZ , 属性ID 有哪些? 哪个有什么作用?可以说明下么.....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
432 小时
注册时间
2010-7-14
帖子
111
56
发表于 2012-8-9 19:43:04 | 只看该作者
这个 买了之后下载来解压不能。。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

  169. #==============================================================================
  170. # ▼ Editting anything past this point may potentially result in causing
  171. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  172. # halitosis so edit at your own risk.
  173. #==============================================================================

  174. module YEA
  175.   module REGEXP
  176.   module ENEMY
  177.    
  178.     ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  179.     ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  180.    
  181.   end # ENEMY
  182.   module USABLEITEM
  183.    
  184.     ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  185.    
  186.   end # USABLEITEM
  187.   module STATE
  188.    
  189.     POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  190.     POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  191.     POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  192.    
  193.     HIDE_ADD  = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  194.     HIDE_REM  = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  195.     HIDE_DUR  = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  196.    
  197.   end # STATE
  198.   end # REGEXP
  199. end # YEA

  200. #==============================================================================
  201. # ■ Switch
  202. #==============================================================================

  203. module Switch
  204.   
  205.   #--------------------------------------------------------------------------
  206.   # self.hide_popups
  207.   #--------------------------------------------------------------------------
  208.   def self.hide_popups
  209.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  210.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  211.   end
  212.   
  213. end # Switch

  214. #==============================================================================
  215. # ■ Colour
  216. #==============================================================================

  217. module Colour
  218.   
  219.   #--------------------------------------------------------------------------
  220.   # self.text_colour
  221.   #--------------------------------------------------------------------------
  222.   def self.text_colour(index)
  223.     windowskin = Cache.system("Window")
  224.     x = 64 + (index % 8) * 8
  225.     y = 96 + (index / 8) * 8
  226.     return windowskin.get_pixel(x, y)
  227.   end
  228.   
  229. end # Colour

  230. #==============================================================================
  231. # ■ Icon
  232. #==============================================================================

  233. module Icon
  234.   
  235.   #--------------------------------------------------------------------------
  236.   # self.no_action
  237.   #--------------------------------------------------------------------------
  238.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  239.    
  240. end # Icon

  241. #==============================================================================
  242. # ■ Numeric
  243. #==============================================================================

  244. class Numeric
  245.   
  246.   #--------------------------------------------------------------------------
  247.   # new method: group_digits
  248.   #--------------------------------------------------------------------------
  249.   unless $imported["YEA-CoreEngine"]
  250.   def group; return self.to_s; end
  251.   end # $imported["YEA-CoreEngine"]
  252.    
  253. end # Numeric

  254. #==============================================================================
  255. # ■ DataManager
  256. #==============================================================================

  257. module DataManager
  258.   
  259.   #--------------------------------------------------------------------------
  260.   # alias method: load_database
  261.   #--------------------------------------------------------------------------
  262.   class <<self; alias load_database_abe load_database; end
  263.   def self.load_database
  264.     load_database_abe
  265.     load_notetags_abe
  266.   end
  267.   
  268.   #--------------------------------------------------------------------------
  269.   # new method: load_notetags_abe
  270.   #--------------------------------------------------------------------------
  271.   def self.load_notetags_abe
  272.     groups = [$data_enemies, $data_states, $data_skills, $data_items]
  273.     for group in groups
  274.       for obj in group
  275.         next if obj.nil?
  276.         obj.load_notetags_abe
  277.       end
  278.     end
  279.   end
  280.   
  281. end # DataManager

  282. #==============================================================================
  283. # ■ RPG::UsableItem
  284. #==============================================================================

  285. class RPG::UsableItem < RPG::BaseItem
  286.   
  287.   #--------------------------------------------------------------------------
  288.   # public instance variables
  289.   #--------------------------------------------------------------------------
  290.   attr_accessor :one_animation
  291.   
  292.   #--------------------------------------------------------------------------
  293.   # common cache: load_notetags_abe
  294.   #--------------------------------------------------------------------------
  295.   def load_notetags_abe
  296.     @one_animation = false
  297.     #---
  298.     self.note.split(/[\r\n]+/).each { |line|
  299.       case line
  300.       #---
  301.       when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  302.         @one_animation = true
  303.       end
  304.     } # self.note.split
  305.     #---
  306.   end
  307.   
  308. end # RPG::UsableItem

  309. #==============================================================================
  310. # ■ RPG::Enemy
  311. #==============================================================================

  312. class RPG::Enemy < RPG::BaseItem
  313.   
  314.   #--------------------------------------------------------------------------
  315.   # public instance variables
  316.   #--------------------------------------------------------------------------
  317.   attr_accessor :atk_animation_id1
  318.   attr_accessor :atk_animation_id2
  319.   
  320.   #--------------------------------------------------------------------------
  321.   # common cache: load_notetags_abe
  322.   #--------------------------------------------------------------------------
  323.   def load_notetags_abe
  324.     @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  325.     @atk_animation_id2 = 0
  326.     #---
  327.     self.note.split(/[\r\n]+/).each { |line|
  328.       case line
  329.       #---
  330.       when YEA::REGEXP::ENEMY::ATK_ANI1
  331.         @atk_animation_id1 = $1.to_i
  332.       when YEA::REGEXP::ENEMY::ATK_ANI2
  333.         @atk_animation_id2 = $1.to_i
  334.       end
  335.     } # self.note.split
  336.     #---
  337.   end
  338.   
  339. end # RPG::Enemy

  340. #==============================================================================
  341. # ■ RPG::Enemy
  342. #==============================================================================

  343. class RPG::State < RPG::BaseItem
  344.   
  345.   #--------------------------------------------------------------------------
  346.   # public instance variables
  347.   #--------------------------------------------------------------------------
  348.   attr_accessor :popup_rules
  349.   
  350.   #--------------------------------------------------------------------------
  351.   # common cache: load_notetags_abe
  352.   #--------------------------------------------------------------------------
  353.   def load_notetags_abe
  354.     @popup_rules = {
  355.       :add_state => "ADDSTATE",
  356.       :rem_state => "REMSTATE",
  357.       :dur_state => nil
  358.     } # Do not remove this.
  359.     #---
  360.     self.note.split(/[\r\n]+/).each { |line|
  361.       case line
  362.       #---
  363.       when YEA::REGEXP::STATE::POPUP_ADD
  364.         @popup_rules[:add_state] = $1.upcase.to_s
  365.       when YEA::REGEXP::STATE::POPUP_REM
  366.         @popup_rules[:rem_state] = $1.upcase.to_s
  367.       when YEA::REGEXP::STATE::POPUP_DUR
  368.         @popup_rules[:dur_state] = $1.upcase.to_s
  369.       when YEA::REGEXP::STATE::HIDE_ADD
  370.         @popup_rules[:add_state] = nil
  371.       when YEA::REGEXP::STATE::HIDE_REM
  372.         @popup_rules[:rem_state] = nil
  373.       when YEA::REGEXP::STATE::HIDE_DUR
  374.         @popup_rules[:dur_state] = nil
  375.       end
  376.     } # self.note.split
  377.     #---
  378.   end
  379.   
  380. end # RPG::State

  381. #==============================================================================
  382. # ■ BattleManager
  383. #==============================================================================

  384. module BattleManager
  385.   
  386.   #--------------------------------------------------------------------------
  387.   # overwrite method: self.battle_start
  388.   #--------------------------------------------------------------------------
  389.   def self.battle_start
  390.     $game_system.battle_count += 1
  391.     $game_party.on_battle_start
  392.     $game_troop.on_battle_start
  393.     return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  394.     $game_troop.enemy_names.each do |name|
  395.       $game_message.add(sprintf(Vocab::Emerge, name))
  396.     end
  397.     if @preemptive
  398.       $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  399.     elsif @surprise
  400.       $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  401.     end
  402.     wait_for_message
  403.   end
  404.   
  405.   #--------------------------------------------------------------------------
  406.   # overwrite method: make_action_orders
  407.   #--------------------------------------------------------------------------
  408.   def self.make_action_orders
  409.     make_dtb_action_orders if btype?(:dtb)
  410.   end
  411.   
  412.   #--------------------------------------------------------------------------
  413.   # new method: make_dtb_action_orders
  414.   #--------------------------------------------------------------------------
  415.   def self.make_dtb_action_orders
  416.     @action_battlers = []
  417.     @action_battlers += $game_party.members unless @surprise
  418.     @action_battlers += $game_troop.members unless @preemptive
  419.     @action_battlers.each {|battler| battler.make_speed }
  420.     @action_battlers.sort! {|a,b| b.speed - a.speed }
  421.   end
  422.   
  423.   #--------------------------------------------------------------------------
  424.   # overwrite method: turn_start
  425.   #--------------------------------------------------------------------------
  426.   def self.turn_start
  427.     @phase = :turn
  428.     clear_actor
  429.     $game_troop.increase_turn
  430.     @performed_battlers = []
  431.     make_action_orders
  432.   end
  433.   
  434.   #--------------------------------------------------------------------------
  435.   # overwrite method: next_subject
  436.   #--------------------------------------------------------------------------
  437.   def self.next_subject
  438.     @performed_battlers = [] if @performed_battlers.nil?
  439.     loop do
  440.       @action_battlers -= @performed_battlers
  441.       battler = @action_battlers.shift
  442.       return nil unless battler
  443.       next unless battler.index && battler.alive?
  444.       @performed_battlers.push(battler)
  445.       return battler
  446.     end
  447.   end
  448.   
  449.   #--------------------------------------------------------------------------
  450.   # new method: self.init_battle_type
  451.   #--------------------------------------------------------------------------
  452.   def self.init_battle_type
  453.     set_btype($game_system.battle_system)
  454.   end
  455.   
  456.   #--------------------------------------------------------------------------
  457.   # new method: self.set_btype
  458.   #--------------------------------------------------------------------------
  459.   def self.set_btype(btype = :dtb)
  460.     @battle_type = btype
  461.   end
  462.   
  463.   #--------------------------------------------------------------------------
  464.   # new method: self.btype?
  465.   #--------------------------------------------------------------------------
  466.   def self.btype?(btype)
  467.     return @battle_type == btype
  468.   end
  469.   
  470. end # BattleManager

  471. #==============================================================================
  472. # ■ Game_System
  473. #==============================================================================

  474. class Game_System
  475.   
  476.   #--------------------------------------------------------------------------
  477.   # new method: battle_system
  478.   #--------------------------------------------------------------------------
  479.   def battle_system
  480.     if @battle_system.nil?
  481.       return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  482.     else
  483.       return battle_system_corrected(@battle_system)
  484.     end
  485.   end
  486.   
  487.   #--------------------------------------------------------------------------
  488.   # new method: set_battle_system
  489.   #--------------------------------------------------------------------------
  490.   def set_battle_system(type)
  491.     case type
  492.     when :dtb; @battle_system = :dtb
  493.     when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  494.     else;      @battle_system = :dtb
  495.     end
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # new method: battle_system_corrected
  500.   #--------------------------------------------------------------------------
  501.   def battle_system_corrected(type)
  502.     case type
  503.     when :dtb; return :dtb
  504.     when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  505.     else;      return :dtb
  506.     end
  507.   end
  508.   
  509. end # Game_System

  510. #==============================================================================
  511. # ■ Sprite_Base
  512. #==============================================================================

  513. class Sprite_Base < Sprite
  514.   
  515.   #--------------------------------------------------------------------------
  516.   # new method: start_pseudo_animation
  517.   #--------------------------------------------------------------------------
  518.   unless $imported["YEA-CoreEngine"]
  519.   def start_pseudo_animation(animation, mirror = false)
  520.     dispose_animation
  521.     @animation = animation
  522.     return if @animation.nil?
  523.     @ani_mirror = mirror
  524.     set_animation_rate
  525.     @ani_duration = @animation.frame_max * @ani_rate + 1
  526.     @ani_sprites = []
  527.   end
  528.   end # $imported["YEA-CoreEngine"]
  529.   
  530. end # Sprite_Base

  531. #==============================================================================
  532. # ■ Sprite_Battler
  533. #==============================================================================

  534. class Sprite_Battler < Sprite_Base
  535.   
  536.   #--------------------------------------------------------------------------
  537.   # public instance variables
  538.   #--------------------------------------------------------------------------
  539.   attr_accessor :effect_type
  540.   attr_accessor :battler_visible
  541.   attr_accessor :popups
  542.   
  543.   #--------------------------------------------------------------------------
  544.   # alias method: initialize
  545.   #--------------------------------------------------------------------------
  546.   alias sprite_battler_initialize_abe initialize
  547.   def initialize(viewport, battler = nil)
  548.     sprite_battler_initialize_abe(viewport, battler)
  549.     @popups = []
  550.     @popup_flags = []
  551.   end
  552.   
  553.   #--------------------------------------------------------------------------
  554.   # alias method: update_bitmap
  555.   #--------------------------------------------------------------------------
  556.   alias sprite_battler_update_bitmap_abe update_bitmap
  557.   def update_bitmap
  558.     return if @battler.actor? && @battler.battler_name == ""
  559.     sprite_battler_update_bitmap_abe
  560.   end
  561.   
  562.   #--------------------------------------------------------------------------
  563.   # alias method: setup_new_animation
  564.   #--------------------------------------------------------------------------
  565.   unless $imported["YEA-CoreEngine"]
  566.   alias sprite_battler_setup_new_animation_abe setup_new_animation
  567.   def setup_new_animation
  568.     sprite_battler_setup_new_animation_abe
  569.     return if @battler.pseudo_ani_id <= 0
  570.     animation = $data_animations[@battler.pseudo_ani_id]
  571.     mirror = @battler.animation_mirror
  572.     start_pseudo_animation(animation, mirror)
  573.     @battler.pseudo_ani_id = 0
  574.   end
  575.   end # $imported["YEA-CoreEngine"]
  576.   
  577.   #--------------------------------------------------------------------------
  578.   # alias method: setup_new_effect
  579.   #--------------------------------------------------------------------------
  580.   alias sprite_battler_setup_new_effect_abe setup_new_effect
  581.   def setup_new_effect
  582.     sprite_battler_setup_new_effect_abe
  583.     setup_popups
  584.   end
  585.   
  586.   #--------------------------------------------------------------------------
  587.   # new method: setup_popups
  588.   #--------------------------------------------------------------------------
  589.   def setup_popups
  590.     return unless @battler.use_sprite?
  591.     @battler.popups = [] if @battler.popups.nil?
  592.     return if @battler.popups == []
  593.     array = @battler.popups.shift
  594.     create_new_popup(array[0], array[1], array[2])
  595.   end
  596.   
  597.   #--------------------------------------------------------------------------
  598.   # new method: create_new_popup
  599.   #--------------------------------------------------------------------------
  600.   def create_new_popup(value, rules, flags)
  601.     return if @battler == nil
  602.     return if flags & @popup_flags != []
  603.     array = YEA::BATTLE::POPUP_RULES[rules]
  604.     for popup in @popups
  605.       popup.y -= 24
  606.     end
  607.     return unless SceneManager.scene.is_a?(Scene_Battle)
  608.     return if SceneManager.scene.spriteset.nil?
  609.     view = SceneManager.scene.spriteset.viewportPopups
  610.     new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  611.     @popups.push(new_popup)
  612.     @popup_flags.push("weakness") if flags.include?("weakness")
  613.     @popup_flags.push("resistant") if flags.include?("resistant")
  614.     @popup_flags.push("immune") if flags.include?("immune")
  615.     @popup_flags.push("absorbed") if flags.include?("absorbed")
  616.   end
  617.   
  618.   #--------------------------------------------------------------------------
  619.   # alias method: update_effect
  620.   #--------------------------------------------------------------------------
  621.   alias sprite_battler_update_effect_abe update_effect
  622.   def update_effect
  623.     sprite_battler_update_effect_abe
  624.     update_popups
  625.   end
  626.   
  627.   #--------------------------------------------------------------------------
  628.   # new method: update_popups
  629.   #--------------------------------------------------------------------------
  630.   def update_popups
  631.     for popup in @popups
  632.       popup.update
  633.       next unless popup.opacity <= 0
  634.       popup.bitmap.dispose
  635.       popup.dispose
  636.       @popups.delete(popup)
  637.       popup = nil
  638.     end
  639.     @popup_flags = [] if @popups == [] && @popup_flags != []
  640.     return unless SceneManager.scene_is?(Scene_Battle)
  641.     if @current_active_battler != SceneManager.scene.subject
  642.       @current_active_battler = SceneManager.scene.subject
  643.       @popup_flags = []
  644.     end
  645.   end
  646.   
  647. end # Sprite_Battler

  648. #==============================================================================
  649. # ■ Sprite_Popup
  650. #==============================================================================

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

  757. #==============================================================================
  758. # ■ Spriteset_Battle
  759. #==============================================================================

  760. class Spriteset_Battle
  761.   
  762.   #--------------------------------------------------------------------------
  763.   # public instance variables
  764.   #--------------------------------------------------------------------------
  765.   attr_accessor :actor_sprites
  766.   attr_accessor :enemy_sprites
  767.   attr_accessor :viewport1
  768.   attr_accessor :viewportPopups
  769.   
  770.   #--------------------------------------------------------------------------
  771.   # alias method: create_viewports
  772.   #--------------------------------------------------------------------------
  773.   alias spriteset_battle_create_viewports_abe create_viewports
  774.   def create_viewports
  775.     spriteset_battle_create_viewports_abe
  776.     @viewportPopups = Viewport.new
  777.     @viewportPopups.z = 200
  778.   end
  779.   
  780.   #--------------------------------------------------------------------------
  781.   # alias method: dispose_viewports
  782.   #--------------------------------------------------------------------------
  783.   alias spriteset_battle_dispose_viewports_abe dispose_viewports
  784.   def dispose_viewports
  785.     spriteset_battle_dispose_viewports_abe
  786.     @viewportPopups.dispose
  787.   end
  788.   
  789.   #--------------------------------------------------------------------------
  790.   # alias method: update_viewports
  791.   #--------------------------------------------------------------------------
  792.   alias spriteset_battle_update_viewports_abe update_viewports
  793.   def update_viewports
  794.     spriteset_battle_update_viewports_abe
  795.     @viewportPopups.update
  796.   end
  797.   
  798. end # Spriteset_Battle

  799. #==============================================================================
  800. # ■ Game_Temp
  801. #==============================================================================

  802. class Game_Temp
  803.   
  804.   #--------------------------------------------------------------------------
  805.   # public instance variables
  806.   #--------------------------------------------------------------------------
  807.   attr_accessor :battle_aid
  808.   attr_accessor :evaluating
  809.   attr_accessor :iconset
  810.   
  811.   #--------------------------------------------------------------------------
  812.   # alias method: initialize
  813.   #--------------------------------------------------------------------------
  814.   alias game_temp_initialize_abe initialize
  815.   def initialize
  816.     game_temp_initialize_abe
  817.     @iconset = Cache.system("Iconset")
  818.   end
  819.   
  820. end # Game_Temp

  821. #==============================================================================
  822. # ■ Game_Action
  823. #==============================================================================

  824. class Game_Action
  825.   
  826.   #--------------------------------------------------------------------------
  827.   # overwrite method: speed
  828.   #--------------------------------------------------------------------------
  829.   def speed
  830.     speed = subject.agi
  831.     speed += item.speed if item
  832.     speed += subject.atk_speed if attack?
  833.     return speed
  834.   end
  835.   
  836.   #--------------------------------------------------------------------------
  837.   # alias method: evaluate_item_with_target
  838.   #--------------------------------------------------------------------------
  839.   alias evaluate_item_with_target_abe evaluate_item_with_target
  840.   def evaluate_item_with_target(target)
  841.     $game_temp.evaluating = true
  842.     result = evaluate_item_with_target_abe(target)
  843.     $game_temp.evaluating = false
  844.     return result
  845.   end
  846.   
  847. end # Game_Action

  848. #==============================================================================
  849. # ■ Game_ActionResult
  850. #==============================================================================

  851. class Game_ActionResult
  852.   
  853.   #--------------------------------------------------------------------------
  854.   # alias method: clear
  855.   #--------------------------------------------------------------------------
  856.   alias game_actionresult_clear_abe clear
  857.   def clear
  858.     game_actionresult_clear_abe
  859.     clear_stored_damage
  860.   end
  861.   
  862.   #--------------------------------------------------------------------------
  863.   # new method: clear_stored_damage
  864.   #--------------------------------------------------------------------------
  865.   def clear_stored_damage
  866.     @stored_hp_damage = 0
  867.     @stored_mp_damage = 0
  868.     @stored_tp_damage = 0
  869.     @stored_hp_drain = 0
  870.     @stored_mp_drain = 0
  871.   end
  872.   
  873.   #--------------------------------------------------------------------------
  874.   # new method: store_damage
  875.   #--------------------------------------------------------------------------
  876.   def store_damage
  877.     @stored_hp_damage += @hp_damage
  878.     @stored_mp_damage += @mp_damage
  879.     @stored_tp_damage += @tp_damage
  880.     @stored_hp_drain += @hp_drain
  881.     @stored_mp_drain += @mp_drain
  882.   end
  883.   
  884.   #--------------------------------------------------------------------------
  885.   # new method: restore_damage
  886.   #--------------------------------------------------------------------------
  887.   def restore_damage
  888.     @hp_damage = @stored_hp_damage
  889.     @mp_damage = @stored_mp_damage
  890.     @tp_damage = @stored_tp_damage
  891.     @hp_drain = @stored_hp_drain
  892.     @mp_drain = @stored_mp_drain
  893.     clear_stored_damage
  894.   end
  895.   
  896. end # Game_ActionResult

  897. #==============================================================================
  898. # ■ Game_BattlerBase
  899. #==============================================================================

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

  1097. #==============================================================================
  1098. # ■ Game_Battler
  1099. #==============================================================================

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

  1252. #==============================================================================
  1253. # ■ Game_Actor
  1254. #==============================================================================

  1255. class Game_Actor < Game_Battler
  1256.   
  1257.   #--------------------------------------------------------------------------
  1258.   # overwrite method: perform_damage_effect
  1259.   #--------------------------------------------------------------------------
  1260.   def perform_damage_effect
  1261.     $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  1262.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1263.     Sound.play_actor_damage
  1264.   end
  1265.   
  1266.   #--------------------------------------------------------------------------
  1267.   # overwrite method: use_sprite?
  1268.   #--------------------------------------------------------------------------
  1269.   def use_sprite?; return true; end
  1270.    
  1271.   #--------------------------------------------------------------------------
  1272.   # new method: screen_x
  1273.   #--------------------------------------------------------------------------
  1274.   def screen_x
  1275.     return 0 unless SceneManager.scene_is?(Scene_Battle)
  1276.     status_window = SceneManager.scene.status_window
  1277.     return 0 if status_window.nil?
  1278.     item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  1279.     ext = SceneManager.scene.info_viewport.ox
  1280.     rect = SceneManager.scene.status_window.item_rect(self.index)
  1281.     constant = 128 + 12
  1282.     return constant + rect.x + item_rect_width / 2 - ext
  1283.   end
  1284.   
  1285.   #--------------------------------------------------------------------------
  1286.   # new method: screen_y
  1287.   #--------------------------------------------------------------------------
  1288.   def screen_y
  1289.     return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  1290.     return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  1291.     return Graphics.height - 120
  1292.   end
  1293.   
  1294.   #--------------------------------------------------------------------------
  1295.   # new method: screen_z
  1296.   #--------------------------------------------------------------------------
  1297.   def screen_z; return 100; end
  1298.   
  1299.   #--------------------------------------------------------------------------
  1300.   # new method: sprite
  1301.   #--------------------------------------------------------------------------
  1302.   def sprite
  1303.     index = $game_party.battle_members.index(self)
  1304.     return SceneManager.scene.spriteset.actor_sprites[index]
  1305.   end
  1306.   
  1307.   #--------------------------------------------------------------------------
  1308.   # new method: draw_mp?
  1309.   #--------------------------------------------------------------------------
  1310.   def draw_mp?
  1311.     return true unless draw_tp?
  1312.     for skill in skills
  1313.       next unless added_skill_types.include?(skill.stype_id)
  1314.       return true if skill.mp_cost > 0
  1315.     end
  1316.     return false
  1317.   end
  1318.   
  1319.   #--------------------------------------------------------------------------
  1320.   # new method: draw_tp?
  1321.   #--------------------------------------------------------------------------
  1322.   def draw_tp?
  1323.     return false unless $data_system.opt_display_tp
  1324.     for skill in skills
  1325.       next unless added_skill_types.include?(skill.stype_id)
  1326.       return true if skill.tp_cost > 0
  1327.     end
  1328.     return false
  1329.   end
  1330.   
  1331. end # Game_Actor

  1332. #==============================================================================
  1333. # ■ Game_Enemy
  1334. #==============================================================================

  1335. class Game_Enemy < Game_Battler
  1336.   
  1337.   #--------------------------------------------------------------------------
  1338.   # overwrite method: perform_damage_effect
  1339.   #--------------------------------------------------------------------------
  1340.   def perform_damage_effect
  1341.     @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  1342.     Sound.play_enemy_damage
  1343.   end
  1344.   
  1345.   #--------------------------------------------------------------------------
  1346.   # new methods: attack_animation_id
  1347.   #--------------------------------------------------------------------------
  1348.   def atk_animation_id1; return enemy.atk_animation_id1; end
  1349.   def atk_animation_id2; return enemy.atk_animation_id2; end
  1350.   
  1351.   #--------------------------------------------------------------------------
  1352.   # new method: sprite
  1353.   #--------------------------------------------------------------------------
  1354.   def sprite
  1355.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1356.   end
  1357.   
  1358. end # Game_Enemy

  1359. #==============================================================================
  1360. # ■ Game_Unit
  1361. #==============================================================================

  1362. class Game_Unit
  1363.   
  1364.   #--------------------------------------------------------------------------
  1365.   # alias method: make_actions
  1366.   #--------------------------------------------------------------------------
  1367.   alias game_unit_make_actions_abe make_actions
  1368.   def make_actions
  1369.     game_unit_make_actions_abe
  1370.     refresh_autobattler_status_window
  1371.   end
  1372.   
  1373.   #--------------------------------------------------------------------------
  1374.   # new method: refresh_autobattler_status_window
  1375.   #--------------------------------------------------------------------------
  1376.   def refresh_autobattler_status_window
  1377.     return unless SceneManager.scene_is?(Scene_Battle)
  1378.     return unless self.is_a?(Game_Party)
  1379.     SceneManager.scene.refresh_autobattler_status_window
  1380.   end
  1381.   
  1382. end # Game_Unit





  1383. #==============================================================================
  1384. # ■ Window_BattleStatus
  1385. #==============================================================================

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

  1565. #==============================================================================
  1566. # ■ Window_BattleActor
  1567. #==============================================================================

  1568. class Window_BattleActor < Window_BattleStatus
  1569.   
  1570.   #--------------------------------------------------------------------------
  1571.   # overwrite method: show
  1572.   #--------------------------------------------------------------------------
  1573.   def show
  1574.     create_flags
  1575.     super
  1576.   end
  1577.   
  1578.   #--------------------------------------------------------------------------
  1579.   # new method: create_flags
  1580.   #--------------------------------------------------------------------------
  1581.   def create_flags
  1582.     set_select_flag(:any)
  1583.     select(0)
  1584.     return if $game_temp.battle_aid.nil?
  1585.     if $game_temp.battle_aid.need_selection?
  1586.       select(0)
  1587.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  1588.     elsif $game_temp.battle_aid.for_user?
  1589.       battler = BattleManager.actor
  1590.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  1591.       select(id)
  1592.       set_select_flag(:user)
  1593.     elsif $game_temp.battle_aid.for_all?
  1594.       select(0)
  1595.       set_select_flag(:all)
  1596.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  1597.     elsif $game_temp.battle_aid.for_random?
  1598.       select(0)
  1599.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  1600.     end
  1601.   end
  1602.   
  1603.   #--------------------------------------------------------------------------
  1604.   # new method: set_flag
  1605.   #--------------------------------------------------------------------------
  1606.   def set_select_flag(flag)
  1607.     @select_flag = flag
  1608.     case @select_flag
  1609.     when :all, :all_dead, :random
  1610.       @cursor_all = true
  1611.     else
  1612.       @cursor_all = false
  1613.     end
  1614.   end
  1615.   
  1616.   #--------------------------------------------------------------------------
  1617.   # overwrite method: update_cursor
  1618.   #--------------------------------------------------------------------------
  1619.   def update_cursor
  1620.     if @cursor_all
  1621.       cursor_rect.set(0, 0, contents.width, contents.height)
  1622.       self.top_row = 0
  1623.     elsif @index < 0
  1624.       cursor_rect.empty
  1625.     else
  1626.       ensure_cursor_visible
  1627.       cursor_rect.set(item_rect(@index))
  1628.     end
  1629.   end
  1630.   
  1631.   #--------------------------------------------------------------------------
  1632.   # overwrite method: cursor_movable?
  1633.   #--------------------------------------------------------------------------
  1634.   def cursor_movable?
  1635.     return false if @select_flag == :user
  1636.     return super
  1637.   end
  1638.   
  1639.   #--------------------------------------------------------------------------
  1640.   # overwrite method: current_item_enabled?
  1641.   #--------------------------------------------------------------------------
  1642.   def current_item_enabled?
  1643.     return true if $game_temp.battle_aid.nil?
  1644.     if $game_temp.battle_aid.need_selection?
  1645.       member = $game_party.battle_members[@index]
  1646.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  1647.     elsif $game_temp.battle_aid.for_dead_friend?
  1648.       for member in $game_party.battle_members
  1649.         return true if member.dead?
  1650.       end
  1651.       return false
  1652.     end
  1653.     return true
  1654.   end
  1655.   
  1656. end # Window_BattleActor

  1657. #==============================================================================
  1658. # ■ Window_BattleStatusAid
  1659. #==============================================================================

  1660. class Window_BattleStatusAid < Window_BattleStatus
  1661.   
  1662.   #--------------------------------------------------------------------------
  1663.   # public instance variables
  1664.   #--------------------------------------------------------------------------
  1665.   attr_accessor :status_window
  1666.   
  1667.   #--------------------------------------------------------------------------
  1668.   # overwrite method: initialize
  1669.   #--------------------------------------------------------------------------
  1670.   def initialize
  1671.     super
  1672.     self.visible = false
  1673.     self.openness = 255
  1674.   end
  1675.   
  1676.   #--------------------------------------------------------------------------
  1677.   # overwrite method: window_width
  1678.   #--------------------------------------------------------------------------
  1679.   def window_width; return 128; end
  1680.   
  1681.   #--------------------------------------------------------------------------
  1682.   # overwrite method: show
  1683.   #--------------------------------------------------------------------------
  1684.   def show
  1685.     super
  1686.     refresh
  1687.   end
  1688.   
  1689.   #--------------------------------------------------------------------------
  1690.   # overwrite method: refresh
  1691.   #--------------------------------------------------------------------------
  1692.   def refresh
  1693.     contents.clear
  1694.     return if @status_window.nil?
  1695.     draw_item(@status_window.index)
  1696.   end
  1697.   
  1698.   #--------------------------------------------------------------------------
  1699.   # overwrite method: item_rect
  1700.   #--------------------------------------------------------------------------
  1701.   def item_rect(index)
  1702.     return Rect.new(0, 0, contents.width, contents.height)
  1703.   end
  1704.   
  1705. end # Window_BattleStatusAid

  1706. #==============================================================================
  1707. # ■ Window_BattleEnemy
  1708. #==============================================================================

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

  1855. #==============================================================================
  1856. # ■ Window_BattleHelp
  1857. #==============================================================================

  1858. class Window_BattleHelp < Window_Help
  1859.   
  1860.   #--------------------------------------------------------------------------
  1861.   # public instance variables
  1862.   #--------------------------------------------------------------------------
  1863.   attr_accessor :actor_window
  1864.   attr_accessor :enemy_window
  1865.   
  1866.   #--------------------------------------------------------------------------
  1867.   # update
  1868.   #--------------------------------------------------------------------------
  1869.   def update
  1870.     super
  1871.     if !self.visible and @text != ""
  1872.       @text = ""
  1873.       return refresh
  1874.     end
  1875.     update_battler_name
  1876.   end
  1877.   
  1878.   #--------------------------------------------------------------------------
  1879.   # update_battler_name
  1880.   #--------------------------------------------------------------------------
  1881.   def update_battler_name
  1882.     return unless @actor_window.active || @enemy_window.active
  1883.     if @actor_window.active
  1884.       battler = $game_party.battle_members[@actor_window.index]
  1885.     elsif @enemy_window.active
  1886.       battler = @enemy_window.enemy
  1887.     end
  1888.     if special_display?
  1889.       refresh_special_case(battler)
  1890.     else
  1891.       refresh_battler_name(battler) if battler_name(battler) != @text
  1892.     end
  1893.   end
  1894.   
  1895.   #--------------------------------------------------------------------------
  1896.   # battler_name
  1897.   #--------------------------------------------------------------------------
  1898.   def battler_name(battler)
  1899.     text = battler.name.clone
  1900.     return text
  1901.   end
  1902.   
  1903.   #--------------------------------------------------------------------------
  1904.   # refresh_battler_name
  1905.   #--------------------------------------------------------------------------
  1906.   def refresh_battler_name(battler)
  1907.     contents.clear
  1908.     reset_font_settings
  1909.     change_color(normal_color)
  1910.     @text = battler_name(battler)
  1911.     icons = battler.state_icons + battler.buff_icons
  1912.     dy = icons.size <= 0 ? line_height / 2 : 0
  1913.     draw_text(0, dy, contents.width, line_height, @text, 1)
  1914.     dx = (contents.width - (icons.size * 24)) / 2
  1915.     draw_actor_icons(battler, dx, line_height, contents.width)
  1916.   end
  1917.   
  1918.   #--------------------------------------------------------------------------
  1919.   # special_display?
  1920.   #--------------------------------------------------------------------------
  1921.   def special_display?
  1922.     return false if $game_temp.battle_aid.nil?
  1923.     return false if $game_temp.battle_aid.for_user?
  1924.     return !$game_temp.battle_aid.need_selection?
  1925.   end
  1926.   
  1927.   #--------------------------------------------------------------------------
  1928.   # refresh_special_case
  1929.   #--------------------------------------------------------------------------
  1930.   def refresh_special_case(battler)
  1931.     if $game_temp.battle_aid.for_opponent?
  1932.       if $game_temp.battle_aid.for_all?
  1933.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  1934.       else
  1935.         case $game_temp.battle_aid.number_of_targets
  1936.         when 1
  1937.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  1938.         else
  1939.           number = $game_temp.battle_aid.number_of_targets
  1940.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  1941.         end
  1942.       end
  1943.     else # $game_temp.battle_aid.for_friend?
  1944.       if $game_temp.battle_aid.for_dead_friend?
  1945.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  1946.       elsif $game_temp.battle_aid.for_random?
  1947.         case $game_temp.battle_aid.number_of_targets
  1948.         when 1
  1949.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  1950.         else
  1951.           number = $game_temp.battle_aid.number_of_targets
  1952.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  1953.         end
  1954.       else
  1955.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  1956.       end
  1957.     end
  1958.     return if text == @text
  1959.     @text = text
  1960.     contents.clear
  1961.     reset_font_settings
  1962.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  1963.   end
  1964.   
  1965. end # Window_BattleHelp

  1966. #==============================================================================
  1967. # ■ Window_BattleLog
  1968. #==============================================================================

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

  2130. #==============================================================================
  2131. # ■ Window_SkillList
  2132. #==============================================================================

  2133. class Window_SkillList < Window_Selectable
  2134.   
  2135.   #--------------------------------------------------------------------------
  2136.   # overwrite method: spacing
  2137.   #--------------------------------------------------------------------------
  2138.   def spacing
  2139.     return 8 if $game_party.in_battle
  2140.     return super
  2141.   end
  2142.   
  2143. end # Window_SkillList

  2144. #==============================================================================
  2145. # ■ Window_ItemList
  2146. #==============================================================================

  2147. class Window_ItemList < Window_Selectable
  2148.   
  2149.   #--------------------------------------------------------------------------
  2150.   # overwrite method: spacing
  2151.   #--------------------------------------------------------------------------
  2152.   def spacing
  2153.     return 8 if $game_party.in_battle
  2154.     return super
  2155.   end
  2156.   
  2157. end # Window_ItemList

  2158. #==============================================================================
  2159. # ■ Scene_Battle
  2160. #==============================================================================

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

  2301.   end
  2302.   
  2303.   #--------------------------------------------------------------------------
  2304.   # alias method: create_actor_command_window
  2305.   #--------------------------------------------------------------------------
  2306.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2307.   def create_actor_command_window
  2308.     scene_battle_create_actor_command_window_abe

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
152 小时
注册时间
2012-1-12
帖子
456
58
发表于 2012-8-9 21:06:59 | 只看该作者
看技能的时候我看到了这个:

但是我加了ace战斗脚本:
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Battle Engine v1.21
  4. # -- Last Updated: 2012.02.13
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.02.13 - Bug fixed: Odd Victory game crash fixed.
  15. # 2012.02.12 - Bug fixed: Displayed damage in combat log is correct now.
  16. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  17. # 2012.01.24 - Compatibility Update: Enemy Levels
  18. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  19. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  20. #              animation only once.
  21. #            - Reduced lag from battle system constantly recreating bitmaps.
  22. # 2012.01.10 - Compatibility Update: Battle System FTB
  23. # 2012.01.09 - Anticrash methods implemented.
  24. #            - Damage Popups are now separate for damage formulas and recovery.
  25. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  26. # 2012.01.02 - Compatibility Update: Target Manager
  27. #            - Added Option: AUTO_FAST
  28. #            - Random hits now show animations individually.
  29. # 2011.12.30 - Compatibility Update: Enemy Levels
  30. #            - Added Option to center the actors in the HUD.
  31. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  32. #            - Default battle system bug fixes are now included from YEA's Ace
  33. #              Core Engine.
  34. #            - Groundwork is also made to support future battle system types.
  35. #            - Multi-hit actions no longer linger when a target dies during the
  36. #              middle of one of the hits.
  37. #            - Compatibility Update: Lunatic Objects v1.02
  38. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  39. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  40. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  41. #            - Bug fixed: During State popup fix.
  42. #            - Added HIDE_POPUP_SWITCH.
  43. # 2011.12.17 - Compatibiilty Update: Cast Animations
  44. # 2011.12.15 - Compatibility Update: Battle Command List
  45. # 2011.12.14 - Compatibility Update: Lunatic Objects
  46. # 2011.12.13 - Compatibility Update: Command Party
  47. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  48. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  49. #            - Popup graphical bug fixed.
  50. #            - Bug fixed: Didn't wait for boss dead animations.
  51. #            - Bug fixed: Surprise attacks that froze the game.
  52. #            - Bug fixed: Popups didn't show for straight recovery effects.
  53. # 2011.12.08 - Finished Script.
  54. # 2011.12.04 - Started Script.
  55. #
  56. #==============================================================================
  57. # ▼ Introduction
  58. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  59. # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  60. # allows for easier management of the battle engine without adding too many
  61. # features, allowing users to customize what they want as they see fit. While
  62. # the Ace Battle Engine isn't an entirely new engine, it gives users control
  63. # that RPG Maker VX Ace didn't originally give them.
  64. #
  65. # Furthermore, this script provides some new features. They are as follows:
  66. #
  67. # -----------------------------------------------------------------------------
  68. # Animation Fixes
  69. # -----------------------------------------------------------------------------
  70. # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  71. # these fixes are included in this script as well to ensure it's working for
  72. # the battle script in the event someone chooses not to work with the Ace Core
  73. # Engine script. The animation fixes prevent excessive animation overlaying
  74. # (and making the screen look really ugly) and prevents animation clashing
  75. # between two dual wielding normal attack animations.
  76. #
  77. # -----------------------------------------------------------------------------
  78. # Enemy Animations
  79. # -----------------------------------------------------------------------------
  80. # Enemies now show battle animations when they deliver attacks and skills
  81. # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  82. # than just sound effects and the screen shaking. Now, animations play where
  83. # the status window is and relative to the position of each party member.
  84. #
  85. # -----------------------------------------------------------------------------
  86. # Left/Right Command Selection
  87. # -----------------------------------------------------------------------------
  88. # While choosing actions, the player can press Left or Right to move freely
  89. # between (alive) actors to change their skills. Players no longer have to
  90. # cancel all the way back to change one person's skill and reselect everything.
  91. # On that note, there is now the option that when a battle starts or at the
  92. # end of a turn, players will start immediately at command selection rather
  93. # than needing to select "Fight" in the Party Command Window.
  94. #
  95. # -----------------------------------------------------------------------------
  96. # Popups
  97. # -----------------------------------------------------------------------------
  98. # Dealing damage, inflicting states, adding buffs, landing critical hits,
  99. # striking weaknesses, missing attacks, you name it, there's probably a popup
  100. # for it. Popups deliver information to the player in a quick or orderly
  101. # fashion without requiring the player to read lines of text.
  102. #
  103. # -----------------------------------------------------------------------------
  104. # Targeting Window
  105. # -----------------------------------------------------------------------------
  106. # When targeting enemies, the window is no longer displayed. Instead, the
  107. # targeted enemies are highlighted and their names are shown at the top of the
  108. # screen in a help window. Another thing that's changed is when skills that
  109. # target multiple targets are selected, there is a confirmation step that the
  110. # player must take before continuing. In this confirmation step, all of the
  111. # multiple targets are selected and in the help window would display the scope
  112. # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  113. # this step by default.
  114. #
  115. # -----------------------------------------------------------------------------
  116. # Toggling On and Off Special Effects and Text
  117. # -----------------------------------------------------------------------------
  118. # Not everybody likes having the screen shake or the enemies blink when they
  119. # take damage. These effects can now be toggled on and off. Certain text can
  120. # also be toggled on and off from appearing. A lot of the displayed text has
  121. # been rendered redundant through the use of popups.
  122. #
  123. # -----------------------------------------------------------------------------
  124. # Visual Battle Status Window
  125. # -----------------------------------------------------------------------------
  126. # Rather than just having rows of names with HP and MP bars next to them, the
  127. # Battle Status Window now displays actors' faces and their gauges aligned at
  128. # the bottom. More status effects can be shown in addition to showing more
  129. # members on screen at once. The Battle Status Window is also optimized to
  130. # refresh less (thus, removing potential lag from the system).
  131. #
  132. # -----------------------------------------------------------------------------
  133. # Window Position Changes
  134. # -----------------------------------------------------------------------------
  135. # Windows such as the Skill Window and Item Window have been rearranged to
  136. # always provide the player a clear view of the battlefield rather than opening
  137. # up and covering everything. As such, the window positions are placed at the
  138. # bottom of the screen and are repositioned.
  139. #
  140. #==============================================================================
  141. # ▼ Instructions
  142. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  143. # To install this script, open up your script editor and copy/paste this script
  144. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  145. #
  146. # -----------------------------------------------------------------------------
  147. # Skill Notetags - These notetags go in the skills notebox in the database.
  148. # -----------------------------------------------------------------------------
  149. # <one animation>
  150. # Causes the action to display the action animation only once, even if it's a
  151. # multi-hit action. This is used primarily for non-all scope targeting.
  152. #
  153. # -----------------------------------------------------------------------------
  154. # Item Notetags - These notetags go in the items notebox in the database.
  155. # -----------------------------------------------------------------------------
  156. # <one animation>
  157. # Causes the action to display the action animation only once, even if it's a
  158. # multi-hit action. This is used primarily for non-all scope targeting.
  159. #
  160. # -----------------------------------------------------------------------------
  161. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  162. # -----------------------------------------------------------------------------
  163. # <atk ani 1: x>
  164. # <atk ani 2: x>
  165. # Changes the normal attack animation of the particular enemy to animation x.
  166. # Attack animation 1 is the first one that plays. If there's a second animation
  167. # then the second one will play after in mirrored form.
  168. #
  169. # -----------------------------------------------------------------------------
  170. # State Notetags - These notetags go in the state notebox in the database.
  171. # -----------------------------------------------------------------------------
  172. # <popup add: string>
  173. # <popup rem: string>
  174. # <popup dur: string>
  175. # Status effects now create popups whenever they're inflicted. However, if you
  176. # don't like that a certain status effect uses a particular colour setting,
  177. # change "string" to one of the rulesets below to cause that popup to use a
  178. # different ruleset.
  179. #
  180. # <popup hide add>
  181. # <popup hide rem>
  182. # <popup hide dur>
  183. # Not everybody wants status effects to show popups when inflicted. When this
  184. # is the case, insert the respective tag to hide popups from appearing when the
  185. # state is added, removed, or during the stand-by phases.
  186. #
  187. # -----------------------------------------------------------------------------
  188. # Debug Tools - These tools only work during Test Play.
  189. # -----------------------------------------------------------------------------
  190. # - F5 Key -
  191. # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  192. # All states and buffs are removed whether they are positive or negative.
  193. #
  194. # - F6 Key -
  195. # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  196. #
  197. # - F7 Key -
  198. # Sets all actors to have max TP. Everything else is unaffected.
  199. #
  200. # - F8 Key -
  201. # Kills all enemies in battle. Ends the battle quickly.
  202. #
  203. #==============================================================================
  204. # ▼ Compatibility
  205. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  206. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  207. # it will run with RPG Maker VX without adjusting.
  208. #
  209. #==============================================================================

  210. module YEA
  211.   module BATTLE
  212.    
  213.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  214.     # - General Battle Settings -
  215.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  216.     # These settings are adjusted for the overall battle system. These are
  217.     # various miscellaneous options to adjust. Each of the settings below will
  218.     # explain what they do. Change default enemy battle animations here, too.
  219.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  220.     BLINK_EFFECTS      = false  # Blink sprite when damaged?
  221.     FLASH_WHITE_EFFECT = true   # Flash enemy white when it starts an attack.
  222.     SCREEN_SHAKE       = false  # Shake screen in battle?
  223.     SKIP_PARTY_COMMAND = false  # Skips the Fight/Escape menu.
  224.     AUTO_FAST          = true   # Causes message windows to not wait.
  225.     ENEMY_ATK_ANI      = 36     # Sets default attack animation for enemies.
  226.    
  227.     # If this switch is ON, popups will be hidden. If OFF, the popups will be
  228.     # shown. If you do not wish to use this switch, set it to 0.
  229.     HIDE_POPUP_SWITCH  = 0
  230.    
  231.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  232.     # - Battle Status Window -
  233.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  234.     # This sets the default battle system your game will use. If your game
  235.     # doesn't have any other battle systems installed, it will use :dtb.
  236.     #
  237.     # Battle System        Requirement
  238.     #   :dtb               - Default Turn Battle. Default system.
  239.     #   :ftb               - YEA Battle System Add-On: Free Turn Battle
  240.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241.     DEFAULT_BATTLE_SYSTEM = :dtb     # Default battle system set.
  242.    
  243.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  244.     # - Battle Status Window -
  245.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  246.     # Here, you can adjust the settings for the battle status window. The
  247.     # battle status window, by default, will show the actor's face, HP, MP, TP
  248.     # (if viable), and any inflicted status effects.
  249.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250.     BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.
  251.     BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
  252.     BATTLESTATUS_NO_ACTION_ICON = 185   # No action icon.
  253.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11    # Y Location buffer used for HP gauge.
  254.     BATTLESTATUS_CENTER_FACES   = false # Center faces for the Battle Status.
  255.    
  256.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  257.     # - Help Window Text -
  258.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  259.     # When selecting a target to attack, this is the text that will be shown
  260.     # in place of a target's name for special cases. These special cases are
  261.     # for selections that were originally non-targetable battle scopes.
  262.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  263.     HELP_TEXT_ALL_FOES        = "All Foes"
  264.     HELP_TEXT_ONE_RANDOM_FOE  = "One Random Foe"
  265.     HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  266.     HELP_TEXT_ALL_ALLIES      = "All Allies"
  267.     HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  268.     HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  269.     HELP_TEXT_RANDOM_ALLIES   = "%d Random Allies"
  270.    
  271.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  272.     # - Popup Settings -
  273.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  274.     # These settings will adjust the popups that appear in battle. Popups
  275.     # deliver information to your player as battlers deal damage, inflict
  276.     # status effects, and more.
  277.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  278.     ENABLE_POPUPS  = true     # Set this to false if you wish to disable them.
  279.     FLASH_CRITICAL = true     # Sets critical hits to flash.
  280.    
  281.     # This hash adjusts the popup settings that will govern how popups appear.
  282.     # Adjust them accordingly.
  283.     POPUP_SETTINGS ={
  284.       :offset     => -24,         # Height offset of a popup.
  285.       :fade       => 12,          # Fade rate for each popup.
  286.       :full       => 60,          # Frames before a popup fades.
  287.       :hp_dmg     => "-%s ",      # SprintF for HP damage.
  288.       :hp_heal    => "+%s ",      # SprintF for HP healing.
  289.       :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  290.       :mp_heal    => "+%s MP",    # SprintF for MP healing.
  291.       :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  292.       :tp_heal    => "+%s TP",    # SprintF for MP healing.
  293.       :drained    => "DRAIN",     # Text display for draining HP/MP.
  294.       :critical   => "CRITICAL!", # Text display for critical hit.
  295.       :missed     => "MISS",      # Text display for missed attack.
  296.       :evaded     => "EVADE!",    # Text display for evaded attack.
  297.       :nulled     => "NULL",      # Text display for nulled attack.
  298.       :failed     => "FAILED",    # Text display for a failed attack.
  299.       :add_state  => "+%s",      # SprintF for added states.
  300.       :rem_state  => "-%s",      # SprintF for removed states.
  301.       :dur_state  => "%s",        # SprintF for during states.
  302.       :ele_rates  => true,        # This will display elemental affinities.
  303.       :ele_wait   => 20,          # This is how many frames will wait.
  304.       :weakpoint  => "WEAKPOINT", # Appears if foe is weak to element.
  305.       :resistant  => "RESIST",    # Appears if foe is resistant to element.
  306.       :immune     => "IMMUNE",    # Appears if foe is immune to element.
  307.       :absorbed   => "ABSORB",    # Appears if foe can absorb the element.
  308.       :add_buff   => "%s+",      # Appears when a positive buff is applied.
  309.       :add_debuff => "%s-",      # Appears when a negative buff is applied.
  310.     } # Do not remove this.
  311.    
  312.     # This is the default font used for the popups. Adjust them accordingly
  313.     # or even add new ones.
  314.     DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  315.    
  316.     # The following are the various rules that govern the individual popup
  317.     # types that will appear. Adjust them accordingly. Here is a list of what
  318.     # each category does.
  319.     #   Zoom1    The zoom the popup starts at. Values over 2.0 may cause lag.
  320.     #   Zoom2    The zoom the popup goes to. Values over 2.0 may cause lag.
  321.     #   Sz       The font size used for the popup text.
  322.     #   Bold     Applying bold for the popup text.
  323.     #   Italic   Applying italic for the popup text.
  324.     #   Red      The red value of the popup text.
  325.     #   Grn      The green value of the popup text.
  326.     #   Blu      The blue value of the popup text.
  327.     #   Font     The font used for the popup text.
  328.     POPUP_RULES ={
  329.       # Type     => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  330.       "DEFAULT"  => [   2.0,   1.0, 24, true,  false, 255, 255, 255, DEFAULT],
  331.       "CRITICAL" => [   2.0,   1.0, 24, true,  false, 255,  80,  80, DEFAULT],
  332.       "HP_DMG"   => [   2.0,   1.0, 36, true,  false, 255, 255, 255, DEFAULT],
  333.       "HP_HEAL"  => [   2.0,   1.0, 36, true,  false, 130, 250, 130, DEFAULT],
  334.       "MP_DMG"   => [   2.0,   1.0, 36, true,  false, 220, 180, 255, DEFAULT],
  335.       "MP_HEAL"  => [   2.0,   1.0, 36, true,  false, 160, 230, 255, DEFAULT],
  336.       "TP_DMG"   => [   2.0,   1.0, 36, true,  false, 242, 108,  78, DEFAULT],
  337.       "TP_HEAL"  => [   2.0,   1.0, 36, true,  false, 251, 175,  92, DEFAULT],
  338.       "ADDSTATE" => [   2.0,   1.0, 24, true,  false, 240, 100, 100, DEFAULT],
  339.       "REMSTATE" => [   2.0,   1.0, 24, true,  false, 125, 170, 225, DEFAULT],
  340.       "DURSTATE" => [   2.0,   1.0, 24, true,  false, 255, 240, 150, DEFAULT],
  341.       "DRAIN"    => [   2.0,   1.0, 36, true,  false, 250, 190, 255, DEFAULT],
  342.       "POSITIVE" => [   2.0,   1.0, 24, true,  false, 110, 210, 245, DEFAULT],
  343.       "NEGATIVE" => [   2.0,   1.0, 24, true,  false, 245, 155, 195, DEFAULT],
  344.       "WEAK_ELE" => [   0.5,   1.0, 24, true,  false, 240, 110,  80, DEFAULT],
  345.       "IMMU_ELE" => [   0.5,   1.0, 24, true,  false, 185, 235, 255, DEFAULT],
  346.       "REST_ELE" => [   0.5,   1.0, 24, true,  false, 145, 230, 180, DEFAULT],
  347.       "ABSB_ELE" => [   0.5,   1.0, 24, true,  false, 250, 190, 255, DEFAULT],
  348.       "BUFF"     => [   2.0,   1.0, 24, true,  false, 255, 240, 100, DEFAULT],
  349.       "DEBUFF"   => [   2.0,   1.0, 24, true,  false, 160, 130, 200, DEFAULT],
  350.     } # Do not remove this.
  351.    
  352.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  353.     # - Streamlined Messages -
  354.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  355.     # Want to remove some of those annoying messages that appear all the time?
  356.     # Now you can! Select which messages you want to enable or disable. Some of
  357.     # these messages will be rendered useless due to popups.
  358.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  359.     MSG_ENEMY_APPEARS  = false  # Message when enemy appears start of battle.
  360.     MSG_CURRENT_STATE  = false  # Show which states has affected battler.
  361.     MSG_CURRENT_ACTION = true   # Show the current action of the battler.
  362.     MSG_COUNTERATTACK  = true   # Show the message for a counterattack.
  363.     MSG_REFLECT_MAGIC  = true   # Show message for reflecting magic attacks.
  364.     MSG_SUBSTITUTE_HIT = true   # Show message for ally taking another's hit.
  365.     MSG_FAILURE_HIT    = false  # Show effect failed against target.
  366.     MSG_CRITICAL_HIT   = false  # Show attack was a critical hit.
  367.     MSG_HIT_MISSED     = false  # Show attack missed the target.
  368.     MSG_EVASION        = false  # Show attack was evaded by the target.
  369.     MSG_HP_DAMAGE      = false  # Show HP damage to target.
  370.     MSG_MP_DAMAGE      = false  # Show MP damage to target.
  371.     MSG_TP_DAMAGE      = false  # Show TP damage to target.
  372.     MSG_ADDED_STATES   = false  # Show target's added states.
  373.     MSG_REMOVED_STATES = false  # Show target's removed states.
  374.     MSG_CHANGED_BUFFS  = false  # Show target's changed buffs.
  375.    
  376.   end # BATTLE
  377. end # YEA

  378. #==============================================================================
  379. # ▼ Editting anything past this point may potentially result in causing
  380. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  381. # halitosis so edit at your own risk.
  382. #==============================================================================

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

  409. #==============================================================================
  410. # ■ Switch
  411. #==============================================================================

  412. module Switch
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # self.hide_popups
  416.   #--------------------------------------------------------------------------
  417.   def self.hide_popups
  418.     return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  419.     return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  420.   end
  421.   
  422. end # Switch

  423. #==============================================================================
  424. # ■ Colour
  425. #==============================================================================

  426. module Colour
  427.   
  428.   #--------------------------------------------------------------------------
  429.   # self.text_colour
  430.   #--------------------------------------------------------------------------
  431.   def self.text_colour(index)
  432.     windowskin = Cache.system("Window")
  433.     x = 64 + (index % 8) * 8
  434.     y = 96 + (index / 8) * 8
  435.     return windowskin.get_pixel(x, y)
  436.   end
  437.   
  438. end # Colour

  439. #==============================================================================
  440. # ■ Icon
  441. #==============================================================================

  442. module Icon
  443.   
  444.   #--------------------------------------------------------------------------
  445.   # self.no_action
  446.   #--------------------------------------------------------------------------
  447.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  448.    
  449. end # Icon

  450. #==============================================================================
  451. # ■ Numeric
  452. #==============================================================================

  453. class Numeric
  454.   
  455.   #--------------------------------------------------------------------------
  456.   # new method: group_digits
  457.   #--------------------------------------------------------------------------
  458.   unless $imported["YEA-CoreEngine"]
  459.   def group; return self.to_s; end
  460.   end # $imported["YEA-CoreEngine"]
  461.    
  462. end # Numeric

  463. #==============================================================================
  464. # ■ DataManager
  465. #==============================================================================

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

  491. #==============================================================================
  492. # ■ RPG::UsableItem
  493. #==============================================================================

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

  518. #==============================================================================
  519. # ■ RPG::Enemy
  520. #==============================================================================

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

  549. #==============================================================================
  550. # ■ RPG::Enemy
  551. #==============================================================================

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

  590. #==============================================================================
  591. # ■ BattleManager
  592. #==============================================================================

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

  680. #==============================================================================
  681. # ■ Game_System
  682. #==============================================================================

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

  719. #==============================================================================
  720. # ■ Sprite_Base
  721. #==============================================================================

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

  740. #==============================================================================
  741. # ■ Sprite_Battler
  742. #==============================================================================

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

  857. #==============================================================================
  858. # ■ Sprite_Popup
  859. #==============================================================================

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

  966. #==============================================================================
  967. # ■ Spriteset_Battle
  968. #==============================================================================

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

  1008. #==============================================================================
  1009. # ■ Game_Temp
  1010. #==============================================================================

  1011. class Game_Temp
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # public instance variables
  1015.   #--------------------------------------------------------------------------
  1016.   attr_accessor :battle_aid
  1017.   attr_accessor :evaluating
  1018.   attr_accessor :iconset
  1019.   
  1020.   #--------------------------------------------------------------------------
  1021.   # alias method: initialize
  1022.   #--------------------------------------------------------------------------
  1023.   alias game_temp_initialize_abe initialize
  1024.   def initialize
  1025.     game_temp_initialize_abe
  1026.     @iconset = Cache.system("Iconset")
  1027.   end
  1028.   
  1029. end # Game_Temp

  1030. #==============================================================================
  1031. # ■ Game_Action
  1032. #==============================================================================

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

  1057. #==============================================================================
  1058. # ■ Game_ActionResult
  1059. #==============================================================================

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

  1106. #==============================================================================
  1107. # ■ Game_BattlerBase
  1108. #==============================================================================

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

  1306. #==============================================================================
  1307. # ■ Game_Battler
  1308. #==============================================================================

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

  1461. #==============================================================================
  1462. # ■ Game_Actor
  1463. #==============================================================================

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

  1541. #==============================================================================
  1542. # ■ Game_Enemy
  1543. #==============================================================================

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

  1568. #==============================================================================
  1569. # ■ Game_Unit
  1570. #==============================================================================

  1571. class Game_Unit
  1572.   
  1573.   #--------------------------------------------------------------------------
  1574.   # alias method: make_actions
  1575.   #--------------------------------------------------------------------------
  1576.   alias game_unit_make_actions_abe make_actions
  1577.   def make_actions
  1578.     game_unit_make_actions_abe
  1579.     refresh_autobattler_status_window
  1580.   end
  1581.   
  1582.   #--------------------------------------------------------------------------
  1583.   # new method: refresh_autobattler_status_window
  1584.   #--------------------------------------------------------------------------
  1585.   def refresh_autobattler_status_window
  1586.     return unless SceneManager.scene_is?(Scene_Battle)
  1587.     return unless self.is_a?(Game_Party)
  1588.     SceneManager.scene.refresh_autobattler_status_window
  1589.   end
  1590.   
  1591. end # Game_Unit





  1592. #==============================================================================
  1593. # ■ Window_BattleStatus
  1594. #==============================================================================

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

  1774. #==============================================================================
  1775. # ■ Window_BattleActor
  1776. #==============================================================================

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

  1866. #==============================================================================
  1867. # ■ Window_BattleStatusAid
  1868. #==============================================================================

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

  1915. #==============================================================================
  1916. # ■ Window_BattleEnemy
  1917. #==============================================================================

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

  2064. #==============================================================================
  2065. # ■ Window_BattleHelp
  2066. #==============================================================================

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

  2175. #==============================================================================
  2176. # ■ Window_BattleLog
  2177. #==============================================================================

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

  2339. #==============================================================================
  2340. # ■ Window_SkillList
  2341. #==============================================================================

  2342. class Window_SkillList < Window_Selectable
  2343.   
  2344.   #--------------------------------------------------------------------------
  2345.   # overwrite method: spacing
  2346.   #--------------------------------------------------------------------------
  2347.   def spacing
  2348.     return 8 if $game_party.in_battle
  2349.     return super
  2350.   end
  2351.   
  2352. end # Window_SkillList

  2353. #==============================================================================
  2354. # ■ Window_ItemList
  2355. #==============================================================================

  2356. class Window_ItemList < Window_Selectable
  2357.   
  2358.   #--------------------------------------------------------------------------
  2359.   # overwrite method: spacing
  2360.   #--------------------------------------------------------------------------
  2361.   def spacing
  2362.     return 8 if $game_party.in_battle
  2363.     return super
  2364.   end
  2365.   
  2366. end # Window_ItemList

  2367. #==============================================================================
  2368. # ■ Scene_Battle
  2369. #==============================================================================

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

  2510.   end
  2511.   
  2512.   #--------------------------------------------------------------------------
  2513.   # alias method: create_actor_command_window
  2514.   #--------------------------------------------------------------------------
  2515.   alias scene_battle_create_actor_command_window_abe create_actor_command_window
  2516.   def create_actor_command_window
  2517.     scene_battle_create_actor_command_window_abe

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

  2996. #==============================================================================
  2997. #
  2998. # ▼ End of File
  2999. #
  3000. #==============================================================================
复制代码

点评

我个人认为这跟你的这个脚本没关系 是装备帮助增强有问题,因为我用的横版也是和你出的错误一样  发表于 2015-6-27 13:51
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
857
在线时间
397 小时
注册时间
2008-1-1
帖子
84
59
发表于 2012-8-11 00:41:00 | 只看该作者
腳本衝突是在所難免的
樓上的只能放棄裝備強化或這個外國腳本了

話說我頗希望作者能回來修復命中暴增的bug
都沒辦法添加+命中的屬性
一加就加上萬%...
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
857
在线时间
397 小时
注册时间
2008-1-1
帖子
84
60
发表于 2012-8-19 09:20:29 | 只看该作者
最近幾天再次研究了一下命中的問題
發現是只要刷出加減命中的裝備
身上所有裝備的命中都會變成同一數值
好比說所有裝備命中都變29.9或7556之類的
不知道從何修正(死)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-22 09:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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