Project1
标题:
关于商店中的人物显示问题
[打印本页]
作者:
kangxi0109
时间:
2011-11-28 00:01
标题:
关于商店中的人物显示问题
在下用的是9人的队伍,商店的脚本...在黑暗圣剑里刮的...如图:
搜狗截图_2011-11-27_23-50-47.png
(677.77 KB, 下载次数: 0)
下载附件
保存到相册
2011-11-27 23:56 上传
无论怎么改都只显示4个人,请问怎么才能把其余的几个列出来?求方法。 dsu_plus_rewardpost_czw
作者:
皮卡星
时间:
2011-11-28 04:11
调整XY坐标= =||
作者:
小白玩家
时间:
2011-11-28 06:52
增加第5个人,第6个人,第7个人,第8个人, 第9个人的坐标
[[角色1x,y],[角色2x,y],[角色3x,y],[角色4x,y],
[角色5x,y],[角色6x,y],[角色7x,y],[角色8x,y],[角色9x,y]
]
当然角色1什么都不用填的,这里只是方便你看懂,中括号别扩错了
作者:
kangxi0109
时间:
2011-11-28 10:41
原脚本已经被在下改成了这个样子,貌似坐标都已经加了啊?#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
# ---------------------------------------
def up_color
return Color.new(0, 255, 0)
end
def down_color
return Color.new(255, 0, 0)
end
def initialize
super(250, 128, 390, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "黑体"
self.contents.font.size = 24
@item = nil
@sprite1 = nil
@sprite2 = nil
@sprite3 = nil
@sprite4 = nil
@sprite5 = nil
@sprite6 = nil
@sprite7 = nil
@sprite8 = nil
@sprite9 = nil
@walk = [false, false, false, false, false, false, false, false, false]
@count = 0
refresh
end
# ---------------------------------------
def refresh
self.contents.clear
if @sprite1 != nil
@sprite1.dispose
@sprite1 = nil
end
if @sprite2 != nil
@sprite2.dispose
@sprite2 = nil
end
if @sprite3 != nil
@sprite3.dispose
@sprite3 = nil
end
if @sprite4 != nil
@sprite4.dispose
@sprite4 = nil
end
if @sprite5 != nil
@sprite5.dispose
@sprite5 = nil
end
if @sprite6 != nil
@sprite6.dispose
@sprite6 = nil
end
if @sprite7 != nil
@sprite7.dispose
@sprite7 = nil
end
if @sprite8 != nil
@sprite8.dispose
@sprite8 = nil
end
if @sprite9 != nil
@sprite9.dispose
@sprite9 = nil
end
self.contents.font.name = "黑体"
self.contents.font.size = 24
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(230, 290, 200, 32, "持有量:")
self.contents.font.color = normal_color
self.contents.draw_text(310, 290, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
@walk = [false, false, false, false]
return
end
for i in 0...[$game_party.actors.size,4].min
actor = $game_party.actors
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.hand1_id]
elsif @item.kind == 0
item1 = $data_armors[actor.hand2_id]
elsif @item.kind == 1
item1 = $data_armors[actor.upbody_id]
elsif @item.kind == 2
item1 = $data_armors[actor.downbody_id]
elsif @item.kind == 3
item1 = $data_armors[actor.head_id]
elsif @item.kind == 4
item1 = $data_armors[actor.shoe_id]
elsif @item.kind == 5
item1 = $data_armors[actor.jewel1_id]
elsif @item.kind == 6
item1 = $data_armors[actor.jewel2_id]
elsif @item.kind == 7
item1 = $data_armors[actor.jewel3_id]
else
item1 = $data_armors[actor.name_id]
end
if not actor.equippable?(@item)
@walk
= false
draw_actor_graphic(actor, 4, 4 + 64 * i, i, 0)
self.contents.font.name = "黑体"
self.contents.font.size = 24
self.contents.font.color = normal_color
self.contents.draw_text(32, 4 + 64 * i, 150, 32, "不可装备")
end
if actor.equippable?(@item)
@walk
= true
draw_actor_graphic(actor, 36, 36 + 64 * i, i, 1)
atk1 = 0
atk2 = 0
eva1 = 0
eva2 = 0
str1 = 0
str2 = 0
dex1 = 0
dex2 = 0
agi1 = 0
agi2 = 0
int1 = 0
int2 = 0
pdf1 = 0
pdf2 = 0
mdf1 = 0
mdf2 = 0
eva1 = 0
eva2 = 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
pdf1 = item1 != nil ? item1.pdef : 0
pdf2 = @item != nil ? @item.pdef : 0
mdf1 = item1 != nil ? item1.mdef : 0
mdf2 = @item != nil ? @item.mdef : 0
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
end
if @item.is_a?(RPG::Armor)
eva1 = item1 != nil ? item1.eva : 0
eva2 = @item != nil ? @item.eva : 0
end
if @item.is_a?(RPG::Armor)
if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
str_change = str2
dex_change = dex2
agi_change = agi2
int_change = int2
pdf_change = pdf2
mdf_change = mdf2
atk_change = atk2
eva_change = eva2
else
str_change = str2 - str1
dex_change = dex2 - dex1
agi_change = agi2 - agi1
int_change = int2 - int1
pdf_change = pdf2 - pdf1
mdf_change = mdf2 - mdf1
atk_change = atk2 - atk1
eva_change = eva2 - eva1
end
else
str_change = str2 - str1
dex_change = dex2 - dex1
agi_change = agi2 - agi1
int_change = int2 - int1
pdf_change = pdf2 - pdf1
mdf_change = mdf2 - mdf1
atk_change = atk2 - atk1
eva_change = eva2 - eva1
end
if item1 == nil
name1 = ""
else
name1 = item1.name
end
if @item == nil
name2 = ""
else
name2 = @item.name
end
if str_change == 0 && dex_change == 0 && agi_change == 0 &&
pdf_change == 0 && mdf_change == 0 && atk_change == 0 &&
eva_change == 0 && name1 != name2
self.contents.draw_text(32, 4 + 64 * i, 150, 32, "无变化")
elsif name1 == name2
self.contents.draw_text(32, 4 + 64 * i, 200, 32, "当前装备")
else
self.contents.font.name = "黑体"
self.contents.font.size = 10
self.contents.font.color = normal_color
self.contents.draw_text(32, 4 + 64 * i, 32, 32, "物攻")
self.contents.draw_text(32, 16 + 64 * i, 32, 32, "物防")
self.contents.draw_text(32, 28 + 64 * i, 32, 32, "魔防")
self.contents.draw_text(82, 4 + 64 * i, 32, 32, "筋骨")
self.contents.draw_text(82, 16 + 64 * i, 32, 32, "灵巧")
self.contents.draw_text(82, 28 + 64 * i, 32, 32, "敏捷")
self.contents.draw_text(82, 40 + 64 * i, 32, 32, "悟性")
if atk_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = atk_change.abs.to_s
self.contents.draw_text(54, 4 + 64 * i, 4, 32, "+")
self.contents.draw_text(55, 4 + 64 * i, 24, 32, s, 2)
end
if atk_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = atk_change.abs.to_s
self.contents.draw_text(54, 4 + 64 * i, 4, 32, "-")
self.contents.draw_text(55, 4 + 64 * i, 24, 32, s, 2)
end
if atk_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(54, 4 + 64 * i, 30, 32, "(不变)", 2)
end
if pdf_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = pdf_change.abs.to_s
self.contents.draw_text(54, 16 + 64 * i, 4, 32, "+")
self.contents.draw_text(55, 16 + 64 * i, 24, 32, s, 2)
end
if pdf_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = pdf_change.abs.to_s
self.contents.draw_text(54, 16 + 64 * i, 4, 32, "-")
self.contents.draw_text(55, 16 + 64 * i, 24, 32, s, 2)
end
if pdf_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(54, 16 + 64 * i, 30, 32, "(不变)", 2)
end
if mdf_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = mdf_change.abs.to_s
self.contents.draw_text(54, 28 + 64 * i, 4, 32, "+")
self.contents.draw_text(55, 28 + 64 * i, 24, 32, s, 2)
end
if mdf_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = mdf_change.abs.to_s
self.contents.draw_text(54, 28 + 64 * i, 4, 32, "-")
self.contents.draw_text(55, 28 + 64 * i, 24, 32, s, 2)
end
if mdf_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(54, 66 + 64 * i, 30, 32, "(不变)", 2)
end
if str_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = str_change.abs.to_s
self.contents.draw_text(104, 4 + 64 * i, 4, 32, "+")
self.contents.draw_text(106, 4 + 64 * i, 24, 32, s, 2)
end
if str_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(104, 4 + 64 * i, 30, 32, "(不变)", 2)
end
if str_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = str_change.abs.to_s
self.contents.draw_text(104, 4 + 64 * i, 4, 32, "-")
self.contents.draw_text(106, 4 + 64 * i, 24, 32, s, 2)
end
if dex_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = dex_change.abs.to_s
self.contents.draw_text(104, 16 + 64 * i, 4, 32, "+")
self.contents.draw_text(106, 16 + 64 * i, 24, 32, s, 2)
end
if dex_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(104, 16 + 64 * i, 30, 32, "(不变)", 2)
end
if dex_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = dex_change.abs.to_s
self.contents.draw_text(104, 16 + 64 * i, 4, 32, "-")
self.contents.draw_text(106, 16 + 64 * i, 24, 32, s, 2)
end
if agi_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = agi_change.abs.to_s
self.contents.draw_text(104, 28 + 64 * i, 4, 32, "+")
self.contents.draw_text(106, 28 + 64 * i, 24, 32, s, 2)
end
if agi_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(104, 28 + 64 * i, 30, 32, "(不变)", 2)
end
if agi_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = agi_change.abs.to_s
self.contents.draw_text(104, 28 + 64 * i, 4, 32, "-")
self.contents.draw_text(106, 28 + 64 * i, 24, 32, s, 2)
end
if int_change > 0
self.contents.font.color = up_color
#if @item.is_a?(RPG::Armor)
##if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = int_change.abs.to_s
self.contents.draw_text(104, 40 + 64 * i, 4, 32, "+")
self.contents.draw_text(106, 40 + 64 * i, 24, 32, s, 2)
end
if int_change < 0
self.contents.font.color = down_color
#if @item.is_a?(RPG::Armor)
#if @item.kind ==1 or @item.kind ==2 or @item.kind ==3
#self.contents.font.color = disabled_color
#end
#end
s = int_change.abs.to_s
self.contents.draw_text(104, 40 + 64 * i, 4, 32, "-")
self.contents.draw_text(106, 40 + 64 * i, 24, 32, s, 2)
end
if int_change == 0
self.contents.font.color = disabled_color
self.contents.draw_text(104, 40 + 64 * i, 30, 32, "(不变)", 2)
end
end
end
end
end
# ---------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
# ---------------------------------------
def draw_actor_graphic(actor, x, y, id, tone_id)
if id == 0
@v1 = Viewport.new(264, 150, 32, 46)
@v1.z = 9998
@sprite1 = Sprite.new(@v1)
@sprite1.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite1.tone = Tone.new(0, 0, 0, 255)
else
@sprite1.tone = Tone.new(0, 0, 0, 0)
end
@sprite1.visible = true
end
if id == 1
@v2 = Viewport.new(264, 214, 32, 46)
@v2.z = 9999
@sprite2 = Sprite.new(@v2)
@sprite2.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite2.tone = Tone.new(0, 0, 0, 255)
else
@sprite2.tone = Tone.new(0, 0, 0, 0)
end
@sprite2.visible = true
end
if id == 2
@v3 = Viewport.new(264, 278, 32, 46)
@v3.z = 9999
@sprite3 = Sprite.new(@v3)
@sprite3.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite3.tone = Tone.new(0, 0, 0, 255)
else
@sprite3.tone = Tone.new(0, 0, 0, 0)
end
@sprite3.visible = true
end
if id == 3
@v4 = Viewport.new(264, 342, 32, 46)
@v4.z = 9999
@sprite4 = Sprite.new(@v4)
@sprite4.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite4.tone = Tone.new(0, 0, 0, 255)
else
@sprite4.tone = Tone.new(0, 0, 0, 0)
end
@sprite4.visible = true
end
if id == 4
@v4 = Viewport.new(380, 406, 32, 46)
@v4.z = 9999
@sprite5 = Sprite.new(@v5)
@sprite5.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite5.tone = Tone.new(0, 0, 0, 255)
else
@sprite5.tone = Tone.new(0, 0, 0, 0)
end
@sprite5.visible = true
end
if id == 5
@v6 = Viewport.new(380, 150, 32, 46)
@v6.z = 9999
@sprite6 = Sprite.new(@v6)
@sprite6.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite6.tone = Tone.new(0, 0, 0, 255)
else
@sprite6.tone = Tone.new(0, 0, 0, 0)
end
@sprite6.visible = true
end
if id == 6
@v7 = Viewport.new(380, 214, 32, 46)
@v7.z = 9999
@sprite7 = Sprite.new(@v7)
@sprite7.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite7.tone = Tone.new(0, 0, 0, 255)
else
@sprite7.tone = Tone.new(0, 0, 0, 0)
end
@sprite7.visible = true
end
if id == 7
@v8 = Viewport.new(380, 278, 32, 46)
@v8.z = 9999
@sprite8 = Sprite.new(@v8)
@sprite8.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite8.tone = Tone.new(0, 0, 0, 255)
else
@sprite8.tone = Tone.new(0, 0, 0, 0)
end
@sprite8.visible = true
end
if id == 8
@v9 = Viewport.new(380, 342, 32, 46)
@v9.z = 9999
@sprite9 = Sprite.new(@v9)
@sprite9.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite9.tone = Tone.new(0, 0, 0, 255)
else
@sprite9.tone = Tone.new(0, 0, 0, 0)
end
@sprite9.visible = true
end
end
# ---------------------------------------
def update
super
@count += 1
for i in
[email protected]
if @walk
== false
case i
when 0
if @sprite1 != nil
@sprite1.ox = 0
end
when 1
if @sprite2 != nil
@sprite2.ox = 0
end
when 2
if @sprite3 != nil
@sprite3.ox = 0
end
when 3
if @sprite4 != nil
@sprite4.ox = 0
end
when 4
if @sprite5 != nil
@sprite5.ox = 0
end
when 5
if @sprite6 != nil
@sprite6.ox = 0
end
when 6
if @sprite7 != nil
@sprite7.ox = 0
end
when 7
if @sprite8 != nil
@sprite8.ox = 0
end
when 8
if @sprite9 != nil
@sprite9.ox = 0
end
end
end
end
if @count == 0
for i in
[email protected]
if @walk
== true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 0
end
when 1
if @sprite2 != nil
@sprite2.ox = 0
end
when 2
if @sprite3 != nil
@sprite3.ox = 0
end
when 3
if @sprite4 != nil
@sprite4.ox = 0
end
when 4
if @sprite5 != nil
@sprite5.ox = 0
end
when 5
if @sprite6 != nil
@sprite6.ox = 0
end
when 6
if @sprite7 != nil
@sprite7.ox = 0
end
when 7
if @sprite8 != nil
@sprite8.ox = 0
end
when 8
if @sprite9 != nil
@sprite9.ox = 0
end
end
end
end
end
if @count == 5
for i in
[email protected]
if @walk
== true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 32
end
when 1
if @sprite2 != nil
@sprite2.ox = 32
end
when 2
if @sprite3 != nil
@sprite3.ox = 32
end
when 3
if @sprite4 != nil
@sprite4.ox = 32
end
when 4
if @sprite5 != nil
@sprite5.ox = 32
end
when 5
if @sprite6 != nil
@sprite6.ox = 32
end
when 6
if @sprite7 != nil
@sprite7.ox = 32
end
when 7
if @sprite8 != nil
@sprite8.ox = 32
end
when 8
if @sprite9 != nil
@sprite9.ox = 32
end
end
end
end
end
if @count == 10
for i in
[email protected]
if @walk
== true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 64
end
when 1
if @sprite2 != nil
@sprite2.ox = 64
end
when 2
if @sprite3 != nil
@sprite3.ox = 64
end
when 3
if @sprite4 != nil
@sprite4.ox = 64
end
when 4
if @sprite5 != nil
@sprite5.ox = 64
end
when 5
if @sprite6 != nil
@sprite6.ox = 64
end
when 6
if @sprite7 != nil
@sprite7.ox = 64
end
when 7
if @sprite8 != nil
@sprite8.ox = 64
end
when 8
if @sprite9 != nil
@sprite9.ox = 64
end
end
end
end
end
if @count == 15
@count = 0
end
end
end
kangxi0109于2011-11-29 12:12补充以下内容:
话说,没有人帮忙解决一下吗?
kangxi0109于2011-11-30 23:45补充以下内容:
好了,问题现在已经完满解决...还是从默认脚本里改的方便,多谢各位了...
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1