| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 7 | 
 
| 经验 | 7443 | 
 
| 最后登录 | 2025-9-22 | 
 
| 在线时间 | 207 小时 | 
 
 
 
 
 
Lv2.观梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 720 
 
        - 在线时间
 - 207 小时
 
        - 注册时间
 - 2013-9-5
 
        - 帖子
 - 77
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
 本帖最后由 a1670770233 于 2014-8-5 17:41 编辑  
 
#============================================================================== 
#  
# ▼ yanfly 引擎 - 胜利之后 V1.03 
# —— 最后更新:2012.01.07 
# —— 水平:简单,正常,硬 
# —— 要求:n/a 
#  
#============================================================================== 
 
$imported = {} if $imported.nil? 
$imported["YEA-VictoryAftermath"] = true 
 
#============================================================================== 
# ▼ Updates 
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
# 2012.01.07 - 兼容性更新:JP经理 
# 2012.01.01 - BUG 的错误:贴错引用标签。 
# 2011.12.26 - 兼容性更新:自动战斗命令 
# 2011.12.16 - 开始和完成的剧本。 
#  
#============================================================================== 
# ▼ 介绍 
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
# 在每场战斗结束后,RPG Maker VX Ace 在默认情况下显示的文字说, 
# 队友已经获得了某某等等EXP,而这个人填平和您的同伴偶然发现这些滴。 
# 这个脚本更改该文本到的东西更多的视觉为你的队员看到的。 
# 积极战斗成员将会看到获得EXP,任何种水平向上的变化,并通过滴得到的项的列表。 
#  
#============================================================================== 
# ▼ 使用说明 
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
# 如果要安装这个脚本,打开你的脚本编辑器和复制/粘贴此脚本下面 ▼ Materials/素材, 
# 但一定要在 ▼ Main 之上。记得保存。 
#  
# ----------------------------------------------------------------------------- 
# 角色 标签 - 这些标签填入去数据库中的角色备注内。 
# ----------------------------------------------------------------------------- 
# <win quotes> 
# 
#  字符串 
# 
# </win quotes> 
# 设置角色胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
# <level quotes> 
# 
#  字符串 
# 
# </level quotes> 
# 设置层次显示角色胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
# <drops quotes> 
# 
#  字符串 
# 
# </drops quotes> 
# 设置滴显示角色胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
# ----------------------------------------------------------------------------- 
# 敌人 标签 - 这些标签填入去数据库中的敌人备注内。 
# ----------------------------------------------------------------------------- 
# <win quotes> 
#  string 
#  string 
# </win quotes> 
# 设置类胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
# <level quotes> 
#  string 
#  string 
# </level quotes> 
# 设置层次显示类胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
# <drops quotes> 
#  string 
#  string 
# </drops quotes> 
# 设置滴显示类胜利奖励信息。该字符串是连续的,可以使用文本代码。 
# 使用\n作为换行符。你想要什么样的角色说的,就输入特定胜利信息。 
# 在两个标记之间使用 [New Quote] ,开始了一个新的胜利信息。 
#  
#============================================================================== 
# ▼ 兼容性 
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
# 这个脚本是由严格的RPG游戏制作VX的王牌。 
# 这是不可能的,它会与RPG游戏制作VX的运行,而无需调整。 
#  
#============================================================================== 
 
