查看: 4678|回复: 6

[已经解决] YEA胜利显示出错

[复制链接]
梦石
0
星屑
50
在线时间
146 小时
注册时间
2011-9-16
回帖
36
发表于 2012-10-16 20:49:34 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 婉烟沉沫 于 2012-10-16 21:57 编辑

于是……就是这样了。我没有动过脚本,但是战斗结束之后……
RRA264($}SE3CIMA``HEV.jpg
TT,求助啊

附带脚本

#==============================================================================
#
# ▼ Yanfly Engine Ace - Victory Aftermath v1.03
# -- Last Updated: 2012.01.07
# -- Level: Easy, Normal, Hard
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-VictoryAftermath"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.07 - Compatibility Update: JP Manager
# 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
# 2011.12.26 - Compatibility Update: Command Autobattle
# 2011.12.16 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# At the end of each battle, RPG Maker VX Ace by default shows text saying that
# the party has gained so-and-so EXP while this person leveled up and your
# party happened to find these drops. This script changes that text into
# something more visual for your players to see. Active battle members will be
# seen gaining EXP, any kind of level up changes, and a list of the items
# obtained through drops.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <win quotes>
#  string
#  string
# </win quotes>
# Sets the win quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <level quotes>
#  string
#  string
# </level quotes>
# Sets the level up quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <drops quotes>
#  string
#  string
# </drops quotes>
# Sets the drops quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <win quotes>
#  string
#  string
# </win quotes>
# Sets the win quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <level quotes>
#  string
#  string
# </level quotes>
# Sets the level up quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <drops quotes>
#  string
#  string
# </drops quotes>
# Sets the drops quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module VICTORY_AFTERMATH
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are various settings that are used throughout the Victory Aftermath
    # portion of a battle. Adjust them as you see fit.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # Victory BGM
    VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP ticking SFX
    LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # Level Up SFX
    SKILLS_TEXT  = "新技能"                        # New skills text title.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Important Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are some important settings so please set them up properly. This
    # section includes a switch that allows you to skip the victory aftermath
    # phase (for those back to back battles and making them seamless) and it
    # also allows you to declare a common event to run after each battle. If
    # you do not wish to use either of these features, set them to 0. The
    # common event will run regardless of win or escape.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    SKIP_AFTERMATH_SWITCH  = 0  # If switch on, skip aftermath. 0 to disable.
    AFTERMATH_COMMON_EVENT = 0  # Runs common event after battle. 0 to disable.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Top Text Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Here, you can adjust the various text that appears in the window that
    # appears at the top of the screen.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    TOP_TEAM         = "%s的队伍"           # Team name used.
    TOP_VICTORY_TEXT = "%s胜利了!"   # Text used to display victory.
    TOP_LEVEL_UP     = "%s升级!"  # Text used to display level up.
    TOP_SPOILS       = "胜利战利品!"     # Text used for spoils.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - EXP Gauge Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Adjust how the EXP Gauge appears for the Victory Aftermath here. This
    # includes the text display, the font size, the colour of the gauges, and
    # more. Adjust it all here.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    VICTORY_EXP  = "+%sEXP"      # Text used to display EXP.
    EXP_PERCENT  = "%1.2f%%"     # The way EXP percentage will be displayed.
    LEVELUP_TEXT = "LEVEL UP!"   # Text to replace percentage when leveled.
    MAX_LVL_TEXT = "MAX LEVEL"   # Text to replace percentage when max level.
    FONTSIZE_EXP = 20            # Font size used for EXP.
    EXP_TICKS    = 15            # Ticks to full EXP
    EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
    EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
    LEVEL_GAUGE1 = 13            # "Window" skin text colour for leveling.
    LEVEL_GAUGE2 = 5             # "Window" skin text colour for leveling.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Victory Messages -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # In the Victory Aftermath, actors can say unique things. This is the pool
    # of quotes used for actors without any custom victory quotes. Note that
    # actors with custom quotes will take priority over classes with custom
    # quotes, which will take priority over these default quotes. Use \n for
    # a line break in the quotes.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
    FOOTER_TEXT = ""                        # Always at end of messages.
   
    # Win Quotes are what the actors say when a battle is won.
    VICTORY_QUOTES ={
    # :type   => Quotes
      #------------------------------------------------------------------------
      :win    => [ # Occurs as initial victory quote.
                   '『胜利了……
  活着就是要战斗。』',
                   '『这是一个弱肉强食的世界,
  失败者是没有存活的价值的。』',
                   '『如果说生存的意义是战斗,
  那么活着就是一场游戏。』',
                   '『人生就像一场棋局,
  做过亦是错过了,是没有反悔的余地的。』',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :level  => [ # Occurs as initial victory quote.
                   '『不断让自己变强,
  只因这世界没有弱者存在的价值。』',
                   '『只要这样不断的努力下去,
  终有一天会变得强大的吧……』',
                   '『变强了呢……
  做好准备面对更艰难的挑战了。』',
                   '『在人生的棋局中,
  我们所能做的只是变强,变得更强。』',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :drops  => [ # Occurs as initial victory quote.
                   '『这是什么……』',
                   '『得到不少好东西么……』',
                   '『这些东西估计还有点用处吧。』',
                   '『居然还有些好东西……』',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
    } # Do not remove this.
   
  end # VICTORY_AFTERMATH
end # YEA

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

module YEA
  module REGEXP
  module BASEITEM
   
    NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
   
    WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
    WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
    LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
    LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
    DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
    DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
   
  end # BASEITEM
  end # REGEXP
end # YEA

#==============================================================================
# ■ Switch
#==============================================================================

module Switch
  
  #--------------------------------------------------------------------------
  # self.skip_aftermath
  #--------------------------------------------------------------------------
  def self.skip_aftermath
    return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
    return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  end
   
end # Switch

#==============================================================================
# ■ Numeric
#==============================================================================

class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
   
end # Numeric

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_va load_database; end
  def self.load_database
    load_database_va
    load_notetags_va
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_va
  #--------------------------------------------------------------------------
  def self.load_notetags_va
    groups = [$data_actors, $data_classes]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_va
      end
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :win_quotes
  attr_accessor :level_quotes
  attr_accessor :drops_quotes
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_va
  #--------------------------------------------------------------------------
  def load_notetags_va
    @win_quotes = [""]
    @level_quotes = [""]
    @drops_quotes = [""]
    @victory_quote_type = nil
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
        @victory_quote_type = :win_quote
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
        @victory_quote_type = :level_quote
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
        @victory_quote_type = :drops_quote
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
        @victory_quote_type = nil
      #---
      when YEA::REGEXP::BASEITEM::NEW_QUOTE
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes.push("")
        when :level_quote; @level_quotes.push("")
        when :drops_quote; @drops_quotes.push("")
        end
      #---
      else
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
        when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
        when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
        end
      end
    } # self.note.split
    #---
    return unless self.is_a?(RPG::Class)
    quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
    @win_quotes = quotes[:win].clone if @win_quotes == [""]
    @level_quotes = quotes[:level].clone if @level_quotes == [""]
    @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  end
  
end # RPG::BaseItem

#==============================================================================
# ■ BattleManager
#==============================================================================

