| 
 
| 赞 | 0 |  
| VIP | 195 |  
| 好人卡 | 0 |  
| 积分 | 15 |  
| 经验 | 4022 |  
| 最后登录 | 2014-4-11 |  
| 在线时间 | 423 小时 |  
 Lv3.寻梦者 
	梦石0 星屑1455 在线时间423 小时注册时间2010-12-26帖子337 | 
| 狱冥幻翼 发表于 2012-8-1 14:52 ![]() 这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二 ...
请问如何整合这些脚本啊!
 
 1物品合成脚本
 
 复制代码#==============================================================================
# ■ RGSS3 アイテム合成 ver 1.02
#------------------------------------------------------------------------------
#  配布元:
#     白の魔 http://izumiwhite.web.fc2.com/
#
#  利用規約:
#     RPGツクールVX Aceの正規の登録者のみご利用になれます。
#     利用報告・著作権表示とかは必要ありません。
#     改造もご自由にどうぞ。
#     何か問題が発生しても責任は持ちません。
#==============================================================================
#--------------------------------------------------------------------------
# ★ 初期設定。
#    合成レシピ等の設定
#--------------------------------------------------------------------------
module WD_itemsynthesis_ini
  
  Cost_view =  true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
  
  Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
  Category_w = true #カテゴリウィンドウに「武器」の項目を表示
  Category_a = true #カテゴリウィンドウに「防具」の項目を表示
  Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
  
  I_recipe = [] #この行は削除しないこと
  W_recipe = [] #この行は削除しないこと
  A_recipe = [] #この行は削除しないこと
  
  #以下、合成レシピ。
  #例: I_recipe[3]  = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  #と記載した場合、ID3のアイテムの合成必要は、100G。
  #必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
  #となる。
  
  #アイテムの合成レシピ
  I_recipe[2]  = [10,  ["I",1,2]]
  I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  I_recipe[17] = [500, ["I",1,10]]
  #武器の合成レシピ
  W_recipe[3]  = [50,   ["W",1,1], ["W",2,1]]
  W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  
  #防具の合成レシピ  
  A_recipe[2]  = [40,   ["A",1,2]]
  A_recipe[5]  = [400,  ["A",2,1], ["W",2,2], ["I",17,0]]
  
end
#==============================================================================
# ■ WD_itemsynthesis
#------------------------------------------------------------------------------
#  アイテム合成用の共通メソッドです。
#==============================================================================
module WD_itemsynthesis
  def i_recipe_switch_on(id)
    $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
    $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
    $game_system.i_rcp_sw[id] = true
  end
  def i_recipe_switch_off(id)
    $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
    $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
    $game_system.i_rcp_sw[id] = false
  end
  def i_recipe_switch_on?(id)
    $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
    $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
    return $game_system.i_rcp_sw[id]
  end
  def i_recipe_all_switch_on
    for i in 1..$data_items.size
      i_recipe_switch_on(i)
    end
  end
  def i_recipe_all_switch_off
    for i in 1..$data_items.size
      i_recipe_switch_off(i)
    end
  end
  def w_recipe_switch_on(id)
    $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
    $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
    $game_system.w_rcp_sw[id] = true
  end
  def w_recipe_switch_off(id)
    $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
    $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
    $game_system.w_rcp_sw[id] = false
  end
  def w_recipe_switch_on?(id)
    $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
    $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
    return $game_system.w_rcp_sw[id]
  end
  def w_recipe_all_switch_on
    for i in 1..$data_weapons.size
      w_recipe_switch_on(i)
    end
  end
  def w_recipe_all_switch_off
    for i in 1..$data_weapons.size
      w_recipe_switch_off(i)
    end
  end
  def a_recipe_switch_on(id)
    $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
    $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
    $game_system.a_rcp_sw[id] = true
  end
  def a_recipe_switch_off(id)
    $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
    $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
    $game_system.a_rcp_sw[id] = false
  end
  def a_recipe_switch_on?(id)
    $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
    $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
    return $game_system.a_rcp_sw[id]
  end
  def a_recipe_all_switch_on
    for i in 1..$data_armors.size
      a_recipe_switch_on(i)
    end
  end
  def a_recipe_all_switch_off
    for i in 1..$data_armors.size
      a_recipe_switch_off(i)
    end
  end
  def recipe_all_switch_on
    i_recipe_all_switch_on
    w_recipe_all_switch_on
    a_recipe_all_switch_on
  end
  def recipe_all_switch_off
    i_recipe_all_switch_off
    w_recipe_all_switch_off
    a_recipe_all_switch_off
  end
end
class Game_Interpreter
  include WD_itemsynthesis
end
class Game_System
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :i_rcp_sw
  attr_accessor :w_rcp_sw
  attr_accessor :a_rcp_sw
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias wd_orig_initialize004 initialize
  def initialize
    wd_orig_initialize004
    @i_rcp_sw = []
    @w_rcp_sw = []
    @a_rcp_sw = []
  end
end
#==============================================================================
# ■ Scene_ItemSynthesis
#------------------------------------------------------------------------------
#  合成画面の処理を行うクラスです。
#==============================================================================
class Scene_ItemSynthesis < Scene_MenuBase
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_dummy_window
    create_number_window
    create_status_window
    create_material_window
    create_list_window
    create_category_window
    create_gold_window
    create_change_window
  end
  #--------------------------------------------------------------------------
  # ● ゴールドウィンドウの作成
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.viewport = @viewport
    @gold_window.x = Graphics.width - @gold_window.width
    @gold_window.y = @help_window.height
    @gold_window.hide
  end
  #--------------------------------------------------------------------------
  # ● 切り替え表示ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_change_window
    wx = 0
    wy = @gold_window.y
    ww = Graphics.width - @gold_window.width
    wh = @gold_window.height
    @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
    @change_window.viewport = @viewport
    @change_window.hide
  end
  #--------------------------------------------------------------------------
  # ● ダミーウィンドウの作成
  #--------------------------------------------------------------------------
  def create_dummy_window
    wy = @help_window.y + @help_window.height + 48
    wh = Graphics.height - wy
    @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
    @dummy_window.viewport = @viewport
  end
  #--------------------------------------------------------------------------
  # ● 個数入力ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_number_window
    wy = @dummy_window.y
    wh = @dummy_window.height
    @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
    @number_window.viewport = @viewport
    @number_window.hide
    @number_window.set_handler(:ok,     method(:on_number_ok))
    @number_window.set_handler(:cancel, method(:on_number_cancel))
  end
  #--------------------------------------------------------------------------
  # ● ステータスウィンドウの作成
  #--------------------------------------------------------------------------
  def create_status_window
    wx = @number_window.width
    wy = @dummy_window.y
    ww = Graphics.width - wx
    wh = @dummy_window.height
    @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
    @status_window.viewport = @viewport
    @status_window.hide
  end
  #--------------------------------------------------------------------------
  # ● 素材ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_material_window
    wx = @number_window.width
    wy = @dummy_window.y
    ww = Graphics.width - wx
    wh = @dummy_window.height
    @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
    @material_window.viewport = @viewport
    @material_window.hide
    @number_window.material_window = @material_window
  end
  #--------------------------------------------------------------------------
  # ● 合成アイテムリストウィンドウの作成
  #--------------------------------------------------------------------------
  def create_list_window
    wy = @dummy_window.y
    wh = @dummy_window.height
    @list_window = Window_ItemSynthesisList.new(0, wy, wh)
    @list_window.viewport = @viewport
    @list_window.help_window = @help_window
    @list_window.status_window = @status_window
    @list_window.material_window = @material_window
    @list_window.hide
    @list_window.set_handler(:ok,     method(:on_list_ok))
    @list_window.set_handler(:cancel, method(:on_list_cancel))
    @list_window.set_handler(:change_window, method(:on_change_window))    
  end
  #--------------------------------------------------------------------------
  # ● カテゴリウィンドウの作成
  #--------------------------------------------------------------------------
  def create_category_window
    @category_window = Window_ItemSynthesisCategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = @help_window.height
    @category_window.activate
    @category_window.item_window = @list_window
    @category_window.set_handler(:ok,     method(:on_category_ok))
    @category_window.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # ● 合成アイテムリストウィンドウのアクティブ化
  #--------------------------------------------------------------------------
  def activate_list_window
    @list_window.money = money
    @list_window.show.activate
  end
  #--------------------------------------------------------------------------
  # ● 合成[決定]
  #--------------------------------------------------------------------------
  def on_list_ok
    @item = @list_window.item
    @list_window.hide
    @number_window.set(@item, max_buy, buying_price, currency_unit)
    @number_window.show.activate
  end
  #--------------------------------------------------------------------------
  # ● 合成[キャンセル]
  #--------------------------------------------------------------------------
  def on_list_cancel
    @category_window.activate
    @category_window.show
    @dummy_window.show
    @list_window.hide
    @status_window.hide
    @status_window.item = nil
    @material_window.hide
    @material_window.set(nil, nil)
    @gold_window.hide
    @change_window.hide
    @help_window.clear
  end
  #--------------------------------------------------------------------------
  # ● 表示切替
  #--------------------------------------------------------------------------
  def on_change_window
    if @status_window.visible
      @status_window.hide
      @material_window.show
    else
      @status_window.show
      @material_window.hide
    end
  end
  #--------------------------------------------------------------------------
  # ● カテゴリ[決定]
  #--------------------------------------------------------------------------
  def on_category_ok
    activate_list_window
    @gold_window.show
    @change_window.show
    @material_window.show
    @category_window.hide
    @list_window.select(0)
  end
  #--------------------------------------------------------------------------
  # ● 個数入力[決定]
  #--------------------------------------------------------------------------
  def on_number_ok
    Sound.play_shop
    do_syntetic(@number_window.number)
    end_number_input
    @gold_window.refresh
  end
  #--------------------------------------------------------------------------
  # ● 個数入力[キャンセル]
  #--------------------------------------------------------------------------
  def on_number_cancel
    Sound.play_cancel
    end_number_input
  end
  #--------------------------------------------------------------------------
  # ● 合成の実行
  #--------------------------------------------------------------------------
  def do_syntetic(number)
    $game_party.lose_gold(number * buying_price)
    $game_party.gain_item(@item, number)
    
      @recipe = @list_window.recipe(@item)
      for i in [email protected]
        kind = @recipe[i][0]
        id   = @recipe[i][1]
        num  = @recipe[i][2]
        if kind == "I"
          item = $data_items[id]
        elsif kind == "W"
          item = $data_weapons[id]
        elsif kind == "A"
          item = $data_armors[id]
        end
        $game_party.lose_item(item, num*number)
      end
  end
  #--------------------------------------------------------------------------
  # ● 個数入力の終了
  #--------------------------------------------------------------------------
  def end_number_input
    @number_window.hide
    activate_list_window
  end
  #--------------------------------------------------------------------------
  # ● 最大購入可能個数の取得
  #--------------------------------------------------------------------------
  def max_buy
    max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
    
    @recipe = @list_window.recipe(@item)
      for i in [email protected]
        kind = @recipe[i][0]
        id   = @recipe[i][1]
        num  = @recipe[i][2]
        if kind == "I"
          item = $data_items[id]
        elsif kind == "W"
          item = $data_weapons[id]
        elsif kind == "A"
          item = $data_armors[id]
        end
        if num > 0
          max_buf = $game_party.item_number(item)/num
        else
          max_buf = 999
        end
        max = [max, max_buf].min
      end
      
    buying_price == 0 ? max : [max, money / buying_price].min
  end
  #--------------------------------------------------------------------------
  # ● 所持金の取得
  #--------------------------------------------------------------------------
  def money
    @gold_window.value
  end
  #--------------------------------------------------------------------------
  # ● 通貨単位の取得
  #--------------------------------------------------------------------------
  def currency_unit
    @gold_window.currency_unit
  end
  #--------------------------------------------------------------------------
  # ● 合成費用の取得
  #--------------------------------------------------------------------------
  def buying_price
    @list_window.price(@item)
  end
