赞 | 0 |
VIP | 170 |
好人卡 | 5 |
积分 | 1 |
经验 | 15787 |
最后登录 | 2013-8-6 |
在线时间 | 285 小时 |
Lv1.梦旅人 垃圾死人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 285 小时
- 注册时间
- 2009-1-27
- 帖子
- 2420
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我使用了KKME整合系统v0.12来当游戏系统...当然..自己更改了很多地方
然后我弄了个技能.使用场合是菜单.使用范围只能是使用者本人
然后进入游戏使用技能的时候出现脚本错误...
第231行 @skill_target_window.index = @skill_actor_index - 15
而我把使用范围改为己方单人又正常...
请问怎么解决呢???
脚本如下:
- #==============================================================================
- # ■ Scene_Skill
- #------------------------------------------------------------------------------
- # 处理特技画面的类。
- #==============================================================================
- class Scene_Skill
- def initialize(index)
- @cmd_index = index
- end
- def main
- cmd = Window_Command_New.new($game_party.actors.size)
- cmd.index = @cmd_index
- cmd.active = false
- # 生成角色索引窗口
- @skill_actor_window = Window_Character.new
- @skill_actor_window.y = 480
- @skill_actor_window.opacity = KKME::MENU_OPACITY
- @skill_actor_window.index = 0
- @flash_viewport_time = 0
- @flash_viewport = Viewport.new(30, 396, 580, 64)
- @flash_viewport.z = 9999
-
- @skill_acotr_index = @skill_actor_window.index
- # 获取角色
- @skill_actor = $game_party.actors[@skill_acotr_index]
- # 生成帮助窗口、状态窗口、特技窗口
- @skill_help_window = Window_Help_New.new
- @skill_help_window.x = 30
- @skill_help_window.y = 480
- @skill_help_window.opacity = KKME::MENU_OPACITY
-
- @skill_status_window = Window_SkillStatus.new(@skill_actor)
- @skill_status_window.opacity = KKME::MENU_OPACITY
- @skill_status_window.x = -368
-
- @skill_skill_window = Window_Skill.new(@skill_actor)
- @skill_skill_window.opacity = KKME::MENU_OPACITY
- @skill_skill_window.y = 480
- @skill_skill_window.active = false
- # 关联帮助窗口
- @skill_skill_window.help_window = @skill_help_window
- # 生成目标窗口 (设置为不可见・不活动)
- @skill_target_window = Window_Target.new
- @skill_target_window.y = 480
- @skill_target_window.visible = false
- @skill_target_window.active = false
- @skill_target_window.opacity = KKME::MENU_OPACITY
- # 窗口的滑动
- Graphics.transition
- for i in 1..8
- @skill_status_window.x += 52
- @skill_skill_window.y -= 36
- @skill_actor_window.y -= 10
- if i==8
- @skill_status_window.x = 50
- @skill_skill_window.y = 192
- @skill_actor_window.y = 396
- end
- Graphics.update
- end
- @flash_viewport_time = 20
- @flash_viewport.flash(Color.new(255,255,255,255),20)
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update_skill_scene
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 窗口的滑动
- for i in 1..9
- @skill_status_window.x -= 52
- @skill_skill_window.y += 36
- @skill_actor_window.y += 10
- Graphics.update
- end
- Graphics.freeze
- cmd.dispose
- # 释放窗口
- @skill_help_window.dispose
- @skill_status_window.dispose
- @skill_skill_window.dispose
- @skill_target_window.dispose
-
- @flash_viewport.dispose
- @skill_actor_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update_skill_scene
- # 刷新窗口
- @skill_help_window.update
- @skill_status_window.update
- @skill_skill_window.update
- @skill_target_window.update
- @skill_actor_window.update
-
- if @flash_viewport_time >0
- @flash_viewport_time -= 1
- @flash_viewport.update
- end
-
- if @skill_acotr_index != @skill_actor_window.index
- @skill_acotr_index = @skill_actor_window.index
- @skill_actor = $game_party.actors[@skill_acotr_index]
- @skill_skill_window.set_actor(@skill_actor)
- @skill_status_window.set_actor(@skill_actor)
- end
-
-
- # 特技窗口被激活的情况下: 调用 update_skill
- if @skill_skill_window.active
- skill_update_skill
- return
- end
- # 目标窗口被激活的情况下: 调用 update_target
- if @skill_target_window.active
- skill_update_target
- return
- end
- if @skill_actor_window.active
- skill_update_actor_window
- return
- end
- end
-
- def skill_update_actor_window
- @skill_actor = $game_party.actors[@skill_actor_window.index]
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- $scene = Scene_Menu.new(@cmd_index)
- return
- end
-
- if Input.trigger?(Input::C)
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活物品窗口
- @skill_skill_window.active = true
- @skill_actor_window.active = false
- @skill_skill_window.index = 0
-
- for i in 1..8
- @skill_actor_window.y += 10
- @skill_help_window.y -= 10
- if i==8
- @skill_actor_window.y = 480
- @skill_help_window.y = 396
- end
- Graphics.update
- end
-
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (特技窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def skill_update_skill
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 结束该菜单
- @skill_skill_window.active = false
- @skill_actor_window.active = true
-
- for i in 1..8
- @skill_actor_window.y -= 10
- @skill_help_window.y += 10
- if i==8
- @skill_actor_window.y = 396
- @skill_help_window.y = 480
- end
- Graphics.update
- end
-
- return
- end
-
-
-
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 获取特技窗口现在选择的特技的数据
- @skill = @skill_skill_window.skill
- # 不能使用的情况下
- if @skill == nil or not @skill_actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 效果范围是我方的情况下
- if @skill.scope >= 3
- # 激活目标窗口
- @skill_skill_window.active = false
- # @skill_target_window.x = (@skill_skill_window.index + 1) % 2 * 304
- @skill_target_window.visible = true
- @skill_target_window.active = true
-
- for i in 1..8
- @skill_target_window.y -= 39
- if i==8
- @skill_target_window.y = 164
- end
- Graphics.update
- end
-
-
- # 设置效果范围 (单体/全体) 的对应光标位置
- if @skill.scope == 4 || @skill.scope == 6
- @skill_target_window.index = -1
- elsif @skill.scope == 7
- @skill_target_window.index = @skill_actor_index - 15
- else
- @skill_target_window.index = 0
- end
- # 效果在我方以外的情况下
- else
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @skill_actor.sp -= @skill.sp_cost
- # 再生成各窗口的内容
- @skill_status_window.refresh
- @skill_skill_window.refresh
- @skill_target_window.refresh
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (目标窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def skill_update_target
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 删除目标窗口
- @skill_skill_window.active = true
-
- for i in 1..9
- @skill_target_window.y += 39
- Graphics.update
- end
-
- @skill_target_window.visible = false
- @skill_target_window.active = false
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 因为 SP 不足而无法使用的情况下
- unless @skill_actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 目标是全体的情况下
- if @skill_target_window.index == -1
- # 对同伴全体应用特技使用效果
- used = false
- for i in $game_party.actors
- used |= i.skill_effect(@skill_actor, @skill)
- end
- end
- # 目标是使用者的情况下
- if @skill_target_window.index <= -2
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@skill_target_window.index + 10]
- used = target.skill_effect(@skill_actor, @skill)
- end
- # 目标是单体的情况下
- if @skill_target_window.index >= 0
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@skill_target_window.index]
- used = target.skill_effect(@skill_actor, @skill)
- end
- # 使用特技的情况下
- if used
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @skill_actor.sp -= @skill.sp_cost
- # 再生成各窗口内容
- @skill_status_window.refresh
- @skill_skill_window.refresh
- @skill_target_window.refresh
- # 全灭的情况下
- if $game_party.all_dead?
- # 切换到游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- # 无法使用特技的情况下
- unless used
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- end
- return
- end
- end
- end
复制代码 |
|