module BattleManager
  
  #--------------------------------------------------------------------------
  # overwrite method: self.process_victory
  #--------------------------------------------------------------------------
  def self.process_victory
    if $imported["YEA-CommandAutobattle"]
      SceneManager.scene.close_disable_autobattle_window
    end
    if Switch.skip_aftermath
      skip_aftermath
      return
    end
    play_battle_end_me
    gain_jp if $imported["YEA-JPManager"]
    display_exp
    gain_exp
    gain_gold
    gain_drop_items
    close_windows
    SceneManager.return
    replay_bgm_and_bgs
    battle_end(0)
    return true
  end
  
  #--------------------------------------------------------------------------
  # new method: self.skip_aftermath
  #--------------------------------------------------------------------------
  def self.skip_aftermath
    $game_party.all_members.each do |actor|
      actor.gain_exp($game_troop.exp_total)
    end
    $game_party.gain_gold($game_troop.gold_total)
    $game_troop.make_drop_items.each do |item|
      $game_party.gain_item(item, 1)
    end
    close_windows
    SceneManager.return
    replay_bgm_and_bgs
    battle_end(0)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.play_battle_end_me
  #--------------------------------------------------------------------------
  def self.play_battle_end_me
    $game_system.battle_end_me.play
    YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
  end
  
  #--------------------------------------------------------------------------
  # new method: self.set_victory_text
  #--------------------------------------------------------------------------
  def self.set_victory_text(actor, type)
    text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
    text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
    text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
    $game_message.face_name = actor.face_name
    $game_message.face_index = actor.face_index
    $game_message.add(text)
    wait_for_message
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.display_exp
  #--------------------------------------------------------------------------
  def self.display_exp
    SceneManager.scene.show_victory_display_exp
    actor = $game_party.random_target
    @victory_actor = actor
    set_victory_text(@victory_actor, :win)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.gain_exp
  #--------------------------------------------------------------------------
  def self.gain_exp
    $game_party.all_members.each do |actor|
      temp_actor = Marshal.load(Marshal.dump(actor))
      actor.gain_exp($game_troop.exp_total)
      next if actor.level == temp_actor.level
      SceneManager.scene.show_victory_level_up(actor, temp_actor)
      set_victory_text(actor, :level)
      wait_for_message
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.gain_gold
  #--------------------------------------------------------------------------
  def self.gain_gold
    $game_party.gain_gold($game_troop.gold_total)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.gain_drop_items
  #--------------------------------------------------------------------------
  def self.gain_drop_items
    drops = []
    $game_troop.make_drop_items.each do |item|
      $game_party.gain_item(item, 1)
      drops.push(item)
    end
    SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
    set_victory_text(@victory_actor, :drops)
    wait_for_message
  end
  
  #--------------------------------------------------------------------------
  # new method: self.close_windows
  #--------------------------------------------------------------------------
  def self.close_windows
    SceneManager.scene.close_victory_windows
  end
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias battle_end_va battle_end; end
  def self.battle_end(result)
    battle_end_va(result)
    return if result == 2
    return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
    event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
    $game_temp.reserve_common_event(event_id)
  end
  
end # BattleManager

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  
  #--------------------------------------------------------------------------
  # overwrite method: gain_exp
  #--------------------------------------------------------------------------
  def gain_exp(exp)
    enabled = !SceneManager.scene_is?(Scene_Battle)
    change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  end
  
  #--------------------------------------------------------------------------
  # new method: victory_quotes
  #--------------------------------------------------------------------------
  def victory_quotes(type)
    case type
    when :win
      return self.actor.win_quotes if self.actor.win_quotes != [""]
      return self.class.win_quotes
    when :level
      return self.actor.level_quotes if self.actor.level_quotes != [""]
      return self.class.level_quotes
    when :drops
      return self.actor.drops_quotes if self.actor.drops_quotes != [""]
      return self.class.drops_quotes
    else
      return ["NOTEXT"]
    end
  end
  
end # Game_Actor

#==============================================================================
# ■ Window_VictoryTitle
#==============================================================================

class Window_VictoryTitle < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    self.z = 200
    self.openness = 0
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh(message = "")
    contents.clear
    draw_text(0, 0, contents.width, line_height, message, 1)
  end
  
end # Window_VictoryTitle

#==============================================================================
# ■ Window_VictoryEXP_Back
#==============================================================================

class Window_VictoryEXP_Back < Window_Selectable
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, fitting_height(1), Graphics.width, window_height)
    self.z = 200
    self.openness = 0
  end
  
  #--------------------------------------------------------------------------
  # window_height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height - fitting_height(4) - fitting_height(1)
  end
  
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max; return item_max; end
  
  #--------------------------------------------------------------------------
  # spacing
  #--------------------------------------------------------------------------
  def spacing; return 8; end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return $game_party.battle_members.size; end
  
  #--------------------------------------------------------------------------
  # open
  #--------------------------------------------------------------------------
  def open
    @exp_total = $game_troop.exp_total
    super
  end
  
  #--------------------------------------------------------------------------
  # item_rect
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new
    rect.width = item_width
    rect.height = contents.height
    rect.x = index % col_max * (item_width + spacing)
    rect.y = index / col_max * item_height
    return rect
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    actor = $game_party.battle_members[index]
    return if actor.nil?
    rect = item_rect(index)
    reset_font_settings
    draw_actor_name(actor, rect)
    draw_exp_gain(actor, rect)
    draw_jp_gain(actor, rect)
    draw_actor_face(actor, rect)
  end
  
  #--------------------------------------------------------------------------
  # draw_actor_name
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, rect)
    name = actor.name
    draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
  end
  
  #--------------------------------------------------------------------------
  # draw_actor_face
  #--------------------------------------------------------------------------
  def draw_actor_face(actor, rect)
    face_name = actor.face_name
    face_index = actor.face_index
    bitmap = Cache.face(face_name)
    rw = [rect.width, 96].min
    face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
    rx = (rect.width - rw) / 2 + rect.x
    contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
  end
  
  #--------------------------------------------------------------------------
  # draw_exp_gain
  #--------------------------------------------------------------------------
  def draw_exp_gain(actor, rect)
    dw = rect.width - (rect.width - [rect.width, 96].min) / 2
    dy = rect.y + line_height * 3 + 96
    fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
    text = sprintf(fmt, actor_exp_gain(actor).group)
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
    change_color(power_up_color)
    draw_text(rect.x, dy, dw, line_height, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # actor_exp_gain
  #--------------------------------------------------------------------------
  def actor_exp_gain(actor)
    n = @exp_total * actor.final_exp_rate
    return n.to_i
  end
  
  #--------------------------------------------------------------------------
  # draw_jp_gain
  #--------------------------------------------------------------------------
  def draw_jp_gain(actor, rect)
    return unless $imported["YEA-JPManager"]
    dw = rect.width - (rect.width - [rect.width, 96].min) / 2
    dy = rect.y + line_height * 4 + 96
    fmt = YEA::JP::VICTORY_AFTERMATH
    text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
    change_color(power_up_color)
    draw_text(rect.x, dy, dw, line_height, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # actor_jp_gain
  #--------------------------------------------------------------------------
  def actor_jp_gain(actor)
    n = actor.battle_jp_earned
    if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
      n += YEA::JP::LEVEL_UP unless actor.max_level?
    end
    return n
  end
  
end # Window_VictoryEXP_Back

#==============================================================================
# ■ Window_VictoryEXP_Front
#==============================================================================

class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super
    self.back_opacity = 0
    @ticks = 0
    @counter = 30
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    update_tick
  end
  
  #--------------------------------------------------------------------------
  # update_tick
  #--------------------------------------------------------------------------
  def update_tick
    return unless self.openness >= 255
    return unless self.visible
    return if complete_ticks?
    @counter -= 1
    return unless @counter <= 0
    return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
    YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
    @counter = 4
    @ticks += 1
    refresh
  end
  
  #--------------------------------------------------------------------------
  # complete_ticks?
  #--------------------------------------------------------------------------
  def complete_ticks?
    for actor in $game_party.battle_members
      total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
      bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
      now_exp = actor.exp - actor.current_level_exp + bonus_exp
      next_exp = actor.next_level_exp - actor.current_level_exp
      rate = now_exp * 1.0 / next_exp
      return false if rate < 1.0
    end
    return true
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    actor = $game_party.battle_members[index]
    return if actor.nil?
    rect = item_rect(index)
    draw_actor_exp(actor, rect)
  end
  
  #--------------------------------------------------------------------------
  # exp_gauge1
  #--------------------------------------------------------------------------
  def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end
  
  #--------------------------------------------------------------------------
  # exp_gauge2
  #--------------------------------------------------------------------------
  def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end
  
  #--------------------------------------------------------------------------
  # lvl_gauge1
  #--------------------------------------------------------------------------
  def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end
  
  #--------------------------------------------------------------------------
  # lvl_gauge2
  #--------------------------------------------------------------------------
  def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end
  
  #--------------------------------------------------------------------------
  # draw_actor_exp
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, rect)
    if actor.max_level?
      draw_exp_gauge(actor, rect, 1.0)
      return
    end
    total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
    bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
    now_exp = actor.exp - actor.current_level_exp + bonus_exp
    next_exp = actor.next_level_exp - actor.current_level_exp
    rate = now_exp * 1.0 / next_exp
    draw_exp_gauge(actor, rect, rate)
  end
  
  #--------------------------------------------------------------------------
  # draw_exp_gauge
  #--------------------------------------------------------------------------
  def draw_exp_gauge(actor, rect, rate)
    rate = [[rate, 1.0].min, 0.0].max
    dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
    dy = rect.y + line_height * 2 + 96
    dw = [rect.width, 96].min
    colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
    colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
    draw_gauge(dx, dy, dw, rate, colour1, colour2)
    fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
    text = sprintf(fmt, [rate * 100, 100.00].min)
    if [rate * 100, 100.00].min == 100.00
      text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
      text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
    end
    draw_text(dx, dy, dw, line_height, text, 1)
  end
  
end # Window_VictoryEXP_Front

#==============================================================================
# ■ Window_VictoryLevelUp
#==============================================================================

class Window_VictoryLevelUp < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, fitting_height(1), Graphics.width, window_height)
    self.z = 200
    hide
  end
  
  #--------------------------------------------------------------------------
  # window_height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height - fitting_height(4) - fitting_height(1)
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh(actor, temp_actor)
    contents.clear
    reset_font_settings
    YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
    draw_actor_changes(actor, temp_actor)
  end
  
  #--------------------------------------------------------------------------
  # draw_actor_changes
  #--------------------------------------------------------------------------
  def draw_actor_changes(actor, temp_actor)
    dx = contents.width / 16
    draw_actor_image(actor, temp_actor, dx)
    draw_param_names(actor, dx)
    draw_former_stats(temp_actor)
    draw_arrows
    draw_newer_stats(actor, temp_actor)
    draw_new_skills(actor, temp_actor)
  end
  
  #--------------------------------------------------------------------------
  # draw_actor_image
  #--------------------------------------------------------------------------
  def draw_actor_image(actor, temp_actor, dx)
    draw_text(dx, line_height, 96, line_height, actor.name, 1)
    draw_actor_face(actor, dx, line_height * 2)
    exp = actor.exp - temp_actor.exp
    text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
    change_color(power_up_color)
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
    draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # draw_param_names
  #--------------------------------------------------------------------------
  def draw_param_names(actor, dx)
    dx += 108
    change_color(system_color)
    text = Vocab.level
    draw_text(dx, 0, contents.width - dx, line_height, text)
    dy = 0
    for i in 0...8
      dy += line_height
      text = Vocab.param(i)
      draw_text(dx, dy, contents.width - dx, line_height, text)
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_former_stats
  #--------------------------------------------------------------------------
  def draw_former_stats(actor)
    dw = contents.width / 2 - 12
    dy = 0
    change_color(normal_color)
    draw_text(0, dy, dw, line_height, actor.level.group, 2)
    for i in 0...8
      dy += line_height
      draw_text(0, dy, dw, line_height, actor.param(i).group, 2)
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_arrows
  #--------------------------------------------------------------------------
  def draw_arrows
    dx = contents.width / 2 - 12
    dy = 0
    change_color(system_color)
    for i in 0..8
      draw_text(dx, dy, 24, line_height, "→", 1)
      dy += line_height
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_newer_stats
  #--------------------------------------------------------------------------
  def draw_newer_stats(actor, temp_actor)
    dx = contents.width / 2 + 12
    dw = contents.width - dx
    dy = 0
    change_color(param_change_color(actor.level - temp_actor.level))
    draw_text(dx, dy, dw, line_height, actor.level.group, 0)
    for i in 0...8
      dy += line_height
      change_color(param_change_color(actor.param(i) - temp_actor.param(i)))
      draw_text(dx, dy, dw, line_height, actor.param(i).group, 0)
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_new_skills
  #--------------------------------------------------------------------------
  def draw_new_skills(actor, temp_actor)
    return if temp_actor.skills.size == actor.skills.size
    dw = 172 + 24
    dx = contents.width - dw
    change_color(system_color)
    text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
    draw_text(dx, 0, dw, line_height, text, 0)
  end
  
