#============================================================================== # ■装備拡張 for RGSS3 Ver1.10 # □author kure # # 呼び出し方法 SceneManager.call(Scene_Equip) #============================================================================== module KURE module ExEquip #画面の表示設定 #装備品のステータス補正表示(0=表示しない 1=表示する) VIEW_EQUIP_STATUS = 1 #装備スロット欄の表示設定---------------------------------------------------- #装備スロット表示名を設定(EQUIP_SLOT_NAME = [スロット5表示名,…] EQUIP_SLOT_NAME = ["兵书","坐骑","军印"] #装備スロットを設定 #通常のスロット EQUIP_SLOT = [0,1,2,3,4,5,6] #二刀流のスロット EQUIP_SLOT_DUAL = [0,0,2,3,4,5,6] #ステータス欄の表示設定------------------------------------------------------- #ステータス変化に表示する文字列 #Vocab_Ex1 = [命中率,回避率,会心率] Vocab_Ex1 = ["命中率","回避率","会心率"] #装備重量システム------------------------------------------------------------- #装備重量システムを利用する(0=利用しない 1=利用する) USE_WEIGHT_SYSTEM = 0 #最大装備重量設定------------------------------------------------------------ #基礎最大重量(全てのアクターが最低限もてる重量を設定します) MAX_WEIGHT_BASE = 50 #レベル補正(レベルが上がるごとに増える最大重量を設定します) MAX_WEIGHT_Lv = 2 #アクター毎、装備重量補正 #MAX_WEIGHT_ACTOR = [アクターID1,アクターID2,アクターID3,…] #MAX_WEIGHT_ACTOR = [20,20,20,20,20,20,20,20,20,20] MAX_WEIGHT_ACTOR = [0] #職業ごとの装備重量補正 #MAX_WEIGHT_JOB = [職業ID1,職業ID2,職業ID3,…] #MAX_WEIGHT_JOB = [10,10,10,10,10,10,10,10,10,10] MAX_WEIGHT_JOB = [0] #スキル補正 #MAX_WEIGHT_SKILL = [[スキルID,重量補正],[スキルID,重量補正],…] #MAX_WEIGHT_SKILL = [[1,10],[3,5],[84,100]] MAX_WEIGHT_SKILL = [[1,0],[3,0],[84,0]] #装備重量の名称 WEIGHT_NAME = "重量" #重量0のアイテムの重量表示(0=表示する 1=表示しない) WEIGHT_0_ITEM = 1 end end #============================================================================== # ■ RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ● 装備重量の定義(追加定義) #-------------------------------------------------------------------------- def weight cheack_note = @note cheack_note.match(/^<装備重量\s?(\d+)>/) if $1 == nil return 0 else return type = $1.to_i end end #-------------------------------------------------------------------------- # ● 装備重量の定義(追加定義) #-------------------------------------------------------------------------- def gain_weight cheack_note = @note cheack_note.match(/^<最大重量増加\s?(\d+)>/) if $1 == nil return 0 else return type = $1.to_i end end end #============================================================================== # ■ RPG::EquipItem(再定義) #============================================================================== class RPG::EquipItem < RPG::BaseItem #-------------------------------------------------------------------------- # ● 装備タイプの定義(再定義) #-------------------------------------------------------------------------- def etype_id if @note != "" cheack_note = @note cheack_note.match(/^<装備タイプ\s?(\d+)>/) if $1 == nil return @etype_id else return type = $1.to_i end else return @etype_id end end #-------------------------------------------------------------------------- # ● 装備タイプの定義(再定義) #-------------------------------------------------------------------------- def etype_id=(etype_id) @etype_id = etype_id end end #============================================================================== # ■ Game_BaseItem(追加定義) #============================================================================== class Game_BaseItem def id @item_id end end #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 装備スロットの配列を取得(再定義) #-------------------------------------------------------------------------- def equip_slots return KURE::ExEquip::EQUIP_SLOT_DUAL if dual_wield? return KURE::ExEquip::EQUIP_SLOT # 通常 end #-------------------------------------------------------------------------- # ● 装備総重量(追加定義) #-------------------------------------------------------------------------- def all_weight weight = 0 for i in [email]0..@equips.size[/email] - 1 #オブジェクトが存在している場合 if @equips[i].object != nil if equip_slots[i] == 0 weight = weight + $data_weapons[@equips[i].id].weight else weight = weight + $data_armors[@equips[i].id].weight end end end return weight end #-------------------------------------------------------------------------- # ● 重量増加量(追加定義) #-------------------------------------------------------------------------- def all_gain_weight gain_weight = 0 for i in [email]0..@equips.size[/email] - 1 #オブジェクトが存在している場合 if @equips[i].object != nil if equip_slots[i] == 0 gain_weight = gain_weight + $data_weapons[@equips[i].id].gain_weight else gain_weight = gain_weight + $data_armors[@equips[i].id].gain_weight end end end return gain_weight end #-------------------------------------------------------------------------- # ● 重量最大量(追加定義) #-------------------------------------------------------------------------- def max_weight max_weight = 0 #追加重量 plus_weight = all_gain_weight #基礎値 max_weight = max_weight + plus_weight + KURE::ExEquip::MAX_WEIGHT_BASE + KURE::ExEquip::MAX_WEIGHT_Lv * @level #アクター補正 if KURE::ExEquip::MAX_WEIGHT_ACTOR[@actor_id] != nil max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_ACTOR[@actor_id] end #職業補正 if KURE::ExEquip::MAX_WEIGHT_JOB[@class_id] != nil max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_JOB[@class_id] end #スキル補正を加算 for i in 0..KURE::ExEquip::MAX_WEIGHT_SKILL.size-1 if KURE::ExEquip::MAX_WEIGHT_SKILL[i] != nil #スキルを設定していればスキルを保存 cheack_skill = $data_skills[KURE::ExEquip::MAX_WEIGHT_SKILL[i][0]] #念のためnilではないか確認 if cheack_skill != nil #スキルを覚えていれば補正値を加算 if skill_learn?(cheack_skill) if KURE::ExEquip::MAX_WEIGHT_SKILL[i][1] != nil max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_SKILL[i][1] end end end end end return max_weight end end #============================================================================== # ■ Scene_Equip(再定義) #------------------------------------------------------------------------------ # 装備画面の処理を行うクラスです。 #============================================================================== class Scene_Equip < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super @max_weight = @actor.max_weight create_help_window create_small_status_window create_command_window create_slot_window create_status_window create_item_window @save_item = 0 end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_Ex_EquipCommand.new(0,@help_window.height + @small_status_window.height, @small_status_window.width) @command_window.viewport = @viewport @command_window.help_window = @help_window @command_window.set_handler(:equip, method(:command_equip)) @command_window.set_handler(:optimize, method(:command_optimize)) @command_window.set_handler(:clear, method(:command_clear)) @command_window.set_handler(:cancel, method(:return_scene)) @command_window.set_handler(:pagedown, method(:next_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) @command_window.activate end #-------------------------------------------------------------------------- # ● スロットウィンドウの作成 #-------------------------------------------------------------------------- def create_slot_window @slot_window = Window_Ex_EquipSlot.new(0, @command_window.height + @help_window.height + 120, 305,Graphics.height - @command_window.height - @help_window.height - 120) @slot_window.viewport = @viewport @slot_window.help_window = @help_window @slot_window.status_window = @status_window @slot_window.actor = @actor @slot_window.set_handler(:ok, method(:on_slot_ok)) @slot_window.set_handler(:cancel, method(:on_slot_cancel)) @slot_window.set_handler(:pagedown, method(:next_actor)) @slot_window.set_handler(:pageup, method(:prev_actor)) @slot_window.deactivate end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_status_window @status_window = Window_Ex_EquipStatus.new(@slot_window.width, @help_window.height,Graphics.width - @slot_window.width,Graphics.height - @help_window.height) @status_window.viewport = @viewport @status_window.actor = @actor end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_small_status_window @small_status_window = Window_Equip_Small_Status.new(0,@help_window.height,305,120) @small_status_window.viewport = @viewport @small_status_window.weight = @actor.all_weight @small_status_window.max_weight = @max_weight @small_status_window.refresh end #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成 #-------------------------------------------------------------------------- def create_item_window @item_window = Window_Ex_EquipItem.new(0,@command_window.height + @help_window.height + 120, 305,Graphics.height - @command_window.height - @help_window.height - 120) @item_window.viewport = @viewport @item_window.help_window = @help_window @item_window.status_window = @status_window @item_window.actor = @actor @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) @slot_window.item_window = @item_window @item_window.visible = false @item_window.weight = @actor.all_weight @item_window.max_weight = @max_weight end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update update_basic update_ex_status_window end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_ex_status_window if @item_window.visible == true if @item_window.item != @save_item @save_item = @item_window.item temp_actor = Marshal.load(Marshal.dump(@actor)) temp_actor.force_change_equip(@item_window.slot_id, @save_item) @status_window.set_temp_actor(temp_actor) @status_window.set_select_item2(@save_item) @status_window.refresh end end end #-------------------------------------------------------------------------- # ● コマンド[装備変更] #-------------------------------------------------------------------------- def command_equip slot_window_set_focus end #-------------------------------------------------------------------------- # ● コマンド[全て外す] #-------------------------------------------------------------------------- def command_clear Sound.play_equip @actor.clear_equipments @status_window.refresh @slot_window.refresh @command_window.activate if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 update_weight end end #-------------------------------------------------------------------------- # ● スロット[決定] #-------------------------------------------------------------------------- def on_slot_ok @save_item = 0 @slot_window.visible = false @item_window.visible = true @status_window.draw_index = 1 @status_window.set_select_item(@slot_window.index) #装備アイテムがあれば重量を渡す if @actor.equips[@slot_window.index] != nil @item_window.chage_item_weight = @actor.equips[@slot_window.index].weight @item_window.chaged_item_gain_weight = @actor.equips[@slot_window.index].gain_weight else @item_window.chage_item_weight = 0 @item_window.chaged_item_gain_weight = 0 end update_weight @item_window.refresh @slot_window.deactivate @item_window.activate @item_window.select(0) end #-------------------------------------------------------------------------- # ● スロット[キャンセル] #-------------------------------------------------------------------------- def on_slot_cancel @slot_window.unselect @slot_window.deactivate @command_window.activate @command_window.select(0) end #-------------------------------------------------------------------------- # ● アイテム[決定] #-------------------------------------------------------------------------- def on_item_ok Sound.play_equip index = @slot_window.index @actor.change_equip(@slot_window.index, @item_window.item) #二刀流両手剣問題対応 if @actor.dual_wield? if @slot_window.index == 0 @actor.change_equip(1, nil) if @actor.features_set(54).include?(1) elsif @slot_window.index == 1 @actor.change_equip(0, nil) if @actor.features_set(54).include?(1) end end @item_window.chaged_item_gain_weight = 0 @status_window.draw_index = 0 slot_window_set_focus delete_plus_status @slot_window.index = index update_weight end #-------------------------------------------------------------------------- # ● アイテム[キャンセル] #-------------------------------------------------------------------------- def on_item_cancel @status_window.draw_index = 0 index = @slot_window.index slot_window_set_focus @slot_window.index = index delete_plus_status end #-------------------------------------------------------------------------- # ● アクターの切り替え #-------------------------------------------------------------------------- def on_actor_change update_weight @status_window.actor = @actor @slot_window.actor = @actor @item_window.actor = @actor @command_window.activate @command_window.select(0) @slot_windowdeactivate @slot_window.unselect end #-------------------------------------------------------------------------- # ● ステータスウィンドウ項目消去 #-------------------------------------------------------------------------- def delete_plus_status @status_window.set_temp_actor(nil) @status_window.set_select_item(nil) @status_window.set_select_item2(nil) @status_window.refresh end #-------------------------------------------------------------------------- # ● スロットウィンドウにカーソルセット #-------------------------------------------------------------------------- def slot_window_set_focus @item_window.visible = false @item_window.unselect @item_window.refresh @slot_window.visible = true @slot_window.activate @slot_window.select(0) @slot_window.refresh @command_window.unselect @command_window.deactivate end #-------------------------------------------------------------------------- # ● 装備重量更新 #-------------------------------------------------------------------------- def update_weight @max_weight = @actor.max_weight @small_status_window.weight = @actor.all_weight @small_status_window.max_weight = @max_weight @item_window.weight = @actor.all_weight @item_window.max_weight = @max_weight @small_status_window.refresh end end #============================================================================== # ■ Window_Ex_EquipSlot #============================================================================== class Window_Ex_EquipSlot < Window_EquipSlot #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :status_window # ステータスウィンドウ attr_reader :item_window # アイテムウィンドウ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @height = height super(x, y, width) @actor = nil refresh end #-------------------------------------------------------------------------- # ● ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height return @height end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) return unless @actor rect = item_rect_for_text(index) change_color(system_color, enable?(index)) if @actor.equip_slots[index] <= 4 draw_text(rect.x, rect.y, 75, line_height, slot_name(index)) else draw_index = KURE::ExEquip::EQUIP_SLOT[index] draw_text(rect.x, rect.y, 75, line_height, KURE::ExEquip::EQUIP_SLOT_NAME[draw_index-5]) end draw_item_name(@actor.equips[index], rect.x + 75, rect.y, enable?(index)) if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 if @actor.equips[index] != nil if @actor.equips[index].gain_weight != 0 change_color(power_up_color) draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].gain_weight.to_s,2) else if KURE::ExEquip::WEIGHT_0_ITEM == 1 if @actor.equips[index].weight != 0 change_color(power_down_color) draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].weight.to_s,2) end else change_color(power_down_color) draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].weight.to_s,2) end end end end end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh #フォントの設定 last_font = contents.font.size contents.font.size = 20 contents.clear create_contents draw_all_items #フォントを戻す contents.font.size = last_font end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.clear @help_window.set_item(item) if @help_window end end #============================================================================== # ■ Window_Ex_EquipItem #============================================================================== class Window_Ex_EquipItem < Window_EquipItem attr_reader :status_window attr_accessor :weight attr_accessor :max_weight attr_accessor :chage_item_weight attr_accessor :chaged_item_gain_weight #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @weight = 0 @max_weight = 0 @chage_item_weight = 0 @chaged_item_gain_weight = 0 end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max return 1 end #-------------------------------------------------------------------------- # ● →キー入力時動作 #-------------------------------------------------------------------------- def cursor_right(wrap = false) if @status_window.draw_index == 1 @status_window.draw_index = 2 else @status_window.draw_index = 1 end @status_window.refresh end #-------------------------------------------------------------------------- # ● ←キー入力時操作 #-------------------------------------------------------------------------- def cursor_left(wrap = false) if @status_window.draw_index == 1 @status_window.draw_index = 2 else @status_window.draw_index = 1 end @status_window.refresh end #-------------------------------------------------------------------------- # ● アイテムを許可状態で表示するかどうか #-------------------------------------------------------------------------- def enable?(item) #重量システムを利用時だけ判定を行う if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 #アイテムが存在する時 if item !=nil #総重量 total_weight = item.weight + @weight - @chage_item_weight if total_weight > @max_weight - @chaged_item_gain_weight return false else return true end else if @weight > @max_weight - @chaged_item_gain_weight return false else return true end end end #重量システム非利用時であればtureを返す return true end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def slot_id return @slot_id end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.set_item(item) end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] if item rect = item_rect(index) rect.width -= 4 draw_item_name(item, rect.x, rect.y, enable?(item)) draw_item_number(rect, item) #重量システムを利用時は重量を表示する if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 if item.gain_weight != 0 change_color(power_up_color) draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.gain_weight.to_s,2) else #重量0をチェック if KURE::ExEquip::WEIGHT_0_ITEM == 1 if item.weight != 0 change_color(power_down_color) draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.weight.to_s,2) end else change_color(power_down_color) draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.weight.to_s,2) end end end end end end #============================================================================== # ■ Window_Small_Status #------------------------------------------------------------------------------ # メニュー画面でパーティメンバーのステータスを表示するウィンドウです。 #============================================================================== class Window_Equip_Small_Status < Window_Selectable #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :pending_index # 保留位置(並び替え用) attr_accessor :weight attr_accessor :max_weight #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y,width,height) super(x, y, width, height) refresh end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_status @actor = $game_party.menu_actor draw_actor_face(@actor, 0, 0) draw_actor_name(@actor, 130, line_height * 0) draw_actor_icons(@actor, 230-50, line_height * 0) draw_actor_hp(@actor, 130, line_height * 1) draw_actor_mp(@actor, 130, line_height * 2) if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 if @max_weight != nil draw_actor_weight(@actor, 130, line_height * 3) end end end #-------------------------------------------------------------------------- # ● 装備重量の描画 #-------------------------------------------------------------------------- def draw_actor_weight(actor, x, y, width = 124) weight_rate = @weight.to_f / @max_weight draw_gauge(x, y, width, weight_rate, tp_gauge_color1, tp_gauge_color2) change_color(system_color) draw_text(x, y, 30, line_height, KURE::ExEquip::WEIGHT_NAME) draw_current_and_max_values(x, y, width, @weight, @max_weight, mp_color(actor), normal_color) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear draw_status end end #============================================================================== # ■ Window_Ex_EquipStatus #------------------------------------------------------------------------------ # 装備画面で、アクターの能力値変化を表示するウィンドウです。 #============================================================================== class Window_Ex_EquipStatus < Window_EquipStatus attr_accessor :draw_index #-------------------------------------------------------------------------- # ◎ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y,width,height) @draw_index = 0 @width = width @height = height super(x, y) end #-------------------------------------------------------------------------- # ◎ ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width return @width end #-------------------------------------------------------------------------- # ◎ ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height return @height end #-------------------------------------------------------------------------- # ◎ リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear #フォントの設定 last_font = contents.font.size contents.font.size = 20 draw_gauge(5,0, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) case @draw_index when 0,1 draw_text(5, 0, 126, contents.font.size, "能力属性栏") draw_equip_befor(5,line_height * 1) draw_right_arrow(0, line_height * 2) draw_equip_after(65,line_height * 2) when 2 draw_text(5, 0, 126, contents.font.size, "装备属性") draw_equip_after(5,line_height * 1) end case @draw_index when 0,1 11.times {|i| draw_item(0, line_height * 2 + contents.font.size * (1 + i), i) } when 2 draw_features(5,line_height * 2) end case @draw_index when 1,2 change_color(normal_color) draw_text(0, line_height * 12, contents.width, contents.font.size, "",1) end contents.font.size = last_font end #-------------------------------------------------------------------------- # ◎ 装備変更のアイテム表示 #-------------------------------------------------------------------------- def draw_equip_befor(x,y) return unless @actor if @base_item_index != nil draw_item_name(@actor.equips[@base_item_index], x, y) end end #-------------------------------------------------------------------------- # ◎ 装備変更のアイテム表示 #-------------------------------------------------------------------------- def draw_equip_after(x,y) return unless @actor if @change_item != nil draw_item_name(@change_item, x, y) end end #-------------------------------------------------------------------------- # ◎ 装備アイテム描画の変数を設定 #-------------------------------------------------------------------------- def set_select_item(index) return if @base_item_index == index @base_item_index = index refresh end #-------------------------------------------------------------------------- # ◎ 変更装備アイテムの変数を設定 #-------------------------------------------------------------------------- def set_select_item2(index) return if @change_item == index @change_item = index refresh end #-------------------------------------------------------------------------- # ◎ 項目の描画 #-------------------------------------------------------------------------- def draw_item(x, y, param_id) case param_id when 0,1,2,3,4,5,6,7 draw_param_name(x + 4, y, param_id) draw_current_param(x + 84+20, y, param_id) if @actor draw_right_arrow(x + 116, y) draw_new_param(x + 140+ 140, y, param_id) if @temp_actor if KURE::ExEquip::VIEW_EQUIP_STATUS == 1 change_color(param_change_color(@change_item.params[param_id])) if @change_item draw_text(x + 172, y, 40, line_height, @change_item.params[param_id], 2) if @change_item end when 8,9,10 value = 0 value2 = 0 value = (@actor.xparam(param_id - 8) * 100).to_i if @actor value2 = (@temp_actor.xparam(param_id - 8) * 100).to_i if @temp_actor change_color(system_color) draw_text(x + 4, y, 80, line_height, KURE::ExEquip::Vocab_Ex1[param_id - 8]) change_color(normal_color) draw_text(x + 84+30, y, 32, line_height, value, 2) if @actor draw_right_arrow(x + 116, y) change_color(param_change_color(value2 - value)) if @temp_actor draw_text(x + 140+ 140, y, 32, line_height, value2, 2) if @temp_actor if KURE::ExEquip::VIEW_EQUIP_STATUS == 1 change_color(param_change_color(value2 - value)) draw_text(x + 172, y, 40, line_height, value2 - value, 2) if @change_item end end end #-------------------------------------------------------------------------- # ◎ 特徴の描画 #-------------------------------------------------------------------------- def draw_features(x,y) return if @change_item == nil #特徴を描画 change_color(system_color) draw_text(5, y, 126, contents.font.size, "属性特效") #配列数取得変数を初期化 features_max = 0 #描画用配列を作成 draw_list = Array.new(100) #配列用カウンターをセット @draw_counter = 0 #装備品が有れば特徴最大数を取得 features_max = @change_item.features.size - 1 #項目をチェックして描画用配列に入れる for l in 0..features_max #攻撃属性がある場合 if @change_item.features[l].code == 31 draw_str = $data_system.elements[@change_item.features[l].data_id] draw_list[@draw_counter] = draw_str + "属性 " @draw_counter += 1 end #属性耐性がある場合 if @change_item.features[l].code == 11 #属性名取得 draw_str = $data_system.elements[@change_item.features[l].data_id]+ "耐性" value = 100 - (@change_item.features[l].value * 100).to_i draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #弱体有効度がある場合 if @change_item.features[l].code == 12 #属性名取得 draw_str = "耐"+Vocab::param(@change_item.features[l].data_id)+ "减少" value = 100 - (@change_item.features[l].value * 100).to_i draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #ステート耐性がある場合 if @change_item.features[l].code == 13 #ステート名取得 draw_str = $data_states[@change_item.features[l].data_id].name + "耐性" value = 100 - (@change_item.features[l].value * 100).to_i draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #ステート無効化がある場合 if @change_item.features[l].code == 14 #ステート名取得 draw_str = $data_states[@change_item.features[l].data_id].name draw_list[@draw_counter] = draw_str + "无效 " @draw_counter += 1 end #通常能力値判定がある場合 if @change_item.features[l].code == 21 #ステータス名取得 draw_str = Vocab::param(@change_item.features[l].data_id) value = (@change_item.features[l].value * 100).to_i - 100 if value > 0 value = "+" + value.to_s end draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #通常能力値判定がある場合 if @change_item.features[l].code == 22 #ステータス名取得 draw_str = @change_item.features[l].data_id case draw_str when 0 draw_str = "命中率" when 1 draw_str = "回避率" when 2 draw_str = "会心率" when 3 draw_str = "会心回避" when 4 draw_str = "兵法回避" when 5 draw_str = "兵法反射" when 6 draw_str = "反击率" when 7 draw_str = "每回兵力回复" when 8 draw_str = "每回谋点回复" when 9 draw_str = "每回气力回复" end value = (@change_item.features[l].value * 100).to_i if value > 0 value = "+" + value.to_s end draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #特殊能力値判定がある場合 if @change_item.features[l].code == 23 #ステート名取得 draw_str = @change_item.features[l].data_id case draw_str when 0 draw_str = "被打几率" when 1 draw_str = "防御効果" when 2 draw_str = "回复效果" when 3 draw_str = "药草知识" when 4 draw_str = "谋点消费率" when 5 draw_str = "气力增加率" when 6 draw_str = "受物理伤害" when 7 draw_str = "受兵法伤害" when 8 draw_str = "受地图伤害" when 9 draw_str = "经验值" end value = (@change_item.features[l].value * 100).to_i - 100 if value > 0 value = "+" + value.to_s end draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #攻撃時ステート判定がある場合 if @change_item.features[l].code == 32 #ステート名取得 draw_str = $data_states[@change_item.features[l].data_id].name + "追加" value = (@change_item.features[l].value * 100).to_i draw_list[@draw_counter] = draw_str + value.to_s + "% " @draw_counter += 1 end #攻撃追加がある場合 if @change_item.features[l].code == 34 #攻撃回数を取得 value = (@change_item.features[l].value + 1).to_i draw_list[@draw_counter] = value.to_s + "回攻击 " @draw_counter += 1 end #スキルタイプ追加がある場合 if @change_item.features[l].code == 41 #項目を取得 value = $data_system.skill_types[@change_item.features[l].data_id] draw_list[@draw_counter] = value + "可使用 " @draw_counter += 1 end #スキルタイプ削除がある場合 if @change_item.features[l].code == 42 #項目を取得 value = $data_system.skill_types[@change_item.features[l].data_id] draw_list[@draw_counter] = value + "使用不可 " @draw_counter += 1 end #スキル追加がある場合 if @change_item.features[l].code == 43 #項目を取得 value = $data_skills[@change_item.features[l].data_id].name draw_list[@draw_counter] = "“" +value + "”可使用 " @draw_counter += 1 end #スキル削除がある場合 if @change_item.features[l].code == 44 #項目を取得 value = $data_skills[@change_item.features[l].data_id].name draw_list[@draw_counter] = "“" +value + "”不可使用 " @draw_counter += 1 end #行動追加がある場合 if @change_item.features[l].code == 61 #項目を取得 value = (@change_item.features[l].value * 100).to_i draw_list[@draw_counter] = "追加行动"+ value.to_s + "% " @draw_counter += 1 end #特殊フラグがある場合 if @change_item.features[l].code == 62 #項目を取得 value = @change_item.features[l].data_id case value when 0 value = "自动战斗" when 1 value = "自动防御" when 2 value = "自动援护" when 3 value = "TP持越" end draw_list[@draw_counter] = value @draw_counter += 1 end #パーティー能力がある場合 if @change_item.features[l].code == 64 #項目を取得 value = @change_item.features[l].data_id case value when 0 value = "遇敌率↓" when 1 value = "遇敌率0" when 2 value = "不会被偷袭" when 3 value = "偷袭率上升" when 4 value = "金钱双倍" when 5 value = "掉宝双倍" when 6 end draw_list[@draw_counter] = value @draw_counter += 1 end end #実際の描画処理 for j in 0..@draw_counter if draw_list[j] != nil or 0 case j when 0..10 change_color(normal_color) draw_text(x, y + contents.font.size * (j + 1) , contents.width / 2, contents.font.size, draw_list[j]) when 11..21 change_color(normal_color) draw_text(x + contents.width / 2, y + contents.font.size * (j - 10) , contents.width / 2, contents.font.size, draw_list[j]) end end end end end #============================================================================== # ■ Window_Ex_EquipCommand #------------------------------------------------------------------------------ # スキル画面で、コマンド(装備変更、最強装備など)を選択するウィンドウです。 #============================================================================== class Window_Ex_EquipCommand < Window_HorzCommand #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width) @window_width = width super(x, y) end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width @window_width end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 return 3 else return 2 end end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::equip2, :equip) if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 add_command(Vocab::optimize, :optimize) end add_command(Vocab::clear, :clear) end end
捕获.PNG (51.95 KB, 下载次数: 4)
捕获2.PNG (91.71 KB, 下载次数: 13)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |