Project1
标题:
黑剑的脚本用到自己游戏的BUG
[打印本页]
作者:
zphyp120
时间:
2008-11-30 04:36
标题:
黑剑的脚本用到自己游戏的BUG
小Z:这是我改的黑剑的脚本,把它用到自己游戏里了,请问有什么“把个”(BUG)?
class Scene_EquipRight < Window_Selectable
# ----------------------------
attr_accessor :translucent_text
# ----------------------------
def initialize(actor)
super(272, 0, 368, 208)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "楷体"
self.contents.font.size = 20
@actor = actor
@translucent_text = [false, false]
@y_point = 0
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])
@item_max = @data.size
case @actor.name
when "小勇"
self.contents.font.color = system_color
self.contents.draw_text(4, 4+0, 92, 32, "剑")
self.contents.draw_text(4, 4+44, 92, 32, "身体护甲")
self.contents.draw_text(4, 4+88, 92, 32, "魔石一")
self.contents.draw_text(4, 4+132, 92, 32,"魔石二")
self.contents.font.color = normal_color
draw_item_name(@data[0], 92, 4+0)
draw_item_name(@data[1], 92, 4+44)
draw_item_name(@data[2], 92, 4+88)
draw_item_name(@data[3], 92, 4+132)
$equip_amount = 4 #、可装备物品数量
$actor_equip_type[2]=0 #、第二个装备的回避修正值
$actor_equip_type[3]=0 #、第三个装备的回避修正值
$actor_equip_type[4]=0
when "小强"
self.contents.font.color = system_color
self.contents.draw_text(4, 4+0, 92, 32, "刀")
self.contents.draw_text(4, 4+33, 92, 32, "铠甲")
self.contents.draw_text(4, 4+66, 92, 32, "魔石一")
self.contents.draw_text(4, 4+99, 92, 32, "魔石二")
self.contents.font.color = normal_color
draw_item_name(@data[0], 92, 4+0)
draw_item_name(@data[1], 92, 4+33)
draw_item_name(@data[2], 92, 4+66)
draw_item_name(@data[3], 92, 4+99)
draw_item_name(@data[4], 92, 4+132)
$equip_amount = 4
$actor_equip_type[2]=0
$actor_equip_type[3]=0
$actor_equip_type[4]=0
when "灵儿"
self.contents.font.color = system_color
self.contents.draw_text(4, 4+0, 92, 32, "仙杖")
self.contents.draw_text(4, 4+33, 92, 32, "仙袍")
self.contents.draw_text(4, 4+66, 92, 32, "天人之石")
self.contents.draw_text(4, 4+99, 92, 32, "戒指")
self.contents.draw_text(4, 4+132, 92, 32,"守护符")
self.contents.font.color = normal_color
draw_item_name(@data[0], 92, 4+0)
draw_item_name(@data[1], 92, 4+33)
draw_item_name(@data[2], 92, 4+66)
draw_item_name(@data[3], 92, 4+99)
draw_item_name(@data[4], 92, 4+132)
$equip_amount = 5
$actor_equip_type[2]=0
$actor_equip_type[3]=0
$actor_equip_type[4]=0
$actor_equip_type[5]=0
when "山丘之王·锤圣"
self.contents.font.color = system_color
self.contents.draw_text(4, 4+0, 92, 32, "雷霆之锤")
self.contents.draw_text(4, 4+44, 92, 32,"风暴之衣")
self.contents.draw_text(4, 4+88, 92, 32, "山丘之石")
self.contents.font.color = normal_color
draw_item_name(@data[0], 92, 4+0)
draw_item_name(@data[1], 92, 4+44)
draw_item_name(@data[2], 92, 4+88)
draw_item_name(@data[3], 92, 4+132)
$equip_amount = 3
$actor_equip_type[2]=0
$actor_equip_type[3]=0
$actor_equip_type[4]=0
#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 * 2, 92, 32, $data_system.words.armor3)
#self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
#draw_item_name(@data[0], 92, 32 * 0, @translucent_text[0])
#draw_item_name(@data[1], 92, 32 * 1, @translucent_text[1])
#draw_item_name(@data[2], 92, 32 * 2, false)
#draw_item_name(@data[3], 92, 32 * 2, false)
#draw_item_name(@data[4], 92, 32 * 4, false)
end
# ----------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
# ----------------------------
def update_cursor_rect
case $equip_amount
when 2
case @index
when 0
@y_point = 33
when 1
@y_point = 99
else
if @index != -1
@index = 1
@y_point = 99
end
end
when 3
case @index
when 0
@y_point = 0
when 1
@y_point = 66
when 2
@y_point = 132
else
if @index != -1
@index = 2
@y_point = 132
end
end
when 4
case @index
when 0
@y_point = 0
when 1
@y_point = 44
when 2
@y_point = 88
when 3
@y_point = 132
else
if @index != -1
@index = 3
@y_point = 132
end
end
else
if @index != -1
@index = 4
@y_point = 132
end
end
else
@y_point = 33
end
if @index<0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @y_point+5 , 280, 28)
end
end
end
复制代码
哦!对了,还有Scene_menu
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
# 处理菜单画面的类。
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ● 初始化对像
# menu_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s1 = "物品使用"
s2 = "角色技能"
s3 = "武力装备"
s4 = "角色状态"
s5 = "查看存档"
s6 = "结束游戏"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
# 同伴人数为 0 的情况下
if $game_party.actors.size == 0
# 物品、特技、装备、状态无效化
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# 禁止存档的情况下
if $game_system.save_disabled
# 存档无效
@command_window.disable_item(4)
end
# 生成游戏时间窗口
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224
# 生成步数窗口
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 320
# 生成金钱窗口
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# 生成状态窗口
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# 命令窗口被激活的情况下: 调用 update_command
if @command_window.active
update_command
return
end
# 状态窗口被激活的情况下: 调用 update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 同伴人数为 0、存档、游戏结束以外的场合
if $game_party.actors.size == 0 and @command_window.index < 4
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 命令窗口的光标位置分支
case @command_window.index
when 0 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到物品画面
$scene = Scene_Item.new
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # 装备
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到装备画面
$scene = Scene_EquipRight.new
when 3 # 状态
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # 存档
# 禁止存档的情况下
if $game_system.save_disabled
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到存档画面
$scene = Scene_Save.new
when 5 # 游戏结束
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到游戏结束画面
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (状态窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_status
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 激活命令窗口
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置分支
case @command_window.index
when 1 # 特技
# 本角色的行动限制在 2 以上的情况下
if $game_party.actors[@status_window.index].restriction >= 2
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到特技画面
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装备
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换的装备画面
$scene = Scene_Equip.new(@status_window.index)
when 3 # 状态
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到状态画面
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
复制代码
作者:
clap_pl
时间:
2008-11-30 10:52
.....
这个 这个 LZ自己捉虫吧-。-
具体出了什么BUG再来求救好了-。-
作者:
sdbgejsb
时间:
2008-11-30 16:56
第一个魔石脚本肯定是用不了的
如果想要完美使用估计要把整个黑剑系统都搬过来
第二个是菜单,看起来是没什么问题.......不过人物头像要有,HP MP德条你要从黑剑里复制来,工作量会很大,对新手来说会很头疼,所以~~~不推荐用!
作者:
星晨
时间:
2008-11-30 17:03
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1