组合键连续技能脚本如下
#==============================================================================
# 组合键连续特技系统 By 绿发的Eclair
#==============================================================================
# 仿传说系列的效果,在使用一个特技中按照一定的顺序摁键可以再使用一个特技。
# 使用方法:在下面的自定义部分里设定特技对应的组合键和连接上的特技。
# 为了避免玩家二周目或者提前知道的情况下一开始就是用强力连续技能的事情发生,
# 特别做了判断,只有$chain这个数组包括的技能才会被连出来。
# 事件脚本中使用 add_chain(可以连出来的特技ID) 可以给这个数组添加新特技。
# 就好像“学会新的”一样。
#==============================================================================
$chain = [ ]#可以使用的连续技
module RPG
class Skill
def chain
############################################################自定义部分
case id
when 57 #有连续效果技能的ID,57就是"十字斩"
chain = ["X","X","X"] #连续技能的摁键,一定要写成数组,用英文半角逗号来隔开
chain_id = 81 #连接技能的ID,81就是"千裂斩"
when 81 #使用技能为千裂斩
chain = ["Y","Y"] #输入魂斗罗的作弊码 :)
chain_id = 82 #连接技能,"灵魂裂隙"
when 82 #使用技能为灵魂裂隙
chain = ["Z","Z","Z"] #输入键顺序为"上下左右"
chain_id = 82 #连接技能还是"灵魂裂隙"
#在这里按照上面的格式添加
#when n
#chain = ["第一个摁键","第二个摁键","第三个摁键"]
#chain_id = 连接技能的ID
############################################################
else
chain = []
chain_id = 0
end
return [chain,chain_id]
end
end
end
class Interpreter
def add_chain(id)
$chain.push(id)
end
end
class Scene_Battle
alias update_phase4_step1_2 :update_phase4_step1
def update_phase4_step1
@result = [] if @result == nil
update_phase4_step1_2
end
alias update_e :update
def update
if (@phase4_step == 3 or @phase4_step == 4 or @phase4_step == 5) && @active_battler.current_action.kind == 1
@use = @active_battler.current_action.kind == 1 && $data_skills[@active_battler.current_action.skill_id].chain != [[],0] && $chain.include?($data_skills[@active_battler.current_action.skill_id].chain[1])
if @use == true and $data_skills[@active_battler.current_action.skill_id].chain != [[],0]
@use = $data_skills[$data_skills[@active_battler.current_action.skill_id].chain[1]].sp_cost <= @active_battler.sp
end
if @use == true
if Input.trigger?(Input::A)
@result.push("A")
end
if Input.trigger?(Input::B)
@result.push("B")
end
if Input.trigger?(Input::C)
@result.push("C")
end
if Input.trigger?(Input::X)
@result.push("X")
end
if Input.trigger?(Input::Y)
@result.push("Y")
end
if Input.trigger?(Input::Z)
@result.push("Z")
end
if Input.trigger?(Input::L)
@result.push("L")
end
if Input.trigger?(Input::R)
@result.push("R")
end
if Input.trigger?(Input::UP)
@result.push("上")
end
if Input.trigger?(Input::DOWN)
@result.push("下")
end
if Input.trigger?(Input::LEFT)
@result.push("左")
end
if Input.trigger?(Input::RIGHT)
@result.push("右")
end
end
end
if @phase == 4 and @phase4_step > 5 and @active_battler.current_action.kind == 1 and @use == true
if @result == $data_skills[@active_battler.current_action.skill_id].chain[0]
@active_battler.current_action.kind = 1
a = $data_skills[@active_battler.current_action.skill_id].chain[1]
@active_battler.current_action.skill_id = a
@action_battlers.unshift(@active_battler)
update_phase4_step1
end
end
update_e
end
#--------------------------------------------------------------------------
# ● 生成特技行动结果
#--------------------------------------------------------------------------
def make_skill_action_result
# 获取特技
@skill = $data_skills[@active_battler.current_action.skill_id]
# 如果不是强制行动
unless @active_battler.current_action.forcing || @result != nil && [] #Eclair
# 因为 SP 耗尽而无法使用的情况下
unless @active_battler.skill_can_use?(@skill.id)
# 清除强制行动对像的战斗者
$game_temp.forcing_battler = nil
# 移至步骤 1
@phase4_step = 1
return
end
end
@result = [] #Eclair
# 消耗 SP
@active_battler.sp -= @skill.sp_cost
# 刷新状态窗口
@status_window.refresh
# 在帮助窗口显示特技名
@help_window.set_text(@skill.name, 1)
# 设置动画 ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# 设置公共事件 ID
@common_event_id = @skill.common_event_id
# 设置对像侧战斗者
set_target_battlers(@skill.scope)
# 应用特技效果
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
end
#==============================================================================
# 组合键连续特技系统 By 绿发的Eclair
#============================================================================== [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~作者: 枫叶的北方 时间: 2008-10-2 08:15
帮忙啊,急用! [LINE]1,#dddddd[/LINE]版主对此帖的评论:『请善用编辑功能,不要频繁自顶。——圣』,积分『-20』。这些被扣积分的一半会用于对本帖正确答案的悬赏。作者: pinko 时间: 2008-10-2 15:20
http://www.atelier-rgss.com/RGSS/Battle/XAS_00.html
这个也许可以满足LZ的要求。 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~作者: 枫叶的北方 时间: 2008-10-2 15:34
不会用啊,我问技能怎么用啊?在这个ARPG中的技能在哪设置啊?作者: pinko 时间: 2008-10-2 15:41
讲起来很复杂…嗯…只是让你自己研究的…作者: 枫叶的北方 时间: 2008-10-2 15:57
。。
研究了一晚上,脑袋都大大的了。。
我只问怎么用技能,不然接不上按键连技了。作者: 枫叶的北方 时间: 2008-10-2 16:07
算了,反正您这个ARPG很华丽,光改一下地图也可以做出很出色的游戏。