赞 | 14 |
VIP | 0 |
好人卡 | 0 |
积分 | 6 |
经验 | 44782 |
最后登录 | 2022-9-28 |
在线时间 | 797 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 596
- 在线时间
- 797 小时
- 注册时间
- 2014-7-1
- 帖子
- 578
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 jiushiainilip19 于 2017-12-9 13:20 编辑
414行开始那里,我设定是变量大于多少开启装备位置
这3个装备是一样的 没有区分头和盔类的,
我这样设定后只要条件变量大于任何一个都会导致全部都开启
求帮忙!!!
#============================================================================== # 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息 #============================================================================== #============================================================================== # ■ Window_Base #------------------------------------------------------------------------------ # 游戏中全部窗口的超级类。 #============================================================================== class Window_Base < Window def up_color return Color.new(255, 0, 0) end def down_color return Color.new(0, 255, 0) end #-------------------------------------------------------------------------- # ● 描绘能力值 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 # type : 能力值种类 (0~6) #-------------------------------------------------------------------------- def draw_actor_parameter(actor, x, y, type) case type when 0 parameter_name = ""#$data_system.words.atk parameter_value = actor.atk when 1 parameter_name = ""#$data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = ""#$data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = ""#$data_system.words.str parameter_value = actor.str when 4 parameter_name = ""#$data_system.words.dex parameter_value = actor.dex when 5 parameter_name = ""#$data_system.words.agi parameter_value = actor.agi when 6 parameter_name = ""#$data_system.words.int parameter_value = actor.int ############################################################### when 7 parameter_name = "" parameter_value = actor.eva end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end end #============================================================================== # ■ Window_EquipLeft #------------------------------------------------------------------------------ # 装备画面的、显示角色能力值变化的窗口。 #============================================================================== class Window_EquipLeft < Window_Base UP_ICON = "橙宝石小" DOWN_ICON = "047-Skill04" #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) #super(0, 64, 272, 480) super(0, 0, 300, 310) self.y = 0 self.contents = Bitmap.new(width - 32, height - 32) @actor = actor self.contents.font.size = 20 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear #draw_actor_name(@actor, 10, 280) draw_actor_level(@actor,90, 280) draw_actor_hp(@actor, 10,0) self.contents.draw_text(10, 40,100, 32, "攻击:") draw_actor_parameter(@actor, x-50, 40, 0) self.contents.draw_text(10, 70,100, 32, "防御:") draw_actor_parameter(@actor, x-50, 70, 1) #self.contents.draw_text(10,100,60, 32, "暴伤:") #draw_actor_parameter(@actor, x-50, 100, 2) self.contents.draw_text(10,100,100, 32, "力道:") draw_actor_parameter(@actor, x-50, 100, 3) self.contents.draw_text(10,130,100, 32, "敏捷:") draw_actor_parameter(@actor, x-50, 130, 4) self.contents.draw_text(10,160,100, 32, "速度:") draw_actor_parameter(@actor, x-50, 160, 5) self.contents.draw_text(10,190,100, 32, "内劲:") draw_actor_parameter(@actor, x-50, 190, 6) self.contents.draw_text(10,220,100, 32, "暴击:") self.contents.draw_text(75,220,60, 32, @actor.crt.to_s) self.contents.draw_text(10,250,100, 32, "暴伤:") self.contents.draw_text(75,250,60, 32, @actor.maxcrt.to_s) if @new_atk != nil if @new_atk > @actor.atk self.contents.font.color = up_color self.contents.draw_text(140,40,100, 32, "升→") self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2) elsif @new_atk < @actor.atk self.contents.font.color = down_color self.contents.draw_text(140,40,100, 32, "低→") self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2) end end if @new_pdef != nil if @new_pdef > @actor.pdef self.contents.font.color = up_color self.contents.draw_text(140,70,100, 32, "升→") self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2) elsif @new_pdef < @actor.pdef self.contents.font.color = down_color self.contents.draw_text(140,70,100, 32, "低→") self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2) end end if @new_mdef != nil if @new_mdef > @actor.mdef self.contents.font.color = up_color self.contents.draw_text(140,70,100, 32, "升→") self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2) elsif @new_mdef < @actor.mdef self.contents.font.color = down_color self.contents.draw_text(140,70,100, 32, "低→") self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2) end end if @new_str != nil if @new_str > @actor.str self.contents.font.color = up_color self.contents.draw_text(140,100,100, 32, "升→") self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2) elsif @new_str < @actor.str self.contents.font.color = down_color self.contents.draw_text(140,100,100, 32, "低→") self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2) end end if @new_dex != nil if @new_dex > @actor.dex self.contents.font.color = up_color self.contents.draw_text(140,130,100, 32, "升→") self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2) elsif @new_dex < @actor.dex self.contents.font.color = down_color self.contents.draw_text(140,130,100, 32, "低→") self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2) end end if @new_agi != nil if @new_agi > @actor.agi self.contents.font.color = up_color self.contents.draw_text(140,160,100, 32, "升→") self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2) elsif @new_agi < @actor.agi self.contents.font.color = down_color self.contents.draw_text(140,160,100, 32, "低→") self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2) end end if @new_int != nil if @new_int > @actor.int self.contents.font.color = up_color self.contents.draw_text(140,190,100, 32, "升→") self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2) elsif @new_int < @actor.int self.contents.font.color = down_color self.contents.draw_text(140,190,100, 32, "低→") self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2) end end if @new_crt != nil if @new_crt > @actor.crt self.contents.font.color = up_color self.contents.draw_text(140,220,100, 32, "升→") self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2) elsif @new_crt < @actor.crt self.contents.font.color = down_color self.contents.draw_text(140,220,100, 32, "低→") self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2) end end if @new_maxcrt != nil if @new_maxcrt > @actor.maxcrt self.contents.font.color = up_color self.contents.draw_text(140,250,100, 32, "升→") self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2) elsif @new_maxcrt < @actor.maxcrt self.contents.font.color = down_color self.contents.draw_text(140,250,100, 32, "低→") self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2) end 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,new_crt,new_maxcrt) 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 or @new_crt != new_crt or @new_maxcrt != new_maxcrt @new_atk = new_atk @new_pdef = new_pdef @new_mdef = new_mdef @new_eva = new_eva @new_str = new_str @new_dex = new_dex @new_agi = new_agi @new_int = new_int @new_crt = new_crt @new_maxcrt = new_maxcrt refresh end end end #============================================================================== # ■ Window_EquipItem #------------------------------------------------------------------------------ # 装备画面、显示浏览变更装备的候补物品的窗口。 #============================================================================== class Window_EquipItem < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 # equip_type : 装备部位 (0~3) #装备栏下的显示高低 #-------------------------------------------------------------------------- def initialize(actor, equip_type) super(300, 380, 340, 100) @actor = actor @equip_type = equip_type @column_max = 1 refresh self.active = false self.index = -1 #self.z = 9998 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 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 @help_window = Window_Help_Self.new(@actor)#错误 @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) @item_window6 = Window_EquipItem.new(@actor, 5) @item_window7 = Window_EquipItem.new(@actor, 6) @item_window8 = Window_EquipItem.new(@actor, 7) @item_window9 = Window_EquipItem.new(@actor, 8) @item_window10 = Window_EquipItem.new(@actor, 9) @item_window11 = Window_EquipItem.new(@actor, 10) # 关联帮助窗口 @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 @item_window6.help_window = @help_window @item_window7.help_window = @help_window @item_window8.help_window = @help_window @item_window9.help_window = @help_window @item_window10.help_window = @help_window @item_window11.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 @item_window6.dispose @item_window7.dispose @item_window8.dispose @item_window9.dispose @item_window10.dispose @item_window11.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) @item_window6.visible = (@right_window.index == 5) @item_window7.visible = (@right_window.index == 6) @item_window8.visible = (@right_window.index == 7) @item_window9.visible = (@right_window.index == 8 or @right_window.index == 9 or @right_window.index == 10) # 获取当前装备中的物品 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 when 5 @item_window = @item_window6 when 6 @item_window = @item_window7 when 7 @item_window = @item_window8 when 8 #条件限制开启装备位置 if @actor.upstar >= 1 @item_window = @item_window9 end when 9 if @actor.upstar >= 2 @item_window = @item_window9 end when 10 if @actor.upstar >= 3 @item_window = @item_window9 end end # 右窗口被激活的情况下 if @right_window.active # 删除变更装备后的能力 ############################################################### @left_window.set_new_parameters(nil, nil, 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 @actor.equip(@right_window.index, 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 new_crt = @actor.crt new_maxcrt = @actor.maxcrt # 返回到装备 @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, new_crt, new_maxcrt) end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @left_window.update @right_window.update @item_window.update # @help1_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 #★★★★★★★★★★★★★★★★ if @right_window.item==nil @help_window.visible=false else @help_window.visible=true end #★★★★★★★★★★★★★★★★ # 按下 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 #★★★★★★★★★★★★★★★★ if @item_window.item==nil @help_window.visible=false else @help_window.visible=true 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) # 获取物品窗口现在选择的装备数据 item = @item_window.item # 变更装备 @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_window.refresh return end end end
#==============================================================================
# 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = ""#$data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = ""#$data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = ""#$data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = ""#$data_system.words.str
parameter_value = actor.str
when 4
parameter_name = ""#$data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = ""#$data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = ""#$data_system.words.int
parameter_value = actor.int
###############################################################
when 7
parameter_name = ""
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "橙宝石小"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
#super(0, 64, 272, 480)
super(0, 0, 300, 310)
self.y = 0
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
self.contents.font.size = 20
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
#draw_actor_name(@actor, 10, 280)
draw_actor_level(@actor,90, 280)
draw_actor_hp(@actor, 10,0)
self.contents.draw_text(10, 40,100, 32, "攻击:")
draw_actor_parameter(@actor, x-50, 40, 0)
self.contents.draw_text(10, 70,100, 32, "防御:")
draw_actor_parameter(@actor, x-50, 70, 1)
#self.contents.draw_text(10,100,60, 32, "暴伤:")
#draw_actor_parameter(@actor, x-50, 100, 2)
self.contents.draw_text(10,100,100, 32, "力道:")
draw_actor_parameter(@actor, x-50, 100, 3)
self.contents.draw_text(10,130,100, 32, "敏捷:")
draw_actor_parameter(@actor, x-50, 130, 4)
self.contents.draw_text(10,160,100, 32, "速度:")
draw_actor_parameter(@actor, x-50, 160, 5)
self.contents.draw_text(10,190,100, 32, "内劲:")
draw_actor_parameter(@actor, x-50, 190, 6)
self.contents.draw_text(10,220,100, 32, "暴击:")
self.contents.draw_text(75,220,60, 32, @actor.crt.to_s)
self.contents.draw_text(10,250,100, 32, "暴伤:")
self.contents.draw_text(75,250,60, 32, @actor.maxcrt.to_s)
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.font.color = up_color
self.contents.draw_text(140,40,100, 32, "升→")
self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
elsif @new_atk < @actor.atk
self.contents.font.color = down_color
self.contents.draw_text(140,40,100, 32, "低→")
self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
end
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.font.color = up_color
self.contents.draw_text(140,70,100, 32, "升→")
self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
elsif @new_pdef < @actor.pdef
self.contents.font.color = down_color
self.contents.draw_text(140,70,100, 32, "低→")
self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
end
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.font.color = up_color
self.contents.draw_text(140,70,100, 32, "升→")
self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
elsif @new_mdef < @actor.mdef
self.contents.font.color = down_color
self.contents.draw_text(140,70,100, 32, "低→")
self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
end
end
if @new_str != nil
if @new_str > @actor.str
self.contents.font.color = up_color
self.contents.draw_text(140,100,100, 32, "升→")
self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
elsif @new_str < @actor.str
self.contents.font.color = down_color
self.contents.draw_text(140,100,100, 32, "低→")
self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
end
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.font.color = up_color
self.contents.draw_text(140,130,100, 32, "升→")
self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
elsif @new_dex < @actor.dex
self.contents.font.color = down_color
self.contents.draw_text(140,130,100, 32, "低→")
self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
end
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.font.color = up_color
self.contents.draw_text(140,160,100, 32, "升→")
self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
elsif @new_agi < @actor.agi
self.contents.font.color = down_color
self.contents.draw_text(140,160,100, 32, "低→")
self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
end
end
if @new_int != nil
if @new_int > @actor.int
self.contents.font.color = up_color
self.contents.draw_text(140,190,100, 32, "升→")
self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
elsif @new_int < @actor.int
self.contents.font.color = down_color
self.contents.draw_text(140,190,100, 32, "低→")
self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
end
end
if @new_crt != nil
if @new_crt > @actor.crt
self.contents.font.color = up_color
self.contents.draw_text(140,220,100, 32, "升→")
self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
elsif @new_crt < @actor.crt
self.contents.font.color = down_color
self.contents.draw_text(140,220,100, 32, "低→")
self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
end
end
if @new_maxcrt != nil
if @new_maxcrt > @actor.maxcrt
self.contents.font.color = up_color
self.contents.draw_text(140,250,100, 32, "升→")
self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
elsif @new_maxcrt < @actor.maxcrt
self.contents.font.color = down_color
self.contents.draw_text(140,250,100, 32, "低→")
self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
end
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,new_crt,new_maxcrt)
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 or @new_crt != new_crt or @new_maxcrt != new_maxcrt
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_crt = new_crt
@new_maxcrt = new_maxcrt
refresh
end
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3) #装备栏下的显示高低
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(300, 380, 340, 100)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
#self.z = 9998
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
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
@help_window = Window_Help_Self.new(@actor)#错误
@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)
@item_window6 = Window_EquipItem.new(@actor, 5)
@item_window7 = Window_EquipItem.new(@actor, 6)
@item_window8 = Window_EquipItem.new(@actor, 7)
@item_window9 = Window_EquipItem.new(@actor, 8)
@item_window10 = Window_EquipItem.new(@actor, 9)
@item_window11 = Window_EquipItem.new(@actor, 10)
# 关联帮助窗口
@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
@item_window6.help_window = @help_window
@item_window7.help_window = @help_window
@item_window8.help_window = @help_window
@item_window9.help_window = @help_window
@item_window10.help_window = @help_window
@item_window11.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
@item_window6.dispose
@item_window7.dispose
@item_window8.dispose
@item_window9.dispose
@item_window10.dispose
@item_window11.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)
@item_window6.visible = (@right_window.index == 5)
@item_window7.visible = (@right_window.index == 6)
@item_window8.visible = (@right_window.index == 7)
@item_window9.visible = (@right_window.index == 8 or @right_window.index == 9 or @right_window.index == 10)
# 获取当前装备中的物品
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
when 5
@item_window = @item_window6
when 6
@item_window = @item_window7
when 7
@item_window = @item_window8
when 8 #条件限制开启装备位置
if @actor.upstar >= 1
@item_window = @item_window9
end
when 9
if @actor.upstar >= 2
@item_window = @item_window9
end
when 10
if @actor.upstar >= 3
@item_window = @item_window9
end
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, 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
new_crt = @actor.crt
new_maxcrt = @actor.maxcrt
# 返回到装备
@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, new_crt, new_maxcrt)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@left_window.update
@right_window.update
@item_window.update
# @help1_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
#★★★★★★★★★★★★★★★★
if @right_window.item==nil
@help_window.visible=false
else
@help_window.visible=true
end
#★★★★★★★★★★★★★★★★
# 按下 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
#★★★★★★★★★★★★★★★★
if @item_window.item==nil
@help_window.visible=false
else
@help_window.visible=true
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)
# 获取物品窗口现在选择的装备数据
item = @item_window.item
# 变更装备
@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_window.refresh
return
end
end
end
class Window_EquipRight < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(300, 0, 340, 400) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($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]) @data.push($data_armors[@actor.armor7_id]) @data.push($data_armors[@actor.armor8_id]) @data.push($data_armors[@actor.armor9_id]) @data.push($data_armors[@actor.armor10_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(5, 32 * 4, 92, 32, $data_system.words.armor4) self.contents.draw_text(6, 32 * 5, 92, 32, "秘法") self.contents.draw_text(7, 32 * 6, 92, 32, "特器") self.contents.draw_text(8, 32 * 7, 92, 32, "功法") self.contents.draw_text(9, 32 * 8, 92, 32, "绝内") self.contents.draw_text(9, 32 * 9, 92, 32, "绝内") self.contents.draw_text(9, 32 * 10, 92, 32, "绝内") if @actor.upstar >= 1 self.contents.draw_text(60, 32 * 8, 92, 32, "") else self.contents.font.color = Color.new(255,1,1, 255) self.contents.draw_text(60, 32 * 8, 92, 32, "二星开启") end if @actor.upstar >= 2 self.contents.draw_text(60, 32 * 9, 92, 32, "") else self.contents.draw_text(60, 32 * 9, 92, 32, "三星开启") end if @actor.upstar >= 3 self.contents.draw_text(60, 32 * 10, 92, 32, "") else self.contents.draw_text(60, 32 * 10, 92, 32, "四星开启") end draw_item_name(@data[0], 50, 32 * 0) draw_item_name(@data[1], 50, 32 * 1) draw_item_name(@data[2], 50, 32 * 2) draw_item_name(@data[3], 50, 32 * 3) draw_item_name(@data[4], 50, 32 * 4) draw_item_name(@data[5], 50, 32 * 5) draw_item_name(@data[6], 50, 32 * 6) draw_item_name(@data[7], 50, 32 * 7) draw_item_name(@data[8], 50, 32 * 8) draw_item_name(@data[9], 50, 32 * 9) draw_item_name(@data[10], 50, 32 * 10) end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help @help_window.set_text(item) # @help_window.set_text(self.item == nil ? "" : self.item.description) @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max) end end
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(300, 0, 340, 400)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● 获取物品
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($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])
@data.push($data_armors[@actor.armor7_id])
@data.push($data_armors[@actor.armor8_id])
@data.push($data_armors[@actor.armor9_id])
@data.push($data_armors[@actor.armor10_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(5, 32 * 4, 92, 32, $data_system.words.armor4)
self.contents.draw_text(6, 32 * 5, 92, 32, "秘法")
self.contents.draw_text(7, 32 * 6, 92, 32, "特器")
self.contents.draw_text(8, 32 * 7, 92, 32, "功法")
self.contents.draw_text(9, 32 * 8, 92, 32, "绝内")
self.contents.draw_text(9, 32 * 9, 92, 32, "绝内")
self.contents.draw_text(9, 32 * 10, 92, 32, "绝内")
if @actor.upstar >= 1
self.contents.draw_text(60, 32 * 8, 92, 32, "")
else
self.contents.font.color = Color.new(255,1,1, 255)
self.contents.draw_text(60, 32 * 8, 92, 32, "二星开启")
end
if @actor.upstar >= 2
self.contents.draw_text(60, 32 * 9, 92, 32, "")
else
self.contents.draw_text(60, 32 * 9, 92, 32, "三星开启")
end
if @actor.upstar >= 3
self.contents.draw_text(60, 32 * 10, 92, 32, "")
else
self.contents.draw_text(60, 32 * 10, 92, 32, "四星开启")
end
draw_item_name(@data[0], 50, 32 * 0)
draw_item_name(@data[1], 50, 32 * 1)
draw_item_name(@data[2], 50, 32 * 2)
draw_item_name(@data[3], 50, 32 * 3)
draw_item_name(@data[4], 50, 32 * 4)
draw_item_name(@data[5], 50, 32 * 5)
draw_item_name(@data[6], 50, 32 * 6)
draw_item_name(@data[7], 50, 32 * 7)
draw_item_name(@data[8], 50, 32 * 8)
draw_item_name(@data[9], 50, 32 * 9)
draw_item_name(@data[10], 50, 32 * 10)
end
#--------------------------------------------------------------------------
# ● 刷新帮助文本
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item)
# @help_window.set_text(self.item == nil ? "" : self.item.description)
@help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
end
end
|
|