end # Window_VictoryLevelUp

#==============================================================================
# ■ Window_VictorySkills
#==============================================================================

class Window_VictorySkills < Window_Selectable
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    dy = fitting_height(1) + 24
    dw = 172 + 24 + 24
    dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
    super(Graphics.width - dw, dy, dw, dh)
    self.opacity = 0
    self.z = 200
    hide
  end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return @data.nil? ? 0 : @data.size; end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh(actor, temp_actor)
    contents.clear
    if actor.skills.size == temp_actor.skills.size
      unselect
      @data = []
      create_contents
      return
    end
    @data = actor.skills - temp_actor.skills
    if @data.size > 8
      select(0)
      activate
    else
      unselect
      deactivate
    end
    create_contents
    draw_all_items
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    skill = @data[index]
    return if skill.nil?
    rect.width -= 4
    draw_item_name(skill, rect.x, rect.y, true)
  end
  
end # Window_VictorySkills

#==============================================================================
# ■ Window_VictorySpoils
#==============================================================================

class Window_VictorySpoils < Window_ItemList
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, fitting_height(1), Graphics.width, window_height)
    self.z = 200
    hide
  end
  
  #--------------------------------------------------------------------------
  # window_height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height - fitting_height(4) - fitting_height(1)
  end
  
  #--------------------------------------------------------------------------
  # spacing
  #--------------------------------------------------------------------------
  def spacing; return 32; end
  
  #--------------------------------------------------------------------------
  # make
  #--------------------------------------------------------------------------
  def make(gold, drops)
    @gold = gold
    @drops = drops
    refresh
    select(0)
    activate
  end
  
  #--------------------------------------------------------------------------
  # make_item_list
  #--------------------------------------------------------------------------
  def make_item_list
    @data = [nil]
    items = {}
    weapons = {}
    armours = {}
    @goods = {}
    for item in @drops
      case item
      when RPG::Item
        items[item] = 0 if items[item].nil?
        items[item] += 1
      when RPG::Weapon
        weapons[item] = 0 if weapons[item].nil?
        weapons[item] += 1
      when RPG::Armor
        armours[item] = 0 if armours[item].nil?
        armours[item] += 1
      end
    end
    items = items.sort { |a,b| a[0].id <=> b[0].id }
    weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
    armours = armours.sort { |a,b| a[0].id <=> b[0].id }
    for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
    for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
    for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    reset_font_settings
    if item.nil?
      draw_gold(rect)
      return
    end
    rect.width -= 4
    draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
    draw_item_number(rect, item)
  end
  
  #--------------------------------------------------------------------------
  # draw_gold
  #--------------------------------------------------------------------------
  def draw_gold(rect)
    text = Vocab.currency_unit
    draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  end
  
  #--------------------------------------------------------------------------
  # draw_item_number
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    number = @goods[item].group
    if $imported["YEA-AdjustLimits"]
      contents.font.size = YEA::LIMIT::ITEM_FONT
      text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
      draw_text(rect, text, 2)
    else
      draw_text(rect, sprintf(":%s", number), 2)
    end
  end
  
end # Window_VictorySpoils

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: create_all_windows
  #--------------------------------------------------------------------------
  alias scene_battle_create_all_windows_va create_all_windows
  def create_all_windows
    scene_battle_create_all_windows_va
    create_victory_aftermath_windows
  end
  
  #--------------------------------------------------------------------------
  # new method: create_victory_aftermath_windows
  #--------------------------------------------------------------------------
  def create_victory_aftermath_windows
    @victory_title_window = Window_VictoryTitle.new
    @victory_exp_window_back = Window_VictoryEXP_Back.new
    @victory_exp_window_front = Window_VictoryEXP_Front.new
    @victory_level_window = Window_VictoryLevelUp.new
    @victory_level_skills = Window_VictorySkills.new
    @victory_spoils_window = Window_VictorySpoils.new
  end
  
  #--------------------------------------------------------------------------
  # new method: show_victory_display_exp
  #--------------------------------------------------------------------------
  def show_victory_display_exp
    @victory_title_window.open
    name = $game_party.battle_members[0].name
    fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
    name = sprintf(fmt, name) if $game_party.battle_members.size > 1
    fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
    text = sprintf(fmt, name)
    @victory_title_window.refresh(text)
    #---
    @victory_exp_window_back.open
    @victory_exp_window_back.refresh
    @victory_exp_window_front.open
    @victory_exp_window_front.refresh
  end
  
  #--------------------------------------------------------------------------
  # new method: show_victory_level_up
  #--------------------------------------------------------------------------
  def show_victory_level_up(actor, temp_actor)
    @victory_exp_window_back.hide
    @victory_exp_window_front.hide
    #---
    fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
    text = sprintf(fmt, actor.name)
    @victory_title_window.refresh(text)
    #---
    @victory_level_window.show
    @victory_level_window.refresh(actor, temp_actor)
    @victory_level_skills.show
    @victory_level_skills.refresh(actor, temp_actor)
  end
  
  #--------------------------------------------------------------------------
  # new method: show_victory_spoils
  #--------------------------------------------------------------------------
  def show_victory_spoils(gold, drops)
    @victory_exp_window_back.hide
    @victory_exp_window_front.hide
    @victory_level_window.hide
    @victory_level_skills.hide
    #---
    text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
    @victory_title_window.refresh(text)
    #---
    @victory_spoils_window.show
    @victory_spoils_window.make(gold, drops)
  end
  
  #--------------------------------------------------------------------------
  # new method: close_victory_windows
  #--------------------------------------------------------------------------
  def close_victory_windows
    @victory_title_window.close
    @victory_exp_window_back.close
    @victory_exp_window_front.close
    @victory_level_window.close
    @victory_level_skills.close
    @victory_spoils_window.close
    wait(16)
  end
  
