Project1

标题: 〈菜鸟脚本,勿PIA^^〉仿传说系列的摁键连技.. [打印本页]

作者: Eclair    时间: 2008-1-22 18:53
提示: 作者被禁止或删除 内容自动屏蔽
作者: 缺牙de兔子    时间: 2008-1-22 19:08
我觉得应该加1条

感觉自己不知道什么时候该按--

而且按的节奏也不清楚............
作者: Eclair    时间: 2008-1-24 23:09
提示: 作者被禁止或删除 内容自动屏蔽
作者: superufo    时间: 2008-1-24 23:34
提示: 作者被禁止或删除 内容自动屏蔽
作者: Eclair    时间: 2008-1-24 23:58
提示: 作者被禁止或删除 内容自动屏蔽
作者: yangff    时间: 2008-1-26 04:02
发布完成
VIP++3
http://rpg.blue/web/shownews.asp?id=937
作者: 冥界王子☆邪    时间: 2008-1-26 11:52
提示: 作者被禁止或删除 内容自动屏蔽
作者: azdhr    时间: 2008-2-1 19:13
  1. #==============================================================================
  2. #   组合键连续特技系统 By 绿发的Eclair
  3. #==============================================================================
  4. #   仿传说系列的效果,在使用一个特技中按照一定的顺序摁键可以再使用一个特技。
  5. #   使用方法:在下面的自定义部分里设定特技对应的组合键和连接上的特技。
  6. #   为了避免玩家二周目或者提前知道的情况下一开始就是用强力连续技能的事情发生,
  7. #   特别做了判断,只有$chain这个数组包括的技能才会被连出来。
  8. #   事件脚本中使用 add_chain(可以连出来的特技ID) 可以给这个数组添加新特技。
  9. #   就好像“学会新的”一样。
  10. #==============================================================================
  11. $chain = [ ]#可以使用的连续技
  12. module RPG
  13. class Skill
  14.   def chain
  15.   ############################################################自定义部分
  16.   case id
  17.    when 1                #有连续效果技能的ID,57就是"十字斩"
  18.     chain = ["上","上"] #连续技能的摁键,一定要写成数组,用英文半角逗号来隔开
  19.     chain_id = 12        #连接技能的ID,81就是"千裂斩"
  20.   ############################################################
  21.   else
  22.     chain = []
  23.     chain_id = 0
  24.   end
  25.    return [chain,chain_id]
  26.   end
  27. end
  28. end
  29. class Interpreter
  30.   def add_chain(id)
  31.     $chain.push(id)
  32.   end
  33. end
  34. class Scene_Battle
  35.   alias update_phase4_step1_2 :update_phase4_step1
  36.   def update_phase4_step1
  37.     @result = [] if @result == nil
  38.     update_phase4_step1_2
  39.   end
  40.   alias update_e :update
  41.   def update# or @phase4_step == 4
  42.     if (@phase4_step == 3 or @phase4_step == 5) && @active_battler.current_action.kind == 1
  43.       @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])
  44.     if @use == true and $data_skills[@active_battler.current_action.skill_id].chain != [[],0]
  45.        @use = $data_skills[$data_skills[@active_battler.current_action.skill_id].chain[1]].sp_cost <= @active_battler.sp
  46.     end
  47.     if @use == true
  48.    if Input.trigger?(Input::A)
  49.      @result.push("A")
  50.    end
  51.    if Input.trigger?(Input::B)
  52.      @result.push("B")
  53.    end
  54.    if Input.trigger?(Input::C)
  55.      @result.push("C")
  56.    end
  57.    if Input.trigger?(Input::X)
  58.      @result.push("X")
  59.    end
  60.    if Input.trigger?(Input::Y)
  61.      @result.push("Y")
  62.    end
  63.    if Input.trigger?(Input::Z)
  64.      @result.push("Z")
  65.    end
  66.    if Input.trigger?(Input::L)
  67.      @result.push("L")
  68.    end
  69.    if Input.trigger?(Input::R)
  70.      @result.push("R")
  71.    end
  72.    if Input.trigger?(Input::UP)
  73.      @result.push("上")
  74.    end
  75.    if Input.trigger?(Input::DOWN)
  76.      @result.push("下")
  77.    end
  78.    if Input.trigger?(Input::LEFT)
  79.      @result.push("左")
  80.    end
  81.    if Input.trigger?(Input::RIGHT)
  82.      @result.push("右")
  83.    end
  84.    end
  85. end
  86.   if @phase == 4 and @phase4_step > 5 and @active_battler.current_action.kind == 1 and @use == true
  87.   if @result == $data_skills[@active_battler.current_action.skill_id].chain[0]
  88.     @active_battler.current_action.kind = 1
  89.     a = $data_skills[@active_battler.current_action.skill_id].chain[1]
  90.     @active_battler.current_action.skill_id = a
  91.     @action_battlers.unshift(@active_battler)
  92.     update_phase4_step1
  93.   end
  94. end
  95. update_e
  96. end
  97.   #--------------------------------------------------------------------------
  98.   # ● 生成特技行动结果
  99.   #--------------------------------------------------------------------------
  100.   def make_skill_action_result
  101.     # 获取特技
  102.     @skill = $data_skills[@active_battler.current_action.skill_id]
  103.     # 如果不是强制行动
  104.     unless @active_battler.current_action.forcing || @result != nil && [] #Eclair
  105.       # 因为 SP 耗尽而无法使用的情况下
  106.       unless @active_battler.skill_can_use?(@skill.id)
  107.         # 清除强制行动对像的战斗者
  108.         $game_temp.forcing_battler = nil
  109.         # 移至步骤 1
  110.         @phase4_step = 1
  111.         return
  112.       end
  113.     end
  114.     @result = [] #Eclair
  115.     # 消耗 SP
  116.     @active_battler.sp -= @skill.sp_cost
  117.     # 刷新状态窗口
  118.     @status_window.refresh
  119.     # 在帮助窗口显示特技名
  120.     @help_window.set_text(@skill.name, 1)
  121.     # 设置动画 ID
  122.     @animation1_id = @skill.animation1_id
  123.     @animation2_id = @skill.animation2_id
  124.     # 设置公共事件 ID
  125.     @common_event_id = @skill.common_event_id
  126.     # 设置对像侧战斗者
  127.     set_target_battlers(@skill.scope)
  128.     # 应用特技效果
  129.     for target in @target_battlers
  130.       target.skill_effect(@active_battler, @skill)
  131.     end
  132.   end
  133. end
  134. #==============================================================================
  135. #   组合键连续特技系统 By 绿发的Eclair
  136. #==============================================================================