module YEA 
  module VICTORY_AFTERMATH 
     
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # - 常规设置 - 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # 这些是用于设置整个一场战斗的胜利之后部分。你认为合适调整它们。 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # 胜利 BGM 
    VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP 滴答 SFX 
    LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # 升级 SFX 
    SKILLS_TEXT  = "新技能"                            # 新技能的文字标题 
     
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # - 重要的设置 - 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # 这些都是一些重要的设置,请设置正确。 
    # 这部分包括一个开关,可以跳过胜利后阶段(可以让玩家无缝回到战斗)。 
    # 也允许你声明了一个普通的事件运行之后的每一个战役。 
    # 如果你不想使用这些功能,设置为0。常见的活动将在无论赢或逃避。怎么不使用啊 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    SKIP_AFTERMATH_SWITCH  = 0  # 如果打开,跳过胜利信息。 0禁用。 
    AFTERMATH_COMMON_EVENT = 0  # 战斗结束后运行常见的事件。 0来禁用。【这没用,不信你试试】 
     
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # - 顶部文字设定 - 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # 在这里,你可以调整出现在屏幕顶部的窗口的各种文本。 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    TOP_TEAM         = "%s的队伍"      # 团队名称           【不要】 
    TOP_VICTORY_TEXT = "%s胜利了!"     # 用于显示胜利文本。【不要】 
    TOP_LEVEL_UP     = "%s升级!"       # 用于显示升级文本。 
    TOP_SPOILS       = "胜利战利品!"   # 用于战利品文本。【这里的话不想要】 
     
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # - EXP 条设置 - 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # 在这里调整EXP条如何出现胜利之后。 
    # 这包括在文本显示,字体大小,EXP条的颜色,等等。这一切在此处调整。 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    VICTORY_EXP  = "+%sEXP"      # 用于显示EXP文本 
    EXP_PERCENT  = "%1.2f%%"     # 显示EXP百分比 
    LEVELUP_TEXT = "升级了!"    # 升级时,用文本替换百分比。 
    MAX_LVL_TEXT = "等级封顶!"  # 等级封顶时,用文本替换百分比。 
    FONTSIZE_EXP = 20            # 显示 EXP 字体大小 
    EXP_TICKS    = 15            # EXP 条每格长度。 
    EXP_GAUGE1   = 12            #“窗口”皮肤的文本颜色规范。 
    EXP_GAUGE2   = 4             #“窗口”皮肤的文本颜色规范。 
    LEVEL_GAUGE1 = 13            #“窗口”皮肤的文本颜色矫平。 
    LEVEL_GAUGE2 = 5             #“窗口”皮肤的文本颜色矫平。 
     
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # - 胜利的消息 - 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    # 在胜利之后,角色可以说独特的东西。这是引用的角色没有任何自定义的胜利引用词。 
    # 注意,自定义引号角色将优先于自定义引用类,将优先于这些默认的引用。使用\n换行。 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
    HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # 总是在开始的消息。 
    FOOTER_TEXT = ""                        # 总是最后消息。 
     
    # 当一场战斗胜利了,根据情况显示胜利消息。 
    VICTORY_QUOTES ={ 
    # :情况   => 胜利消息 
      #------------------------------------------------------------------------ 
      :win    => [ # 如发生初战告捷的消息。                 【以下这些话好白痴,可删掉就出错,不是战斗前就是战斗后……反正会出错啦 
                   '"我们赢了! 多么激烈的战斗!"', 
                   '"我出了一身汗."', 
                   '"这并不难."', 
                   '"让我们挑战更厉害的!"', 
                 ], 
      #------------------------------------------------------------------------ 
      :level  => [ # 战斗胜利升级的消息。 
                   '"好! 升级了!"', 
                   '"我变强了!"', 
                   '"试试超过我!"', 
                   '"我又成长了!"', 
                 ], 
      #------------------------------------------------------------------------ 
      :drops  => [ # 战斗胜利获得战利品的消息。 
                   '"带走这些东西."', 
                   '"胜利者的战利品."', 
                   '"怪物掉了些东西!"', 
                   '"嘿, 这是什么?"', 
                 ], 
      #------------------------------------------------------------------------ 
    } 
     
  end # VICTORY_AFTERMATH 
end # YEA 
 
#============================================================================== 
# ▼ 编辑任何过去这一点可能会导致电脑损坏,失禁,用户的头部,爆炸,昏迷,死亡,和/或 
#    口臭等编辑你自己的风险。 
#============================================================================== 
 
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 
#  
#============================================================================== 
 |   
 
 
 
 |