end
#==============================================================================
# ■ Window_ItemSynthesisList
#------------------------------------------------------------------------------
#  合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisList < Window_Selectable
  include WD_itemsynthesis
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :status_window            # ステータスウィンドウ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y, height)
    super(x, y, window_width, height)
    
    @shop_goods = []
    @shop_recipes = []
    
    for i in 1..WD_itemsynthesis_ini::I_recipe.size
      recipe = WD_itemsynthesis_ini::I_recipe[i]
      if recipe
        good = [0, i, recipe[0]]
        if i_recipe_switch_on?(i)
          @shop_goods.push(good)
          @shop_recipes.push(recipe)
        end
      end
    end
    for i in 1..WD_itemsynthesis_ini::W_recipe.size
      recipe = WD_itemsynthesis_ini::W_recipe[i]
      if recipe
        good = [1, i, recipe[0]]
        if w_recipe_switch_on?(i)
          @shop_goods.push(good)
          @shop_recipes.push(recipe)
        end
      end
    end
    for i in 1..WD_itemsynthesis_ini::A_recipe.size
      recipe = WD_itemsynthesis_ini::A_recipe[i]
      if recipe
        good = [2, i, recipe[0]]
        if a_recipe_switch_on?(i)
          @shop_goods.push(good)
          @shop_recipes.push(recipe)
        end
      end
    end
    
    @money = 0
    refresh
    select(0)
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウ幅の取得
  #--------------------------------------------------------------------------
  def window_width
    return 304
  end
  #--------------------------------------------------------------------------
  # ● 項目数の取得
  #--------------------------------------------------------------------------
  def item_max
    @data ? @data.size : 1
  end
  #--------------------------------------------------------------------------
  # ● アイテムの取得
  #--------------------------------------------------------------------------
  def item
    @data[index]
  end
  #--------------------------------------------------------------------------
  # ● 所持金の設定
  #--------------------------------------------------------------------------
  def money=(money)
    @money = money
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 選択項目の有効状態を取得
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
  end
  #--------------------------------------------------------------------------
  # ● 合成費用を取得
  #--------------------------------------------------------------------------
  def price(item)
    @price[item]
  end
  #--------------------------------------------------------------------------
  # ● 合成可否を取得
  #--------------------------------------------------------------------------
  def enable?(item)
    @makable[item]
  end
  #--------------------------------------------------------------------------
  # ● レシピを取得
  #--------------------------------------------------------------------------
  def recipe(item)
    @recipe[item]
  end
  #--------------------------------------------------------------------------
  # ● アイテムを許可状態で表示するかどうか
  #--------------------------------------------------------------------------
  def have_mat?(recipe)
    flag = true
    if @money >= recipe[0]
      for i in 1...recipe.size
        kind = recipe[i][0]
        id   = recipe[i][1]
        num  = recipe[i][2]
        if kind == "I"
          item = $data_items[id]
        elsif kind == "W"
          item = $data_weapons[id]
        elsif kind == "A"
          item = $data_armors[id]
        end
        if $game_party.item_number(item) < [num, 1].max
          flag = false
        end
      end
    else
      flag = false
    end
    return flag
  end
  #--------------------------------------------------------------------------
  # ● カテゴリの設定
  #--------------------------------------------------------------------------
  def category=(category)
    return if @category == category
    @category = category
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
  #--------------------------------------------------------------------------
  # ● アイテムをリストに含めるかどうか
  #--------------------------------------------------------------------------
  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテムリストの作成
  #--------------------------------------------------------------------------
  def make_item_list
    @data = []
    @price = {}
    @makable = {}
    @recipe = {}
    for i in 0...@shop_goods.size
      goods = @shop_goods[i]
      recipe = @shop_recipes[i]
      case goods[0]
      when 0;  item = $data_items[goods[1]]
      when 1;  item = $data_weapons[goods[1]]
      when 2;  item = $data_armors[goods[1]]
      end
      if item
        if include?(item)
          @data.push(item)
          @price[item] = goods[2]
          @makable[item] = have_mat?(recipe)
          @recipe[item] = recipe
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item))
    rect.width -= 4
    draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  end
  #--------------------------------------------------------------------------
  # ● ステータスウィンドウの設定
  #--------------------------------------------------------------------------
  def status_window=(status_window)
    @status_window = status_window
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ● 素材ウィンドウの設定
  #--------------------------------------------------------------------------
  def material_window=(material_window)
    @material_window = material_window
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item) if @help_window
    @status_window.item = item if @status_window
    @material_window.set(item, recipe(item)) if @material_window
  end
  #--------------------------------------------------------------------------
  # ● ←→ ボタン(表示切替)が押されたときの処理
  #--------------------------------------------------------------------------
  def process_change_window
    Sound.play_cursor
    Input.update
    call_handler(:change_window)
  end
  #--------------------------------------------------------------------------
  # ● 決定やキャンセルなどのハンドリング処理
  #--------------------------------------------------------------------------
  def process_handling
    super
    if active
      return process_change_window if handle?(:change_window) && Input.trigger?(:X)
      return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
    end
  end
end
#==============================================================================
# ■ Window_ItemSynthesisMaterial
#------------------------------------------------------------------------------
#  合成画面で、合成に必要な素材を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisMaterial < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_possession(4, 0)
    draw_material_info(0, line_height * 2)
  end
  #--------------------------------------------------------------------------
  # ● アイテムの設定
  #--------------------------------------------------------------------------
  def set(item, recipe)
    @item = item
    @recipe = recipe
    @make_number = 1
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 作成個数の設定
  #--------------------------------------------------------------------------
  def set_num(make_number)
    @make_number = make_number
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 所持数の描画
  #--------------------------------------------------------------------------
  def draw_possession(x, y)
    rect = Rect.new(x, y, contents.width - 4 - x, line_height)
    change_color(system_color)
    draw_text(rect, Vocab::Possession)
    change_color(normal_color)
    draw_text(rect, $game_party.item_number(@item), 2)
  end
  #--------------------------------------------------------------------------
  # ● 素材情報の描画
  #--------------------------------------------------------------------------
  def draw_material_info(x, y)
    rect = Rect.new(x, y, contents.width, line_height)
    change_color(system_color)
    contents.font.size = 18
    draw_text(rect, "必要素材", 0)
    if @recipe
      for i in [email protected]
        kind = @recipe[i][0]
        id   = @recipe[i][1]
        num  = @recipe[i][2]
        if kind == "I"
          item = $data_items[id]
        elsif kind == "W"
          item = $data_weapons[id]
        elsif kind == "A"
          item = $data_armors[id]
        end
        rect = Rect.new(x, y + line_height*i, contents.width, line_height)
        enabled = true
        enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
        draw_item_name(item, rect.x, rect.y, enabled)
        change_color(normal_color, enabled)
        if num > 0
          draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
        end
      end
    end
    change_color(normal_color)
    contents.font.size = 24
  end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
#  合成画面で、合成するアイテムの個数を入力するウィンドウです。
#==============================================================================
class Window_ItemSynthesisNumber < Window_ShopNumber
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_item_name(@item, 0, item_y)
    draw_number
    draw_total_price if WD_itemsynthesis_ini::Cost_view
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def material_window=(material_window)
    @material_window = material_window
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ● 作成個数の変更
  #--------------------------------------------------------------------------
  def change_number(amount)
    @number = [[@number + amount, @max].min, 1].max
    call_update_help #追加
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def call_update_help
    @material_window.set_num(@number) if @material_window
  end
end
#==============================================================================
# ■ Window_ItemSynthesisCategory
#------------------------------------------------------------------------------
#  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
#==============================================================================
class Window_ItemSynthesisCategory < Window_ItemCategory
  #--------------------------------------------------------------------------
  # ● 桁数の取得
  #--------------------------------------------------------------------------
  def col_max
    i = 0
    i += 1 if WD_itemsynthesis_ini::Category_i
    i += 1 if WD_itemsynthesis_ini::Category_w
    i += 1 if WD_itemsynthesis_ini::Category_a
    i += 1 if WD_itemsynthesis_ini::Category_k
    return i
  end
  #--------------------------------------------------------------------------
  # ● コマンドリストの作成
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
    add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
    add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
    add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
#  合成画面で、切替を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisChange < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    text = "X Y:表示切り替え"
    draw_text(0, 0, contents_width, line_height, text, 1)
  end
end
 分割线-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 2物品图鉴
 
 
 物品图鉴
 
 
 
 
 物品图鉴本体
 
 
 复制代码#==============================================================================
