赞 | 0 |
VIP | 0 |
好人卡 | 12 |
积分 | 1 |
经验 | 5827 |
最后登录 | 2020-5-5 |
在线时间 | 116 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 116 小时
- 注册时间
- 2008-5-12
- 帖子
- 264
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 shinliwei 于 2010-12-10 20:56 编辑
如图,我用了wangswz前辈的天赋技能树脚本,并且我把这项添加到菜单里了。
点击后选人物进入天赋界面,但是按范围时不回到菜单界面了,我看了下其他项目(如状态、装备)的脚本项,并按照样式进行修改,可是还是不返回菜单界面,因此特来请教诸位。- #==============================================================================
- # ■ Scene_Skill_Tree
- #------------------------------------------------------------------------------
- # 天赋技能类
- #==============================================================================
- class Scene_Skill_Tree < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # index : 天赋树
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0)
- @actor = actor_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- start_command
- @skill_tree_window = Window_Skill_Tree.new(272, 0, 272, 328, $game_party.members[@actor])
- @skill_tree_window.active = false
- @skill_tree_window.visible = false
- @skill_tree_window.index = 2 #??
- @base_window = Window_Base.new(272, 0, 272, 328)
- @skill_status_window = Window_skill_status.new
- @skill_status_window.visible = false
- @base_window2 = Window_Base.new(0, 328, 544, 88)
- @skill_actor_window = Window_actor_Tree.new($game_party.members[@actor])
- @skill_actor_window.active = true
- @skill_data = Window_skill_data.new($game_party.members[@actor].id)
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start_command
- s1 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][0]][1]
- s2 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][1]][1]
- s3 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][2]][1]
- @command_window = Window_Command.new(272, [s1, s2, s3], 3)
- @command_window.y = 88
- @command_window.active = true
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @skill_tree_window.dispose
- @base_window.dispose
- @base_window2.dispose
- @skill_data.dispose
- @skill_status_window.dispose
- @skill_actor_window.dispose
- @command_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 回到原画面
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(4)
- end
- #--------------------------------------------------------------------------
- # ● 切换至下一角色画面
- #--------------------------------------------------------------------------
- def next_actor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill_Tree.new(@actor_index)
- end
- #--------------------------------------------------------------------------
- # ● 切换至上一角色画面
- #--------------------------------------------------------------------------
- def prev_actor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill_Tree.new(@actor_index)
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- @skill_tree_window.update
- @skill_actor_window.update
- @skill_status_window.update
- @base_window.update
- @base_window2.update
- @skill_data.update
- @command_window.update
-
- if @skill_actor_window.active
- if @skill_tree_window.visible == false
- if Input.trigger?(Input::R)
- Sound.play_cursor
- @actor += 1
- @actor %= $game_party.members.size
- $scene = Scene_Skill_Tree.new(@actor)
- @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- @actor += $game_party.members.size - 1
- @actor %= $game_party.members.size
- $scene = Scene_Skill_Tree.new(@actor)
- @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
- end
- end
- end
- if @command_window.active
- update_command_selection
- elsif @skill_tree_window.active
- update_skill_tree_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新命令窗口
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- case @command_window.index
- when 0 # 第一天赋
- Sound.play_decision
- @command_window.active = false
- @base_window.visible = false
- @base_window2.visible = false
- @skill_actor_window.active = false
- @skill_tree_window.active = true
- @skill_tree_window.visible = true
- @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][0]
- @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
- @skill_status_window.visible = true
- @skill_status_window.skill = @skill_tree_window.STK
- when 1 # 第二天赋
- Sound.play_decision
- @command_window.active = false
- @base_window.visible = false
- @base_window2.visible = false
- @skill_actor_window.active = false
- @skill_tree_window.active = true
- @skill_tree_window.visible = true
- @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][1]
- @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
- @skill_status_window.visible = true
- @skill_status_window.skill = @skill_tree_window.STK
- when 2 # 第三天赋
- Sound.play_decision
- @command_window.active = false
- @base_window.visible = false
- @base_window2.visible = false
- @skill_actor_window.active = false
- @skill_tree_window.active = true
- @skill_tree_window.visible = true
- @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][2]
- @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
- @skill_status_window.visible = true
- @skill_status_window.skill = @skill_tree_window.STK
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新天赋窗口
- #--------------------------------------------------------------------------
- def update_skill_tree_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @base_window.visible = true
- @base_window2.visible = true
- @skill_actor_window.active = true
- @skill_tree_window.active = false
- @skill_tree_window.visible = false
- @skill_status_window.visible = false
- @skill_tree_window.ST_actor_data2
- end
- if Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT) || Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.trigger?(Input::X)
- @skill_status_window.skill = @skill_tree_window.STK
- @skill_tree_window.ST_actor_data3
- @skill_data.refresh
- end
- end
- end
复制代码 |
|