复制代码






完全不起作用啊,求助开版大,
我用的也是RGSS103J,

是不是把Scene_Battle 4里的步骤3和4结合在一起就不行了?





  1.   #--------------------------------------------------------------------------
  2.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  3.   #--------------------------------------------------------------------------
  4.   def update_phase4_step3
  5.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  6.     if @animation1_id == 0
  7.       @active_battler.white_flash = true
  8.     else
  9.       @active_battler.animation_id = @animation1_id
  10.       @active_battler.animation_hit = true
  11.     end
  12.     # 对像方动画
  13.     for target in @target_battlers
  14.       target.animation_id = @animation2_id
  15.       target.animation_hit = (target.damage != "Miss")
  16.     end
  17.     # 限制动画长度、最低 8 帧
  18.     @wait_count = 50
  19.     # 移至步骤 4
  20.     @phase4_step = 5
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  24.   #--------------------------------------------------------------------------
  25.   def update_phase4_step4
  26.     # 移至步骤 5
  27.     @phase4_step = 5
  28.   end
复制代码


这是我改的..。
作者: Eclair    时间: 2008-2-1 20:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: feipeng250    时间: 2009-1-9 23:50
用自己的连技id好像不行啊???比如说
 case id
   when 1               
    chain = ["上","上"]
    chain_id = 2       只要id不是81(千裂斩)和82(灵魂裂隙)就无法显示动画...
作者: mkzr    时间: 2009-1-25 02:41
求助,用了add_chain增加了以后
只要存盘再读盘就会丢失这个数据(也就是说 存盘 退出再读盘以后 就没用了!!)
作者: mkzr    时间: 2009-1-25 02:44
呃...好象自己解决掉了...在存盘和读盘的时候使用内置函数把$CHAN这个数组存入SAVE里就行了

作者: dbshy    时间: 2009-1-25 03:22
很久就看到这个脚本了,到现在都不知道干啥用的 - -
作者: mkzr    时间: 2009-1-25 04:15
也许我的经历对后面用这个脚本的人有点用吧
我对这个东东做了如下改进
1.每次合法按键时都会播放一个短音效 以便玩家确认
2.修改存盘和读盘函数
在Scene_Load的def read_save_data(file)函数中添加    $chain = Marshal.load(file)
在Scene_Save的def write_save_data(file)函数中添加    Marshal.dump($chain, file)
这样就可以把游戏中获得的连技保存 并在下次游戏时加以读取

我本是新手,在使用中自己摸索的,还请各位大大指正

作者: Tabris_Air    时间: 2009-1-25 05:35
以下引用mkzr于2009-1-24 20:15:14的发言:

也许我的经历对后面用这个脚本的人有点用吧
我对这个东东做了如下改进
1.每次合法按键时都会播放一个短音效 以便玩家确认
2.修改存盘和读盘函数
在Scene_Load的def read_save_data(file)函数中添加    $chain = Marshal.load(file)
在Scene_Save的def write_save_data(file)函数中添加    Marshal.dump($chain, file)
这样就可以把游戏中获得的连技保存 并在下次游戏时加以读取

我本是新手,在使用中自己摸索的,还请各位大大指正


赞,用了好久也没发现有这个问题……




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1