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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
146 小时
注册时间
2011-9-16
帖子
55
跳转到指定楼层
1
发表于 2012-10-16 20:49:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 婉烟沉沫 于 2012-10-16 21:57 编辑

于是……就是这样了。我没有动过脚本,但是战斗结束之后……

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
#
#==============================================================================

Lv1.梦旅人

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

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
161
在线时间
629 小时
注册时间
2012-6-9
帖子
1321
5
发表于 2013-1-21 20:10:17 | 只看该作者
你能不能把它框起来呢?(添加代码文字)
有什么问题呀?这脚本就是这样的。多了个框框而已。
RUBY 代码复制
  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.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-VictoryAftermath"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.07 - Compatibility Update: JP Manager
  17. # 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
  18. # 2011.12.26 - Compatibility Update: Command Autobattle
  19. # 2011.12.16 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ▼ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # At the end of each battle, RPG Maker VX Ace by default shows text saying that
  25. # the party has gained so-and-so EXP while this person leveled up and your
  26. # party happened to find these drops. This script changes that text into
  27. # something more visual for your players to see. Active battle members will be
  28. # seen gaining EXP, any kind of level up changes, and a list of the items
  29. # obtained through drops.
  30. #
  31. #==============================================================================
  32. # ▼ Instructions
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # To install this script, open up your script editor and copy/paste this script
  35. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  36. #
  37. # -----------------------------------------------------------------------------
  38. # Actor Notetags - These notetags go in the actors notebox in the database.
  39. # -----------------------------------------------------------------------------
  40. # <win quotes>
  41. #  string
  42. #  string
  43. # </win quotes>
  44. # Sets the win quote for the actor. The strings are continuous and can use
  45. # text codes. Use \n for a line break. Type in what you want the actor to say
  46. # for the particular win quote. Use [New Quote] in between the two tags to
  47. # start up a new quote.
  48. #
  49. # <level quotes>
  50. #  string
  51. #  string
  52. # </level quotes>
  53. # Sets the level up quote for the actor. The strings are continuous and can use
  54. # text codes. Use \n for a line break. Type in what you want the actor to say
  55. # for the particular win quote. Use [New Quote] in between the two tags to
  56. # start up a new quote.
  57. #
  58. # <drops quotes>
  59. #  string
  60. #  string
  61. # </drops quotes>
  62. # Sets the drops quote for the actor. The strings are continuous and can use
  63. # text codes. Use \n for a line break. Type in what you want the actor to say
  64. # for the particular win quote. Use [New Quote] in between the two tags to
  65. # start up a new quote.
  66. #
  67. # -----------------------------------------------------------------------------
  68. # Class Notetags - These notetags go in the class notebox in the database.
  69. # -----------------------------------------------------------------------------
  70. # <win quotes>
  71. #  string
  72. #  string
  73. # </win quotes>
  74. # Sets the win quote for the class. The strings are continuous and can use
  75. # text codes. Use \n for a line break. Type in what you want the actor to say
  76. # for the particular win quote. Use [New Quote] in between the two tags to
  77. # start up a new quote.
  78. #
  79. # <level quotes>
  80. #  string
  81. #  string
  82. # </level quotes>
  83. # Sets the level up quote for the class. The strings are continuous and can use
  84. # text codes. Use \n for a line break. Type in what you want the actor to say
  85. # for the particular win quote. Use [New Quote] in between the two tags to
  86. # start up a new quote.
  87. #
  88. # <drops quotes>
  89. #  string
  90. #  string
  91. # </drops quotes>
  92. # Sets the drops quote for the class. The strings are continuous and can use
  93. # text codes. Use \n for a line break. Type in what you want the actor to say
  94. # for the particular win quote. Use [New Quote] in between the two tags to
  95. # start up a new quote.
  96. #
  97. #==============================================================================
  98. # ▼ Compatibility
  99. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  100. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  101. # it will run with RPG Maker VX without adjusting.
  102. #
  103. #==============================================================================
  104.  
  105. module YEA
  106.   module VICTORY_AFTERMATH
  107.  
  108.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  109.     # - General Settings -
  110.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111.     # These are various settings that are used throughout the Victory Aftermath
  112.     # portion of a battle. Adjust them as you see fit.
  113.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  114.     VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # Victory BGM
  115.     VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP ticking SFX
  116.     LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # Level Up SFX
  117.     SKILLS_TEXT  = "新技能"                        # New skills text title.
  118.  
  119.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  120.     # - Important Settings -
  121.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  122.     # These are some important settings so please set them up properly. This
  123.     # section includes a switch that allows you to skip the victory aftermath
  124.     # phase (for those back to back battles and making them seamless) and it
  125.     # also allows you to declare a common event to run after each battle. If
  126.     # you do not wish to use either of these features, set them to 0. The
  127.     # common event will run regardless of win or escape.
  128.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  129.     SKIP_AFTERMATH_SWITCH  = 0  # If switch on, skip aftermath. 0 to disable.
  130.     AFTERMATH_COMMON_EVENT = 0  # Runs common event after battle. 0 to disable.
  131.  
  132.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  133.     # - Top Text Settings -
  134.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  135.     # Here, you can adjust the various text that appears in the window that
  136.     # appears at the top of the screen.
  137.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  138.     TOP_TEAM         = "%s的队伍"           # Team name used.
  139.     TOP_VICTORY_TEXT = "%s胜利了!"   # Text used to display victory.
  140.     TOP_LEVEL_UP     = "%s升级!"  # Text used to display level up.
  141.     TOP_SPOILS       = "胜利战利品!"     # Text used for spoils.
  142.  
  143.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  144.     # - EXP Gauge Settings -
  145.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  146.     # Adjust how the EXP Gauge appears for the Victory Aftermath here. This
  147.     # includes the text display, the font size, the colour of the gauges, and
  148.     # more. Adjust it all here.
  149.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  150.     VICTORY_EXP  = "+%sEXP"      # Text used to display EXP.
  151.     EXP_PERCENT  = "%1.2f%%"     # The way EXP percentage will be displayed.
  152.     LEVELUP_TEXT = "LEVEL UP!"   # Text to replace percentage when leveled.
  153.     MAX_LVL_TEXT = "MAX LEVEL"   # Text to replace percentage when max level.
  154.     FONTSIZE_EXP = 20            # Font size used for EXP.
  155.     EXP_TICKS    = 15            # Ticks to full EXP
  156.     EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
  157.     EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
  158.     LEVEL_GAUGE1 = 13            # "Window" skin text colour for leveling.
  159.     LEVEL_GAUGE2 = 5             # "Window" skin text colour for leveling.
  160.  
  161.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  162.     # - Victory Messages -
  163.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  164.     # In the Victory Aftermath, actors can say unique things. This is the pool
  165.     # of quotes used for actors without any custom victory quotes. Note that
  166.     # actors with custom quotes will take priority over classes with custom
  167.     # quotes, which will take priority over these default quotes. Use \n for
  168.     # a line break in the quotes.
  169.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170.     HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
  171.     FOOTER_TEXT = ""                        # Always at end of messages.
  172.  
  173.     # Win Quotes are what the actors say when a battle is won.
  174.     VICTORY_QUOTES ={
  175.     # :type   => Quotes
  176.       #------------------------------------------------------------------------
  177.       :win    => [ # Occurs as initial victory quote.
  178.                    '『胜利了……
  179.   活着就是要战斗。』',
  180.                    '『这是一个弱肉强食的世界,
  181.   失败者是没有存活的价值的。』',
  182.                    '『如果说生存的意义是战斗,
  183.   那么活着就是一场游戏。』',
  184.                    '『人生就像一场棋局,
  185.   做过亦是错过了,是没有反悔的余地的。』',
  186.                  ],# Do not remove this.
  187.       #------------------------------------------------------------------------
  188.       :level  => [ # Occurs as initial victory quote.
  189.                    '『不断让自己变强,
  190.   只因这世界没有弱者存在的价值。』',
  191.                    '『只要这样不断的努力下去,
  192.   终有一天会变得强大的吧……』',
  193.                    '『变强了呢……
  194.   做好准备面对更艰难的挑战了。』',
  195.                    '『在人生的棋局中,
  196.   我们所能做的只是变强,变得更强。』',
  197.                  ],# Do not remove this.
  198.       #------------------------------------------------------------------------
  199.       :drops  => [ # Occurs as initial victory quote.
  200.                    '『这是什么……』',
  201.                    '『得到不少好东西么……』',
  202.                    '『这些东西估计还有点用处吧。』',
  203.                    '『居然还有些好东西……』',
  204.                  ],# Do not remove this.
  205.       #------------------------------------------------------------------------
  206.     } # Do not remove this.
  207.  
  208.   end # VICTORY_AFTERMATH
  209. end # YEA
  210.  
  211. #==============================================================================
  212. # ▼ Editting anything past this point may potentially result in causing
  213. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  214. # halitosis so edit at your own risk.
  215. #==============================================================================
  216.  
  217. module YEA
  218.   module REGEXP
  219.   module BASEITEM
  220.  
  221.     NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  222.  
  223.     WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
  224.     WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
  225.     LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
  226.     LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
  227.     DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  228.     DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  229.  
  230.   end # BASEITEM
  231.   end # REGEXP
  232. end # YEA
  233.  
  234. #==============================================================================
  235. # ■ Switch
  236. #==============================================================================
  237.  
  238. module Switch
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # self.skip_aftermath
  242.   #--------------------------------------------------------------------------
  243.   def self.skip_aftermath
  244.     return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
  245.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  246.   end
  247.  
  248. end # Switch
  249.  
  250. #==============================================================================
  251. # ■ Numeric
  252. #==============================================================================
  253.  
  254. class Numeric
  255.  
  256.   #--------------------------------------------------------------------------
  257.   # new method: group_digits
  258.   #--------------------------------------------------------------------------
  259.   unless $imported["YEA-CoreEngine"]
  260.   def group; return self.to_s; end
  261.   end # $imported["YEA-CoreEngine"]
  262.  
  263. end # Numeric
  264.  
  265. #==============================================================================
  266. # ■ DataManager
  267. #==============================================================================
  268.  
  269. module DataManager
  270.  
  271.   #--------------------------------------------------------------------------
  272.   # alias method: load_database
  273.   #--------------------------------------------------------------------------
  274.   class <<self; alias load_database_va load_database; end
  275.   def self.load_database
  276.     load_database_va
  277.     load_notetags_va
  278.   end
  279.  
  280.   #--------------------------------------------------------------------------
  281.   # new method: load_notetags_va
  282.   #--------------------------------------------------------------------------
  283.   def self.load_notetags_va
  284.     groups = [$data_actors, $data_classes]
  285.     for group in groups
  286.       for obj in group
  287.         next if obj.nil?
  288.         obj.load_notetags_va
  289.       end
  290.     end
  291.   end
  292.  
  293. end # DataManager
  294.  
  295. #==============================================================================
  296. # ■ RPG::BaseItem
  297. #==============================================================================
  298.  
  299. class RPG::BaseItem
  300.  
  301.   #--------------------------------------------------------------------------
  302.   # public instance variables
  303.   #--------------------------------------------------------------------------
  304.   attr_accessor :win_quotes
  305.   attr_accessor :level_quotes
  306.   attr_accessor :drops_quotes
  307.  
  308.   #--------------------------------------------------------------------------
  309.   # common cache: load_notetags_va
  310.   #--------------------------------------------------------------------------
  311.   def load_notetags_va
  312.     @win_quotes = [""]
  313.     @level_quotes = [""]
  314.     @drops_quotes = [""]
  315.     @victory_quote_type = nil
  316.     #---
  317.     self.note.split(/[\r\n]+/).each { |line|
  318.       case line
  319.       #---
  320.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
  321.         @victory_quote_type = :win_quote
  322.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
  323.         @victory_quote_type = nil
  324.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
  325.         @victory_quote_type = :level_quote
  326.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
  327.         @victory_quote_type = nil
  328.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
  329.         @victory_quote_type = :drops_quote
  330.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
  331.         @victory_quote_type = nil
  332.       #---
  333.       when YEA::REGEXP::BASEITEM::NEW_QUOTE
  334.         case @victory_quote_type
  335.         when nil; next
  336.         when :win_quote;   @win_quotes.push("")
  337.         when :level_quote; @level_quotes.push("")
  338.         when :drops_quote; @drops_quotes.push("")
  339.         end
  340.       #---
  341.       else
  342.         case @victory_quote_type
  343.         when nil; next
  344.         when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
  345.         when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
  346.         when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
  347.         end
  348.       end
  349.     } # self.note.split
  350.     #---
  351.     return unless self.is_a?(RPG::Class)
  352.     quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
  353.     @win_quotes = quotes[:win].clone if @win_quotes == [""]
  354.     @level_quotes = quotes[:level].clone if @level_quotes == [""]
  355.     @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  356.   end
  357.  
  358. end # RPG::BaseItem
  359.  
  360. #==============================================================================
  361. # ■ BattleManager
  362. #==============================================================================
  363.  
  364. module BattleManager
  365.  
  366.   #--------------------------------------------------------------------------
  367.   # overwrite method: self.process_victory
  368.   #--------------------------------------------------------------------------
  369.   def self.process_victory
  370.     if $imported["YEA-CommandAutobattle"]
  371.       SceneManager.scene.close_disable_autobattle_window
  372.     end
  373.     if Switch.skip_aftermath
  374.       skip_aftermath
  375.       return
  376.     end
  377.     play_battle_end_me
  378.     gain_jp if $imported["YEA-JPManager"]
  379.     display_exp
  380.     gain_exp
  381.     gain_gold
  382.     gain_drop_items
  383.     close_windows
  384.     SceneManager.return
  385.     replay_bgm_and_bgs
  386.     battle_end(0)
  387.     return true
  388.   end
  389.  
  390.   #--------------------------------------------------------------------------
  391.   # new method: self.skip_aftermath
  392.   #--------------------------------------------------------------------------
  393.   def self.skip_aftermath
  394.     $game_party.all_members.each do |actor|
  395.       actor.gain_exp($game_troop.exp_total)
  396.     end
  397.     $game_party.gain_gold($game_troop.gold_total)
  398.     $game_troop.make_drop_items.each do |item|
  399.       $game_party.gain_item(item, 1)
  400.     end
  401.     close_windows
  402.     SceneManager.return
  403.     replay_bgm_and_bgs
  404.     battle_end(0)
  405.   end
  406.  
  407.   #--------------------------------------------------------------------------
  408.   # overwrite method: self.play_battle_end_me
  409.   #--------------------------------------------------------------------------
  410.   def self.play_battle_end_me
  411.     $game_system.battle_end_me.play
  412.     YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
  413.   end
  414.  
  415.   #--------------------------------------------------------------------------
  416.   # new method: self.set_victory_text
  417.   #--------------------------------------------------------------------------
  418.   def self.set_victory_text(actor, type)
  419.     text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
  420.     text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
  421.     text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
  422.     $game_message.face_name = actor.face_name
  423.     $game_message.face_index = actor.face_index
  424.     $game_message.add(text)
  425.     wait_for_message
  426.   end
  427.  
  428.   #--------------------------------------------------------------------------
  429.   # overwrite method: self.display_exp
  430.   #--------------------------------------------------------------------------
  431.   def self.display_exp
  432.     SceneManager.scene.show_victory_display_exp
  433.     actor = $game_party.random_target
  434.     @victory_actor = actor
  435.     set_victory_text(@victory_actor, :win)
  436.   end
  437.  
  438.   #--------------------------------------------------------------------------
  439.   # overwrite method: self.gain_exp
  440.   #--------------------------------------------------------------------------
  441.   def self.gain_exp
  442.     $game_party.all_members.each do |actor|
  443.       temp_actor = Marshal.load(Marshal.dump(actor))
  444.       actor.gain_exp($game_troop.exp_total)
  445.       next if actor.level == temp_actor.level
  446.       SceneManager.scene.show_victory_level_up(actor, temp_actor)
  447.       set_victory_text(actor, :level)
  448.       wait_for_message
  449.     end
  450.   end
  451.  
  452.   #--------------------------------------------------------------------------
  453.   # overwrite method: self.gain_gold
  454.   #--------------------------------------------------------------------------
  455.   def self.gain_gold
  456.     $game_party.gain_gold($game_troop.gold_total)
  457.   end
  458.  
  459.   #--------------------------------------------------------------------------
  460.   # overwrite method: self.gain_drop_items
  461.   #--------------------------------------------------------------------------
  462.   def self.gain_drop_items
  463.     drops = []
  464.     $game_troop.make_drop_items.each do |item|
  465.       $game_party.gain_item(item, 1)
  466.       drops.push(item)
  467.     end
  468.     SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
  469.     set_victory_text(@victory_actor, :drops)
  470.     wait_for_message
  471.   end
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # new method: self.close_windows
  475.   #--------------------------------------------------------------------------
  476.   def self.close_windows
  477.     SceneManager.scene.close_victory_windows
  478.   end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # alias method: load_database
  482.   #--------------------------------------------------------------------------
  483.   class <<self; alias battle_end_va battle_end; end
  484.   def self.battle_end(result)
  485.     battle_end_va(result)
  486.     return if result == 2
  487.     return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
  488.     event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
  489.     $game_temp.reserve_common_event(event_id)
  490.   end
  491.  
  492. end # BattleManager
  493.  
  494. #==============================================================================
  495. # ■ Game_Actor
  496. #==============================================================================
  497.  
  498. class Game_Actor < Game_Battler
  499.  
  500.   #--------------------------------------------------------------------------
  501.   # overwrite method: gain_exp
  502.   #--------------------------------------------------------------------------
  503.   def gain_exp(exp)
  504.     enabled = !SceneManager.scene_is?(Scene_Battle)
  505.     change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  506.   end
  507.  
  508.   #--------------------------------------------------------------------------
  509.   # new method: victory_quotes
  510.   #--------------------------------------------------------------------------
  511.   def victory_quotes(type)
  512.     case type
  513.     when :win
  514.       return self.actor.win_quotes if self.actor.win_quotes != [""]
  515.       return self.class.win_quotes
  516.     when :level
  517.       return self.actor.level_quotes if self.actor.level_quotes != [""]
  518.       return self.class.level_quotes
  519.     when :drops
  520.       return self.actor.drops_quotes if self.actor.drops_quotes != [""]
  521.       return self.class.drops_quotes
  522.     else
  523.       return ["NOTEXT"]
  524.     end
  525.   end
  526.  
  527. end # Game_Actor
  528.  
  529. #==============================================================================
  530. # ■ Window_VictoryTitle
  531. #==============================================================================
  532.  
  533. class Window_VictoryTitle < Window_Base
  534.  
  535.   #--------------------------------------------------------------------------
  536.   # initialize
  537.   #--------------------------------------------------------------------------
  538.   def initialize
  539.     super(0, 0, Graphics.width, fitting_height(1))
  540.     self.z = 200
  541.     self.openness = 0
  542.   end
  543.  
  544.   #--------------------------------------------------------------------------
  545.   # refresh
  546.   #--------------------------------------------------------------------------
  547.   def refresh(message = "")
  548.     contents.clear
  549.     draw_text(0, 0, contents.width, line_height, message, 1)
  550.   end
  551.  
  552. end # Window_VictoryTitle
  553.  
  554. #==============================================================================
  555. # ■ Window_VictoryEXP_Back
  556. #==============================================================================
  557.  
  558. class Window_VictoryEXP_Back < Window_Selectable
  559.  
  560.   #--------------------------------------------------------------------------
  561.   # initialize
  562.   #--------------------------------------------------------------------------
  563.   def initialize
  564.     super(0, fitting_height(1), Graphics.width, window_height)
  565.     self.z = 200
  566.     self.openness = 0
  567.   end
  568.  
  569.   #--------------------------------------------------------------------------
  570.   # window_height
  571.   #--------------------------------------------------------------------------
  572.   def window_height
  573.     return Graphics.height - fitting_height(4) - fitting_height(1)
  574.   end
  575.  
  576.   #--------------------------------------------------------------------------
  577.   # col_max
  578.   #--------------------------------------------------------------------------
  579.   def col_max; return item_max; end
  580.  
  581.   #--------------------------------------------------------------------------
  582.   # spacing
  583.   #--------------------------------------------------------------------------
  584.   def spacing; return 8; end
  585.  
  586.   #--------------------------------------------------------------------------
  587.   # item_max
  588.   #--------------------------------------------------------------------------
  589.   def item_max; return $game_party.battle_members.size; end
  590.  
  591.   #--------------------------------------------------------------------------
  592.   # open
  593.   #--------------------------------------------------------------------------
  594.   def open
  595.     @exp_total = $game_troop.exp_total
  596.     super
  597.   end
  598.  
  599.   #--------------------------------------------------------------------------
  600.   # item_rect
  601.   #--------------------------------------------------------------------------
  602.   def item_rect(index)
  603.     rect = Rect.new
  604.     rect.width = item_width
  605.     rect.height = contents.height
  606.     rect.x = index % col_max * (item_width + spacing)
  607.     rect.y = index / col_max * item_height
  608.     return rect
  609.   end
  610.  
  611.   #--------------------------------------------------------------------------
  612.   # draw_item
  613.   #--------------------------------------------------------------------------
  614.   def draw_item(index)
  615.     actor = $game_party.battle_members[index]
  616.     return if actor.nil?
  617.     rect = item_rect(index)
  618.     reset_font_settings
  619.     draw_actor_name(actor, rect)
  620.     draw_exp_gain(actor, rect)
  621.     draw_jp_gain(actor, rect)
  622.     draw_actor_face(actor, rect)
  623.   end
  624.  
  625.   #--------------------------------------------------------------------------
  626.   # draw_actor_name
  627.   #--------------------------------------------------------------------------
  628.   def draw_actor_name(actor, rect)
  629.     name = actor.name
  630.     draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
  631.   end
  632.  
  633.   #--------------------------------------------------------------------------
  634.   # draw_actor_face
  635.   #--------------------------------------------------------------------------
  636.   def draw_actor_face(actor, rect)
  637.     face_name = actor.face_name
  638.     face_index = actor.face_index
  639.     bitmap = Cache.face(face_name)
  640.     rw = [rect.width, 96].min
  641.     face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
  642.     rx = (rect.width - rw) / 2 + rect.x
  643.     contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
  644.   end
  645.  
  646.   #--------------------------------------------------------------------------
  647.   # draw_exp_gain
  648.   #--------------------------------------------------------------------------
  649.   def draw_exp_gain(actor, rect)
  650.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  651.     dy = rect.y + line_height * 3 + 96
  652.     fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
  653.     text = sprintf(fmt, actor_exp_gain(actor).group)
  654.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  655.     change_color(power_up_color)
  656.     draw_text(rect.x, dy, dw, line_height, text, 2)
  657.   end
  658.  
  659.   #--------------------------------------------------------------------------
  660.   # actor_exp_gain
  661.   #--------------------------------------------------------------------------
  662.   def actor_exp_gain(actor)
  663.     n = @exp_total * actor.final_exp_rate
  664.     return n.to_i
  665.   end
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # draw_jp_gain
  669.   #--------------------------------------------------------------------------
  670.   def draw_jp_gain(actor, rect)
  671.     return unless $imported["YEA-JPManager"]
  672.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  673.     dy = rect.y + line_height * 4 + 96
  674.     fmt = YEA::JP::VICTORY_AFTERMATH
  675.     text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
  676.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  677.     change_color(power_up_color)
  678.     draw_text(rect.x, dy, dw, line_height, text, 2)
  679.   end
  680.  
  681.   #--------------------------------------------------------------------------
  682.   # actor_jp_gain
  683.   #--------------------------------------------------------------------------
  684.   def actor_jp_gain(actor)
  685.     n = actor.battle_jp_earned
  686.     if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
  687.       n += YEA::JP::LEVEL_UP unless actor.max_level?
  688.     end
  689.     return n
  690.   end
  691.  
  692. end # Window_VictoryEXP_Back
  693.  
  694. #==============================================================================
  695. # ■ Window_VictoryEXP_Front
  696. #==============================================================================
  697.  
  698. class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  699.  
  700.   #--------------------------------------------------------------------------
  701.   # initialize
  702.   #--------------------------------------------------------------------------
  703.   def initialize
  704.     super
  705.     self.back_opacity = 0
  706.     @ticks = 0
  707.     @counter = 30
  708.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  709.   end
  710.  
  711.   #--------------------------------------------------------------------------
  712.   # update
  713.   #--------------------------------------------------------------------------
  714.   def update
  715.     super
  716.     update_tick
  717.   end
  718.  
  719.   #--------------------------------------------------------------------------
  720.   # update_tick
  721.   #--------------------------------------------------------------------------
  722.   def update_tick
  723.     return unless self.openness >= 255
  724.     return unless self.visible
  725.     return if complete_ticks?
  726.     @counter -= 1
  727.     return unless @counter <= 0
  728.     return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
  729.     YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
  730.     @counter = 4
  731.     @ticks += 1
  732.     refresh
  733.   end
  734.  
  735.   #--------------------------------------------------------------------------
  736.   # complete_ticks?
  737.   #--------------------------------------------------------------------------
  738.   def complete_ticks?
  739.     for actor in $game_party.battle_members
  740.       total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  741.       bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  742.       now_exp = actor.exp - actor.current_level_exp + bonus_exp
  743.       next_exp = actor.next_level_exp - actor.current_level_exp
  744.       rate = now_exp * 1.0 / next_exp
  745.       return false if rate < 1.0
  746.     end
  747.     return true
  748.   end
  749.  
  750.   #--------------------------------------------------------------------------
  751.   # draw_item
  752.   #--------------------------------------------------------------------------
  753.   def draw_item(index)
  754.     actor = $game_party.battle_members[index]
  755.     return if actor.nil?
  756.     rect = item_rect(index)
  757.     draw_actor_exp(actor, rect)
  758.   end
  759.  
  760.   #--------------------------------------------------------------------------
  761.   # exp_gauge1
  762.   #--------------------------------------------------------------------------
  763.   def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end
  764.  
  765.   #--------------------------------------------------------------------------
  766.   # exp_gauge2
  767.   #--------------------------------------------------------------------------
  768.   def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end
  769.  
  770.   #--------------------------------------------------------------------------
  771.   # lvl_gauge1
  772.   #--------------------------------------------------------------------------
  773.   def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end
  774.  
  775.   #--------------------------------------------------------------------------
  776.   # lvl_gauge2
  777.   #--------------------------------------------------------------------------
  778.   def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end
  779.  
  780.   #--------------------------------------------------------------------------
  781.   # draw_actor_exp
  782.   #--------------------------------------------------------------------------
  783.   def draw_actor_exp(actor, rect)
  784.     if actor.max_level?
  785.       draw_exp_gauge(actor, rect, 1.0)
  786.       return
  787.     end
  788.     total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  789.     bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  790.     now_exp = actor.exp - actor.current_level_exp + bonus_exp
  791.     next_exp = actor.next_level_exp - actor.current_level_exp
  792.     rate = now_exp * 1.0 / next_exp
  793.     draw_exp_gauge(actor, rect, rate)
  794.   end
  795.  
  796.   #--------------------------------------------------------------------------
  797.   # draw_exp_gauge
  798.   #--------------------------------------------------------------------------
  799.   def draw_exp_gauge(actor, rect, rate)
  800.     rate = [[rate, 1.0].min, 0.0].max
  801.     dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
  802.     dy = rect.y + line_height * 2 + 96
  803.     dw = [rect.width, 96].min
  804.     colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
  805.     colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
  806.     draw_gauge(dx, dy, dw, rate, colour1, colour2)
  807.     fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
  808.     text = sprintf(fmt, [rate * 100, 100.00].min)
  809.     if [rate * 100, 100.00].min == 100.00
  810.       text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
  811.       text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
  812.     end
  813.     draw_text(dx, dy, dw, line_height, text, 1)
  814.   end
  815.  
  816. end # Window_VictoryEXP_Front
  817.  
  818. #==============================================================================
  819. # ■ Window_VictoryLevelUp
  820. #==============================================================================
  821.  
  822. class Window_VictoryLevelUp < Window_Base
  823.  
  824.   #--------------------------------------------------------------------------
  825.   # initialize
  826.   #--------------------------------------------------------------------------
  827.   def initialize
  828.     super(0, fitting_height(1), Graphics.width, window_height)
  829.     self.z = 200
  830.     hide
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # window_height
  835.   #--------------------------------------------------------------------------
  836.   def window_height
  837.     return Graphics.height - fitting_height(4) - fitting_height(1)
  838.   end
  839.  
  840.   #--------------------------------------------------------------------------
  841.   # refresh
  842.   #--------------------------------------------------------------------------
  843.   def refresh(actor, temp_actor)
  844.     contents.clear
  845.     reset_font_settings
  846.     YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
  847.     draw_actor_changes(actor, temp_actor)
  848.   end
  849.  
  850.   #--------------------------------------------------------------------------
  851.   # draw_actor_changes
  852.   #--------------------------------------------------------------------------
  853.   def draw_actor_changes(actor, temp_actor)
  854.     dx = contents.width / 16
  855.     draw_actor_image(actor, temp_actor, dx)
  856.     draw_param_names(actor, dx)
  857.     draw_former_stats(temp_actor)
  858.     draw_arrows
  859.     draw_newer_stats(actor, temp_actor)
  860.     draw_new_skills(actor, temp_actor)
  861.   end
  862.  
  863.   #--------------------------------------------------------------------------
  864.   # draw_actor_image
  865.   #--------------------------------------------------------------------------
  866.   def draw_actor_image(actor, temp_actor, dx)
  867.     draw_text(dx, line_height, 96, line_height, actor.name, 1)
  868.     draw_actor_face(actor, dx, line_height * 2)
  869.     exp = actor.exp - temp_actor.exp
  870.     text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
  871.     change_color(power_up_color)
  872.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  873.     draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
  874.     reset_font_settings
  875.   end
  876.  
  877.   #--------------------------------------------------------------------------
  878.   # draw_param_names
  879.   #--------------------------------------------------------------------------
  880.   def draw_param_names(actor, dx)
  881.     dx += 108
  882.     change_color(system_color)
  883.     text = Vocab.level
  884.     draw_text(dx, 0, contents.width - dx, line_height, text)
  885.     dy = 0
  886.     for i in 0...8
  887.       dy += line_height
  888.       text = Vocab.param(i)
  889.       draw_text(dx, dy, contents.width - dx, line_height, text)
  890.     end
  891.   end
  892.  
  893.   #--------------------------------------------------------------------------
  894.   # draw_former_stats
  895.   #--------------------------------------------------------------------------
  896.   def draw_former_stats(actor)
  897.     dw = contents.width / 2 - 12
  898.     dy = 0
  899.     change_color(normal_color)
  900.     draw_text(0, dy, dw, line_height, actor.level.group, 2)
  901.     for i in 0...8
  902.       dy += line_height
  903.       draw_text(0, dy, dw, line_height, actor.param(i).group, 2)
  904.     end
  905.   end
  906.  
  907.   #--------------------------------------------------------------------------
  908.   # draw_arrows
  909.   #--------------------------------------------------------------------------
  910.   def draw_arrows
  911.     dx = contents.width / 2 - 12
  912.     dy = 0
  913.     change_color(system_color)
  914.     for i in 0..8
  915.       draw_text(dx, dy, 24, line_height, "→", 1)
  916.       dy += line_height
  917.     end
  918.   end
  919.  
  920.   #--------------------------------------------------------------------------
  921.   # draw_newer_stats
  922.   #--------------------------------------------------------------------------
  923.   def draw_newer_stats(actor, temp_actor)
  924.     dx = contents.width / 2 + 12
  925.     dw = contents.width - dx
  926.     dy = 0
  927.     change_color(param_change_color(actor.level - temp_actor.level))
  928.     draw_text(dx, dy, dw, line_height, actor.level.group, 0)
  929.     for i in 0...8
  930.       dy += line_height
  931.       change_color(param_change_color(actor.param(i) - temp_actor.param(i)))
  932.       draw_text(dx, dy, dw, line_height, actor.param(i).group, 0)
  933.     end
  934.   end
  935.  
  936.   #--------------------------------------------------------------------------
  937.   # draw_new_skills
  938.   #--------------------------------------------------------------------------
  939.   def draw_new_skills(actor, temp_actor)
  940.     return if temp_actor.skills.size == actor.skills.size
  941.     dw = 172 + 24
  942.     dx = contents.width - dw
  943.     change_color(system_color)
  944.     text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
  945.     draw_text(dx, 0, dw, line_height, text, 0)
  946.   end
  947.  
  948. end # Window_VictoryLevelUp
  949.  
  950. #==============================================================================
  951. # ■ Window_VictorySkills
  952. #==============================================================================
  953.  
  954. class Window_VictorySkills < Window_Selectable
  955.  
  956.   #--------------------------------------------------------------------------
  957.   # initialize
  958.   #--------------------------------------------------------------------------
  959.   def initialize
  960.     dy = fitting_height(1) + 24
  961.     dw = 172 + 24 + 24
  962.     dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
  963.     super(Graphics.width - dw, dy, dw, dh)
  964.     self.opacity = 0
  965.     self.z = 200
  966.     hide
  967.   end
  968.  
  969.   #--------------------------------------------------------------------------
  970.   # item_max
  971.   #--------------------------------------------------------------------------
  972.   def item_max; return @data.nil? ? 0 : @data.size; end
  973.  
  974.   #--------------------------------------------------------------------------
  975.   # refresh
  976.   #--------------------------------------------------------------------------
  977.   def refresh(actor, temp_actor)
  978.     contents.clear
  979.     if actor.skills.size == temp_actor.skills.size
  980.       unselect
  981.       @data = []
  982.       create_contents
  983.       return
  984.     end
  985.     @data = actor.skills - temp_actor.skills
  986.     if @data.size > 8
  987.       select(0)
  988.       activate
  989.     else
  990.       unselect
  991.       deactivate
  992.     end
  993.     create_contents
  994.     draw_all_items
  995.   end
  996.  
  997.   #--------------------------------------------------------------------------
  998.   # refresh
  999.   #--------------------------------------------------------------------------
  1000.   def draw_item(index)
  1001.     rect = item_rect(index)
  1002.     skill = @data[index]
  1003.     return if skill.nil?
  1004.     rect.width -= 4
  1005.     draw_item_name(skill, rect.x, rect.y, true)
  1006.   end
  1007.  
  1008. end # Window_VictorySkills
  1009.  
  1010. #==============================================================================
  1011. # ■ Window_VictorySpoils
  1012. #==============================================================================
  1013.  
  1014. class Window_VictorySpoils < Window_ItemList
  1015.  
  1016.   #--------------------------------------------------------------------------
  1017.   # initialize
  1018.   #--------------------------------------------------------------------------
  1019.   def initialize
  1020.     super(0, fitting_height(1), Graphics.width, window_height)
  1021.     self.z = 200
  1022.     hide
  1023.   end
  1024.  
  1025.   #--------------------------------------------------------------------------
  1026.   # window_height
  1027.   #--------------------------------------------------------------------------
  1028.   def window_height
  1029.     return Graphics.height - fitting_height(4) - fitting_height(1)
  1030.   end
  1031.  
  1032.   #--------------------------------------------------------------------------
  1033.   # spacing
  1034.   #--------------------------------------------------------------------------
  1035.   def spacing; return 32; end
  1036.  
  1037.   #--------------------------------------------------------------------------
  1038.   # make
  1039.   #--------------------------------------------------------------------------
  1040.   def make(gold, drops)
  1041.     [url=home.php?mod=space&uid=236945]@gold[/url] = gold
  1042.     @drops = drops
  1043.     refresh
  1044.     select(0)
  1045.     activate
  1046.   end
  1047.  
  1048.   #--------------------------------------------------------------------------
  1049.   # make_item_list
  1050.   #--------------------------------------------------------------------------
  1051.   def make_item_list
  1052.     @data = [nil]
  1053.     items = {}
  1054.     weapons = {}
  1055.     armours = {}
  1056.     @goods = {}
  1057.     for item in @drops
  1058.       case item
  1059.       when RPG::Item
  1060.         items[item] = 0 if items[item].nil?
  1061.         items[item] += 1
  1062.       when RPG::Weapon
  1063.         weapons[item] = 0 if weapons[item].nil?
  1064.         weapons[item] += 1
  1065.       when RPG::Armor
  1066.         armours[item] = 0 if armours[item].nil?
  1067.         armours[item] += 1
  1068.       end
  1069.     end
  1070.     items = items.sort { |a,b| a[0].id <=> b[0].id }
  1071.     weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
  1072.     armours = armours.sort { |a,b| a[0].id <=> b[0].id }
  1073.     for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1074.     for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1075.     for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1076.   end
  1077.  
  1078.   #--------------------------------------------------------------------------
  1079.   # draw_item
  1080.   #--------------------------------------------------------------------------
  1081.   def draw_item(index)
  1082.     item = @data[index]
  1083.     rect = item_rect(index)
  1084.     reset_font_settings
  1085.     if item.nil?
  1086.       draw_gold(rect)
  1087.       return
  1088.     end
  1089.     rect.width -= 4
  1090.     draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  1091.     draw_item_number(rect, item)
  1092.   end
  1093.  
  1094.   #--------------------------------------------------------------------------
  1095.   # draw_gold
  1096.   #--------------------------------------------------------------------------
  1097.   def draw_gold(rect)
  1098.     text = Vocab.currency_unit
  1099.     draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  1100.   end
  1101.  
  1102.   #--------------------------------------------------------------------------
  1103.   # draw_item_number
  1104.   #--------------------------------------------------------------------------
  1105.   def draw_item_number(rect, item)
  1106.     number = @goods[item].group
  1107.     if $imported["YEA-AdjustLimits"]
  1108.       contents.font.size = YEA::LIMIT::ITEM_FONT
  1109.       text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
  1110.       draw_text(rect, text, 2)
  1111.     else
  1112.       draw_text(rect, sprintf(":%s", number), 2)
  1113.     end
  1114.   end
  1115.  
  1116. end # Window_VictorySpoils
  1117.  
  1118. #==============================================================================
  1119. # ■ Scene_Battle
  1120. #==============================================================================
  1121.  
  1122. class Scene_Battle < Scene_Base
  1123.  
  1124.   #--------------------------------------------------------------------------
  1125.   # alias method: create_all_windows
  1126.   #--------------------------------------------------------------------------
  1127.   alias scene_battle_create_all_windows_va create_all_windows
  1128.   def create_all_windows
  1129.     scene_battle_create_all_windows_va
  1130.     create_victory_aftermath_windows
  1131.   end
  1132.  
  1133.   #--------------------------------------------------------------------------
  1134.   # new method: create_victory_aftermath_windows
  1135.   #--------------------------------------------------------------------------
  1136.   def create_victory_aftermath_windows
  1137.     @victory_title_window = Window_VictoryTitle.new
  1138.     @victory_exp_window_back = Window_VictoryEXP_Back.new
  1139.     @victory_exp_window_front = Window_VictoryEXP_Front.new
  1140.     @victory_level_window = Window_VictoryLevelUp.new
  1141.     @victory_level_skills = Window_VictorySkills.new
  1142.     @victory_spoils_window = Window_VictorySpoils.new
  1143.   end
  1144.  
  1145.   #--------------------------------------------------------------------------
  1146.   # new method: show_victory_display_exp
  1147.   #--------------------------------------------------------------------------
  1148.   def show_victory_display_exp
  1149.     @victory_title_window.open
  1150.     name = $game_party.battle_members[0].name
  1151.     fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
  1152.     name = sprintf(fmt, name) if $game_party.battle_members.size > 1
  1153.     fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
  1154.     text = sprintf(fmt, name)
  1155.     @victory_title_window.refresh(text)
  1156.     #---
  1157.     @victory_exp_window_back.open
  1158.     @victory_exp_window_back.refresh
  1159.     @victory_exp_window_front.open
  1160.     @victory_exp_window_front.refresh
  1161.   end
  1162.  
  1163.   #--------------------------------------------------------------------------
  1164.   # new method: show_victory_level_up
  1165.   #--------------------------------------------------------------------------
  1166.   def show_victory_level_up(actor, temp_actor)
  1167.     @victory_exp_window_back.hide
  1168.     @victory_exp_window_front.hide
  1169.     #---
  1170.     fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
  1171.     text = sprintf(fmt, actor.name)
  1172.     @victory_title_window.refresh(text)
  1173.     #---
  1174.     @victory_level_window.show
  1175.     @victory_level_window.refresh(actor, temp_actor)
  1176.     @victory_level_skills.show
  1177.     @victory_level_skills.refresh(actor, temp_actor)
  1178.   end
  1179.  
  1180.   #--------------------------------------------------------------------------
  1181.   # new method: show_victory_spoils
  1182.   #--------------------------------------------------------------------------
  1183.   def show_victory_spoils(gold, drops)
  1184.     @victory_exp_window_back.hide
  1185.     @victory_exp_window_front.hide
  1186.     @victory_level_window.hide
  1187.     @victory_level_skills.hide
  1188.     #---
  1189.     text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
  1190.     @victory_title_window.refresh(text)
  1191.     #---
  1192.     @victory_spoils_window.show
  1193.     @victory_spoils_window.make(gold, drops)
  1194.   end
  1195.  
  1196.   #--------------------------------------------------------------------------
  1197.   # new method: close_victory_windows
  1198.   #--------------------------------------------------------------------------
  1199.   def close_victory_windows
  1200.     @victory_title_window.close
  1201.     @victory_exp_window_back.close
  1202.     @victory_exp_window_front.close
  1203.     @victory_level_window.close
  1204.     @victory_level_skills.close
  1205.     @victory_spoils_window.close
  1206.     wait(16)
  1207.   end
  1208.  
  1209. end # Scene_Battle
  1210.  
  1211. #==============================================================================
  1212. #
  1213. # ▼ End of File
  1214. #
  1215. #==============================================================================
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
160 小时
注册时间
2012-2-10
帖子
98
6
发表于 2013-1-24 18:27:38 | 只看该作者
怎么解决的?
回复

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-11 23:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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