赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 27553 |
最后登录 | 2017-9-29 |
在线时间 | 200 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 200 小时
- 注册时间
- 2008-3-1
- 帖子
- 360
|
本帖最后由 木许许 于 2011-9-29 16:14 编辑
如下面的脚本,当角色编号大于10,我定义了新的装备栏,希望把armor2、armor3、armor4去掉,但是直接去掉装备显示就不正常,应该怎么改?
def refresh
if @actor.id < 11 # 编号10以前的角色都是常规装备
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])
@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, "法宝")
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)
else # 编号11以后的角色都是宠物装备
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])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, "灵符1")
self.contents.draw_text(4, 32 * 1, 92, 32, "灵符2")
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, "法宝")
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)
end
end
end |
|