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

Project1

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

[已经解决] VA的戰鬥模式 如何做才能向VX一樣

[复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
579 小时
注册时间
2011-5-30
帖子
497
跳转到指定楼层
1
发表于 2012-11-8 16:35:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 拉羅卡特 于 2012-11-8 21:35 编辑

有戰鬥頭像顯示?




有辦法麻

Lv1.梦旅人

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


评分

参与人数 1星屑 +20 收起 理由
拉羅卡特 + 20 感謝^^

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
38 小时
注册时间
2010-9-4
帖子
43
3
发表于 2012-11-9 19:07:59 | 只看该作者
c248611 发表于 2012-11-8 20:23
$imported = {} if $imported.nil?
$imported["YEA-BattleEngine"] = true

请问要怎么插入这段脚本呢- -  我复制的话黏贴是在同一行的 运行不了- -

点评

用谷歌或者搜狐浏览器打开就能复制了  发表于 2013-1-3 19:44
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-1-1
帖子
21
4
发表于 2013-1-3 19:32:07 | 只看该作者
請問這要怎麼解決?

评分

参与人数 1星屑 -10 收起 理由
Mic_洛洛 -10 请自行发帖提问~

查看全部评分

回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
21891
在线时间
8558 小时
注册时间
2011-12-31
帖子
3361
5
发表于 2013-1-3 20:45:44 | 只看该作者

Ver1
  1. #==============================================================================
  2. # ■ VXAce-RGSS3-10 フロントビュー改 [Ver.1.0.0]            by Claimh
  3. #------------------------------------------------------------------------------
  4. # ・戦闘画面を顔グラフィック表示に変更します。
  5. # ・エネミー選択ウィンドウで残HPを表示します。
  6. #==============================================================================


  7. #==============================================================================
  8. # ■ Window_BattleStatus
  9. #==============================================================================
  10. class Window_BattleStatus < Window_Selectable
  11.   #--------------------------------------------------------------------------
  12.   # ● HP/MP/TPの行の高さ取得
  13.   #--------------------------------------------------------------------------
  14.   def gauge_line_height
  15.     return 16
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 桁数の取得
  19.   #--------------------------------------------------------------------------
  20.   def col_max
  21.     return [item_max, 4].max
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 横に項目が並ぶときの空白の幅を取得
  25.   #--------------------------------------------------------------------------
  26.   def spacing
  27.     return 0
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 項目を描画する矩形の取得
  31.   #--------------------------------------------------------------------------
  32.   def item_rect(index)
  33.     rect = Rect.new
  34.     rect.width = item_width
  35.     rect.height = contents_height
  36.     rect.x = index % col_max * (item_width + spacing)
  37.     rect.y = index / col_max * contents_height
  38.     rect
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 基本エリアの矩形を取得
  42.   #--------------------------------------------------------------------------
  43.   def basic_area_rect(index)
  44.     rect = item_rect_for_text(index)
  45.     rect.height -= gauge_area_height
  46.     rect
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● ゲージエリアの矩形を取得
  50.   #--------------------------------------------------------------------------
  51.   def gauge_area_rect(index)
  52.     rect = item_rect_for_text(index)
  53.     rect.y += contents_height - gauge_area_height - 8
  54.     rect.height = gauge_area_height
  55.     rect
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● ゲージエリアの高さを取得
  59.   #--------------------------------------------------------------------------
  60.   def gauge_area_height
  61.     return (gauge_line_height * ($data_system.opt_display_tp ? 3 : 2))
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 基本エリアの描画
  65.   #--------------------------------------------------------------------------
  66.   def draw_basic_area(rect, actor)
  67. #    draw_actor_name(actor, rect.x, rect.y, 100)
  68.     draw_actor_face(actor, rect.x, rect.y, !actor.dead?)
  69.     draw_actor_icons(actor, rect.x, rect.y, rect.width+8)
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● ゲージエリアの描画(TP あり)
  73.   #--------------------------------------------------------------------------
  74.   def draw_gauge_area_with_tp(rect, actor)
  75.     draw_actor_hp(actor, rect.x, rect.y + gauge_line_height * 0, rect.width)
  76.     draw_actor_mp(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  77.     draw_actor_tp(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● ゲージエリアの描画(TP なし)
  81.   #--------------------------------------------------------------------------
  82.   def draw_gauge_area_without_tp(rect, actor)
  83.     draw_actor_hp(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
  84.     draw_actor_mp(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
  85.   end
  86. end


  87. #==============================================================================
  88. # ■ Window_BattleEnemy
  89. #==============================================================================
  90. class Window_BattleEnemy < Window_Selectable
  91.   #--------------------------------------------------------------------------
  92.   # ● 項目の描画
  93.   #--------------------------------------------------------------------------
  94.   alias draw_item_fv draw_item
  95.   def draw_item(index)
  96.     draw_hp(index)
  97.     draw_item_fv(index)
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● HPの描画
  101.   #--------------------------------------------------------------------------
  102.   def draw_hp(index)
  103.     rect = item_rect_for_text(index)
  104.     w = rect.width - 60
  105.     x = rect.x + 30
  106.     hp = $game_troop.alive_members[index].hp_rate
  107.     draw_gauge(x, rect.y, w, hp, hp_gauge_color1, hp_gauge_color2)
  108.   end
  109. end
复制代码
Ver1



Ver2

点评

謝謝您的分享!  发表于 2013-1-3 22:48
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 02:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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