Project1
标题:
组合键连续技能如何达到这种效果?
[打印本页]
作者:
mmmkly
时间:
2013-2-2 17:03
标题:
组合键连续技能如何达到这种效果?
本帖最后由 mmmkly 于 2013-2-18 00:15 编辑
就是下面这个组合键脚本,我想要的效果在脚本中应该比较明了,就是使用50号技能按不同的顺序按键会有不同的技能出现,可是像我这样好像不行,求助,怎样才能达到这样的效果?
#==============================================================================
# 组合键连续特技系统 By 绿发的Eclair
#==============================================================================
# 仿传说系列的效果,在使用一个特技中按照一定的顺序摁键可以再使用一个特技。
# 使用方法:在下面的自定义部分里设定特技对应的组合键和连接上的特技。
# 为了避免玩家二周目或者提前知道的情况下一开始就是用强力连续技能的事情发生,
# 特别做了判断,只有$chain这个数组包括的技能才会被连出来。
# 事件脚本中使用 add_chain(可以连出来的特技ID) 可以给这个数组添加新特技。
# 就好像“学会新的”一样。
#==============================================================================
$chain = [40,41,42,43,91,92,93,94,95,96,97,98]#可以使用的连续技
module RPG
class Skill
def chain
############################################################自定义部分
case id
when 1 #有连续效果技能的ID,57就是"十字斩"
chain = ["A","B","A","B"] #连续技能的摁键,一定要写成数组,用英文半角逗号来隔开
chain_id = 40
when 4 #使用技能为灵魂裂隙
chain = ["上","下","左","右","A"] #输入键顺序为"上下左右"
chain_id = 41
when 3 #使用技能为千裂斩
chain = ["上","上","A"] #输入魂斗罗的作弊码 :)
chain_id = 42
when 2 #使用技能为千裂斩
chain = ["左","右","左","右","A"] #输入魂斗罗的作弊码 :)
chain_id = 43
when 50
chain = ["上","上","A"]#输入魂斗罗的作弊码 :)
chain_id = 91
when 50
chain = ["下","下","A"]#输入魂斗罗的作弊码 :)
chain_id = 92
when 50
chain = ["左","左","A"]#输入魂斗罗的作弊码 :)
chain_id = 93
when 50
chain = ["右","右","A"]#输入魂斗罗的作弊码 :)
chain_id = 94
when 50
chain = ["上","下","A"]#输入魂斗罗的作弊码 :)
chain_id = 95
when 50
chain = ["下","上","A"]#输入魂斗罗的作弊码 :)
chain_id = 96
when 50
chain = ["左","右","A"]#输入魂斗罗的作弊码 :)
chain_id = 97
when 50
chain = ["右","左","A"]#输入魂斗罗的作弊码 :)
chain_id = 98
#在这里按照上面的格式添加
#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
# 获取特技
[url=home.php?mod=space&uid=260100]@skill[/url] = $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
#==============================================================================
复制代码
作者:
rvqsw
时间:
2013-2-2 19:12
提示:
作者被禁止或删除 内容自动屏蔽
作者:
mmmkly
时间:
2013-2-3 22:07
看来很复杂噢。
作者:
mmmkly
时间:
2013-2-8 21:43
没有人会吗?
作者:
弗雷德
时间:
2013-2-8 23:06
其实不难,首先建多几个数组纪录键位,在下面判断按键的位置加多个判断,新建了几个数组判断几次,然后俺这做好一个范例了,可俺现在在家上不到网……
作者:
mmmkly
时间:
2013-2-10 16:32
弗雷德 发表于 2013-2-8 23:06
其实不难,首先建多几个数组纪录键位,在下面判断按键的位置加多个判断,新建了几个数组判断几次,然后俺这 ...
麻烦一下,谢谢了,这个我等了很久了,自己一直在尝试,一直没弄出来
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1