赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 35025 |
最后登录 | 2017-9-29 |
在线时间 | 231 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 231 小时
- 注册时间
- 2007-12-17
- 帖子
- 541
|
二刀流+六边形界面脚本关于窗口描绘的部分
- #==============================================================================
- # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
- #
- # 装备窗口美化,全能力值描绘并追加新的防具装备栏
- #
- # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
- #==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_EquipRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(272, 64, 368, 252)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- @data.push($data_weapons[@actor.weapon_id])
- # --- ここから変更部分 ---
- @data.push(@actor.weapon2_id != 0 ? $data_weapons[@actor.weapon2_id] : $data_armors[@actor.armor1_id])
- # --- 変更部分終わり ---
- @data.push($data_armors[@actor.armor2_id])
- @data.push($data_armors[@actor.armor3_id])
- @data.push($data_armors[@actor.armor4_id])
- @data.push($data_armors[@actor.armor5_id])
- @data.push($data_armors[@actor.armor6_id])
- @item_max = @data.size
- self.contents.font.color = system_color
- self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
- self.contents.draw_text(4, 32 * 5, 92, 32, "项链")
- self.contents.draw_text(4, 32 * 6, 92, 32, "脚部")
- draw_item_name(@data[0], 92, 32 * 0)
- draw_item_name(@data[1], 92, 32 * 1)
- draw_item_name(@data[2], 92, 32 * 2)
- draw_item_name(@data[3], 92, 32 * 3)
- draw_item_name(@data[4], 92, 32 * 4)
- draw_item_name(@data[5], 92, 32 * 5)
- draw_item_name(@data[6], 92, 32 * 6)
- end
- end
- # ■ Harts_Window_EquipItem
- #==============================================================================
- class Harts_Window_EquipItem < Window_Selectable
-
-
- #--------------------------------------------------------------------------
- # ● 初期化
- # actor : 角色
- # equip_type : 装備部位 (0~3)
- #--------------------------------------------------------------------------
- def initialize(actor, equip_type)
- super(272, 314, 368, 102)
- @actor = actor
- @equip_type = equip_type
- @column_max = 1
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 物品取得
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 最強id取得
- #--------------------------------------------------------------------------
- def max_item_id
- if @equip_type == 0
- if @actor.weapon_id == 0
- max = 0
- else
- max = $data_weapons[@actor.weapon_id].atk
- end
- # --- ここから追加部分 ---
- # 二刀流可能なアクターの場合は、盾に二刀武器も表示
- elsif @equip_type == 1 and @actor.can_two_weapons?
- if @actor.weapon2_id == 0
- max = 0
- else
- max = $data_weapons[@actor.weapon2_id].atk
- end
- #weapon_set = $data_classes[@actor.class_id].weapon_set
- #for i in 1...$data_weapons.size
- # if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- # @data.push($data_weapons[i])
- # end
- #end
-
- # --- 追加部分終わり ---
- elsif @equip_type == 1
- if @actor.armor1_id == 0
- max = 0
- else
- max = $data_armors[@actor.armor1_id].pdef
- end
- elsif @equip_type == 2
- if @actor.armor2_id == 0
- max = 0
- else
- max = $data_armors[@actor.armor2_id].pdef
- end
- elsif @equip_type == 3
- if @actor.armor3_id == 0
- max = 0
- else
- max = $data_armors[@actor.armor3_id].pdef
- end
- elsif @equip_type == 4
- if @actor.armor4_id == 0
- max = 0
- else
- max = $data_armors[@actor.armor4_id].pdef
- end
- elsif @equip_type == 5
- if @actor.armor5_id == 0
- max = 0
- else
- max = $data_armors[@actor.armor5_id].pdef
- end
- end
- for i in [email protected]
- if @equip_type <= 1 and @actor.can_two_weapons?
- if max <= $data_weapons[@data[i].id].atk
- max = $data_weapons[@data[i].id].atk
- item_id = @data[i].id
- end
- elsif #@equip_type >= 1
- if max <= $data_armors[@data[i].id].pdef
- max = $data_armors[@data[i].id].pdef
- item_id = @data[i].id
- end
- end
- end
- return item_id
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 装備可能的武器追加
- if @equip_type == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
- @data.push($data_weapons[i])
- end
- end
- end
- # --- ここから追加部分 ---
- # 二刀流可能なアクターの場合は、盾に二刀武器も表示
- if @equip_type == 1 and @actor.can_two_weapons?
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- @data.push($data_weapons[i])
- end
- end
- end
- # --- 追加部分終わり ---
- ###########################################################################
- # if Kboard.keyboard($R_Key_G)
- # # 演奏取消 SE
- # $game_system.se_play($data_system.cancel_se)
- # # 切换到菜单画面
- # $scene = Scene_Map.new
- # return
- # end
- ###########################################################################
- # 装備可能的防具追加
- if @equip_type != 0
- armor_set = $data_classes[@actor.class_id].armor_set
- for i in 1...$data_armors.size
- if $game_party.armor_number(i) > 0 and armor_set.include?(i)
- if $data_armors[i].kind == @equip_type-1
- @data.push($data_armors[i])
- end
- end
- end
- end
- # 空白追加
- @data.push(nil)
- # 全項目描画
- @item_max = @data.size
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max-1
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● 項目描画
- # index : 項目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- x = 4
- y = index * 32
- case item
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- bitmap = RPG::Cache.icon(item.icon_name)
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 帮助更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.item == nil ? "" : self.item.description)
- end
- end
- #==============================================================================
- # ■ Harts_Window_EquipLeft
- #==============================================================================
- class Harts_Window_EquipLeft < Window_Base
- #--------------------------------------------------------------------------
- # ● 初期化
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 64, 272, 352)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 32, 64)
- draw_actor_name(@actor, 4 + 96, 0)
- draw_actor_level(@actor, 4 + 96, 32)
- draw_actor_parameter(@actor, 4, 100, 0)#80=64
- draw_actor_parameter(@actor, 4, 127, 1)#112=96
- draw_actor_parameter(@actor, 4, 154, 2)#144=128
- draw_actor_parameter(@actor, 4, 181, 7)
- draw_actor_parameter(@actor, 4, 211, 3)
- draw_actor_parameter(@actor, 4, 238, 4)
- draw_actor_parameter(@actor, 4, 265, 5)
- draw_actor_parameter(@actor, 4, 292, 6)
- if @new_atk != nil and @new_atk != @actor.atk
- if @new_atk > @actor.atk
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 100, 40, 32, "→", 1)
- self.contents.draw_text(200, 100, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil and @new_pdef != @actor.pdef
- if @new_pdef > @actor.pdef
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 127, 40, 32, "→", 1)
- self.contents.draw_text(200, 127, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil and @new_mdef != @actor.mdef
- if @new_mdef > @actor.mdef
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 154, 40, 32, "→", 1)
- self.contents.draw_text(200, 154, 36, 32, @new_mdef.to_s, 2)
- end
- if @new_eva != nil and @new_eva != @actor.eva
- if @new_eva > @actor.eva
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 181, 40, 32, "→", 1)
- self.contents.draw_text(200, 181, 36, 32, @new_mdef.to_s, 2)
- end
- if @new_str != nil and @new_str != @actor.str
- if @new_str > @actor.str
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 211, 40, 32, "→", 1)
- self.contents.draw_text(200, 211, 36, 32, @new_str.to_s, 2)
- end
- if @new_dex != nil and @new_dex != @actor.dex
- if @new_dex > @actor.dex
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 238, 40, 32, "→", 1)
- self.contents.draw_text(200, 238, 36, 32, @new_dex.to_s, 2)
- end
- if @new_agi != nil and @new_agi != @actor.agi
- if @new_agi > @actor.agi
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 265, 40, 32, "→", 1)
- self.contents.draw_text(200, 265, 36, 32, @new_agi.to_s, 2)
- end
- if @new_int != nil and @new_int != @actor.int
- if @new_int > @actor.int
- self.contents.font.color = system_color
- else
- self.contents.font.color = disabled_color
- end
- self.contents.draw_text(160, 292, 40, 32, "→", 1)
- self.contents.draw_text(200, 292, 36, 32, @new_int.to_s, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 装備変更後設定
- # new_atk : 装備変更後攻撃力
- # new_pdef : 装備変更後物理防御
- # new_mdef : 装備変更後魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
- if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- @new_str = new_str
- @new_dex = new_dex
- @new_agi = new_agi
- @new_int = new_int
- refresh
- end
- end
- end
- #==============================================================================
- # ■ Harts_Scene_Equip
- #==============================================================================
- class Scene_Equip
- include OPACITY_66RPG
- #--------------------------------------------------------------------------
- # ● 初期化
- # actor_index : 角色编号
- # equip_index : 装備编号
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, equip_index = -1, command_index = 0, equip_active = false, command_active = true)
- @actor_index = actor_index
- @equip_index = equip_index
- @command_index = command_index
- @equip_active = equip_active
- @command_active = command_active
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- create_screen
- @actor = $game_party.actors[@actor_index]
- @title_window = Harts_Window_EquipTitle.new
- @command_window = Harts_Window_EquipCommand.new
- @help_window = Window_Help.new
- @help_window.y = 416
- @left_window = Harts_Window_EquipLeft.new(@actor)
- @right_window = Window_EquipRight.new(@actor)
- @item_window0 = Harts_Window_EquipItem.new(@actor, -1)
- @item_window1 = Harts_Window_EquipItem.new(@actor, 0)
- @item_window2 = Harts_Window_EquipItem.new(@actor, 1)
- @item_window3 = Harts_Window_EquipItem.new(@actor, 2)
- @item_window4 = Harts_Window_EquipItem.new(@actor, 3)
- @item_window5 = Harts_Window_EquipItem.new(@actor, 4)
- @item_window6 = Harts_Window_EquipItem.new(@actor, 5)
- @item_window7 = Harts_Window_EquipItem.new(@actor, 6)
- # 关联帮助窗口
- @right_window.help_window = @help_window
- @item_window0.help_window = @help_window
- @item_window1.help_window = @help_window
- @item_window2.help_window = @help_window
- @item_window3.help_window = @help_window
- @item_window4.help_window = @help_window
- @item_window5.help_window = @help_window
- @item_window6.help_window = @help_window
- @item_window7.help_window = @help_window
- ##############
- @equip_window = Window_Equip.new
- ##############
- # 设置光标位置
- @command_window.index = @command_index
- @right_window.index = @equip_index
- @command_window.active = @command_active
- @right_window.active = @equip_active
- testname = @actor.battler_name+"_h.png"
- if FileTest.exist?("Graphics/battlers/#{testname}")
- sp = Sprite.new
- sp.bitmap=Bitmap.new("Graphics/battlers/#{testname}")
- sp.opacity = 120
- end
- refresh
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话的就中断循环
- if $scene != self
- break
- end
- end
- # トランジション準備
- Graphics.freeze
- # ウィンドウを解放
- @title_window.dispose
- @command_window.dispose
- @help_window.dispose
- @left_window.dispose
- @right_window.dispose
- @item_window0.dispose
- @item_window1.dispose
- @item_window2.dispose
- @item_window3.dispose
- @item_window4.dispose
- @item_window5.dispose
- @item_window6.dispose
- @item_window7.dispose
- ##############
- @equip_window.dispose
- ##############
- dispose_screen
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- @item_window0.visible = (@right_window.index == -1)
- @item_window1.visible = (@right_window.index == 0)
- @item_window2.visible = (@right_window.index == 1)
- @item_window3.visible = (@right_window.index == 2)
- @item_window4.visible = (@right_window.index == 3)
- @item_window5.visible = (@right_window.index == 4)
- @item_window6.visible = (@right_window.index == 5)
- @item_window7.visible = (@right_window.index == 6)
- # 获取当前装备中的物品
- item1 = @right_window.item
- ##############
- @equip_window.set_item(item1)
- ##############
- # 设置当前的物品窗口到 @item_window
- case @right_window.index
- when -1
- @item_window = @item_window0
- when 0
- @item_window = @item_window1
- when 1
- @item_window = @item_window2
- when 2
- @item_window = @item_window3
- when 3
- @item_window = @item_window4
- when 4
- @item_window = @item_window5
- when 5
- @item_window = @item_window6
- when 6
- @item_window = @item_window7
- end
- # 右窗口被激活的情况下
- if @right_window.active
- # 删除变更装备后的能力
- ###############################################################
- @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
- end
- # 物品窗口被激活的情况下
- if @item_window.active
- # 获取现在选中的物品
- item2 = @item_window.item
- # 变更装备
- last_hp = @actor.hp
- last_sp = @actor.sp
- # --- ここから変更部分 ---
- # 現在の装備を保存(装備の種類を増やしている場合はここを変更)
- equipments = [@actor.weapon2_id, @actor.weapon_id, @actor.armor1_id, @actor.armor2_id, @actor.armor3_id, @actor.armor4_id]
- @actor.equip(equip_type(@right_window.index, item2), item2 == nil ? 0 : item2.id)
- # --- 変更部分終わり ---
- # 装備変更後のパラメータを取得
- ###############################################################
- # 获取变更装备后的能力值
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- new_eva = @actor.eva
- new_str = @actor.str
- new_dex = @actor.dex
- new_agi = @actor.agi
- new_int = @actor.int
- # --- ここから変更部分 ---
- # 装備を戻す
- for i in 0...equipments.size
- @actor.equip(i - 1, equipments[i])
- end
- # --- 変更部分終わり ---
- # 返回到装备
- @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
- @actor.hp = last_hp
- @actor.sp = last_sp
- # 描画左窗口
- ###############################################################
- @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
- ###############################################################
- ##################
- @equip_window.set_item(item2)
- ##################
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update
- @title_window.update
- @command_window.update
- @left_window.update
- @right_window.update
- @item_window.update
- ##############
- @equip_window.refresh
- ##############
- refresh
- if @command_window.active
- update_command
- return
- end
- if @right_window.active
- update_right
- return
- end
- # 物品窗口被激活的情况下: 调用 update_item
- if @item_window.active
- update_item
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update_command
- # 按下B的场合
- if Input.trigger?(Input::B)
- # 音效演奏
- $game_system.se_play($data_system.cancel_se)
- # 画面切换
- $scene = Scene_Menu.new(2)
- return
- end
- # 按下C的场合
- if Input.trigger?(Input::C)
- case @command_window.index
- # 装備的場合
- when 0
- # 音效演奏
- $game_system.se_play($data_system.decision_se)
- @right_window.active = true
- @command_window.active = false
- @right_window.index = 0
- @command_window.index = -1
- return
- # 最強装備的場合
- =begin
- when 1
-
- # 音效演奏
- $game_system.se_play($data_system.equip_se)
- if @actor.can_two_weapons?
- # 最強装備的取得
- max_weapon_id = @item_window1.max_item_id
- max_weapon2_id = @item_window2.max_item_id
- max_armor2_id = @item_window3.max_item_id
- max_armor3_id = @item_window4.max_item_id
- max_armor4_id = @item_window5.max_item_id
- max_armor5_id = @item_window6.max_item_id
- max_armor6_id = @item_window7.max_item_id
- # 最強装備执行
- @actor.equip(0, max_weapon_id)
- @actor.equip(1, max_weapon2_id)
- @actor.equip(2, max_armor2_id)
- @actor.equip(3, max_armor3_id)
- @actor.equip(4, max_armor4_id)
- @actor.equip(5, max_armor5_id)
- @actor.equip(6, max_armor6_id)
- elsif # 最強装備的取得
- max_weapon_id = @item_window1.max_item_id
- max_armor1_id = @item_window2.max_item_id
- max_armor2_id = @item_window3.max_item_id
- max_armor3_id = @item_window4.max_item_id
- max_armor4_id = @item_window5.max_item_id
- max_armor5_id = @item_window6.max_item_id
- max_armor6_id = @item_window7.max_item_id
- # 最強装備执行
- @actor.equip(0, max_weapon_id)
- @actor.equip(1, max_armor1_id)
- @actor.equip(2, max_armor2_id)
- @actor.equip(3, max_armor3_id)
- @actor.equip(4, max_armor4_id)
- @actor.equip(5, max_armor5_id)
- @actor.equip(6, max_armor6_id)
- end
- @right_window.refresh
- @left_window.refresh
- @item_window1.refresh
- @item_window2.refresh
- @item_window3.refresh
- @item_window4.refresh
- @item_window5.refresh
- @item_window6.refresh
- return
- =end
- when 1
- # 音效演奏
- $game_system.se_play($data_system.cancel_se)
- # 画面切换
- $scene = Scene_Menu.new(2)
- return
- end
- end
- # 按下R的场合
- if Input.trigger?(Input::R)
- # 音效演奏
- $game_system.se_play($data_system.cursor_se)
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 画面切换
- $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
- return
- end
- # 按下L的场合
- if Input.trigger?(Input::L)
- # 音效演奏
- $game_system.se_play($data_system.cursor_se)
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 画面切换
- $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新右边窗口
- #--------------------------------------------------------------------------
- def update_right
- # 按下B的场合
- if Input.trigger?(Input::B)
- # 音效演奏
- $game_system.se_play($data_system.cancel_se)
- @right_window.active = false
- @command_window.active = true
- @right_window.index = -1
- @command_window.index = 0
- return
- end
- # 按下C的场合
- if Input.trigger?(Input::C)
- # 装備固定时
- if @actor.equip_fix?(@right_window.index)
- # 音效演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 音效演奏
- $game_system.se_play($data_system.decision_se)
- @right_window.active = false
- @item_window.active = true
- @item_window.index = 0
- return
- end
- # 按下R的场合
- if Input.trigger?(Input::R)
- # 音效演奏
- $game_system.se_play($data_system.cursor_se)
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 画面切换
- $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
- return
- end
- # 按下L的场合
- if Input.trigger?(Input::L)
- # 音效演奏
- $game_system.se_play($data_system.cursor_se)
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 画面切换
- $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新物品
- #--------------------------------------------------------------------------
- def update_item
- # 按下B的场合
- if Input.trigger?(Input::B)
- # 音效演奏
- $game_system.se_play($data_system.cancel_se)
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- return
- end
- # 按下C的场合
- if Input.trigger?(Input::C)
- # 音效演奏
- $game_system.se_play($data_system.equip_se)
- # アイテムウィンドウで現在選択されているデータを取得
- item = @item_window.item
- # --- ここから変更部分 ---
- # 装備を変更
- # @actor.equip(@right_window.index, item == nil ? 0 : item.id)
- @actor.equip(equip_type(@right_window.index, item), item == nil ? 0 : item.id)
- @actor.equip(@right_window.index, item == nil ? 0 : item.id)
- # --- 変更部分終わり ---
- # ライトウィンドウをアクティブ化
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- # 刷新
- @right_window.refresh
- # --- ここから変更部分 ---
- # めんどくさいのですべてのウィンドウをリフレッシュ
- @item_window1.refresh
- @item_window2.refresh
- @item_window3.refresh
- @item_window4.refresh
- @item_window5.refresh
- @item_window6.refresh
- @item_window7.refresh
- # --- 変更部分終わり ---
- return
- end
-
- end
-
- # --- ここから追加部分 ---
- #--------------------------------------------------------------------------
- # ● 二刀流用の装備部位取得
- #--------------------------------------------------------------------------
- def equip_type(index, item)
- return index * (item.is_a?(RPG::Armor) ? 1 : -1)
- end
- # --- 追加部分終わり ---
- end
复制代码 |
|