赞 | 1 |
VIP | 60 |
好人卡 | 27 |
积分 | 6 |
经验 | 39775 |
最后登录 | 2023-11-29 |
在线时间 | 2271 小时 |
Lv2.观梦者 (暗夜天使) 万兽
- 梦石
- 0
- 星屑
- 597
- 在线时间
- 2271 小时
- 注册时间
- 2006-11-4
- 帖子
- 4868

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
RT
本人不是很懂代码,弄来弄去就是不行,实在没办法在向大家求助,
希望哪位可以把整合好的范例发给
要求整合后夏娜的菜单功能不变,窗口也不变,只是把套装的脚本改一下.
这个是套装的代码.
- module K_EQUIP
- #17是 装备属性
- # [0,0,0,0,1]是套装位置 有的为 0 没有的为1 顺序依次是 武器 盾 盔 甲 饰品
- # 后面的 [0,500],[1,500] 0和1为附加属性 0-最大生命
- # 1-最大魔法值 2-力量 3- 灵巧 4-速度 5-魔力
- # 500 是增加量
- KE = {17 => [[0,0,0,0,1] , [0,500],[1,500]] , 18 => [[0,1,1,1,0], [2,100],[3,100],[5,100]] }
- #装备套装提示音效
- ON = "Audio/Se/055-Right01"
- #卸下套装提示音效
- OFF = "Audio/Se/058-Wrong02"
-
- #UP =
- end
-
- class Game_Actor < Game_Battler
- attr_accessor :on_equip
- alias ksetup setup
- def setup(actor_id)
- ksetup(actor_id)
- @on_equip = {}
- end
- end
- #==============================================================================
- # ■ Window_EquipLeft
- #------------------------------------------------------------------------------
- # 装备画面的、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipLeft < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 64, 272, 192)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- #kk
- self.contents.font.color = system_color
- draw_actor_level(@actor, 4, 32)
- draw_actor_parameter(@actor, 4, 64, 0)
- draw_actor_parameter(@actor, 4, 96, 1)
- draw_actor_parameter(@actor, 4, 128, 2)
- if @new_atk != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 64, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 96, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 128, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 变更装备后的能力值设置
- # new_atk : 变更装备后的攻击力
- # new_pdef : 变更装备后的物理防御
- # new_mdef : 变更装备后的魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef)
- if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- refresh
- end
- end
- end
- ######################################################################################
- #==============================================================================
- # ■ Scene_Equip
- #------------------------------------------------------------------------------
- # 处理装备画面的类。
- #==============================================================================
- class Scene_Equip
-
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- # equip_index : 装备索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, equip_index = 0)
- @actor_index = actor_index
- @equip_index = equip_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 获取角色
- @actor = $game_party.actors[@actor_index]
- # 生成窗口
- @help_window = Window_Help.new
- @left_window = Window_EquipLeft.new(@actor)
- @right_window = Window_EquipRight.new(@actor)
- @item_window1 = Window_EquipItem.new(@actor, 0)
- @item_window2 = Window_EquipItem.new(@actor, 1)
- @item_window3 = Window_EquipItem.new(@actor, 2)
- @item_window4 = Window_EquipItem.new(@actor, 3)
- @item_window5 = Window_EquipItem.new(@actor, 4)
- # 关联帮助窗口
- @right_window.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
- # 设置光标位置
- @right_window.index = @equip_index
- refresh
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话的就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @help_window.dispose
- @left_window.dispose
- @right_window.dispose
- @item_window1.dispose
- @item_window2.dispose
- @item_window3.dispose
- @item_window4.dispose
- @item_window5.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- # 设置物品窗口的可视状态
- @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)
- # 获取当前装备中的物品
- item1 = @right_window.item
- # 设置当前的物品窗口到 @item_window
- case @right_window.index
- 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
- end
- # 右窗口被激活的情况下
- if @right_window.active
- # 删除变更装备后的能力
- @left_window.set_new_parameters(nil, nil, nil)
- end
- # 物品窗口被激活的情况下
- if @item_window.active
- # 获取现在选中的物品
- item2 = @item_window.item
- # 变更装备
- last_hp = @actor.hp
- last_sp = @actor.sp
- @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
-
-
-
- # 获取变更装备后的能力值
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- # 返回到装备
-
-
- @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)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @left_window.update
- @right_window.update
- @item_window.update
- refresh
- # 右侧窗口被激活的情况下: 调用 update_right
- if @right_window.active
- update_right
- return
- end
- # 物品窗口被激活的情况下: 调用 update_item
- if @item_window.active
- update_item
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (右侧窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_right
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
-
- $scene = Scene_Menu.new(2)
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 固定装备的情况下
- if @actor.equip_fix?(@right_window.index)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $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)
- # 演奏光标 SE
- $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)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $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)
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (物品窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_item
- for k in K_EQUIP::KE.keys
- if @actor.weapon_id != 0
- K_EQUIP::KE[k][0][0] = 1 if $data_weapons[@actor.weapon_id].element_set.include?(k)
- end
- if @actor.armor1_id != 0
- K_EQUIP::KE[k][0][1] = 1 if $data_armors[@actor.armor1_id].guard_element_set.include?(k)
- end
- if @actor.armor2_id != 0
- K_EQUIP::KE[k][0][2] = 1 if $data_armors[@actor.armor2_id].guard_element_set.include?(k)
- end
- if @actor.armor3_id != 0
- K_EQUIP::KE[k][0][3] = 1 if $data_armors[@actor.armor3_id].guard_element_set.include?(k)
- end
- if @actor.armor4_id != 0
- K_EQUIP::KE[k][0][4] = 1 if $data_armors[@actor.armor4_id].guard_element_set.include?(k)
- end
- end
-
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $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)
- # 演奏装备 SE
- $game_system.se_play($data_system.equip_se)
- # 获取物品窗口现在选择的装备数据
- item1 = @right_window.item
- item = @item_window.item
- # 变更装备
- @actor.equip(@right_window.index, item == nil ? 0 : item.id)
- for k in K_EQUIP::KE.keys
- if item1.is_a?(RPG::Weapon)
- if $data_weapons[item1.id].element_set.include?(k)
- K_EQUIP::KE[k][0][0] = 0
- if $game_party.actors[@actor_index].on_equip[k]
- for j in 1..K_EQUIP::KE[k].size - 1
- case K_EQUIP::KE[k][j][0]
- when 0
- @actor.maxhp -= K_EQUIP::KE[k][j][1]
- when 1
- @actor.maxsp -= K_EQUIP::KE[k][j][1]
- when 2
- @actor.str -= K_EQUIP::KE[k][j][1]
- when 3
- @actor.dex -= K_EQUIP::KE[k][j][1]
- when 4
- @actor.agi -= K_EQUIP::KE[k][j][1]
- when 5
- @actor.int -= K_EQUIP::KE[k][j][1]
- end
- end
- Audio.se_play(K_EQUIP::OFF)
- $game_party.actors[@actor_index].on_equip[k] = false
- end
- end
- end
- if item1.is_a?(RPG::Armor)
- if $data_armors[item1.id].guard_element_set.include?(k)
- if item != nil
- case item.kind
- when 0
- K_EQUIP::KE[k][0][1] = 0
- when 1
- K_EQUIP::KE[k][0][2] = 0
- when 2
- K_EQUIP::KE[k][0][3] = 0
- when 3
- K_EQUIP::KE[k][0][4] = 0
- end
- end
- if $game_party.actors[@actor_index].on_equip[k]
-
- for j in 1..K_EQUIP::KE[k].size - 1
- case K_EQUIP::KE[k][j][0]
- when 0
- @actor.maxhp -= K_EQUIP::KE[k][j][1]
- when 1
- @actor.maxsp -= K_EQUIP::KE[k][j][1]
- when 2
- @actor.str -= K_EQUIP::KE[k][j][1]
- when 3
- @actor.dex -= K_EQUIP::KE[k][j][1]
- when 4
- @actor.agi -= K_EQUIP::KE[k][j][1]
- when 5
- @actor.int -= K_EQUIP::KE[k][j][1]
- end
- end
-
- Audio.se_play(K_EQUIP::OFF)
- $game_party.actors[@actor_index].on_equip[k] = false
- end
- end
- end
-
-
- if item.is_a?(RPG::Weapon)
- if $data_weapons[item.id].element_set.include?(k)
- K_EQUIP::KE[k][0][0] = 1
-
- if !K_EQUIP::KE[k][0].include?(0) and !$game_party.actors[@actor_index].on_equip[k]
- for j in 1..K_EQUIP::KE[k].size - 1
- case K_EQUIP::KE[k][j][0]
- when 0
- @actor.maxhp += K_EQUIP::KE[k][j][1]
- when 1
- @actor.maxsp += K_EQUIP::KE[k][j][1]
- when 2
- @actor.str += K_EQUIP::KE[k][j][1]
- when 3
- @actor.dex += K_EQUIP::KE[k][j][1]
- when 4
- @actor.agi += K_EQUIP::KE[k][j][1]
- when 5
- @actor.int += K_EQUIP::KE[k][j][1]
- end
- end
- Audio.se_play(K_EQUIP::ON)
- $game_party.actors[@actor_index].on_equip[k] = true
-
- end
- end
- end
- if item.is_a?(RPG::Armor)
- if $data_armors[item.id].guard_element_set.include?(k)
- if item != nil
- case item.kind
- when 0
- K_EQUIP::KE[k][0][1] = 1
- when 1
- K_EQUIP::KE[k][0][2] = 1
- when 2
- K_EQUIP::KE[k][0][3] = 1
- when 3
- K_EQUIP::KE[k][0][4] = 1
- end
- end
- if !K_EQUIP::KE[k][0].include?(0) and !$game_party.actors[@actor_index].on_equip[k]
- for j in 1..K_EQUIP::KE[k].size - 1
- case K_EQUIP::KE[k][j][0]
- when 0
- @actor.maxhp += K_EQUIP::KE[k][j][1]
- when 1
- @actor.maxsp += K_EQUIP::KE[k][j][1]
- when 2
- @actor.str += K_EQUIP::KE[k][j][1]
- when 3
- @actor.dex += K_EQUIP::KE[k][j][1]
- when 4
- @actor.agi += K_EQUIP::KE[k][j][1]
- when 5
- @actor.int += K_EQUIP::KE[k][j][1]
- end
- end
- Audio.se_play(K_EQUIP::ON)
- $game_party.actors[@actor_index].on_equip[k] = true
- end
- end
- end
-
- end
- # 激活右侧窗口
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- # 再生成右侧窗口、物品窗口的内容
- @right_window.refresh
- @item_window.refresh
- return
- end
- end
- end
复制代码
夏娜的菜单
http://rpg.blue/web/ftppic/200604/菜单.rar
余下的就麻烦各位了.
|
|