赞 | 204 |
VIP | 13 |
好人卡 | 7 |
积分 | 122 |
经验 | 52899 |
最后登录 | 2021-6-29 |
在线时间 | 4435 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 12157
- 在线时间
- 4435 小时
- 注册时间
- 2014-4-11
- 帖子
- 5955
|
和 ★商店全能力的显示 脚本有冲突。同时使用的时候特技窗口的上面解说部分窗口会没掉。装备窗口右上角装备栏窗口会没掉。窗口里面的内容在,就是底色和边框没了。
#============================================================================== # ■ Window_ShopStatus #------------------------------------------------------------------------------ # 商店画面、显示物品所持数与角色装备的窗口。 #============================================================================== class Window_ShopStatus < Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(368, 128, 272, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 16 @item = nil refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear if @item == nil return end case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end self.contents.font.color = system_color self.contents.draw_text(4, 0, 200, 32, "所持数") self.contents.font.color = normal_color self.contents.draw_text(204, 0, 32, 32, number.to_s, 2) if @item.is_a?(RPG::Item) return end # 添加装备品信息 for i in 0...$game_party.actors.size # 获取角色 actor = $game_party.actors[i] # 可以装备为普通文字颜色、不能装备设置为无效文字颜色 if actor.equippable?(@item) self.contents.font.color = normal_color else next self.contents.font.color = disabled_color end # 描绘角色名字 self.contents.draw_text(0, 66 + 55 * i, 120, 32, actor.name) # 获取当前的装备品 if @item.is_a?(RPG::Weapon) item1 = $data_weapons[actor.weapon_id] elsif @item.kind == 0 item1 = $data_armors[actor.armor1_id] elsif @item.kind == 1 item1 = $data_armors[actor.armor2_id] elsif @item.kind == 2 item1 = $data_armors[actor.armor3_id] else item1 = $data_armors[actor.armor4_id] end # 可以装备的情况 #if actor.equippable?(@item) # 武器的情况 i += 1 if @item.is_a?(RPG::Weapon) atk1 = item1 != nil ? item1.atk : 0 atk2 = @item != nil ? @item.atk : 0 pdef1 = item1 != nil ? item1.pdef : 0 pdef2 = @item != nil ? @item.pdef : 0 str1 = item1 != nil ? item1.str_plus : 0 str2 = @item != nil ? @item.str_plus : 0 dex1 = item1 != nil ? item1.dex_plus : 0 dex2 = @item != nil ? @item.dex_plus : 0 agi1 = item1 != nil ? item1.agi_plus : 0 agi2 = @item != nil ? @item.agi_plus : 0 int1 = item1 != nil ? item1.int_plus : 0 int2 = @item != nil ? @item.int_plus : 0 [url=home.php?mod=space&uid=101599]@atk[/url] = atk2 - atk1 @str = str2 - str1 @dex = dex2 - dex1 [url=home.php?mod=space&uid=6136]@agi[/url] = agi2 - agi1 @int = int2 - int1 @pdef = pdef2 - pdef1 self.contents.draw_text(80*0, 32+55 * i, 112, 32,"攻击",0) self.contents.draw_text(80*1, 32+55 * i, 112, 32,"力量",0) self.contents.draw_text(80*2, 32+55 * i, 112, 32,"速度",0) self.contents.draw_text(80*0, 32+55 * i+16, 112, 32,"敏捷",0) self.contents.draw_text(80*1, 32+55 * i+16, 112, 32,"魔力",0) self.contents.draw_text(80*2, 32+55 * i+16, 112, 32,"防御",0) #--------------------------------------------------------------------- q=40-10 if atk2 >= atk1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if str2 >= str1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if dex2 >= dex1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if agi2 >= agi1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- if int2 >= int1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- if pdef2 >= pdef1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- self.contents.font.color = Color.new(159,251,162,255) q=50 self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,@atk.abs.to_s,0) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,@str.abs.to_s,0) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,@dex.abs.to_s,0) #--------------------------------------------------------------------- self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,@agi.abs.to_s,0) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,@int.abs.to_s,0) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,@pdef.abs.to_s,0) end # 防具的情况 if @item.is_a?(RPG::Armor) str1 = item1 != nil ? item1.str_plus : 0 str2 = @item != nil ? @item.str_plus : 0 dex1 = item1 != nil ? item1.dex_plus : 0 dex2 = @item != nil ? @item.dex_plus : 0 agi1 = item1 != nil ? item1.agi_plus : 0 agi2 = @item != nil ? @item.agi_plus : 0 int1 = item1 != nil ? item1.int_plus : 0 int2 = @item != nil ? @item.int_plus : 0 pdef1 = item1 != nil ? item1.pdef : 0 pdef2 = @item != nil ? @item.pdef : 0 mdef1 = item1 != nil ? item1.mdef : 0 mdef2 = @item != nil ? @item.mdef : 0 @str = str2 - str1 @dex = dex2 - dex1 @agi = agi2 - agi1 @int = int2 - int1 @pdef = pdef2 - pdef1 @mdef = mdef2 - mdef1 self.contents.draw_text(80*0, 32+55 * i, 112, 32,"力量",0) self.contents.draw_text(80*1, 32+55 * i, 112, 32,"速度",0) self.contents.draw_text(80*2, 32+55 * i, 112, 32,"敏捷",0) self.contents.draw_text(80*0, 32+55 * i+16, 112, 32,"魔力",0) self.contents.draw_text(80*1, 32+55 * i+16, 112, 32,"防御",0) self.contents.draw_text(80*2, 32+55 * i+16, 112, 32,"魔御",0) #--------------------------------------------------------------------- q=30 if str2 >= str1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if dex2 >= dex1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if agi2 >= agi1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↓",0) end #--------------------------------------------------------------------- if int2 >= int1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- q=40-10 if pdef2 >= pdef1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- if mdef2 >= mdef1 self.contents.font.color = Color.new(159,251,162,255) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↑",0) else self.contents.font.color = Color.new(255,0,0,255) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↓",0) end #--------------------------------------------------------------------- self.contents.font.color = Color.new(159,251,162,255) q=50 self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,@str.abs.to_s,0) self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,@dex.abs.to_s,0) self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,@agi.abs.to_s,0) #--------------------------------------------------------------------- self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,@int.abs.to_s,0) self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,@pdef.abs.to_s,0) self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,@mdef.abs.to_s,0) end end self.contents.font.color = normal_color i -= 1 #self.contents.font.size = 22 # 描绘物品 if item1 != nil x = 4 y = 64 + 64 * i + 32 #bitmap = RPG::Cache.icon(item1.icon_name) #opacity = self.contents.font.color == normal_color ? 255 : 128 #self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) #self.contents.draw_text(x + 28, y, 212, 32, item1.name) end end #end #-------------------------------------------------------------------------- # ● 设置物品 # item : 新的物品 #-------------------------------------------------------------------------- def item=(item) if @item != item @item = item refresh end end end
#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(368, 128, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 16
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "所持数")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
return
end
# 添加装备品信息
for i in 0...$game_party.actors.size
# 获取角色
actor = $game_party.actors[i]
# 可以装备为普通文字颜色、不能装备设置为无效文字颜色
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
next
self.contents.font.color = disabled_color
end
# 描绘角色名字
self.contents.draw_text(0, 66 + 55 * i, 120, 32, actor.name)
# 获取当前的装备品
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
# 可以装备的情况
#if actor.equippable?(@item)
# 武器的情况
i += 1
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item.pdef : 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item.str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item.dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item.agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item.int_plus : 0
[url=home.php?mod=space&uid=101599]@atk[/url] = atk2 - atk1
@str = str2 - str1
@dex = dex2 - dex1
[url=home.php?mod=space&uid=6136]@agi[/url] = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
self.contents.draw_text(80*0, 32+55 * i, 112, 32,"攻击",0)
self.contents.draw_text(80*1, 32+55 * i, 112, 32,"力量",0)
self.contents.draw_text(80*2, 32+55 * i, 112, 32,"速度",0)
self.contents.draw_text(80*0, 32+55 * i+16, 112, 32,"敏捷",0)
self.contents.draw_text(80*1, 32+55 * i+16, 112, 32,"魔力",0)
self.contents.draw_text(80*2, 32+55 * i+16, 112, 32,"防御",0)
#---------------------------------------------------------------------
q=40-10
if atk2 >= atk1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if str2 >= str1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if dex2 >= dex1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if agi2 >= agi1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if int2 >= int1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if pdef2 >= pdef1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
self.contents.font.color = Color.new(159,251,162,255)
q=50
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,@atk.abs.to_s,0)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,@str.abs.to_s,0)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,@dex.abs.to_s,0)
#---------------------------------------------------------------------
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,@agi.abs.to_s,0)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,@int.abs.to_s,0)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,@pdef.abs.to_s,0)
end
# 防具的情况
if @item.is_a?(RPG::Armor)
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item.str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item.dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item.agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item.int_plus : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
mdef2 = @item != nil ? @item.mdef : 0
@str = str2 - str1
@dex = dex2 - dex1
@agi = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
@mdef = mdef2 - mdef1
self.contents.draw_text(80*0, 32+55 * i, 112, 32,"力量",0)
self.contents.draw_text(80*1, 32+55 * i, 112, 32,"速度",0)
self.contents.draw_text(80*2, 32+55 * i, 112, 32,"敏捷",0)
self.contents.draw_text(80*0, 32+55 * i+16, 112, 32,"魔力",0)
self.contents.draw_text(80*1, 32+55 * i+16, 112, 32,"防御",0)
self.contents.draw_text(80*2, 32+55 * i+16, 112, 32,"魔御",0)
#---------------------------------------------------------------------
q=30
if str2 >= str1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if dex2 >= dex1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if agi2 >= agi1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if int2 >= int1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
q=40-10
if pdef2 >= pdef1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
if mdef2 >= mdef1
self.contents.font.color = Color.new(159,251,162,255)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↑",0)
else
self.contents.font.color = Color.new(255,0,0,255)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,"↓",0)
end
#---------------------------------------------------------------------
self.contents.font.color = Color.new(159,251,162,255)
q=50
self.contents.draw_text(80*0+q, 32+55 * i, 112, 32,@str.abs.to_s,0)
self.contents.draw_text(80*1+q, 32+55 * i, 112, 32,@dex.abs.to_s,0)
self.contents.draw_text(80*2+q, 32+55 * i, 112, 32,@agi.abs.to_s,0)
#---------------------------------------------------------------------
self.contents.draw_text(80*0+q, 32+55 * i+16, 112, 32,@int.abs.to_s,0)
self.contents.draw_text(80*1+q, 32+55 * i+16, 112, 32,@pdef.abs.to_s,0)
self.contents.draw_text(80*2+q, 32+55 * i+16, 112, 32,@mdef.abs.to_s,0)
end
end
self.contents.font.color = normal_color
i -= 1
#self.contents.font.size = 22
# 描绘物品
if item1 != nil
x = 4
y = 64 + 64 * i + 32
#bitmap = RPG::Cache.icon(item1.icon_name)
#opacity = self.contents.font.color == normal_color ? 255 : 128
#self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
#self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
#end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 新的物品
#--------------------------------------------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
end
|
|