# ■ RGSS3 アイテム図鑑 ver 1.00 本体プログラム
#------------------------------------------------------------------------------
#  配布元:
# 白の魔 http://izumiwhite.web.fc2.com/
#
#  利用規約:
# RPGツクールVXの正規の登録者のみご利用になれます。
# 利用報告・著作権表示とかは必要ありません。
# 改造もご自由にどうぞ。
# 何か問題が発生しても責任は持ちません。
#==============================================================================
#==============================================================================
# ■ WD_itemdictionary
#------------------------------------------------------------------------------
#  アイテム図鑑用の共通メソッドです。
#==============================================================================
module WD_itemdictionary
def i_dictionary_switch_on(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
$game_system.i_dic_sw[id] = true
end
def i_dictionary_switch_off(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
$game_system.i_dic_sw[id] = false
end
def i_dictionary_switch_on?(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
return $game_system.i_dic_sw[id]
end
def w_dictionary_switch_on(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
$game_system.w_dic_sw[id] = true
end
def w_dictionary_switch_off(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
$game_system.w_dic_sw[id] = false
end
def w_dictionary_switch_on?(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
return $game_system.w_dic_sw[id]
end
def a_dictionary_switch_on(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
$game_system.a_dic_sw[id] = true
end
def a_dictionary_switch_off(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
$game_system.a_dic_sw[id] = false
end
def a_dictionary_switch_on?(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
return $game_system.a_dic_sw[id]
end
def t_dictionary_switch_on(item)
if item.is_a?(RPG::Item)
i_dictionary_switch_on(item.id)
end
if item.is_a?(RPG::Weapon)
w_dictionary_switch_on(item.id)
end
if item.is_a?(RPG::Armor)
a_dictionary_switch_on(item.id)
end
end
def t_dictionary_switch_on?(item)
if item.is_a?(RPG::Item)
return i_dictionary_switch_on?(item.id)
end
if item.is_a?(RPG::Weapon)
return w_dictionary_switch_on?(item.id)
end
if item.is_a?(RPG::Armor)
return a_dictionary_switch_on?(item.id)
end
end
def print_dictionary?(item)
if item != nil
if item.name.size > 0
hantei = /<图鉴无效>/ =~ item.note
if hantei == nil
return true
end
end
end
return false
end
def item_dictionary_perfection
dic_max = 0
dic_num = 0
$data_items.each do |item|
if print_dictionary?(item)
dic_max += 1
if i_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
$data_weapons.each do |item|
if print_dictionary?(item)
dic_max += 1
if w_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
$data_armors.each do |item|
if print_dictionary?(item)
dic_max += 1
if a_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
return (100*dic_num)/dic_max
end
end
class Game_Interpreter
include WD_itemdictionary
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :i_dic_sw
attr_accessor :w_dic_sw
attr_accessor :a_dic_sw
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias wd_orig_initialize001 initialize
def initialize
wd_orig_initialize001
@i_dic_sw = []
@w_dic_sw = []
@a_dic_sw = []
end
end
class Game_Party < Game_Unit
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● アイテムの増加(減少)
# include_equip : 装備品も含める
#--------------------------------------------------------------------------
alias wd_orig_gain_item001 gain_item
def gain_item(item, amount, include_equip = false) 
wd_orig_gain_item001(item, amount, include_equip = false)
if amount > 0
t_dictionary_switch_on(item)
end
end
end
#==============================================================================
# ■ Scene_ItemDictionary
#------------------------------------------------------------------------------
#  アイテム図鑑画面の処理を行うクラスです。
#==============================================================================
class Scene_ItemDictionary < Scene_ItemBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_help_window
create_category_window
create_status_window
create_item_window
create_perfection_window
end
#--------------------------------------------------------------------------
# ● カテゴリウィンドウの作成
#--------------------------------------------------------------------------
def create_category_window
@category_window = Window_ItemCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @help_window.height
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_scene))
end
def return_scene
$game_map.autoplay
SceneManager.return
end
#--------------------------------------------------------------------------
# ● アイテムウィンドウの作成
#--------------------------------------------------------------------------
def create_item_window
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy - 48
@item_window = Window_ItemDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.set_handler(:cancel, method(:on_item_cancel))
@category_window.item_window = @item_window
end
#--------------------------------------------------------------------------
# ● アイテムステータスウィンドウの作成
#--------------------------------------------------------------------------
def create_status_window
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy
@status_window = Window_ItemDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
@status_window.viewport = @viewport
@status_window.set_item(nil)
end
#--------------------------------------------------------------------------
# ● 図鑑完成度ウィンドウの作成
#--------------------------------------------------------------------------
def create_perfection_window
wy = @item_window.y + @item_window.height
wh = 48
@perfection_window = Window_ItemDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
@perfection_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# ● カテゴリ[決定]
#--------------------------------------------------------------------------
def on_category_ok
@item_window.activate
@item_window.select_last
end
#--------------------------------------------------------------------------
# ● アイテム[キャンセル]
#--------------------------------------------------------------------------
def on_item_cancel
@item_window.unselect
@category_window.activate
@status_window.set_item(nil)
end
end
#==============================================================================
# ■ Window_ItemDictionaryList
#------------------------------------------------------------------------------
#  アイテム図鑑画面で、アイテムの一覧を表示するウィンドウです。
#==============================================================================
class Window_ItemDictionaryList < Window_Selectable
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@category = :none
@data = []
end
#--------------------------------------------------------------------------
# ● カテゴリの設定
#--------------------------------------------------------------------------
def category=(category)
return if @category == category
@category = category
refresh
self.oy = 0
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
@data && index >= 0 ? @data[index] : nil
end
#--------------------------------------------------------------------------
# ● 選択項目の有効状態を取得
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(@data[index])
end
#--------------------------------------------------------------------------
# ● アイテムをリストに含めるかどうか
#--------------------------------------------------------------------------
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && !item.key_item?
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)
when :key_item
item.is_a?(RPG::Item) && item.key_item?
else
false
end
end
#--------------------------------------------------------------------------
# ● アイテムリストの作成
#--------------------------------------------------------------------------
def make_item_list
@data = []
$data_items.each do |item|
if print_dictionary?(item)
@data.push(item) if include?(item)
end
end
$data_weapons.each do |item|
if print_dictionary?(item)
@data.push(item) if include?(item)
end
end
$data_armors.each do |item|
if print_dictionary?(item)
@data.push(item) if include?(item)
end
end
@data.push(nil) if include?(nil)
end
#--------------------------------------------------------------------------
# ● 前回の選択位置を復帰
#--------------------------------------------------------------------------
def select_last
select(0)
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if item
rect = item_rect(index)
rect.width -= 4
if t_dictionary_switch_on?(item)
change_color(normal_color, true)
draw_item_name(item, rect.x, rect.y, true)
else
change_color(normal_color, false)
draw_text(rect.x + 24, rect.y, 172, line_height, "???????")
end
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
if t_dictionary_switch_on?(item)
@help_window.set_item(item)
@status_window.set_item(item, @index, true)
else
@help_window.set_text("???????")
@status_window.set_item(item, @index, false)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの設定
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
end
end
#==============================================================================
# ■ Window_ItemDictionaryPerfection
#------------------------------------------------------------------------------
#  アイテム図鑑画面で、図鑑の完成度を表示するウィンドウです。
#==============================================================================
class Window_ItemDictionaryPerfection < Window_Selectable
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
refresh(width)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(width)
contents.clear
draw_text(0, 0, width-24, line_height, "图鉴完成度: #{item_dictionary_perfection} %", 1)
end
end
#==============================================================================
# ■ Window_ItemDictionaryStatus
#------------------------------------------------------------------------------
#  アイテム図鑑画面で、アイテムの詳細を表示するウィンドウです。
#==============================================================================
class Window_ItemDictionaryStatus < Window_Selectable
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def set_item(item, index=-1, print=false)
return if ((@item == item) and (@index == index))
@item = item
@index = index
@print = print
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
contents.font.size = 24
if @print
if @item.is_a?(RPG::Item)
if WD_itemdictionary_layout::I_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::I_id_display_x
y = WD_itemdictionary_layout::I_id_display_y
width = WD_itemdictionary_layout::I_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::I_name_display
x = WD_itemdictionary_layout::I_name_display_x
y = WD_itemdictionary_layout::I_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::I_price_display
text1 = WD_itemdictionary_layout::I_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::I_price_display_x
y = WD_itemdictionary_layout::I_price_display_y
width = WD_itemdictionary_layout::I_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::I_occasion_display
text1 = WD_itemdictionary_layout::I_occasion_display_text1
text2 = WD_itemdictionary_layout::I_occasion_display_text2
text3 = WD_itemdictionary_layout::I_occasion_display_text3
text4 = WD_itemdictionary_layout::I_occasion_display_text4
text5 = WD_itemdictionary_layout::I_occasion_display_text5
x = WD_itemdictionary_layout::I_occasion_display_x
y = WD_itemdictionary_layout::I_occasion_display_y
width = WD_itemdictionary_layout::I_occasion_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
case @item.occasion
when 0
draw_text(x, y, width, font_size, text2, 2)
when 1
draw_text(x, y, width, font_size, text3, 2)
when 2
draw_text(x, y, width, font_size, text4, 2)
when 3
draw_text(x, y, width, font_size, text5, 2)
end
end
if WD_itemdictionary_layout::I_consumable_display
text1 = WD_itemdictionary_layout::I_consumable_display_text1
text2 = WD_itemdictionary_layout::I_consumable_display_text2
text3 = WD_itemdictionary_layout::I_consumable_display_text3
x = WD_itemdictionary_layout::I_consumable_display_x
y = WD_itemdictionary_layout::I_consumable_display_y
width = WD_itemdictionary_layout::I_consumable_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
if @item.consumable
draw_text(x, y, width, font_size, text2, 2)
else
draw_text(x, y, width, font_size, text3, 2)
end
end 
if WD_itemdictionary_layout::I_option_display
text1 = WD_itemdictionary_layout::I_option_display_text1
text2 = WD_itemdictionary_layout::I_option_display_text2
x = WD_itemdictionary_layout::I_option_display_x
y = WD_itemdictionary_layout::I_option_display_y
width = WD_itemdictionary_layout::I_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
elsif @item.is_a?(RPG::Weapon)
if WD_itemdictionary_layout::W_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::W_id_display_x
y = WD_itemdictionary_layout::W_id_display_y
width = WD_itemdictionary_layout::W_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::W_name_display
x = WD_itemdictionary_layout::W_name_display_x
y = WD_itemdictionary_layout::W_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::W_type_display
text1 = WD_itemdictionary_layout::W_type_display_text1
text2 = $data_system.weapon_types[@item.wtype_id]
x = WD_itemdictionary_layout::W_type_display_x
y = WD_itemdictionary_layout::W_type_display_y
width = WD_itemdictionary_layout::W_type_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_price_display
text1 = WD_itemdictionary_layout::W_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::W_price_display_x
y = WD_itemdictionary_layout::W_price_display_y
width = WD_itemdictionary_layout::W_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::W_atk_display
text1 = Vocab::param(2)
text2 = @item.params[2]
x = WD_itemdictionary_layout::W_atk_display_x
y = WD_itemdictionary_layout::W_atk_display_y
width = WD_itemdictionary_layout::W_atk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_def_display
text1 = Vocab::param(3)
text2 = @item.params[3]
x = WD_itemdictionary_layout::W_def_display_x
y = WD_itemdictionary_layout::W_def_display_y
width = WD_itemdictionary_layout::W_def_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mat_display
text1 = Vocab::param(4)
text2 = @item.params[4]
x = WD_itemdictionary_layout::W_mat_display_x
y = WD_itemdictionary_layout::W_mat_display_y
width = WD_itemdictionary_layout::W_mat_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mdf_display
text1 = Vocab::param(5)
text2 = @item.params[5]
x = WD_itemdictionary_layout::W_mdf_display_x
y = WD_itemdictionary_layout::W_mdf_display_y
width = WD_itemdictionary_layout::W_mdf_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_agi_display
text1 = Vocab::param(6)
text2 = @item.params[6]
x = WD_itemdictionary_layout::W_agi_display_x
y = WD_itemdictionary_layout::W_agi_display_y
width = WD_itemdictionary_layout::W_agi_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_luk_display
text1 = Vocab::param(7)
text2 = @item.params[7]
x = WD_itemdictionary_layout::W_luk_display_x
y = WD_itemdictionary_layout::W_luk_display_y
width = WD_itemdictionary_layout::W_luk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mhp_display
text1 = Vocab::param(0)
text2 = @item.params[0]
x = WD_itemdictionary_layout::W_mhp_display_x
y = WD_itemdictionary_layout::W_mhp_display_y
width = WD_itemdictionary_layout::W_mhp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mmp_display
text1 = Vocab::param(1)
text2 = @item.params[1]
x = WD_itemdictionary_layout::W_mmp_display_x
y = WD_itemdictionary_layout::W_mmp_display_y
width = WD_itemdictionary_layout::W_mmp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_option_display
text1 = WD_itemdictionary_layout::W_option_display_text1
text2 = WD_itemdictionary_layout::W_option_display_text2
x = WD_itemdictionary_layout::W_option_display_x
y = WD_itemdictionary_layout::W_option_display_y
width = WD_itemdictionary_layout::W_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
elsif @item.is_a?(RPG::Armor)
if WD_itemdictionary_layout::A_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::A_id_display_x
y = WD_itemdictionary_layout::A_id_display_y
width = WD_itemdictionary_layout::A_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::A_name_display
x = WD_itemdictionary_layout::A_name_display_x
y = WD_itemdictionary_layout::A_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::A_type_display
text1 = WD_itemdictionary_layout::A_type_display_text1
text2 = $data_system.armor_types[@item.atype_id]
x = WD_itemdictionary_layout::A_type_display_x
y = WD_itemdictionary_layout::A_type_display_y
width = WD_itemdictionary_layout::A_type_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_price_display
text1 = WD_itemdictionary_layout::A_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::A_price_display_x
y = WD_itemdictionary_layout::A_price_display_y
width = WD_itemdictionary_layout::A_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::A_atk_display
text1 = Vocab::param(2)
text2 = @item.params[2]
x = WD_itemdictionary_layout::A_atk_display_x
y = WD_itemdictionary_layout::A_atk_display_y
width = WD_itemdictionary_layout::A_atk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_def_display
text1 = Vocab::param(3)
text2 = @item.params[3]
x = WD_itemdictionary_layout::A_def_display_x
y = WD_itemdictionary_layout::A_def_display_y
width = WD_itemdictionary_layout::A_def_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mat_display
text1 = Vocab::param(4)
text2 = @item.params[4]
x = WD_itemdictionary_layout::A_mat_display_x
y = WD_itemdictionary_layout::A_mat_display_y
width = WD_itemdictionary_layout::A_mat_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mdf_display
text1 = Vocab::param(5)
text2 = @item.params[5]
x = WD_itemdictionary_layout::A_mdf_display_x
y = WD_itemdictionary_layout::A_mdf_display_y
width = WD_itemdictionary_layout::A_mdf_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_agi_display
text1 = Vocab::param(6)
text2 = @item.params[6]
x = WD_itemdictionary_layout::A_agi_display_x
y = WD_itemdictionary_layout::A_agi_display_y
width = WD_itemdictionary_layout::A_agi_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_luk_display
text1 = Vocab::param(7)
text2 = @item.params[7]
x = WD_itemdictionary_layout::A_luk_display_x
y = WD_itemdictionary_layout::A_luk_display_y
width = WD_itemdictionary_layout::A_luk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mhp_display
text1 = Vocab::param(0)
text2 = @item.params[0]
x = WD_itemdictionary_layout::A_mhp_display_x
y = WD_itemdictionary_layout::A_mhp_display_y
width = WD_itemdictionary_layout::A_mhp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mmp_display
text1 = Vocab::param(1)
text2 = @item.params[1]
x = WD_itemdictionary_layout::A_mmp_display_x
y = WD_itemdictionary_layout::A_mmp_display_y
width = WD_itemdictionary_layout::A_mmp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_option_display
text1 = WD_itemdictionary_layout::A_option_display_text1
text2 = WD_itemdictionary_layout::A_option_display_text2
x = WD_itemdictionary_layout::A_option_display_x
y = WD_itemdictionary_layout::A_option_display_y
width = WD_itemdictionary_layout::A_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
end
elsif @item != nil
if @item.is_a?(RPG::Item)
if WD_itemdictionary_layout::I_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::I_id_display_x
y = WD_itemdictionary_layout::I_id_display_y
width = WD_itemdictionary_layout::I_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::I_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::I_name_display_x
y = WD_itemdictionary_layout::I_name_display_y
width = WD_itemdictionary_layout::I_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
if @item.is_a?(RPG::Weapon)
if WD_itemdictionary_layout::W_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::W_id_display_x
y = WD_itemdictionary_layout::W_id_display_y
width = WD_itemdictionary_layout::W_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::W_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::W_name_display_x
y = WD_itemdictionary_layout::W_name_display_y
width = WD_itemdictionary_layout::W_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
if @item.is_a?(RPG::Armor)
if WD_itemdictionary_layout::A_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::A_id_display_x
y = WD_itemdictionary_layout::A_id_display_y
width = WD_itemdictionary_layout::A_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::A_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::A_name_display_x
y = WD_itemdictionary_layout::A_name_display_y
width = WD_itemdictionary_layout::A_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
end
end
end
 分割线-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 怪物图鉴
 
 
 
 怪物图鉴本体
 
 
 
 复制代码#==============================================================================
# ■ RGSS3 魔物図鑑 ver 1.00 本体プログラム
#------------------------------------------------------------------------------
#  配布元:
# 白の魔 http://izumiwhite.web.fc2.com/
#
#  利用規約:
# RPGツクールVXの正規の登録者のみご利用になれます。
# 利用報告・著作権表示とかは必要ありません。
# 改造もご自由にどうぞ。
# 何か問題が発生しても責任は持ちません。
#==============================================================================
#==============================================================================
# ■ WD_monsterdictionary
#------------------------------------------------------------------------------
#  魔物図鑑用の共通メソッドです。
#==============================================================================
module WD_monsterdictionary
def m_dictionary_encount_switch_on(id)
$game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
$game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
$game_system.m_dic_encount_sw[id] = true
end
def m_dictionary_encount_switch_off(id)
$game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
$game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
$game_system.m_dic_encount_sw[id] = false
end
def m_dictionary_encount_switch_on?(id)
$game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
$game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
return $game_system.m_dic_encount_sw[id]
end
def m_dictionary_victory_switch_on(id)
$game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
$game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
$game_system.m_dic_victory_sw[id] = true
end
def m_dictionary_victory_switch_off(id)
$game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
$game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
$game_system.m_dic_victory_sw[id] = false
end
def m_dictionary_victory_switch_on?(id)
$game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
$game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
return $game_system.m_dic_victory_sw[id]
end
def m_dictionary_drop_switch_on(id, n)
$game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
$game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
$game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
$game_system.m_dic_drop_sw[id][n] = true
end
def m_dictionary_drop_switch_off(id, n)
$game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
$game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
$game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
$game_system.m_dic_drop_sw[id][n] = false
end
def m_dictionary_drop_switch_on?(id, n)
$game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
$game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
$game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
return $game_system.m_dic_drop_sw[id][n]
end
def m_dictionary_genoside_number_add(id, n)
$game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
$game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
$game_system.m_dic_genoside_num[id] += n
end
def m_dictionary_genoside_number(id)
$game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
$game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
return $game_system.m_dic_genoside_num[id]
end
def print_dictionary?(enemy)
if enemy != nil
if enemy.name.size > 0
hantei = /<图鉴无效>/ =~ enemy.note
if hantei == nil
return true
end
end
end
return false
end
def monster_dictionary_perfection
dic_max = 0
dic_num = 0
$data_enemies.each do |enemy|
if print_dictionary?(enemy)
dic_max += 1
if WD_monsterdictionary_layout::Perfection_timing == 1
if m_dictionary_encount_switch_on?(enemy.id) == true
dic_num += 1
end
elsif WD_monsterdictionary_layout::Perfection_timing == 2
if m_dictionary_victory_switch_on?(enemy.id) == true
dic_num += 1
end
end
end
end
return (100*dic_num)/dic_max
end
end
class Game_Interpreter
include WD_monsterdictionary
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :m_dic_encount_sw
attr_accessor :m_dic_victory_sw
attr_accessor :m_dic_drop_sw
attr_accessor :m_dic_genoside_num
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias wd_orig_initialize002 initialize
def initialize
wd_orig_initialize002
@m_dic_encount_sw = []
@m_dic_victory_sw = []
@m_dic_drop_sw = []
@m_dic_genoside_num = []
end
end
class Game_Troop < Game_Unit
include WD_monsterdictionary
#--------------------------------------------------------------------------
# ● 図鑑への登録(遭遇済み判定)
#--------------------------------------------------------------------------
def dictionary1
for enemy in members
m_dictionary_encount_switch_on(enemy.enemy_id) unless enemy.hidden? #遭遇済み図鑑登録
end
end
#--------------------------------------------------------------------------
# ● 図鑑への登録(撃破済み判定)
#--------------------------------------------------------------------------
def dictionary2
for enemy in dead_members
m_dictionary_victory_switch_on(enemy.enemy_id) unless enemy.hidden? #撃破済み図鑑登録
m_dictionary_genoside_number_add(enemy.enemy_id, 1) unless enemy.hidden? #撃破数カウント
end
end
end
class << BattleManager
#--------------------------------------------------------------------------
# ● 戦闘開始
#--------------------------------------------------------------------------
alias wd_orig_battle_start002 battle_start
def battle_start
wd_orig_battle_start002
$game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
end
#--------------------------------------------------------------------------
# ● 勝利の処理
#--------------------------------------------------------------------------
alias wd_orig_process_victory002 process_victory
def process_victory
$game_troop.dictionary2 #図鑑への登録(撃破済み判定)
wd_orig_process_victory002
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 敵キャラの出現
#--------------------------------------------------------------------------
alias wd_orig_command_335_002 command_335
def command_335
wd_orig_command_335_002
$game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
end
end
class Game_Enemy < Game_Battler
include WD_monsterdictionary
#--------------------------------------------------------------------------
# ● ドロップアイテムの配列作成(再定義)
#--------------------------------------------------------------------------
def make_drop_items
n = -1
enemy.drop_items.inject([]) do |r, di|
n += 1
if di.kind > 0 && rand * di.denominator < drop_item_rate
m_dictionary_drop_switch_on(@enemy_id, n)
r.push(item_object(di.kind, di.data_id))
else
r
end
end
end
end
#==============================================================================
# ■ Scene_MonsterDictionary
#------------------------------------------------------------------------------
#  魔物図鑑画面の処理を行うクラスです。
#==============================================================================
class Scene_MonsterDictionary < Scene_ItemBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_status_window
create_item_window
create_perfection_window
end
#--------------------------------------------------------------------------
# ● アイテムウィンドウの作成
#--------------------------------------------------------------------------
def create_item_window
wy = 0
wh = Graphics.height - 48
@item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
@item_window.viewport = @viewport
@item_window.status_window = @status_window
@item_window.set_handler(:cancel, method(:return_scene))
@item_window.update_help
end
def return_scene
$game_map.autoplay
SceneManager.return
end
#--------------------------------------------------------------------------
# ● アイテムステータスウィンドウの作成
#--------------------------------------------------------------------------
def create_status_window
wy = 0
wh = Graphics.height
@status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
@status_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# ● 図鑑完成度ウィンドウの作成
#--------------------------------------------------------------------------
def create_perfection_window
wy = @item_window.y + @item_window.height
wh = 48
@perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
@perfection_window.viewport = @viewport
end
end
#==============================================================================
# ■ Window_MonsterDictionaryList
#------------------------------------------------------------------------------
#  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。
#==============================================================================
class Window_MonsterDictionaryList < Window_Selectable
include WD_monsterdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@data = []
refresh
activate
select(0)
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def enemy
@data && index >= 0 ? @data[index] : nil
end
#--------------------------------------------------------------------------
# ● アイテムリストの作成
#--------------------------------------------------------------------------
def make_item_list
@data = []
$data_enemies.each do |enemy|
if print_dictionary?(enemy)
@data.push(enemy)
end
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
enemy = @data[index]
if enemy
rect = item_rect(index)
rect.width -= 4
if m_dictionary_encount_switch_on?(enemy.id)
change_color(normal_color, true)
draw_text(rect.x, rect.y, 172, line_height, enemy.name)
else
change_color(normal_color, false)
draw_text(rect.x, rect.y, 172, line_height, "???????")
end
end
end
#--------------------------------------------------------------------------
# ● ヘルプウィンドウ更新メソッドの呼び出し
#--------------------------------------------------------------------------
def call_update_help
update_help if active
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
if @status_window
if m_dictionary_encount_switch_on?(enemy.id)
@status_window.set_item(enemy, @index, true)
else
@status_window.set_item(enemy, @index, false)
end
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの設定
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
end
end
#==============================================================================
# ■ Window_MonsterDictionaryPerfection
#------------------------------------------------------------------------------
#  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。
#==============================================================================
class Window_MonsterDictionaryPerfection < Window_Selectable
include WD_monsterdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
refresh(width)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(width)
contents.clear
draw_text(0, 0, width-24, line_height, "图鉴完成度: #{monster_dictionary_perfection} %", 1)
end
end
#==============================================================================
# ■ Window_MonsterDictionaryStatus
#------------------------------------------------------------------------------
#  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。
#==============================================================================
class Window_MonsterDictionaryStatus < Window_Selectable
include WD_monsterdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@enemy = nil
refresh
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def set_item(enemy, index=-1, print=false)
return if ((@enemy == enemy) and (@index == index))
@enemy = enemy
@index = index
@print = print
refresh
end
#--------------------------------------------------------------------------
# ● アイテムオブジェクトの取得
#--------------------------------------------------------------------------
def item_object(kind, data_id)
return $data_items [data_id] if kind == 1
return $data_weapons[data_id] if kind == 2
return $data_armors [data_id] if kind == 3
return nil
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
contents.font.size = 24
if @print
if WD_monsterdictionary_layout::M_id_display
text1 = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
x = WD_monsterdictionary_layout::M_id_display_x
y = WD_monsterdictionary_layout::M_id_display_y
width = WD_monsterdictionary_layout::M_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_monsterdictionary_layout::M_name_display
text1 = @enemy.name
x = WD_monsterdictionary_layout::M_name_display_x
y = WD_monsterdictionary_layout::M_name_display_y
width = WD_monsterdictionary_layout::M_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_monsterdictionary_layout::M_pic_display
pic_name = @enemy.battler_name 
pic_hue = @enemy.battler_hue
x = WD_monsterdictionary_layout::M_pic_display_x
y = WD_monsterdictionary_layout::M_pic_display_y
opacity= WD_monsterdictionary_layout::M_pic_display_opacity
bitmap = Cache.battler(pic_name, pic_hue)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)
end
font_size = WD_monsterdictionary_layout::C_font_size
contents.font.size = font_size
if WD_monsterdictionary_layout::M_mhp_display
text1 = Vocab::param(0)
text2 = "?"
text2 = @enemy.params[0] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_mhp_display_x
y = WD_monsterdictionary_layout::M_mhp_display_y
width = WD_monsterdictionary_layout::M_mhp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_mmp_display
text1 = Vocab::param(1)
text2 = "?"
text2 = @enemy.params[1] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_mmp_display_x
y = WD_monsterdictionary_layout::M_mmp_display_y
width = WD_monsterdictionary_layout::M_mmp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_atk_display
text1 = Vocab::param(2)
text2 = "?"
text2 = @enemy.params[2] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_atk_display_x
y = WD_monsterdictionary_layout::M_atk_display_y
width = WD_monsterdictionary_layout::M_atk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_def_display
text1 = Vocab::param(3)
text2 = "?"
text2 = @enemy.params[3] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_def_display_x
y = WD_monsterdictionary_layout::M_def_display_y
width = WD_monsterdictionary_layout::M_def_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_mat_display
text1 = Vocab::param(4)
text2 = "?"
text2 = @enemy.params[4] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_mat_display_x
y = WD_monsterdictionary_layout::M_mat_display_y
width = WD_monsterdictionary_layout::M_mat_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_mdf_display
text1 = Vocab::param(5)
text2 = "?"
text2 = @enemy.params[5] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_mdf_display_x
y = WD_monsterdictionary_layout::M_mdf_display_y
width = WD_monsterdictionary_layout::M_mdf_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_agi_display
text1 = Vocab::param(6)
text2 = "?"
text2 = @enemy.params[6] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_agi_display_x
y = WD_monsterdictionary_layout::M_agi_display_y
width = WD_monsterdictionary_layout::M_agi_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_luk_display
text1 = Vocab::param(7)
text2 = "?"
text2 = @enemy.params[7] if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_luk_display_x
y = WD_monsterdictionary_layout::M_luk_display_y
width = WD_monsterdictionary_layout::M_luk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_feature_display
text1 = WD_monsterdictionary_layout::M_feature_display_text1
text2 = "?"
text2 = WD_monsterdictionary_layout::M_feature_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_feature_display_x
y = WD_monsterdictionary_layout::M_feature_display_y
width = WD_monsterdictionary_layout::M_feature_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
if m_dictionary_victory_switch_on?(@enemy.id)
@enemy.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
end
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
if WD_monsterdictionary_layout::M_exp_display
text1 = WD_monsterdictionary_layout::M_exp_display_text1
text2 = "?"
text2 = @enemy.exp if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_exp_display_x
y = WD_monsterdictionary_layout::M_exp_display_y
width = WD_monsterdictionary_layout::M_exp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_monsterdictionary_layout::M_gold_display
text1 = WD_monsterdictionary_layout::M_gold_display_text1
text2 = "?"
text2 = @enemy.gold if m_dictionary_victory_switch_on?(@enemy.id)
text3 = Vocab::currency_unit
x = WD_monsterdictionary_layout::M_gold_display_x
y = WD_monsterdictionary_layout::M_gold_display_y
width = WD_monsterdictionary_layout::M_gold_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_monsterdictionary_layout::M_drop_display
text1 = WD_monsterdictionary_layout::M_drop_display_text1
text2 = WD_monsterdictionary_layout::M_drop_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_drop_display_x
y = WD_monsterdictionary_layout::M_drop_display_y
width = WD_monsterdictionary_layout::M_drop_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@enemy.drop_items.each do |di|
if di.kind > 0
i += 1
item = item_object(di.kind, di.data_id)
n = i -1
if m_dictionary_drop_switch_on?(@enemy.id, n)
text2 = item.name
text3 = "1/#{di.denominator}"
else
text2 = "???????"
text3 = ""
end
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text2, 0)
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text3, 2)
end
end
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
if WD_monsterdictionary_layout::M_help_display
text1 = WD_monsterdictionary_layout::M_help_display_text1
text2 = "?"
text2 = WD_monsterdictionary_layout::M_help_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
x = WD_monsterdictionary_layout::M_help_display_x
y = WD_monsterdictionary_layout::M_help_display_y
width = WD_monsterdictionary_layout::M_help_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
if m_dictionary_victory_switch_on?(@enemy.id)
@enemy.note.scan(/<图鉴说明:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
end
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
if WD_monsterdictionary_layout::M_geno_display
text1 = WD_monsterdictionary_layout::M_geno_display_text1
text2 = "#{m_dictionary_genoside_number(@enemy.id)}"
x = WD_monsterdictionary_layout::M_geno_display_x
y = WD_monsterdictionary_layout::M_geno_display_y
width = WD_monsterdictionary_layout::M_geno_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
elsif @enemy != nil
if WD_monsterdictionary_layout::M_id_display
text1 = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
x = WD_monsterdictionary_layout::M_id_display_x
y = WD_monsterdictionary_layout::M_id_display_y
width = WD_monsterdictionary_layout::M_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_monsterdictionary_layout::M_name_display
text1 = "- No Data -"
x = WD_monsterdictionary_layout::M_name_display_x
y = WD_monsterdictionary_layout::M_name_display_y
width = WD_monsterdictionary_layout::M_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
end
end
 声音控制
 
 
 
 复制代码# encoding: utf-8
#===============================================================================
# ¡ Volume Control For RGSS3
#-------------------------------------------------------------------------------
#@2011/12/01@Ru/‚Þ‚Á‚­Ru
#-------------------------------------------------------------------------------
# English Translation By: Elemental Crisis (http://RPGMakerVXAce.com)
#-------------------------------------------------------------------------------
#@Adds the ability to change volume control. 
#
#@œ The following methods are added to the Audio Module
#@Audio.volBGM cc Maximum BGM volume setting.
#@Audio.volBGS cc Maximum BGS volume setting. 
#@Audio.volSE cc Maximum SE volume setting. 
#@Audio.volME cc Maximum ME volume setting. 
#@Audio.volBGM=”’l ccSet BGM maximum volume (0-100)
#@Audio.volBGM=”’l cc Set BGS maximum volume (0-100)
#@Audio.volSE=”’l cc Set SE maximum volume (0-100)
#@Audio.volME=”’l cc Set ME maximum volume (0-100)
#
#@œ Volume control is added to the main menu.
#
#-------------------------------------------------------------------------------
# yKnown Issuesz
#@Created before VXAce's official release so unable to properly test. 
#-------------------------------------------------------------------------------
#==============================================================================
# œ Settings
#==============================================================================
module HZM_VXA
module AudioVol
# Display Volume Control on Main Menu?
# @true cc Display.
# @false cc Don't Display.
MENU_FLAG = true
# Volume Control Name in Main Menu.
MENU_NAME = "声音控制" 
# Volume Control Settings Name.
CONFIG_BGM_NAME = "BGM"
CONFIG_BGS_NAME = "BGS"
CONFIG_SE_NAME = "SE"
CONFIG_ME_NAME = "ME"
CONFIG_EXIT_NAME = "退出"
# Volume Change Variation.
# ADD_VOL_NORMAL cc Variation of Left/Right Keys.
# ADD_VOL_HIGH cc Variation of LR Key. 
ADD_VOL_NORMAL = 5
ADD_VOL_HIGH = 25
end
end
#==============================================================================
# ª @ Settings Above @ ª
# « Script Below «
#==============================================================================
# Additonal Methods. 
module Audio
def self.volBGM=(vol)
vol=100 if vol>100
vol=0 if vol<0
@hzmVolBGM = vol
end
def self.volBGS=(vol)
vol=100 if vol>100
vol=0 if vol<0
@hzmVolBGS = vol
end
def self.volSE=(vol)
vol=100 if vol>100
vol=0 if vol<0
@hzmVolSE = vol
end
def self.volME=(vol)
vol=100 if vol>100
vol=0 if vol<0
@hzmVolME = vol
end
def self.volBGM
@hzmVolBGM = 100 if @hzmVolBGM == nil
return @hzmVolBGM
end
def self.volBGS
@hzmVolBGS = 100 if @hzmVolBGS == nil
return @hzmVolBGS
end
def self.volSE
@hzmVolSE = 100 if @hzmVolSE == nil
return @hzmVolSE
end
def self.volME
@hzmVolME = 100 if @hzmVolME == nil
return @hzmVolME
end
end
# Playback
class << Audio
alias hzm_Vol_Audio_bgm_play bgm_play
def bgm_play(filename, volume=100, pitch=100, pos=0)
volume = self.volBGM * volume / 100
hzm_Vol_Audio_bgm_play(filename, volume, pitch, pos)
end
alias hzm_Vol_Audio_bgs_play bgs_play
def bgs_play(filename, volume=100, pitch=100)
volume = self.volBGS * volume / 100
hzm_Vol_Audio_bgs_play(filename, volume, pitch)
end
alias hzm_Vol_Audio_se_play se_play
def se_play(filename, volume=100, pitch=100)
volume = self.volSE * volume / 100
hzm_Vol_Audio_se_play(filename, volume, pitch)
end
alias hzm_Vol_Audio_me_play me_play
def me_play(filename, volume=100, pitch=100)
volume = self.volME * volume / 100
hzm_Vol_Audio_me_play(filename, volume, pitch)
end
end
# Add To Menu.
if HZM_VXA::AudioVol::MENU_FLAG
class Window_MenuCommand
alias hzm_Vol_Window_MenuCommand_add_original_commands add_original_commands
def add_original_commands
hzm_Vol_Window_MenuCommand_add_original_commands
add_command(HZM_VXA::AudioVol::MENU_NAME, :hzm_vxa_vol)
end
end
class Scene_Menu
alias hzm_Vol_create_command_window create_command_window
def create_command_window
hzm_Vol_create_command_window
@command_window.set_handler(:hzm_vxa_vol, method(:hzm_vxa_vol))
end
def hzm_vxa_vol
SceneManager.call(HZM_VXA::AudioVol::Scene_VolConfig)
end
end
end
# Volume Chage Window
module HZM_VXA
module AudioVol
class Window_VolConfig < Window_Command
def initialize
super(0, 0)
self.x = (Graphics.width - self.window_width)/2
self.y = (Graphics.height - self.window_height)/2
end
def make_command_list
add_command(HZM_VXA::AudioVol::CONFIG_BGM_NAME, :bgm)
add_command(HZM_VXA::AudioVol::CONFIG_BGS_NAME, :bgs)
add_command(HZM_VXA::AudioVol::CONFIG_SE_NAME, :se)
add_command(HZM_VXA::AudioVol::CONFIG_ME_NAME, :me)
add_command(HZM_VXA::AudioVol::CONFIG_EXIT_NAME, :cancel)
end
def draw_item(index)
super
return unless index < 4
case index
when 0
vol = Audio.volBGM
when 1
vol = Audio.volBGS
when 2
vol = Audio.volSE
when 3
vol = Audio.volME
end
draw_text(item_rect_for_text(index), vol, 2)
end
def volAdd(index, val)
case index
when 0
Audio.volBGM += val
now = RPG::BGM.last 
Audio.bgm_play('Audio/BGM/' + now.name, now.volume, now.pitch, now.pos) if now
when 1
Audio.volBGS += val
when 2
Audio.volSE += val
when 3
Audio.volME += val
end
Sound.play_cursor
redraw_item(index)
end
def cursor_left(wrap = false)
volAdd(@index, -HZM_VXA::AudioVol::ADD_VOL_NORMAL)
end
def cursor_right(wrap = false)
volAdd(@index, HZM_VXA::AudioVol::ADD_VOL_NORMAL)
end
def cursor_pageup
volAdd(@index, -HZM_VXA::AudioVol::ADD_VOL_HIGH)
end
def cursor_pagedown
volAdd(@index, HZM_VXA::AudioVol::ADD_VOL_HIGH)
end
end
class Scene_VolConfig < Scene_MenuBase
def start
super
@command_window = Window_VolConfig.new
@command_window.viewport = @viewport
@command_window.set_handler(:cancel, method(:return_scene))
end
def terminate
super
@command_window.dispose
end
end
end
end
# Reading/Saving
class << DataManager
alias hzm_Vol_make_save_contents make_save_contents
def make_save_contents
contents = hzm_Vol_make_save_contents
contents[:hzm_vxa_vol] = {
:bgm => Audio.volBGM,
:bgs => Audio.volBGS,
:se => Audio.volSE,
:me => Audio.volME
}
contents
end
alias hzm_Vol_extract_save_contents extract_save_contents
def extract_save_contents(contents)
hzm_Vol_extract_save_contents(contents)
Audio.volBGM = contents[:hzm_vxa_vol][:bgm]
Audio.volBGS = contents[:hzm_vxa_vol][:bgs]
Audio.volSE = contents[:hzm_vxa_vol][:se]
Audio.volME = contents[:hzm_vxa_vol][:me]
end
end
 
 证件
 
 
 
 复制代码#==============================================================================
# ★ RGSS3_実績メダル Ver1.01
#==============================================================================
=begin
作者:tomoaky
webサイト:ひきも記 (http://hikimoki.sakura.ne.jp/)
すごい記録を達成したときにポコンッと出るあれです。
イベントコマンド『スクリプト』を使ってメダルを獲得することができます。
例)gain_medal(0) # 0番のメダルを獲得する
設定項目にて番号に対応するメダルの内容を設定してください。
2012.01.25 Ver1.01
メダル獲得表示中のシーン切り替えにより表示がリセットされないように修正
2012.01.16 Ver1.0
公開
=end
#==============================================================================
# □ 設定項目
#==============================================================================
module TMMEDAL
COMMAND_MEDAL = "证件" # メニューコマンド名
# メダルが1枚もない状態でメダルコマンドを隠すかどうか(true で隠す)
HIDE_COMMAND = false
# メダル獲得時の効果音
SE_GAIN_MEDAL = RPG::SE.new("Powerup", 90, 140)
# メダル名とアイコンIDと説明文の設定
MEDAL_DATA = {}
MEDAL_DATA[0] = ["ご主人様", 187, "メイドさんと会話をした証"]
MEDAL_DATA[1] = ["禁断の光魔法", 187, "光魔法オメガアツマーレを目撃した証"]
MEDAL_DATA[2] = ["サキュバスファン", 190, "サキュバスと会話をした証"]
end
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :medals # 獲得済みメダル
attr_reader :new_medals # 新規獲得メダル
attr_accessor :medal_info_count # メダル情報表示カウント
attr_accessor :medal_info_opacity # メダル情報表示不透明度
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias tmmedal_game_party_initialize initialize
def initialize
tmmedal_game_party_initialize
@medals = []
@new_medals = []
@medal_info_count = 0
@medal_info_opacity = 0
end
#--------------------------------------------------------------------------
# ○ メダルの獲得
#--------------------------------------------------------------------------
def gain_medal(medal_id)
return if @medals.any? {|medal| medal[0] == medal_id }
t = Time.now.strftime(" (%Y/%m/%d %H:%M)")
@medals.push([medal_id, t])
@new_medals.push([medal_id, t])
end
#--------------------------------------------------------------------------
# ○ 獲得メダル情報の消去
#--------------------------------------------------------------------------
def delete_new_medal
@new_medals.shift
end
end
#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ○ メダルの獲得
#--------------------------------------------------------------------------
def gain_medal(medal_id)
$game_party.gain_medal(medal_id)
end
end
#==============================================================================
# ■ Window_MenuCommand
#==============================================================================
class Window_MenuCommand
#--------------------------------------------------------------------------
# ● 独自コマンドの追加用
#--------------------------------------------------------------------------
alias tmmedal_window_menucommand_add_original_commands add_original_commands
def add_original_commands
tmmedal_window_menucommand_add_original_commands
unless TMMEDAL::HIDE_COMMAND && !medal_enabled
add_command(TMMEDAL::COMMAND_MEDAL, :medal, medal_enabled)
end
end
#--------------------------------------------------------------------------
# ○ メダルの有効状態を取得
#--------------------------------------------------------------------------
def medal_enabled
!$game_party.medals.empty?
end
end
#==============================================================================
# □ Window_MedalInfo
#==============================================================================
class Window_MedalInfo < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(Graphics.width - window_width, 0, window_width, fitting_height(1))
self.opacity = 0
self.contents_opacity = $game_party.medal_info_opacity
refresh
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 240
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
if $game_party.medal_info_count > 0
self.contents_opacity += 16
$game_party.medal_info_count -= 1
$game_party.delete_new_medal if $game_party.medal_info_count == 0
else
self.contents_opacity -= 16
if self.contents_opacity == 0
open unless $game_party.new_medals.empty?
end
end
$game_party.medal_info_opacity = self.contents_opacity
end
#--------------------------------------------------------------------------
# ● ウィンドウを開く
#--------------------------------------------------------------------------
def open
refresh
TMMEDAL::SE_GAIN_MEDAL.play
$game_party.medal_info_count = 150
self.contents_opacity = 0
self
end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
unless $game_party.new_medals.empty?
draw_background(contents.rect)
medal = TMMEDAL::MEDAL_DATA[$game_party.new_medals[0][0]]
rect = contents.rect.clone
draw_icon(medal[1], rect.x, rect.y)
rect.x += 24
rect.width -= 24
draw_text(rect, medal[0])
end
end
#--------------------------------------------------------------------------
# ○ 背景の描画
#--------------------------------------------------------------------------
def draw_background(rect)
temp_rect = rect.clone
temp_rect.width /= 2
contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
temp_rect.x = temp_rect.width
contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
end
#--------------------------------------------------------------------------
# ○ 背景色 1 の取得
#--------------------------------------------------------------------------
def back_color1
Color.new(0, 0, 0, 192)
end
#--------------------------------------------------------------------------
# ○ 背景色 2 の取得
#--------------------------------------------------------------------------
def back_color2
Color.new(0, 0, 0, 0)
end
end
#==============================================================================
# □ Window_Medal
#==============================================================================
class Window_Medal < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
refresh
select(0)
activate
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
@data && index >= 0 ? @data[index] : nil
end
#--------------------------------------------------------------------------
# ● アイテムリストの作成
#--------------------------------------------------------------------------
def make_item_list
@data = $game_party.medals
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
medal = TMMEDAL::MEDAL_DATA[item[0]]
rect = item_rect(index)
draw_icon(medal[1], rect.x, rect.y)
rect.x += 24
rect.width -= 216
draw_text(rect, medal[0])
rect.x = contents.width - 192
rect.width = 192
draw_text(rect, item[1], 2)
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
if item
medal = TMMEDAL::MEDAL_DATA[item[0]]
text = medal[2]
@help_window.set_text(text)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ● 全ウィンドウの作成
#--------------------------------------------------------------------------
alias tmmedal_scene_map_create_all_windows create_all_windows
def create_all_windows
tmmedal_scene_map_create_all_windows
create_medal_window
end
#--------------------------------------------------------------------------
# ○ メダルウィンドウの作成
#--------------------------------------------------------------------------
def create_medal_window
@medal_window = Window_MedalInfo.new
end
end
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias tmmedal_scene_menu_create_command_window create_command_window
def create_command_window
tmmedal_scene_menu_create_command_window
@command_window.set_handler(:medal, method(:command_medal))
end
#--------------------------------------------------------------------------
# ○ コマンド[メダル]
#--------------------------------------------------------------------------
def command_medal
SceneManager.call(Scene_Medal)
end
end
#==============================================================================
# □ Scene_Medal
#==============================================================================
class Scene_Medal < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_help_window
create_item_window
end
#--------------------------------------------------------------------------
# ○ アイテムウィンドウの作成
#--------------------------------------------------------------------------
def create_item_window
wy = @help_window.height
wh = Graphics.height - wy
@item_window = Window_Medal.new(0, wy, Graphics.width, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:cancel, method(:return_scene))
end
end
 
 无敌分割线--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 以下是菜单,只需要上边的脚本!如何删除多余的啊!
 
 
 
 复制代码#==============================================================================
# 
# ▼ Yanfly Engine Ace - Ace Menu Engine v1.07
# -- Last Updated: 2012.01.03
# -- Level: Normal, Hard
# -- Requires: n/a
# 
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-AceMenuEngine"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.03 - Compatibility Update: Ace Item Menu
# 2012.01.01 - Compatibility Update: Kread-EX's Synthesis
# - Compatibility Update: Kread-EX's Grathnode Install
# - Compatibility Update: Yami's Slot Battle
# 2011.12.23 - Script efficiency optimized.
# 2011.12.19 - Compatibility Update: Class System
# 2011.12.15 - Updated for better menu MP/TP gauge management.
# 2011.12.13 - Compatibility Update: Ace Equip Engine
# 2011.12.07 - Update to allow for switches to also hide custom commands.
# 2011.12.06 - Started Script and Finished.
# 
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# The menu system in RPG Maker VX Ace is great. However, it lacks the user
# customization that RPG Maker 2003 allowed. With this script, you can add,
# remove, and rearrange menu commands as you see fit. In addition to that, you
# can add in menu commands that lead to common events or even custom commands
# provided through other scripts.
# 
# This script also provides window appearance management such as setting almost
# all command windows to be center aligned or changing the position of the
# help window. You can also opt to show the TP Gauge in the main menu as well
# as in the skill menu.
# 
#==============================================================================
# ▼ 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.
# 
# Edit the settings in the module below as you see fit.
# 
#==============================================================================
# ▼ 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 MENU
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - General Menu Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This changes the way menus appear in your game. You can change their
# alignment, and the location of the help window, Note that any non-Yanfly
# Engine Ace scripts may not conform to these menu styles.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
HELP_WINDOW_LOCATION = 0 # 0-Top, 1-Middle, 2-Bottom.
COMMAND_WINDOW_ALIGN = 1 # 0-Left, 1-Middle, 2-Right.
# These settings below adjust the visual appearance of the main menu.
# Change the settings as you see fit.
MAIN_MENU_ALIGN = 0 # 0-Left, 1-Middle, 2-Right.
MAIN_MENU_RIGHT = false # false-Left, true-Right.
MAIN_MENU_ROWS = 14 # Maximum number of rows for main menu.
DRAW_TP_GAUGE = true # If true, draws TP in the main menu.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Main Menu Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These settings adjust the main menu, the order at which commands appear,
# what text is displayed, and what the commands are linked to. Here's a
# list of which commands do what:
# 
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# :item Opens up the item menu. Default menu item.
# :skill Opens up the skill menu. Default menu item.
# :equip Opens up the equip menu. Default menu item.
# :status Opens up the status menu. Default menu item.
# :formation Lets player manage party. Default menu item.
# :save Opens up the save menu. Default menu item.
# :game_end Opens up the shutdown menu. Default menu item.
# 
# :class Requires YEA - Class System
# 
# :gogototori Requires Kread-EX's Go Go Totori! Synthesis
# :grathnode Requires Kread-EX's Grathnote Install
# :sslots Requires Yami's YSA - Slot Battle
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COMMANDS =[
:item, # Opens up the item menu. Default menu item.
:skill, # Opens up the skill menu. Default menu item.
:equip, # Opens up the equip menu. Default menu item.
:class, # Requires YEA - Class System.
:guardian,
:status, # Opens up the status menu. Default menu item.
#:formation, # Lets player manage party. Default menu item.
:event_3, # Launches Common Event 3. Common Event Command.
:event_4, # Launches Common Event 4. Common Event Command.
:event_13, # Launches Common Event 13. Common Event Command.
:event_14, # Launches Common Event 14. Common Event Command.
:event_15, # Launches Common Event 15. Common Event Command.
:event_16, # Launches Common Event 16. Common Event Command.
:event_21, # Launches Common Event 16. Common Event Command.
:event_22, # Launches Common Event 16. Common Event Command.
# :debug, # Opens up debug menu. Custom Command.
:shop, # Opens up a shop to pawn items. Custom Command.
:save, # Opens up the save menu. Default menu item.
:game_end, # Opens up the shutdown menu. Default menu item.
] # Do not remove this.
#--------------------------------------------------------------------------
# - Common Event Commands -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# If you insert one of the following commands into the COMMANDS array, the
# player can trigger a common event to launch. You can disable certain
# commands in the menu by binding them to a switch. If you don't want to
# disable them, set the switch to 0 and it will always be enabled. The
# ShowSwitch will prevent a command from appear if that switch is false.
# Set it to 0 for it to have no impact.
#--------------------------------------------------------------------------
COMMON_EVENT_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Event ID],
:event_3 => [ "事件商店", 0, 0, 3],
:event_4 => [ "情报", 0, 0, 4],
:event_13 => [ "物品图鉴", 0, 0, 13],
:event_14 => [ "怪物图鉴", 0, 0, 14],
:event_15 => [ "睡眠", 0, 0, 15],
:event_16 => [ "合成", 0, 0, 16],
:event_21 => [ "魔法世界", 0, 0, 21],
:event_22 => [ "队伍变更", 0, 0, 22],
} # Do not remove this.
#--------------------------------------------------------------------------
# - Custom Commands -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For those who use scripts that may lead to other menu scenes, use this
# hash to manage custom commands that run specific script calls. You can
# disable certain commands in the menu by binding them to a switch. If you
# don't want to disable them, set the switch to 0. The ShowSwitch will
# prevent a command from appear if that switch is false. Set it to 0 for
# it to have no impact.
#--------------------------------------------------------------------------
CUSTOM_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
:debug => [ "Debug", 0, 0, :command_debug],
:shop => [ "商店", 0, 0, :command_shop],
:gogototori => ["Synthesis", 0, 0, :command_totori],
:grathnode => [ "Grathnode", 0, 0, :command_install],
:guardian => [ "援护", 0, 0, :command_guardian],
} # Do not remove this.
end # MENU
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.
#==============================================================================
#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
# This class is kept towards the top of the script to provide easier access.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::MENU::COMMANDS
case command
#--- Default Commands ---
when :item
add_command(Vocab::item, :item, main_commands_enabled)
when :skill
add_command(Vocab::skill, :skill, main_commands_enabled)
when :equip
add_command(Vocab::equip, :equip, main_commands_enabled)
when :status
add_command(Vocab::status, :status, main_commands_enabled)
when :formation
add_formation_command
when :save
add_original_commands
add_save_command
when :game_end
add_game_end_command
#--- Yanfly Engine Ace Commands ---
when :class
next unless $imported["YEA-ClassSystem"]
add_class_command
#--- Imported Commands ---
when :sslots
next unless $imported["YSA-SlotBattle"]
add_sslots_command
when :grathnode
next unless $imported["KRX-GrathnodeInstall"]
process_custom_command(command)
when :gogototori
next unless $imported["KRX-AlchemicSynthesis"]
process_custom_command(command)
#--- Imported Commands ---
else
process_common_event_command(command)
process_custom_command(command)
end
end
end
#--------------------------------------------------------------------------
# new method: process_common_event_command
#--------------------------------------------------------------------------
def process_common_event_command(command)
return unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
show = YEA::MENU::COMMON_EVENT_COMMANDS[command][2]
continue = show <= 0 ? true : $game_switches[show]
return unless continue
text = YEA::MENU::COMMON_EVENT_COMMANDS[command][0]
switch = YEA::MENU::COMMON_EVENT_COMMANDS[command][1]
ext = YEA::MENU::COMMON_EVENT_COMMANDS[command][3]
enabled = switch <= 0 ? true : $game_switches[switch]
add_command(text, command, enabled, ext)
end
#--------------------------------------------------------------------------
# new method: process_custom_command
#--------------------------------------------------------------------------
def process_custom_command(command)
return unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
show = YEA::MENU::CUSTOM_COMMANDS[command][2]
continue = show <= 0 ? true : $game_switches[show]
return unless continue
text = YEA::MENU::CUSTOM_COMMANDS[command][0]
switch = YEA::MENU::CUSTOM_COMMANDS[command][1]
enabled = switch <= 0 ? true : $game_switches[switch]
add_command(text, command, enabled)
end
end # Window_MenuCommand
#==============================================================================
# ■ Menu
#==============================================================================
module Menu
#--------------------------------------------------------------------------
# self.help_window_location
#--------------------------------------------------------------------------
def self.help_window_location
return YEA::MENU::HELP_WINDOW_LOCATION
end
#--------------------------------------------------------------------------
# self.command_window_align
#--------------------------------------------------------------------------
def self.command_window_align
return YEA::MENU::COMMAND_WINDOW_ALIGN
end
#--------------------------------------------------------------------------
# self.main_menu_align
#--------------------------------------------------------------------------
def self.main_menu_align
return YEA::MENU::MAIN_MENU_ALIGN
end
#--------------------------------------------------------------------------
# self.main_menu_right
#--------------------------------------------------------------------------
def self.main_menu_right
return YEA::MENU::MAIN_MENU_RIGHT
end
end # Menu
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# new method: draw_mp?
#--------------------------------------------------------------------------
def draw_mp?
return true unless draw_tp?
for skill in skills
next unless added_skill_types.include?(skill.stype_id)
return true if skill.mp_cost > 0
end
return false
end
#--------------------------------------------------------------------------
# new method: draw_tp?
#--------------------------------------------------------------------------
def draw_tp?
return false unless $data_system.opt_display_tp
for skill in skills
next unless added_skill_types.include?(skill.stype_id)
return true if skill.tp_cost > 0
end
return false
end
end # Game_Actor
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# overwrite method: draw_actor_simple_status
#--------------------------------------------------------------------------
def draw_actor_simple_status(actor, dx, dy)
dy -= line_height / 2
draw_actor_name(actor, dx, dy)
draw_actor_level(actor, dx, dy + line_height * 1)
draw_actor_icons(actor, dx, dy + line_height * 2)
dw = contents.width - dx - 124
draw_actor_class(actor, dx + 120, dy, dw)
draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
if $imported["YEA-BattleEngine"]
draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
draw_actor_mp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
else
draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
end
else
draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
end
end
end # Window_Base
#==============================================================================
# ■ Window_Command
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# overwrite method: alignment
#--------------------------------------------------------------------------
def alignment
return Menu.command_window_align
end
end # Window_Command
#==============================================================================
# ■ Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# alias method: init_command_position
#--------------------------------------------------------------------------
class <<self; alias init_command_position_ame init_command_position; end
def self.init_command_position
init_command_position_ame
@@last_command_oy = nil
end
#--------------------------------------------------------------------------
# overwrite method: visible_line_number
#--------------------------------------------------------------------------
def visible_line_number
return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
end
#--------------------------------------------------------------------------
# overwrite method: alignment
#--------------------------------------------------------------------------
def alignment
return Menu.main_menu_align
end
#--------------------------------------------------------------------------
# alias method: process_ok
#--------------------------------------------------------------------------
alias window_menucommand_process_ok_ame process_ok
def process_ok
@@last_command_oy = self.oy
window_menucommand_process_ok_ame
end
#--------------------------------------------------------------------------
# alias method: select_last
#--------------------------------------------------------------------------
alias window_menucommand_select_last_ame select_last
def select_last
window_menucommand_select_last_ame
self.oy = @@last_command_oy unless @@last_command_oy.nil?
@@last_command_oy = nil
end
end # Window_MenuCommand
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# alias method: start
#--------------------------------------------------------------------------
alias scene_menu_start_ame start
def start
scene_menu_start_ame
relocate_windows
end
#--------------------------------------------------------------------------
# new method: relocate_windows
#--------------------------------------------------------------------------
def relocate_windows
return unless Menu.main_menu_right
@command_window.x = Graphics.width - @command_window.width
@gold_window.x = Graphics.width - @gold_window.width
@status_window.x = 0
end
def return_scene
$game_map.autoplay
SceneManager.return
end
end # Scene_Menu
#==============================================================================
# ■ Scene_Item
#==============================================================================
class Scene_Item < Scene_ItemBase
#--------------------------------------------------------------------------
# alias method: start
#--------------------------------------------------------------------------
alias scene_item_start_ame start
def start
scene_item_start_ame
return if $imported["YEA-ItemMenu"]
relocate_windows
end
#--------------------------------------------------------------------------
# new method: relocate_windows
#--------------------------------------------------------------------------
def relocate_windows
case Menu.help_window_location
when 0 # Top
@help_window.y = 0
@category_window.y = @help_window.height
@item_window.y = @category_window.y + @category_window.height
when 1 # Middle
@category_window.y = 0
@help_window.y = @category_window.height
@item_window.y = @help_window.y + @help_window.height
else # Bottom
@category_window.y = 0
@item_window.y = @category_window.height
@help_window.y = @item_window.y + @item_window.height
end
if $imported["YEA-ItemMenu"]
@types_window.y = @category_window.y
@status_window.y = @category_window.y
end
end
end # Scene_Item
#==============================================================================
# ■ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_ItemBase
#--------------------------------------------------------------------------
# alias method: start
#--------------------------------------------------------------------------
alias scene_skill_start_ame start
def start
scene_skill_start_ame
relocate_windows
end
#--------------------------------------------------------------------------
# new method: relocate_windows
#--------------------------------------------------------------------------
def relocate_windows
case Menu.help_window_location
when 0 # Top
@help_window.y = 0
@command_window.y = @help_window.height
@status_window.y = @help_window.height
@item_window.y = @status_window.y + @status_window.height
when 1 # Middle
@command_window.y = 0
@status_window.y = 0
@help_window.y = @status_window.y + @status_window.height
@item_window.y = @help_window.y + @help_window.height
else # Bottom
@command_window.y = 0
@status_window.y = 0
@item_window.y = @status_window.y + @status_window.height
@help_window.y = @item_window.y + @item_window.height
end
end
end # Scene_Skill
#==============================================================================
# ■ Scene_Equip
#==============================================================================
class Scene_Equip < Scene_MenuBase
#--------------------------------------------------------------------------
# alias method: start
#--------------------------------------------------------------------------
alias scene_equip_start_ame start
def start
scene_equip_start_ame
relocate_windows
relocate_aee_windows
end
#--------------------------------------------------------------------------
# new method: relocate_windows
#--------------------------------------------------------------------------
def relocate_windows
return if $imported["YEA-AceEquipEngine"]
case Menu.help_window_location
when 0 # Top
@help_window.y = 0
@status_window.y = @help_window.height
@command_window.y = @help_window.height
@slot_window.y = @command_window.y + @command_window.height
@item_window.y = @slot_window.y + @slot_window.height
when 1 # Middle
@status_window.y = 0
@command_window.y = 0
@slot_window.y = @command_window.y + @command_window.height
@help_window.y = @slot_window.y + @slot_window.height
@item_window.y = @help_window.y + @help_window.height
else # Bottom
@status_window.y = 0
@command_window.y = 0
@slot_window.y = @command_window.y + @command_window.height
@item_window.y = @slot_window.y + @slot_window.height
@help_window.y = @item_window.y + @item_window.height
end
end
#--------------------------------------------------------------------------
# new method: relocate_aee_windows
#--------------------------------------------------------------------------
def relocate_aee_windows
return unless $imported["YEA-AceEquipEngine"]
case Menu.help_window_location
when 0 # Top
@help_window.y = 0
@command_window.y = @help_window.height
@slot_window.y = @command_window.y + @command_window.height
when 1 # Middle
@command_window.y = 0
@help_window.y = @command_window.height
@slot_window.y = @help_window.y + @help_window.height
else # Bottom
@command_window.y = 0
@slot_window.y = @command_window.height
@help_window.y = @slot_window.y + @slot_window.height
end
@actor_window.y = @command_window.y
@item_window.y = @slot_window.y
@status_window.y = @slot_window.y
end
end # Scene_Equip
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# alias method: create_command_window
#--------------------------------------------------------------------------
alias scene_menu_create_command_window_ame create_command_window
def create_command_window
scene_menu_create_command_window_ame
process_common_event_commands
process_custom_commands
end
#--------------------------------------------------------------------------
# new method: process_common_event_commands
#--------------------------------------------------------------------------
def process_common_event_commands
for command in YEA::MENU::COMMANDS
next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
@command_window.set_handler(command, method(:command_common_event))
end
end
#--------------------------------------------------------------------------
# new method: command_common_event
#--------------------------------------------------------------------------
def command_common_event
event_id = @command_window.current_ext
return return_scene if event_id.nil?
return return_scene if $data_common_events[event_id].nil?
$game_temp.reserve_common_event(event_id)
return_scene
end
#--------------------------------------------------------------------------
# new method: process_custom_commands
#--------------------------------------------------------------------------
def process_custom_commands
for command in YEA::MENU::COMMANDS
next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
@command_window.set_handler(command, method(called_method))
end
end
#--------------------------------------------------------------------------
# new method: command_debug
#--------------------------------------------------------------------------
def command_debug
SceneManager.call(Scene_Debug)
end
#--------------------------------------------------------------------------
# new method: command_shop
#--------------------------------------------------------------------------
def command_shop
goods = []
SceneManager.call(Scene_Shop)
SceneManager.scene.prepare(goods, false)
end
#--------------------------------------------------------------------------
# new method: command_totori
#--------------------------------------------------------------------------
def command_totori
return unless $imported['KRX-AlchemicSynthesis']
SceneManager.call(Scene_Alchemy)
end
end # Scene_Menu
#==============================================================================
# 
# ▼ End of File
# 
#==============================================================================
 
 | 
 |