end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================
梦石
0
星屑
50
在线时间
1061 小时
注册时间
2012-9-10
回帖
286
发表于 2012-10-17 00:34:04 | 显示全部楼层
我也是用yea胜利显示..把我的用掉套用你的..还是正常显示...所以..是其他脚本的问题吧...@"@
那就很难找了...要不,你开个新的套看看,是否相同..如果还是一漾...= ="(重安装吧...)
资料库更新...累死人的一堆文字...
我不是做avg,卻要有avg的叙述....-   3 -
回复

使用道具 举报

梦石
0
星屑
55
在线时间
160 小时
注册时间
2012-2-10
回帖
92
发表于 2013-1-21 18:06:19 | 显示全部楼层
我也遇到这个问题了,我曾经删掉所有外加的脚本,可结果还是一样,郁闷啊。今天在单位一天没事做,一直坐在电脑前试图解决,还是不行,期待高手解答。
回复

使用道具 举报

梦石
0
星屑
55
在线时间
160 小时
注册时间
2012-2-10
回帖
92
发表于 2013-1-21 18:06:40 | 显示全部楼层
我也遇到这个问题了,我曾经删掉所有外加的脚本,可结果还是一样,郁闷啊。今天在单位一天没事做,一直坐在电脑前试图解决,还是不行,期待高手解答。
回复

使用道具 举报

