#============================================================================== # ■アイテム倉庫(装備品個別管理対応) for RGSS3 Ver0.50-α # □作成者 kure # # 呼び出し方法  SceneManager.call(Scene_Storage) # #============================================================================== module KURE module Storage Vocab_SlotList = "装備スロットリスト" #装備スロットリスト Vocab_Symbollist = "装備シンボルリスト" #装備シンボルリスト end end #============================================================================== # ■ RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ◆ 倉庫最大保有量の定義(追加定義) #-------------------------------------------------------------------------- def storage_max @note.match(/<最大保有量\s?(\d+)\s?>/) return $1 ? $1.to_i : 99 end end #============================================================================== # ■ Game_Party #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- # ● 全アイテムリストの初期化(エイリアス) #-------------------------------------------------------------------------- alias k_integrate_before_init_all_items init_all_items def init_all_items k_integrate_before_init_all_items init_storage end #-------------------------------------------------------------------------- # ● 倉庫用のリストの作成() #-------------------------------------------------------------------------- def init_storage @storage_items = [] @storage_weapons = [] @storage_armors = [] end #-------------------------------------------------------------------------- # ● 倉庫のコンテナオブジェクトを取得 #-------------------------------------------------------------------------- def storage_container(item_class) return @storage_items if item_class == RPG::Item return @storage_weapons if item_class == RPG::Weapon return @storage_armors if item_class == RPG::Armor return nil end #-------------------------------------------------------------------------- # ● 倉庫のアイテムオブジェクトの配列取得( #-------------------------------------------------------------------------- def storage_items item = Array.new @storage_items.each_with_index{|num, index| next unless num next if num == 0 item.push($data_items[index]) } return item end #-------------------------------------------------------------------------- # ● 倉庫の武器オブジェクトの配列取得 #-------------------------------------------------------------------------- def storage_weapons weapon = @storage_weapons.compact.flatten return weapon end #-------------------------------------------------------------------------- # ● 倉庫の防具オブジェクトの配列取得 #-------------------------------------------------------------------------- def storage_armors armors = @storage_armors.compact.flatten return armors end #-------------------------------------------------------------------------- # ● 倉庫のアイテムオブジェクトの配列取得 #-------------------------------------------------------------------------- def all_storage_items storage_items + storage_weapons + storage_armors end #-------------------------------------------------------------------------- # ● 倉庫の所持数取得 #-------------------------------------------------------------------------- def storage_item_number(item) #対応するコンテナを取得 container = storage_container(item.class) return 0 unless container #通常アイテムの場合 if item.class == RPG::Item return 0 if container[item.id] == 0 return 0 if container[item.id] == nil return container[item.id] else return 0 unless container[turn_item_id(item.id)] return container[turn_item_id(item.id)].size end end #-------------------------------------------------------------------------- # ● 削除する配列位置を取得(追加定義) #-------------------------------------------------------------------------- def set_storage_delete(item_id,item) container = @storage_weapons[item_id] if item.class == RPG::Weapon container = @storage_armors[item_id] if item.class == RPG::Armor return nil unless container for block_id in 0..container.size - 1 if container[block_id].id == item.id return block_id break end end end #-------------------------------------------------------------------------- # ● 倉庫へアイテムの移動 #-------------------------------------------------------------------------- def in_to_storage(item) return unless item #対応するアイテムコンテナを取得 container = item_container(item.class) s_container = storage_container(item.class) #通常アイテム if item.class == RPG::Item container[item.id] = [[item_number(item) - 1, 0].max, max_item_number(item)].min s_container[item.id] ||= 0 s_container[item.id] += 1 #それ以外(装備品オブジェクト) else same_object = Marshal.load(Marshal.dump(item)) item_id = $game_party.turn_item_id(same_object.id) lose_item_id = set_delete(item_id,same_object) return unless lose_item_id #コンテナよりアイテムを削除 container[item_id][lose_item_id] = nil container[item_id].compact! #倉庫のコンテナにアイテムを出力 s_container[item_id] ||= [] s_container[item_id].push(same_object) end end #-------------------------------------------------------------------------- # ● 倉庫からアイテムを取り出す #-------------------------------------------------------------------------- def out_put_storage(item) return unless item #対応するアイテムコンテナを取得 container = item_container(item.class) s_container = storage_container(item.class) #通常アイテム if item.class == RPG::Item s_container[item.id] ||= 0 s_container[item.id] -= 1 gain_item(item, 1) #それ以外(装備品オブジェクト) else same_object = Marshal.load(Marshal.dump(item)) item_id = $game_party.turn_item_id(same_object.id) lose_item_id = set_storage_delete(item_id,same_object) return unless lose_item_id #コンテナよりアイテムを削除 s_container[item_id][lose_item_id] = nil s_container[item_id].compact! #倉庫のコンテナにアイテムを出力 container[item_id] ||= [] container[item_id].push(same_object) end end end #============================================================================== # ■ Scene_Storage #============================================================================== class Scene_Storage < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super $game_party.refresh_equip_name_list_both create_help_window create_category_window create_item_window create_info_window window_setting end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(1) @help_window.set_text("作業を選択してください。") end #-------------------------------------------------------------------------- # ● カテゴリウィンドウの作成 #-------------------------------------------------------------------------- def create_category_window wx = 0 wy = @help_window.height @category_window = Ex_Window_Storage_Category.new(wx, wy) @category_window.set_handler(:ok, method(:on_category_ok)) @category_window.set_handler(:cancel, method(:on_category_cancel)) @category_window.activate end #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成 #-------------------------------------------------------------------------- def create_item_window wy = @category_window.y + @category_window.height ww = Graphics.width / 2 wh = Graphics.height - wy @item_window = Ext_Window_StorageItemList.new(0, wy, ww, wh) @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) @item_window.deactivate end #-------------------------------------------------------------------------- # ● インフォメーションウィンドウの作成 #-------------------------------------------------------------------------- def create_info_window wx = @item_window.width wy = @category_window.y + @category_window.height ww = Graphics.width - wx wh = Graphics.height - wy @info_window = Window_k_Ext_Storage_Info.new(wx, wy, ww, wh) end #-------------------------------------------------------------------------- # ● 各ウィンドウの初期設定 #-------------------------------------------------------------------------- def window_setting @category_window.item_window = @item_window @item_window.info_window = @info_window end #-------------------------------------------------------------------------- # ● カテゴリ[決定] #-------------------------------------------------------------------------- def on_category_ok case @category_window.mode when 0 @item_window.mode = @category_window.index @info_window.system_mode = @category_window.index @category_window.mode = 1 @category_window.select(0) @category_window.activate when 1 @category_window.deactivate @item_window.select(0) @item_window.activate end end #-------------------------------------------------------------------------- # ● カテゴリ[キャンセル] #-------------------------------------------------------------------------- def on_category_cancel case @category_window.mode when 0 ; return_scene when 1 @category_window.mode = 0 @category_window.select(0) @category_window.activate end end #-------------------------------------------------------------------------- # ● アイテム[決定] #-------------------------------------------------------------------------- def on_item_ok case @item_window.mode when 0 ; $game_party.in_to_storage(@item_window.item) when 1 ; $game_party.out_put_storage(@item_window.item) end @item_window.refresh @item_window.set_item @item_window.activate end #-------------------------------------------------------------------------- # ● アイテム[キャンセル] #-------------------------------------------------------------------------- def on_item_cancel @category_window.activate @item_window.unselect end end #============================================================================== # ■ Ex_Window_Storage_Category #============================================================================== class Ex_Window_Storage_Category < Window_HorzCommand attr_accessor :item_window attr_reader :mode #-------------------------------------------------------------------------- # ● オブジェクト初期化(エイリアス) #-------------------------------------------------------------------------- alias k_integrate_before_initialize initialize unless $! def initialize(x, y) @mode = 0 k_integrate_before_initialize(x, y) end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max ; return 4 ; end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width ; Graphics.width ; end #-------------------------------------------------------------------------- # ● 表示モードの設定 #-------------------------------------------------------------------------- def mode=(mode) return if @mode == mode @mode = mode refresh end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help return if index < 0 @item_window.category = current_ext if @item_window end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list case mode when 0 ; make_command_0 when 1 ; make_command_1 end end #-------------------------------------------------------------------------- # ● コマンドリストの作成(設定0) #-------------------------------------------------------------------------- def make_command_0 add_command("預ける", :ok, true, 0) add_command("引き出す", :ok, true, 0) end #-------------------------------------------------------------------------- # ● コマンドリストの作成(設定1) #-------------------------------------------------------------------------- def make_command_1 add_command(Vocab::item, :ok, true, 1) add_command(Vocab::weapon, :ok, true, 2) add_command(Vocab::armor, :ok, true, 3) add_command(Vocab::key_item, :ok, true, 4) end end #============================================================================== # ■ Ext_Window_StorageItemList #============================================================================== class Ext_Window_StorageItemList < Window_ItemList attr_reader :mode attr_accessor :info_window #-------------------------------------------------------------------------- # ● オブジェクト初期化(エイリアス) #-------------------------------------------------------------------------- alias k_integrate_before_initialize initialize unless $! def initialize(x, y, width, height) @mode = 0 @pages = [] k_integrate_before_initialize(x, y, width, height) end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max ; return 1 ; end #-------------------------------------------------------------------------- # ● アイテムを許可状態で表示するかどうか #-------------------------------------------------------------------------- def enable?(item) return false unless item case @mode when 0 return false if $game_party.storage_item_number(item) >= item.storage_max return true when 1 return false if $game_party.item_number(item) >= $game_party.max_item_number(item) return true end end #-------------------------------------------------------------------------- # ● 動作モードの設定 #-------------------------------------------------------------------------- def mode=(mode) return if @mode == mode @mode = mode refresh end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help set_item end #-------------------------------------------------------------------------- # ● 現在のアイテムをインフォウィンドウに表示 #-------------------------------------------------------------------------- def set_item @info_window.item = nil if index < 0 @info_window.item = item if @info_window && index >= 0 if item.is_a?(RPG::EquipItem) @pages[0] = call_add_feature_size(item) @pages[1] = call_ap_list_size(item) @pages[2] = call_sortout_size(0, item) @pages[3] = call_sortout_size(1, item) end @info_window.page_fix @info_window.refresh end #-------------------------------------------------------------------------- # ● 特徴ページ数 #-------------------------------------------------------------------------- def call_add_feature_size(item) return 0 unless item if $kure_integrate_script[:integrate] basic = KURE.call_add_feature_txt(item).size else basic = KURE.basic_actor_add_feature_txt(item).size end result = basic.div(10) + 1 result -= 1 if basic.modulo(10) == 0 return [result, 1].max end #-------------------------------------------------------------------------- # ● APリスト数 #-------------------------------------------------------------------------- def call_ap_list_size(item) return 0 unless item return 0 unless $kure_integrate_script[:integrate] basic = KURE.call_add_feature(83, item.note).size result = basic.div(4) + 1 result -= 1 if basic.modulo(4) == 0 return [result, 1].max end #-------------------------------------------------------------------------- # ● スロット数やシンボル数などページ数の取得 #-------------------------------------------------------------------------- def call_sortout_size(type, item) return 0 unless item return 0 unless $kure_integrate_script[:SortOut] case type when 0 result = item.max_slot_number.div(9) + 1 result -= 1 if item.max_slot_number.modulo(9) == 0 when 1 result = item.max_symbol_number.div(9) + 1 result -= 1 if item.max_symbol_number.modulo(9) == 0 end return [result, 1].max end #-------------------------------------------------------------------------- # ● →キー入力時動作 #-------------------------------------------------------------------------- def cursor_right(wrap = false) first_page = Array.new first_page = use_101? ? [100, 101] : [100] @pages[0] ||= 1 ; @pages[1] ||= 1 ; @pages[2] ||= 1 ; @pages[3] ||= 1 ; page_list = first_page @pages[0].times{|index| page_list.push(200 + index)} if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if $kure_integrate_script[:ExEquip] && KURE::ExEquip::AP_VIEWER == 1 @pages[2].times{|index| page_list.push(400 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SLOT_EQUIP == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list += first_page page_list.each_with_index{|id, index| if id == @info_window.draw_index @info_window.draw_index = page_list[index + 1] break end } end #-------------------------------------------------------------------------- # ● ←キー入力時操作 #-------------------------------------------------------------------------- def cursor_left(wrap = false) first_page = Array.new first_page = use_101? ? [100, 101] : [100] @pages[0] ||= 1 ; @pages[1] ||= 1 ; @pages[2] ||= 1 ; @pages[3] ||= 1 page_list = first_page @pages[0].times{|index| page_list.push(200 + index)} if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if $kure_integrate_script[:ExEquip] && KURE::ExEquip::AP_VIEWER == 1 @pages[2].times{|index| page_list.push(400 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SLOT_EQUIP == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list.unshift(page_list[page_list.size - 1]) for page in 1..page_list.size - 1 if page_list[page] == @info_window.draw_index @info_window.draw_index = page_list[page - 1] break end end end #-------------------------------------------------------------------------- # ● 装備条件ページが必要かどうか #-------------------------------------------------------------------------- def use_101? return false unless $kure_integrate_script[:ExEquip] return true if KURE::ExEquip::USE_EQUIPLV_SYSTEM == 1 return true if KURE::ExEquip::USE_EQUIPSTATUS_SYSTEM == 1 return true if KURE::ExEquip::USE_EQUIPVAL_SYSTEM == 1 return false end #-------------------------------------------------------------------------- # ● アイテムリストの作成 #-------------------------------------------------------------------------- def make_item_list case @mode when 0 ; @data = $game_party.all_items.select {|item| include?(item) } when 1 ; @data = $game_party.all_storage_items.select {|item| include?(item) } end @data.push(nil) if include?(nil) end #-------------------------------------------------------------------------- # ● アイテムをリストに含めるかどうか #-------------------------------------------------------------------------- def include?(item) case @category when 0 ; false #空白 when 1 ; item.is_a?(RPG::Item) && !item.key_item? #アイテム when 2 ; item.is_a?(RPG::Weapon) #武器 when 3 ; item.is_a?(RPG::Armor) #防具 when 4 ; item.is_a?(RPG::Item) && item.key_item? #大切な物 else ; false end end #-------------------------------------------------------------------------- # ● アイテムの個数を描画 #-------------------------------------------------------------------------- def draw_item_number(rect, item) case @mode when 0 num = item.is_a?(RPG::EquipItem) ? 1 : $game_party.item_number(item) draw_text(rect, sprintf(":%2d", num), 2) when 1 num = item.is_a?(RPG::EquipItem) ? 1 : $game_party.storage_item_number(item) draw_text(rect, sprintf(":%2d", num), 2) end end end #============================================================================== # ■ Window_k_Ext_Storage_Info #============================================================================== class Window_k_Ext_Storage_Info < Window_EquipStatus attr_accessor :draw_index attr_accessor :system_mode #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @width = width @height = height @system_mode = 0 @draw_index = 0 @item = nil super(x, y) end #-------------------------------------------------------------------------- # ◎ ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width ; return @width ;end #-------------------------------------------------------------------------- # ◎ ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height ; return @height ;end #-------------------------------------------------------------------------- # ● 表示アイテムの設定 #-------------------------------------------------------------------------- def item=(item) return if @item == item @item = item @draw_index = item ? 100 : 0 refresh end #-------------------------------------------------------------------------- # ◎ 描画INDEXの設定 #-------------------------------------------------------------------------- def draw_index=(index) @draw_index = index refresh end #-------------------------------------------------------------------------- # ◎ 描画ページの修正を設定 #-------------------------------------------------------------------------- def page_fix case @draw_index when 100..199 ; @draw_index = 100 when 200..299 ; @draw_index = 200 when 300..399 ; @draw_index = 300 when 400..499 ; @draw_index = 400 when 500..599 ; @draw_index = 500 when 600..699 ; @draw_index = 600 when 700..799 ; @draw_index = 700 end end #-------------------------------------------------------------------------- # ◎ ブロック描画(アイテム) #-------------------------------------------------------------------------- def draw_block_0 draw_text(0, 0, 180, contents.font.size, "アイテム詳細") #アイテム名を描画 draw_item_name(@item, 5, line_height * 1) #残量を表示 change_color(system_color) text = "倉庫収容数" if @system_mode == 0 text = "所持数" if @system_mode == 1 draw_text(5, line_height * 2, 130, contents.font.size, text) change_color(normal_color) num = $game_party.storage_item_number(@item).to_s if @system_mode == 0 num = $game_party.item_number(@item).to_s if @system_mode == 1 draw_text(150, line_height * 2, 130, contents.font.size, num) draw_item_effects(5, line_height * 3, @item) end #-------------------------------------------------------------------------- # ◎ 特徴の描画 #-------------------------------------------------------------------------- def draw_item_effects(x,y,item) return unless item effect_max = 0 draw_list = KURE.call_effect_txt(item) effect_max = draw_list.size - 1 #実際の描画処理 for list in 0..effect_max change_color(normal_color) draw_text(x, y + contents.font.size * list , contents.width, contents.font.size, draw_list[list]) end end #-------------------------------------------------------------------------- # ◎ リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear return unless @item #フォントの設定 last_font = contents.font.size contents.font.size = 20 #タイトルゲージを描画 draw_gauge(0,0, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) draw_text(0, contents.height - contents.font.size, contents.width, contents.font.size, "← →:表示切り替え",1) if @draw_index != 0 #アイテムの種類で描画を変更 draw_block_0 if @item.is_a?(RPG::Item) if @item.is_a?(RPG::EquipItem) case @draw_index when 100..199 ; draw_index_one when 200..299 ; draw_index_two when 300..399 ; draw_index_three when 400..499 ; draw_index_four when 500..599 ; draw_index_five when 600..699 ; draw_index_six when 700..799 ; draw_index_seven end end end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 100,101) #-------------------------------------------------------------------------- def draw_index_one case @draw_index when 100 ; draw_text(0, 0, 180, contents.font.size, "装備品能力") when 101 ; draw_text(0, 0, 180, contents.font.size, "装備条件") end return unless @item draw_item_name(@item, 5,line_height * 1) case @draw_index when 100 8.times {|i| draw_item_index1_1(0, line_height * 2, i, @item) } draw_equip_type(0,line_height * 1 + contents.font.size * 6, @item) when 101 draw_equip_condition(0, line_height * 1, @item) end end #-------------------------------------------------------------------------- # ◎ 項目の描画(draw_index = 100) #-------------------------------------------------------------------------- def draw_item_index1_1(x, y, param_id, item) if $kure_integrate_script[:ExEquip] return unless KURE::ExEquip::VIEW_PARAM[param_id] draw_id = KURE::ExEquip::VIEW_PARAM[param_id] else draw_id = param_id end left = "" ; left2 = "" pos_x = x + (contents.width / 2) * param_id.modulo(2) pos_y = y + contents.font.size * param_id.div(2) draw_param_name(pos_x, pos_y, draw_id) if item change_color(param_change_color(item.params[draw_id])) left =" " if item.params[draw_id].abs < 100 left =" " if item.params[draw_id].abs < 10 left2 = "+" if item.params[draw_id] > 0 left2 = " " if item.params[draw_id] == 0 end draw_text(pos_x, pos_y, contents.width / 2 - 5, contents.font.size, left + left2 + (item.params[draw_id].abs).to_s, 2) end #-------------------------------------------------------------------------- # ◎ 要求条件の描画(draw_index = 100) #-------------------------------------------------------------------------- def draw_equip_type(x,y,item) 5.times{|index| case index when 1 next unless $kure_integrate_script[:ExEquip] next if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 when 2,3,4 ; next unless $kure_integrate_script[:SortOut] end pos_y = y + contents.font.size * index case index when 0 ; system_name = KURE::ExEquip::Vocab_EquipType when 1 ; system_name = KURE::ExEquip::Vocab_Weight when 2 ; system_name = KURE::ExEquip::Vocab_EquipExp when 3 ; system_name = KURE::ExEquip::Vocab_Durable when 4 ; system_name = KURE::ExEquip::Vocab_Slot + "(装備/最大)" end next if system_name == "" change_color(system_color) draw_text(x, pos_y, 130, contents.font.size, system_name) case index when 0 if item.is_a?(RPG::Weapon) ; str = $data_system.weapon_types[item.wtype_id] elsif item.is_a?(RPG::Armor) ; str = $data_system.armor_types[item.atype_id] else ; str = "" end when 1 weight = item.weight.to_s revise = item.gain_weight > 0 ? "+" + item.gain_weight.to_s : item.gain_weight.to_s str = weight + " / " + revise when 2 str = item.equip_exp.to_s when 3 str = item.broken? ? "破損中" : item.durable_value when 4 slot_max = item.max_slot_number slot_num = item.slot_list.compact.size str = "(" + slot_num.to_s + " / " + slot_max.to_s + ")" end change_color(normal_color) draw_text(x, pos_y, contents.width - 10, contents.font.size, str, 2) } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 101) #-------------------------------------------------------------------------- def draw_equip_condition(x, y, item) #装備レベル利用時は要求レベルを描画 line = 1 3.times{|index| case index when 0 ; list = item.need_equip_level ; next if list == [] when 1 ; list = item.need_equip_status ; next if list == [] when 2 ; list = [item.need_equip_val] ; next if list == [[0, 0]] end case index when 0 next unless $kure_integrate_script[:ExEquip] next if KURE::ExEquip::USE_EQUIPLV_SYSTEM == 0 name = "装備可能レベル" when 1 next unless $kure_integrate_script[:ExEquip] next if KURE::ExEquip::USE_EQUIPSTATUS_SYSTEM == 0 name = "装備要求ステータス" when 2 next unless $kure_integrate_script[:ExEquip] next if KURE::ExEquip::USE_EQUIPVAL_SYSTEM == 0 name = "装備要求条件" end change_color(system_color) draw_text(x, y + contents.font.size * line, 150, contents.font.size, name) line += 1 change_color(normal_color) list.each{|block| case index when 0 name = $data_classes[block[0]].name + " " need = block[1] != 0 ? block[1].to_s + "以上 " : "" limit = block[2] != 0 ? block[2].to_s + "以下" : "" str = name + need + limit when 1 name = Vocab::param(block[0]) + " " need = block[1].to_s + "以上" str = name + need when 2 name = $data_system.variables[block[0]] ? $data_system.variables[block[0]] + " " : "特殊条件" need = block[1].to_s + "以上" str = name + need end draw_text(x + 10, y + contents.font.size * line, contents.width - 15, contents.font.size, str) line += 1 } } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 2) #-------------------------------------------------------------------------- def draw_index_two draw_text(0, 0, 180, contents.font.size, "装備品特徴" + "(" + (@draw_index - 199).to_s + ")" ) draw_item_name(@item, 5,line_height * 1) if @item draw_features(0,line_height * 2,@item) end #-------------------------------------------------------------------------- # ◎ 特徴の描画(draw_index = 200..299) #-------------------------------------------------------------------------- def draw_features(x,y,item) return unless item if $kure_integrate_script[:integrate] draw_list = KURE.call_add_feature_txt(item) else draw_list = KURE.basic_actor_add_feature_txt(item) end first = 0 + 11 * (@draw_index - 200) last = [10 + 11 * (@draw_index - 200), draw_list.size].min draw_list[first..last].each_with_index{|text, index| pos_y = y + contents.font.size * index draw_text(x, pos_y, contents.width, contents.font.size, text) } end #-------------------------------------------------------------------------- # ◎ 習得スキルリスト(draw_index = 3) #-------------------------------------------------------------------------- def draw_index_three draw_text(0, 0, 180, contents.font.size, "習得スキルリスト" + "(" + (@draw_index - 299).to_s + ")" ) draw_item_name(@item, 5,line_height * 1) if @item draw_aplist(0,line_height * 2,@item) end #-------------------------------------------------------------------------- # ◎ APのリストを描画(draw_index = 300..399) #-------------------------------------------------------------------------- def draw_aplist(x,y,item) return unless item draw_list = KURE.call_add_feature(83, item.note) first = 0 + 5 * (@draw_index - 300) last = [4 + 5 * (@draw_index - 300), draw_list.size].min draw_list[first..last].each_with_index{|data, index| pos_y = y + line_height * index * 2 pos_y2 = y + line_height * ((index * 2) + 1) skill = $data_skills[data[0]] value = @actor.call_ability_point(data[0]) text1 = skill.name + "(" + "x" + data[1].to_s + ")" text2 = value.to_s + "/" + "1000" draw_icon(skill.icon_index, x, pos_y) draw_text(x + 30, pos_y + (line_height - contents.font.size) / 2, contents.width, contents.font.size, text1) draw_text(x, pos_y2, contents.width, contents.font.size, text2, 2) } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 4) #-------------------------------------------------------------------------- def draw_index_four draw_text(0, 0, 180, contents.font.size, KURE::Storage::Vocab_SlotList + "(" + (@draw_index - 399).to_s + ")" ) draw_item_name(@item, 5,line_height * 1) if @item draw_ss_list(0, line_height * 2, @item, 0) end #-------------------------------------------------------------------------- # ◎ 装備シンボルリスト(draw_index = 5) #-------------------------------------------------------------------------- def draw_index_five draw_text(0, 0, 180, contents.font.size, KURE::Storage::Vocab_Symbollist + "(" + (@draw_index - 499).to_s + ")" ) draw_item_name(@item, 5,line_height * 1) if @item draw_ss_list(0, line_height * 2, @item, 1) end #-------------------------------------------------------------------------- # ◎ スロット、シンボル内容を描画 #-------------------------------------------------------------------------- def draw_ss_list(x, y, item, mode) return unless item case mode when 0 slot_list = item.slot_list slot_max_size = item.max_slot_number base = 400 when 1 slot_list = item.symbol_list.collect{|obj| obj[0] } slot_max_size = item.max_symbol_number base = 500 end first = 0 + 10 * (@draw_index - base) last = [10 + 10 * (@draw_index - base), slot_max_size].min (last - first).times{|index| pos_y = y + (line_height * index) + 2 id = index + first draw_text(5, pos_y, 25, line_height, id + 1) draw_item_name(slot_list[id], 30, pos_y) if slot_list[id] } end end