赞 | 5 |
VIP | 0 |
好人卡 | 2 |
积分 | 36 |
经验 | 24079 |
最后登录 | 2024-11-5 |
在线时间 | 1890 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3591
- 在线时间
- 1890 小时
- 注册时间
- 2010-6-19
- 帖子
- 1211
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 黑米馒头 于 2010-11-22 20:22 编辑
来个高手帮看下.怎么改可以改成当光点到使用物品的时候,弹出物品框..
这是脚本:
#==============================================================================
# ■ Scene_Baby
#------------------------------------------------------------------------------
# 对召唤兽的管理菜单
#==============================================================================
class Scene_Baby
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
$kds_baby = actor_index
$baby_face = 0
if $game_party.actors[$kds_baby].kds_baby.size > 0
if $game_party.actors[$kds_baby].kds_canzhan != 0
$baby_index = $game_actors[$game_party.actors[$kds_baby].kds_canzhan]
else
$baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
end
$stop = nil
else
$stop = 0
end
end
def main
@menu_com = Sprite.new
@menu_com.bitmap = RPG::Cache.picture("宠物显示窗口.png")
@help_window = Window_Help_Self.new
@help_window.y = 424 #介绍物品效果的框
@help_window.x = 13 #介绍物品效果的框
@help_window.opacity = 0 #窗口透明度
@item_window = Window_Item.new
@item_window.active = false
@item_window.help_window = @help_window
@item_window.index = -1
if $game_party.actors[$kds_baby].kds_baby.size > 0
if $game_party.actors[$kds_baby].kds_canzhan != 0
@skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
@skill_window.help_window = @help_window
else
@skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
@skill_window.help_window = @help_window
end
else
@skill_window = Window_Skill.new(0)
end
@skill_window.active = false
@skill_window.index = -1
@skill_window.update
s1 = "设置参战"
s2 = "查看技能"
s3 = "使用物品"
s4 = "能力分配"
s5 = "放生宠物"
s6 = "退出菜单"
@command_window = Window_Command.new(119, [s1, s2, s3, s4, s5,s6])
@command_window.y = 480-35-192-34-27 #介绍设置游戏-退出菜单的框
@command_window.x = 248 #介绍设置游戏-退出菜单的框-横向移动
@command_window.opacity = 0 #窗口透明度
if $game_party.actors[$kds_baby].kds_baby.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
end
@command_window.refresh
@command_window.update
s1 = ""
s3 = ""
s2 = ""
s4 = ""
s5 = ""
#设置宠物选单的窗口和Window_EquipLeft一起用
@command2_window = Window_Command.new(120, [s1, s2, s3, s4, s5],1,24,25)
@command2_window.x = 128
@command2_window.y = 260
@command2_window.index = -1
@command2_window.back_opacity = 0
@command2_window.opacity = 0
@command2_window.active = false
@command2_window.help_window = @help_window
if $game_party.actors[$kds_baby].kds_baby.size > 0
if $game_party.actors[$kds_baby].kds_canzhan != 0
@status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
else
@status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
end
else
@status_window = Window_EquipLeft.new(0)
end
if $game_party.actors[$kds_baby].kds_baby.size > 0
if $game_party.actors[$kds_baby].kds_canzhan != 0
@head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
else
@head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
end
else
@head_window = Window_Head.new(0)
end
if $game_party.actors[$kds_baby].kds_baby.size > 0
if $game_party.actors[$kds_baby].kds_canzhan != 0
@babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
else
@babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
end
else
@babys_window = Window_Baby.new(0)
end
@babys_window.index = -1
@babys_window.update
@babys_window.active = false
@babys_window.help_window = @help_window
Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放窗口
$stop = nil
@command_window.dispose
@command2_window.dispose
@help_window.dispose
@item_window.dispose
@head_window.dispose
@status_window.dispose
@skill_window.dispose
@babys_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
@help_window.update
$baby_face += 1
if ($baby_face+12)%12 == 0 and $game_party.actors[$kds_baby].kds_baby.size > 0
@head_window.refresh
if $baby_face == 36
$baby_face = 0
end
end
if @command2_window.active
@command2_window.update
up_command2
end
if @babys_window.active
@babys_window.update
up_babys
end
if @skill_window.active
@skill_window.update
up_skill
end
if @command_window.active
@command_window.update
up_command
end
if @item_window.active
@item_window.update
up_item
end
end
def up_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(7)
return
end
if Input.trigger?(Input::C)
$command_index = @command_window.index
if @command_window.index != 5 and @command_window.index != 2
if $game_party.actors[$kds_baby].kds_baby.size == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@babys_window.index = 0
@babys_window.active = true
$baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
@baby_index = 0
@babys_window.refresh
@head_window.refresh
@skill_window.refresh
@status_window.refresh2
elsif @command_window.index == 5
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(7)
elsif @command_window.index == 2
if $game_party.actors[$kds_baby].kds_baby.size == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@item_window.update
@item_window.index = -1
@command_window.active = false
@babys_window.index = 0
@babys_window.active = true
$baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
@baby_index = 0
@babys_window.refresh
@head_window.refresh
@skill_window.refresh
@status_window.refresh2
end
return
end
end
def up_babys
if @babys_window.index != @baby_index
@baby_index = @babys_window.index
$baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
@babys_window.refresh
@head_window.refresh
@skill_window.refresh
@status_window.refresh2
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
@babys_window.index = -1
@babys_window.active = false
@command_window.active = true
@help_window.set_text("")
Graphics.transition
return
end
if Input.trigger?(Input::C)
Graphics.freeze
$game_system.se_play($data_system.decision_se)
@chong = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
@zhu = $game_party.actors[$kds_baby]
case @command_window.index
when 0
if $game_party.actors[$kds_baby].kds_canzhan == $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
$game_party.actors[$kds_baby].kds_canzhan = 0
else
$game_party.actors[$kds_baby].kds_canzhan = $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
end
@babys_window.refresh
when 1
@babys_window.active = false
@skill_window.index = 0
@skill_window.active = true
when 2
@babys_window.active = false
@item_window.index = 0
@item_window.active = true
when 3
@babys_window.active = false
@command2_window.index = 0
@command2_window.active = true
when 4
$game_variables[29] = $game_party.actors[$kds_baby].id
$game_party.remove_actor(@chong.id)
@baby_index = 0
if @babys_window.index > 0
@babys_window.index -= 1
end
if @zhu.kds_baby.size == 0
$stop = 0
@babys_window.index = -1
@babys_window.active = false
@command_window.active = true
@help_window.set_text("")
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
@command_window.refresh
@command_window.update
end
@babys_window.refresh
@head_window.refresh
@skill_window.refresh
@status_window.refresh2
end
Graphics.transition
return
end
end
def up_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
@babys_window.active = true
@skill_window.index = -1
@skill_window.active = false
Graphics.transition
return
end
end
def up_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
@babys_window.active = true
@item_window.index = -1
@item_window.active = false
Graphics.transition
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
if @item == nil
$game_system.se_play($data_system.buzzer_se)
return
end
if @item.element_set.include?(11)
if @chong.skills.include?(@item.recover_hp) == false
@chong.learn_skill(@item.recover_hp)
else
$game_system.se_play($data_system.buzzer_se)
return
end
elsif @item.element_set.include?(12)
$game_system.se_play(@item.menu_se)
end
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
end
@item_window.refresh
@skill_window.refresh
@status_window.refresh2
return
end
end
def up_command2
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
@babys_window.active = true
@command2_window.index = -1
@command2_window.active = false
Graphics.transition
return
end
if Input.trigger?(Input::C)
if @chong.qianli <= 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
case @command2_window.index
when 0
@chong.maxhp += 12
@chong.hp += 12
when 1
@chong.maxsp += 6
@chong.sp += 6
@chong.int += 1
when 2
@chong.str += 1
when 3
@chong.dex += 1.5
when 4
@chong.agi += 1
end
@chong.qianli -= 1
@status_window.refresh2
end
end
end
|
|