梦石
0
星屑
166
在线时间
630 小时
注册时间
2012-6-9
回帖
1233
发表于 2013-1-21 20:10:17 | 显示全部楼层
你能不能把它框起来呢?(添加代码文字)
有什么问题呀?这脚本就是这样的。多了个框框而已。
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Victory Aftermath v1.03
  4. # -- Last Updated: 2012.01.07
  5. # -- Level: Easy, Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.07 - Compatibility Update: JP Manager
  15. # 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
  16. # 2011.12.26 - Compatibility Update: Command Autobattle
  17. # 2011.12.16 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # At the end of each battle, RPG Maker VX Ace by default shows text saying that
  23. # the party has gained so-and-so EXP while this person leveled up and your
  24. # party happened to find these drops. This script changes that text into
  25. # something more visual for your players to see. Active battle members will be
  26. # seen gaining EXP, any kind of level up changes, and a list of the items
  27. # obtained through drops.
  28. #
  29. #==============================================================================
  30. # ▼ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  34. #
  35. # -----------------------------------------------------------------------------
  36. # Actor Notetags - These notetags go in the actors notebox in the database.
  37. # -----------------------------------------------------------------------------
  38. # <win quotes>
  39. #  string
  40. #  string
  41. # </win quotes>
  42. # Sets the win quote for the actor. The strings are continuous and can use
  43. # text codes. Use \n for a line break. Type in what you want the actor to say
  44. # for the particular win quote. Use [New Quote] in between the two tags to
  45. # start up a new quote.
  46. #
  47. # <level quotes>
  48. #  string
  49. #  string
  50. # </level quotes>
  51. # Sets the level up quote for the actor. The strings are continuous and can use
  52. # text codes. Use \n for a line break. Type in what you want the actor to say
  53. # for the particular win quote. Use [New Quote] in between the two tags to
  54. # start up a new quote.
  55. #
  56. # <drops quotes>
  57. #  string
  58. #  string
  59. # </drops quotes>
  60. # Sets the drops quote for the actor. The strings are continuous and can use
  61. # text codes. Use \n for a line break. Type in what you want the actor to say
  62. # for the particular win quote. Use [New Quote] in between the two tags to
  63. # start up a new quote.
  64. #
  65. # -----------------------------------------------------------------------------
  66. # Class Notetags - These notetags go in the class notebox in the database.
  67. # -----------------------------------------------------------------------------
  68. # <win quotes>
  69. #  string
  70. #  string
  71. # </win quotes>
  72. # Sets the win quote for the class. The strings are continuous and can use
  73. # text codes. Use \n for a line break. Type in what you want the actor to say
  74. # for the particular win quote. Use [New Quote] in between the two tags to
  75. # start up a new quote.
  76. #
  77. # <level quotes>
  78. #  string
  79. #  string
  80. # </level quotes>
  81. # Sets the level up quote for the class. The strings are continuous and can use
  82. # text codes. Use \n for a line break. Type in what you want the actor to say
  83. # for the particular win quote. Use [New Quote] in between the two tags to
  84. # start up a new quote.
  85. #
  86. # <drops quotes>
  87. #  string
  88. #  string
  89. # </drops quotes>
  90. # Sets the drops quote for the class. The strings are continuous and can use
  91. # text codes. Use \n for a line break. Type in what you want the actor to say
  92. # for the particular win quote. Use [New Quote] in between the two tags to
  93. # start up a new quote.
  94. #
  95. #==============================================================================
  96. # ▼ Compatibility
  97. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  98. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  99. # it will run with RPG Maker VX without adjusting.
  100. #
  101. #==============================================================================

  102. module YEA
  103.   module VICTORY_AFTERMATH
  104.    
  105.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  106.     # - General Settings -
  107.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  108.     # These are various settings that are used throughout the Victory Aftermath
  109.     # portion of a battle. Adjust them as you see fit.
  110.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111.     VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # Victory BGM
  112.     VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP ticking SFX
  113.     LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # Level Up SFX
  114.     SKILLS_TEXT  = "新技能"                        # New skills text title.
  115.    
  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     # - Important Settings -
  118.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119.     # These are some important settings so please set them up properly. This
  120.     # section includes a switch that allows you to skip the victory aftermath
  121.     # phase (for those back to back battles and making them seamless) and it
  122.     # also allows you to declare a common event to run after each battle. If
  123.     # you do not wish to use either of these features, set them to 0. The
  124.     # common event will run regardless of win or escape.
  125.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  126.     SKIP_AFTERMATH_SWITCH  = 0  # If switch on, skip aftermath. 0 to disable.
  127.     AFTERMATH_COMMON_EVENT = 0  # Runs common event after battle. 0 to disable.
  128.    
  129.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130.     # - Top Text Settings -
  131.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  132.     # Here, you can adjust the various text that appears in the window that
  133.     # appears at the top of the screen.
  134.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  135.     TOP_TEAM         = "%s的队伍"           # Team name used.
  136.     TOP_VICTORY_TEXT = "%s胜利了!"   # Text used to display victory.
  137.     TOP_LEVEL_UP     = "%s升级!"  # Text used to display level up.
  138.     TOP_SPOILS       = "胜利战利品!"     # Text used for spoils.
  139.    
  140.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  141.     # - EXP Gauge Settings -
  142.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  143.     # Adjust how the EXP Gauge appears for the Victory Aftermath here. This
  144.     # includes the text display, the font size, the colour of the gauges, and
  145.     # more. Adjust it all here.
  146.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  147.     VICTORY_EXP  = "+%sEXP"      # Text used to display EXP.
  148.     EXP_PERCENT  = "%1.2f%%"     # The way EXP percentage will be displayed.
  149.     LEVELUP_TEXT = "LEVEL UP!"   # Text to replace percentage when leveled.
  150.     MAX_LVL_TEXT = "MAX LEVEL"   # Text to replace percentage when max level.
  151.     FONTSIZE_EXP = 20            # Font size used for EXP.
  152.     EXP_TICKS    = 15            # Ticks to full EXP
  153.     EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
  154.     EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
  155.     LEVEL_GAUGE1 = 13            # "Window" skin text colour for leveling.
  156.     LEVEL_GAUGE2 = 5             # "Window" skin text colour for leveling.
  157.    
  158.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  159.     # - Victory Messages -
  160.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  161.     # In the Victory Aftermath, actors can say unique things. This is the pool
  162.     # of quotes used for actors without any custom victory quotes. Note that
  163.     # actors with custom quotes will take priority over classes with custom
  164.     # quotes, which will take priority over these default quotes. Use \n for
  165.     # a line break in the quotes.
  166.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167.     HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
  168.     FOOTER_TEXT = ""                        # Always at end of messages.
  169.    
  170.     # Win Quotes are what the actors say when a battle is won.
  171.     VICTORY_QUOTES ={
  172.     # :type   => Quotes
  173.       #------------------------------------------------------------------------
  174.       :win    => [ # Occurs as initial victory quote.
  175.                    '『胜利了……
  176.   活着就是要战斗。』',
  177.                    '『这是一个弱肉强食的世界,
  178.   失败者是没有存活的价值的。』',
  179.                    '『如果说生存的意义是战斗,
  180.   那么活着就是一场游戏。』',
  181.                    '『人生就像一场棋局,
  182.   做过亦是错过了,是没有反悔的余地的。』',
  183.                  ],# Do not remove this.
  184.       #------------------------------------------------------------------------
  185.       :level  => [ # Occurs as initial victory quote.
  186.                    '『不断让自己变强,
  187.   只因这世界没有弱者存在的价值。』',
  188.                    '『只要这样不断的努力下去,
  189.   终有一天会变得强大的吧……』',
  190.                    '『变强了呢……
  191.   做好准备面对更艰难的挑战了。』',
  192.                    '『在人生的棋局中,
  193.   我们所能做的只是变强,变得更强。』',
  194.                  ],# Do not remove this.
  195.       #------------------------------------------------------------------------
  196.       :drops  => [ # Occurs as initial victory quote.
  197.                    '『这是什么……』',
  198.                    '『得到不少好东西么……』',
  199.                    '『这些东西估计还有点用处吧。』',
  200.                    '『居然还有些好东西……』',
  201.                  ],# Do not remove this.
  202.       #------------------------------------------------------------------------
  203.     } # Do not remove this.
  204.    
  205.   end # VICTORY_AFTERMATH
  206. end # YEA

  207. #==============================================================================
  208. # ▼ Editting anything past this point may potentially result in causing
  209. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  210. # halitosis so edit at your own risk.
  211. #==============================================================================

  212. module YEA
  213.   module REGEXP
  214.   module BASEITEM
  215.    
  216.     NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  217.    
  218.     WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
  219.     WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
  220.     LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
  221.     LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
  222.     DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  223.     DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  224.    
  225.   end # BASEITEM
  226.   end # REGEXP
  227. end # YEA

  228. #==============================================================================
  229. # ■ Switch
  230. #==============================================================================

  231. module Switch
  232.   
  233.   #--------------------------------------------------------------------------
  234.   # self.skip_aftermath
  235.   #--------------------------------------------------------------------------
  236.   def self.skip_aftermath
  237.     return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
  238.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  239.   end
  240.    
  241. end # Switch

  242. #==============================================================================
  243. # ■ Numeric
  244. #==============================================================================

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

  255. #==============================================================================
  256. # ■ DataManager
  257. #==============================================================================

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

  283. #==============================================================================
  284. # ■ RPG::BaseItem
  285. #==============================================================================

  286. class RPG::BaseItem
  287.   
  288.   #--------------------------------------------------------------------------
  289.   # public instance variables
  290.   #--------------------------------------------------------------------------
  291.   attr_accessor :win_quotes
  292.   attr_accessor :level_quotes
  293.   attr_accessor :drops_quotes
  294.   
  295.   #--------------------------------------------------------------------------
  296.   # common cache: load_notetags_va
  297.   #--------------------------------------------------------------------------
  298.   def load_notetags_va
  299.     @win_quotes = [""]
  300.     @level_quotes = [""]
  301.     @drops_quotes = [""]
  302.     @victory_quote_type = nil
  303.     #---
  304.     self.note.split(/[\r\n]+/).each { |line|
  305.       case line
  306.       #---
  307.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
  308.         @victory_quote_type = :win_quote
  309.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
  310.         @victory_quote_type = nil
  311.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
  312.         @victory_quote_type = :level_quote
  313.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
  314.         @victory_quote_type = nil
  315.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
  316.         @victory_quote_type = :drops_quote
  317.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
  318.         @victory_quote_type = nil
  319.       #---
  320.       when YEA::REGEXP::BASEITEM::NEW_QUOTE
  321.         case @victory_quote_type
  322.         when nil; next
  323.         when :win_quote;   @win_quotes.push("")
  324.         when :level_quote; @level_quotes.push("")
  325.         when :drops_quote; @drops_quotes.push("")
  326.         end
  327.       #---
  328.       else
  329.         case @victory_quote_type
  330.         when nil; next
  331.         when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
  332.         when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
  333.         when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
  334.         end
  335.       end
  336.     } # self.note.split
  337.     #---
  338.     return unless self.is_a?(RPG::Class)
  339.     quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
  340.     @win_quotes = quotes[:win].clone if @win_quotes == [""]
  341.     @level_quotes = quotes[:level].clone if @level_quotes == [""]
  342.     @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  343.   end
  344.   
  345. end # RPG::BaseItem

  346. #==============================================================================
  347. # ■ BattleManager
  348. #==============================================================================

  349. module BattleManager
  350.   
  351.   #--------------------------------------------------------------------------
  352.   # overwrite method: self.process_victory
  353.   #--------------------------------------------------------------------------
  354.   def self.process_victory
  355.     if $imported["YEA-CommandAutobattle"]
  356.       SceneManager.scene.close_disable_autobattle_window
  357.     end
  358.     if Switch.skip_aftermath
  359.       skip_aftermath
  360.       return
  361.     end
  362.     play_battle_end_me
  363.     gain_jp if $imported["YEA-JPManager"]
  364.     display_exp
  365.     gain_exp
  366.     gain_gold
  367.     gain_drop_items
  368.     close_windows
  369.     SceneManager.return
  370.     replay_bgm_and_bgs
  371.     battle_end(0)
  372.     return true
  373.   end
  374.   
  375.   #--------------------------------------------------------------------------
  376.   # new method: self.skip_aftermath
  377.   #--------------------------------------------------------------------------
  378.   def self.skip_aftermath
  379.     $game_party.all_members.each do |actor|
  380.       actor.gain_exp($game_troop.exp_total)
  381.     end
  382.     $game_party.gain_gold($game_troop.gold_total)
  383.     $game_troop.make_drop_items.each do |item|
  384.       $game_party.gain_item(item, 1)
  385.     end
  386.     close_windows
  387.     SceneManager.return
  388.     replay_bgm_and_bgs
  389.     battle_end(0)
  390.   end
  391.   
  392.   #--------------------------------------------------------------------------
  393.   # overwrite method: self.play_battle_end_me
  394.   #--------------------------------------------------------------------------
  395.   def self.play_battle_end_me
  396.     $game_system.battle_end_me.play
  397.     YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
  398.   end
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # new method: self.set_victory_text
  402.   #--------------------------------------------------------------------------
  403.   def self.set_victory_text(actor, type)
  404.     text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
  405.     text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
  406.     text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
  407.     $game_message.face_name = actor.face_name
  408.     $game_message.face_index = actor.face_index
  409.     $game_message.add(text)
  410.     wait_for_message
  411.   end
  412.   
  413.   #--------------------------------------------------------------------------
  414.   # overwrite method: self.display_exp
  415.   #--------------------------------------------------------------------------
  416.   def self.display_exp
  417.     SceneManager.scene.show_victory_display_exp
  418.     actor = $game_party.random_target
  419.     @victory_actor = actor
  420.     set_victory_text(@victory_actor, :win)
  421.   end
  422.   
  423.   #--------------------------------------------------------------------------
  424.   # overwrite method: self.gain_exp
  425.   #--------------------------------------------------------------------------
  426.   def self.gain_exp
  427.     $game_party.all_members.each do |actor|
  428.       temp_actor = Marshal.load(Marshal.dump(actor))
  429.       actor.gain_exp($game_troop.exp_total)
  430.       next if actor.level == temp_actor.level
  431.       SceneManager.scene.show_victory_level_up(actor, temp_actor)
  432.       set_victory_text(actor, :level)
  433.       wait_for_message
  434.     end
  435.   end
  436.   
  437.   #--------------------------------------------------------------------------
  438.   # overwrite method: self.gain_gold
  439.   #--------------------------------------------------------------------------
  440.   def self.gain_gold
  441.     $game_party.gain_gold($game_troop.gold_total)
  442.   end
  443.   
  444.   #--------------------------------------------------------------------------
  445.   # overwrite method: self.gain_drop_items
  446.   #--------------------------------------------------------------------------
  447.   def self.gain_drop_items
  448.     drops = []
  449.     $game_troop.make_drop_items.each do |item|
  450.       $game_party.gain_item(item, 1)
  451.       drops.push(item)
  452.     end
  453.     SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
  454.     set_victory_text(@victory_actor, :drops)
  455.     wait_for_message
  456.   end
  457.   
  458.   #--------------------------------------------------------------------------
  459.   # new method: self.close_windows
  460.   #--------------------------------------------------------------------------
  461.   def self.close_windows
  462.     SceneManager.scene.close_victory_windows
  463.   end
  464.   
  465.   #--------------------------------------------------------------------------
  466.   # alias method: load_database
  467.   #--------------------------------------------------------------------------
  468.   class <<self; alias battle_end_va battle_end; end
  469.   def self.battle_end(result)
  470.     battle_end_va(result)
  471.     return if result == 2
  472.     return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
  473.     event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
  474.     $game_temp.reserve_common_event(event_id)
  475.   end
  476.   
  477. end # BattleManager

  478. #==============================================================================
  479. # ■ Game_Actor
  480. #==============================================================================

  481. class Game_Actor < Game_Battler
  482.   
  483.   #--------------------------------------------------------------------------
  484.   # overwrite method: gain_exp
  485.   #--------------------------------------------------------------------------
  486.   def gain_exp(exp)
  487.     enabled = !SceneManager.scene_is?(Scene_Battle)
  488.     change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  489.   end
  490.   
  491.   #--------------------------------------------------------------------------
  492.   # new method: victory_quotes
  493.   #--------------------------------------------------------------------------
  494.   def victory_quotes(type)
  495.     case type
  496.     when :win
  497.       return self.actor.win_quotes if self.actor.win_quotes != [""]
  498.       return self.class.win_quotes
  499.     when :level
  500.       return self.actor.level_quotes if self.actor.level_quotes != [""]
  501.       return self.class.level_quotes
  502.     when :drops
  503.       return self.actor.drops_quotes if self.actor.drops_quotes != [""]
  504.       return self.class.drops_quotes
  505.     else
  506.       return ["NOTEXT"]
  507.     end
  508.   end
  509.   
  510. end # Game_Actor

  511. #==============================================================================
  512. # ■ Window_VictoryTitle
  513. #==============================================================================

  514. class Window_VictoryTitle < Window_Base
  515.   
  516.   #--------------------------------------------------------------------------
  517.   # initialize
  518.   #--------------------------------------------------------------------------
  519.   def initialize
  520.     super(0, 0, Graphics.width, fitting_height(1))
  521.     self.z = 200
  522.     self.openness = 0
  523.   end
  524.   
  525.   #--------------------------------------------------------------------------
  526.   # refresh
  527.   #--------------------------------------------------------------------------
  528.   def refresh(message = "")
  529.     contents.clear
  530.     draw_text(0, 0, contents.width, line_height, message, 1)
  531.   end
  532.   
  533. end # Window_VictoryTitle

  534. #==============================================================================
  535. # ■ Window_VictoryEXP_Back
  536. #==============================================================================

  537. class Window_VictoryEXP_Back < Window_Selectable
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # initialize
  541.   #--------------------------------------------------------------------------
  542.   def initialize
  543.     super(0, fitting_height(1), Graphics.width, window_height)
  544.     self.z = 200
  545.     self.openness = 0
  546.   end
  547.   
  548.   #--------------------------------------------------------------------------
  549.   # window_height
  550.   #--------------------------------------------------------------------------
  551.   def window_height
  552.     return Graphics.height - fitting_height(4) - fitting_height(1)
  553.   end
  554.   
  555.   #--------------------------------------------------------------------------
  556.   # col_max
  557.   #--------------------------------------------------------------------------
  558.   def col_max; return item_max; end
  559.   
  560.   #--------------------------------------------------------------------------
  561.   # spacing
  562.   #--------------------------------------------------------------------------
  563.   def spacing; return 8; end
  564.   
  565.   #--------------------------------------------------------------------------
  566.   # item_max
  567.   #--------------------------------------------------------------------------
  568.   def item_max; return $game_party.battle_members.size; end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # open
  572.   #--------------------------------------------------------------------------
  573.   def open
  574.     @exp_total = $game_troop.exp_total
  575.     super
  576.   end
  577.   
  578.   #--------------------------------------------------------------------------
  579.   # item_rect
  580.   #--------------------------------------------------------------------------
  581.   def item_rect(index)
  582.     rect = Rect.new
  583.     rect.width = item_width
  584.     rect.height = contents.height
  585.     rect.x = index % col_max * (item_width + spacing)
  586.     rect.y = index / col_max * item_height
  587.     return rect
  588.   end
  589.   
  590.   #--------------------------------------------------------------------------
  591.   # draw_item
  592.   #--------------------------------------------------------------------------
  593.   def draw_item(index)
  594.     actor = $game_party.battle_members[index]
  595.     return if actor.nil?
  596.     rect = item_rect(index)
  597.     reset_font_settings
  598.     draw_actor_name(actor, rect)
  599.     draw_exp_gain(actor, rect)
  600.     draw_jp_gain(actor, rect)
  601.     draw_actor_face(actor, rect)
  602.   end
  603.   
  604.   #--------------------------------------------------------------------------
  605.   # draw_actor_name
  606.   #--------------------------------------------------------------------------
  607.   def draw_actor_name(actor, rect)
  608.     name = actor.name
  609.     draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
  610.   end
  611.   
  612.   #--------------------------------------------------------------------------
  613.   # draw_actor_face
  614.   #--------------------------------------------------------------------------
  615.   def draw_actor_face(actor, rect)
  616.     face_name = actor.face_name
  617.     face_index = actor.face_index
  618.     bitmap = Cache.face(face_name)
  619.     rw = [rect.width, 96].min
  620.     face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
  621.     rx = (rect.width - rw) / 2 + rect.x
  622.     contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
  623.   end
  624.   
  625.   #--------------------------------------------------------------------------
  626.   # draw_exp_gain
  627.   #--------------------------------------------------------------------------
  628.   def draw_exp_gain(actor, rect)
  629.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  630.     dy = rect.y + line_height * 3 + 96
  631.     fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
  632.     text = sprintf(fmt, actor_exp_gain(actor).group)
  633.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  634.     change_color(power_up_color)
  635.     draw_text(rect.x, dy, dw, line_height, text, 2)
  636.   end
  637.   
  638.   #--------------------------------------------------------------------------
  639.   # actor_exp_gain
  640.   #--------------------------------------------------------------------------
  641.   def actor_exp_gain(actor)
  642.     n = @exp_total * actor.final_exp_rate
  643.     return n.to_i
  644.   end
  645.   
  646.   #--------------------------------------------------------------------------
  647.   # draw_jp_gain
  648.   #--------------------------------------------------------------------------
  649.   def draw_jp_gain(actor, rect)
  650.     return unless $imported["YEA-JPManager"]
  651.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  652.     dy = rect.y + line_height * 4 + 96
  653.     fmt = YEA::JP::VICTORY_AFTERMATH
  654.     text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
  655.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  656.     change_color(power_up_color)
  657.     draw_text(rect.x, dy, dw, line_height, text, 2)
  658.   end
  659.   
  660.   #--------------------------------------------------------------------------
  661.   # actor_jp_gain
  662.   #--------------------------------------------------------------------------
  663.   def actor_jp_gain(actor)
  664.     n = actor.battle_jp_earned
  665.     if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
  666.       n += YEA::JP::LEVEL_UP unless actor.max_level?
  667.     end
  668.     return n
  669.   end
  670.   
  671. end # Window_VictoryEXP_Back

  672. #==============================================================================
  673. # ■ Window_VictoryEXP_Front
  674. #==============================================================================

  675. class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  676.   
  677.   #--------------------------------------------------------------------------
  678.   # initialize
  679.   #--------------------------------------------------------------------------
  680.   def initialize
  681.     super
  682.     self.back_opacity = 0
  683.     @ticks = 0
  684.     @counter = 30
  685.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  686.   end
  687.   
  688.   #--------------------------------------------------------------------------
  689.   # update
  690.   #--------------------------------------------------------------------------
  691.   def update
  692.     super
  693.     update_tick
  694.   end
  695.   
  696.   #--------------------------------------------------------------------------
  697.   # update_tick
  698.   #--------------------------------------------------------------------------
  699.   def update_tick
  700.     return unless self.openness >= 255
  701.     return unless self.visible
  702.     return if complete_ticks?
  703.     @counter -= 1
  704.     return unless @counter <= 0
  705.     return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
  706.     YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
  707.     @counter = 4
  708.     @ticks += 1
  709.     refresh
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # complete_ticks?
  714.   #--------------------------------------------------------------------------
  715.   def complete_ticks?
  716.     for actor in $game_party.battle_members
  717.       total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  718.       bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  719.       now_exp = actor.exp - actor.current_level_exp + bonus_exp
  720.       next_exp = actor.next_level_exp - actor.current_level_exp
  721.       rate = now_exp * 1.0 / next_exp
  722.       return false if rate < 1.0
  723.     end
  724.     return true
  725.   end
  726.   
  727.   #--------------------------------------------------------------------------
  728.   # draw_item
  729.   #--------------------------------------------------------------------------
  730.   def draw_item(index)
  731.     actor = $game_party.battle_members[index]
  732.     return if actor.nil?
  733.     rect = item_rect(index)
  734.     draw_actor_exp(actor, rect)
  735.   end
  736.   
  737.   #--------------------------------------------------------------------------
  738.   # exp_gauge1
  739.   #--------------------------------------------------------------------------
  740.   def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end
  741.   
  742.   #--------------------------------------------------------------------------
  743.   # exp_gauge2
  744.   #--------------------------------------------------------------------------
  745.   def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end
  746.   
  747.   #--------------------------------------------------------------------------
  748.   # lvl_gauge1
  749.   #--------------------------------------------------------------------------
  750.   def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # lvl_gauge2
  754.   #--------------------------------------------------------------------------
  755.   def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end
  756.   
  757.   #--------------------------------------------------------------------------
  758.   # draw_actor_exp
  759.   #--------------------------------------------------------------------------
  760.   def draw_actor_exp(actor, rect)
  761.     if actor.max_level?
  762.       draw_exp_gauge(actor, rect, 1.0)
  763.       return
  764.     end
  765.     total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  766.     bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  767.     now_exp = actor.exp - actor.current_level_exp + bonus_exp
  768.     next_exp = actor.next_level_exp - actor.current_level_exp
  769.     rate = now_exp * 1.0 / next_exp
  770.     draw_exp_gauge(actor, rect, rate)
  771.   end
  772.   
  773.   #--------------------------------------------------------------------------
  774.   # draw_exp_gauge
  775.   #--------------------------------------------------------------------------
  776.   def draw_exp_gauge(actor, rect, rate)
  777.     rate = [[rate, 1.0].min, 0.0].max
  778.     dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
  779.     dy = rect.y + line_height * 2 + 96
  780.     dw = [rect.width, 96].min
  781.     colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
  782.     colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
  783.     draw_gauge(dx, dy, dw, rate, colour1, colour2)
  784.     fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
  785.     text = sprintf(fmt, [rate * 100, 100.00].min)
  786.     if [rate * 100, 100.00].min == 100.00
  787.       text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
  788.       text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
  789.     end
  790.     draw_text(dx, dy, dw, line_height, text, 1)
  791.   end
  792.   
  793. end # Window_VictoryEXP_Front

  794. #==============================================================================
  795. # ■ Window_VictoryLevelUp
  796. #==============================================================================

  797. class Window_VictoryLevelUp < Window_Base
  798.   
  799.   #--------------------------------------------------------------------------
  800.   # initialize
  801.   #--------------------------------------------------------------------------
  802.   def initialize
  803.     super(0, fitting_height(1), Graphics.width, window_height)
  804.     self.z = 200
  805.     hide
  806.   end
  807.   
  808.   #--------------------------------------------------------------------------
  809.   # window_height
  810.   #--------------------------------------------------------------------------
  811.   def window_height
  812.     return Graphics.height - fitting_height(4) - fitting_height(1)
  813.   end
  814.   
  815.   #--------------------------------------------------------------------------
  816.   # refresh
  817.   #--------------------------------------------------------------------------
  818.   def refresh(actor, temp_actor)
  819.     contents.clear
  820.     reset_font_settings
  821.     YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
  822.     draw_actor_changes(actor, temp_actor)
  823.   end
  824.   
  825.   #--------------------------------------------------------------------------
  826.   # draw_actor_changes
  827.   #--------------------------------------------------------------------------
  828.   def draw_actor_changes(actor, temp_actor)
  829.     dx = contents.width / 16
  830.     draw_actor_image(actor, temp_actor, dx)
  831.     draw_param_names(actor, dx)
  832.     draw_former_stats(temp_actor)
  833.     draw_arrows
  834.     draw_newer_stats(actor, temp_actor)
  835.     draw_new_skills(actor, temp_actor)
  836.   end
  837.   
  838.   #--------------------------------------------------------------------------
  839.   # draw_actor_image
  840.   #--------------------------------------------------------------------------
  841.   def draw_actor_image(actor, temp_actor, dx)
  842.     draw_text(dx, line_height, 96, line_height, actor.name, 1)
  843.     draw_actor_face(actor, dx, line_height * 2)
  844.     exp = actor.exp - temp_actor.exp
  845.     text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
  846.     change_color(power_up_color)
  847.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  848.     draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
  849.     reset_font_settings
  850.   end
  851.   
  852.   #--------------------------------------------------------------------------
  853.   # draw_param_names
  854.   #--------------------------------------------------------------------------
  855.   def draw_param_names(actor, dx)
  856.     dx += 108
  857.     change_color(system_color)
  858.     text = Vocab.level
  859.     draw_text(dx, 0, contents.width - dx, line_height, text)
  860.     dy = 0
  861.     for i in 0...8
  862.       dy += line_height
  863.       text = Vocab.param(i)
  864.       draw_text(dx, dy, contents.width - dx, line_height, text)
  865.     end
  866.   end
  867.   
  868.   #--------------------------------------------------------------------------
  869.   # draw_former_stats
  870.   #--------------------------------------------------------------------------
  871.   def draw_former_stats(actor)
  872.     dw = contents.width / 2 - 12
  873.     dy = 0
  874.     change_color(normal_color)
  875.     draw_text(0, dy, dw, line_height, actor.level.group, 2)
  876.     for i in 0...8
  877.       dy += line_height
  878.       draw_text(0, dy, dw, line_height, actor.param(i).group, 2)
  879.     end
  880.   end
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # draw_arrows
  884.   #--------------------------------------------------------------------------
  885.   def draw_arrows
  886.     dx = contents.width / 2 - 12
  887.     dy = 0
  888.     change_color(system_color)
  889.     for i in 0..8
  890.       draw_text(dx, dy, 24, line_height, "→", 1)
  891.       dy += line_height
  892.     end
  893.   end
  894.   
  895.   #--------------------------------------------------------------------------
  896.   # draw_newer_stats
  897.   #--------------------------------------------------------------------------
  898.   def draw_newer_stats(actor, temp_actor)
  899.     dx = contents.width / 2 + 12
  900.     dw = contents.width - dx
  901.     dy = 0
  902.     change_color(param_change_color(actor.level - temp_actor.level))
  903.     draw_text(dx, dy, dw, line_height, actor.level.group, 0)
  904.     for i in 0...8
  905.       dy += line_height
  906.       change_color(param_change_color(actor.param(i) - temp_actor.param(i)))
  907.       draw_text(dx, dy, dw, line_height, actor.param(i).group, 0)
  908.     end
  909.   end
  910.   
  911.   #--------------------------------------------------------------------------
  912.   # draw_new_skills
  913.   #--------------------------------------------------------------------------
  914.   def draw_new_skills(actor, temp_actor)
  915.     return if temp_actor.skills.size == actor.skills.size
  916.     dw = 172 + 24
  917.     dx = contents.width - dw
  918.     change_color(system_color)
  919.     text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
  920.     draw_text(dx, 0, dw, line_height, text, 0)
  921.   end
  922.   
  923. end # Window_VictoryLevelUp

  924. #==============================================================================
  925. # ■ Window_VictorySkills
  926. #==============================================================================

  927. class Window_VictorySkills < Window_Selectable
  928.   
  929.   #--------------------------------------------------------------------------
  930.   # initialize
  931.   #--------------------------------------------------------------------------
  932.   def initialize
  933.     dy = fitting_height(1) + 24
  934.     dw = 172 + 24 + 24
  935.     dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
  936.     super(Graphics.width - dw, dy, dw, dh)
  937.     self.opacity = 0
  938.     self.z = 200
  939.     hide
  940.   end
  941.   
  942.   #--------------------------------------------------------------------------
  943.   # item_max
  944.   #--------------------------------------------------------------------------
  945.   def item_max; return @data.nil? ? 0 : @data.size; end
  946.   
  947.   #--------------------------------------------------------------------------
  948.   # refresh
  949.   #--------------------------------------------------------------------------
  950.   def refresh(actor, temp_actor)
  951.     contents.clear
  952.     if actor.skills.size == temp_actor.skills.size
  953.       unselect
  954.       @data = []
  955.       create_contents
  956.       return
  957.     end
  958.     @data = actor.skills - temp_actor.skills
  959.     if @data.size > 8
  960.       select(0)
  961.       activate
  962.     else
  963.       unselect
  964.       deactivate
  965.     end
  966.     create_contents
  967.     draw_all_items
  968.   end
  969.   
  970.   #--------------------------------------------------------------------------
  971.   # refresh
  972.   #--------------------------------------------------------------------------
  973.   def draw_item(index)
  974.     rect = item_rect(index)
  975.     skill = @data[index]
  976.     return if skill.nil?
  977.     rect.width -= 4
  978.     draw_item_name(skill, rect.x, rect.y, true)
  979.   end
  980.   
  981. end # Window_VictorySkills

  982. #==============================================================================
  983. # ■ Window_VictorySpoils
  984. #==============================================================================

  985. class Window_VictorySpoils < Window_ItemList
  986.   
  987.   #--------------------------------------------------------------------------
  988.   # initialize
  989.   #--------------------------------------------------------------------------
  990.   def initialize
  991.     super(0, fitting_height(1), Graphics.width, window_height)
  992.     self.z = 200
  993.     hide
  994.   end
  995.   
  996.   #--------------------------------------------------------------------------
  997.   # window_height
  998.   #--------------------------------------------------------------------------
  999.   def window_height
  1000.     return Graphics.height - fitting_height(4) - fitting_height(1)
  1001.   end
  1002.   
  1003.   #--------------------------------------------------------------------------
  1004.   # spacing
  1005.   #--------------------------------------------------------------------------
  1006.   def spacing; return 32; end
  1007.   
  1008.   #--------------------------------------------------------------------------
  1009.   # make
  1010.   #--------------------------------------------------------------------------
  1011.   def make(gold, drops)
  1012.     [url=home.php?mod=space&uid=236945]@gold[/url] = gold
  1013.     @drops = drops
  1014.     refresh
  1015.     select(0)
  1016.     activate
  1017.   end
  1018.   
  1019.   #--------------------------------------------------------------------------
  1020.   # make_item_list
  1021.   #--------------------------------------------------------------------------
  1022.   def make_item_list
  1023.     @data = [nil]
  1024.     items = {}
  1025.     weapons = {}
  1026.     armours = {}
  1027.     @goods = {}
  1028.     for item in @drops
  1029.       case item
  1030.       when RPG::Item
  1031.         items[item] = 0 if items[item].nil?
  1032.         items[item] += 1
  1033.       when RPG::Weapon
  1034.         weapons[item] = 0 if weapons[item].nil?
  1035.         weapons[item] += 1
  1036.       when RPG::Armor
  1037.         armours[item] = 0 if armours[item].nil?
  1038.         armours[item] += 1
  1039.       end
  1040.     end
  1041.     items = items.sort { |a,b| a[0].id <=> b[0].id }
  1042.     weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
  1043.     armours = armours.sort { |a,b| a[0].id <=> b[0].id }
  1044.     for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1045.     for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1046.     for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1047.   end
  1048.   
  1049.   #--------------------------------------------------------------------------
  1050.   # draw_item
  1051.   #--------------------------------------------------------------------------
  1052.   def draw_item(index)
  1053.     item = @data[index]
  1054.     rect = item_rect(index)
  1055.     reset_font_settings
  1056.     if item.nil?
  1057.       draw_gold(rect)
  1058.       return
  1059.     end
  1060.     rect.width -= 4
  1061.     draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  1062.     draw_item_number(rect, item)
  1063.   end
  1064.   
  1065.   #--------------------------------------------------------------------------
  1066.   # draw_gold
  1067.   #--------------------------------------------------------------------------
  1068.   def draw_gold(rect)
  1069.     text = Vocab.currency_unit
  1070.     draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  1071.   end
  1072.   
  1073.   #--------------------------------------------------------------------------
  1074.   # draw_item_number
  1075.   #--------------------------------------------------------------------------
  1076.   def draw_item_number(rect, item)
  1077.     number = @goods[item].group
  1078.     if $imported["YEA-AdjustLimits"]
  1079.       contents.font.size = YEA::LIMIT::ITEM_FONT
  1080.       text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
  1081.       draw_text(rect, text, 2)
  1082.     else
  1083.       draw_text(rect, sprintf(":%s", number), 2)
  1084.     end
  1085.   end
  1086.   
  1087. end # Window_VictorySpoils

  1088. #==============================================================================
  1089. # ■ Scene_Battle
  1090. #==============================================================================

  1091. class Scene_Battle < Scene_Base
  1092.   
  1093.   #--------------------------------------------------------------------------
  1094.   # alias method: create_all_windows
  1095.   #--------------------------------------------------------------------------
  1096.   alias scene_battle_create_all_windows_va create_all_windows
  1097.   def create_all_windows
  1098.     scene_battle_create_all_windows_va
  1099.     create_victory_aftermath_windows
  1100.   end
  1101.   
  1102.   #--------------------------------------------------------------------------
  1103.   # new method: create_victory_aftermath_windows
  1104.   #--------------------------------------------------------------------------
  1105.   def create_victory_aftermath_windows
  1106.     @victory_title_window = Window_VictoryTitle.new
  1107.     @victory_exp_window_back = Window_VictoryEXP_Back.new
  1108.     @victory_exp_window_front = Window_VictoryEXP_Front.new
  1109.     @victory_level_window = Window_VictoryLevelUp.new
  1110.     @victory_level_skills = Window_VictorySkills.new
  1111.     @victory_spoils_window = Window_VictorySpoils.new
  1112.   end
  1113.   
  1114.   #--------------------------------------------------------------------------
  1115.   # new method: show_victory_display_exp
  1116.   #--------------------------------------------------------------------------
  1117.   def show_victory_display_exp
  1118.     @victory_title_window.open
  1119.     name = $game_party.battle_members[0].name
  1120.     fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
  1121.     name = sprintf(fmt, name) if $game_party.battle_members.size > 1
  1122.     fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
  1123.     text = sprintf(fmt, name)
  1124.     @victory_title_window.refresh(text)
  1125.     #---
  1126.     @victory_exp_window_back.open
  1127.     @victory_exp_window_back.refresh
  1128.     @victory_exp_window_front.open
  1129.     @victory_exp_window_front.refresh
  1130.   end
  1131.   
  1132.   #--------------------------------------------------------------------------
  1133.   # new method: show_victory_level_up
  1134.   #--------------------------------------------------------------------------
  1135.   def show_victory_level_up(actor, temp_actor)
  1136.     @victory_exp_window_back.hide
  1137.     @victory_exp_window_front.hide
  1138.     #---
  1139.     fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
  1140.     text = sprintf(fmt, actor.name)
  1141.     @victory_title_window.refresh(text)
  1142.     #---
  1143.     @victory_level_window.show
  1144.     @victory_level_window.refresh(actor, temp_actor)
  1145.     @victory_level_skills.show
  1146.     @victory_level_skills.refresh(actor, temp_actor)
  1147.   end
  1148.   
  1149.   #--------------------------------------------------------------------------
  1150.   # new method: show_victory_spoils
  1151.   #--------------------------------------------------------------------------
  1152.   def show_victory_spoils(gold, drops)
  1153.     @victory_exp_window_back.hide
  1154.     @victory_exp_window_front.hide
  1155.     @victory_level_window.hide
  1156.     @victory_level_skills.hide
  1157.     #---
  1158.     text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
  1159.     @victory_title_window.refresh(text)
  1160.     #---
  1161.     @victory_spoils_window.show
  1162.     @victory_spoils_window.make(gold, drops)
  1163.   end
  1164.   
  1165.   #--------------------------------------------------------------------------
  1166.   # new method: close_victory_windows
  1167.   #--------------------------------------------------------------------------
  1168.   def close_victory_windows
  1169.     @victory_title_window.close
  1170.     @victory_exp_window_back.close
  1171.     @victory_exp_window_front.close
  1172.     @victory_level_window.close
  1173.     @victory_level_skills.close
  1174.     @victory_spoils_window.close
  1175.     wait(16)
  1176.   end
  1177.   
  1178. end # Scene_Battle

  1179. #==============================================================================
  1180. #
  1181. # ▼ End of File
  1182. #
  1183. #==============================================================================
复制代码
回复

使用道具 举报

梦石
0
星屑
55
在线时间
160 小时
注册时间
2012-2-10
回帖
92
发表于 2013-1-24 18:27:38 | 显示全部楼层
怎么解决的?
回复

使用道具 举报

梦石
0
星屑
55
在线时间
160 小时
注册时间
2012-2-10
回帖
92
发表于 2013-1-29 20:02:54 | 显示全部楼层
我用了一个特笨特脑残的办法解决掉了那就是让它先显示升级,然后在显示得到的战利品,嘿嘿,我很聪明吧?
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部