设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 5598|回复: 45
打印 上一主题 下一主题

[已经解决] 请教在状态50下使用攻击技能100结束后几率使用技能101再次...

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
跳转到指定楼层
1
发表于 2019-6-29 20:08:22 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我是这么想的:

条件1:装备第50号状态
条件2:已经学会第100号技能和第101号技能

结果:
当使用第100号技能攻击结束时自动触发第101号技能再次攻击


然后我发现我不知道要在哪个phase或者哪个step下写了。。。

求大神指点下思路,感激不尽!

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
2
 楼主| 发表于 2019-7-17 10:50:00 | 显示全部楼层
soulsaga 发表于 2019-6-29 20:22
技能调用公共事件强制行动就可以了吧?

那要是用下面猫大的连击脚本该怎么改呢?

这个是猫大的连击脚本:

# ===================================================================
# 连击效果(完美版) v1.2 by SailCat
# ===================================================================
# 数据库设定(特技):
#   名称:技能名称,连击次数(要用半角逗号)
#   例如:超究舞神霸斩,11
#         狮子心,16
#         陨石,9
# 注意这是连击次数,实际攻击的回数是这个回数+1回。
# 省略逗号连同后面的参数的话,连击次数默认为零。
# 连击次数是负数的话,将取绝对值处理。
# 视觉效果是发动动画只放1回,击中动画放N回,伤害值显示N次,
# 所以,如使用了齐时战斗的话,要修改倒数第四行,该行内容为:
#     @phase4_step = 4
# 改为@phase4_step = 3
# 其他:RTAB不适用
# ===================================================================
module RPG
class Skill
   def name
     name = @name.split(/,/)[0]
     return name != nil ? name : ""
   end
   def hit_count
     name = @name.split(/,/)[1]
     return name != nil ? name.to_i.abs : 0
   end
end
class Sprite < ::Sprite
   def effect?
     @_whiten_duration > 0 or
     @_appear_duration > 0 or
     @_escape_duration > 0 or
     @_animation_duration > 0
   end
   def damage_effect?
     @_damage_duration > 0 or
     @_collapse_duration > 0
   end
end
end
class Spriteset_Battle
def damage_effect?
   for sprite in @enemy_sprites + @actor_sprites
     return true if sprite.damage_effect?
   end
   return false
end
end  
class Scene_Battle
alias sailcat_update_phase4_step1 update_phase4_step1
alias sailcat_make_skill_action_result make_skill_action_result
alias sailcat_update_phase4_step5 update_phase4_step5
def update_phase4_step1
   @hit_count = 0
   sailcat_update_phase4_step1
end
def make_skill_action_result
   sailcat_make_skill_action_result
   @hit_count = @skill.hit_count
end
def update_phase4_step5
   sailcat_update_phase4_step5
   if @hit_count > 0
     for target in @target_battlers.clone
       if target.dead?
         if @target_battlers.size > 1
           @target_battlers.delete(target)
         else
           @target_battlers.delete(target)
           if target.is_a?(Game_Enemy)
             target = $game_troop.smooth_target_enemy(target.index)
           else
             target = $game_party.smooth_target_actor(target.index)
           end
           if target.is_a?(Game_Battler)
             @target_battlers.push(target)
           end
         end
       end
     end
     if @target_battlers.size == 0
       return
     end
     for target in @target_battlers
       if target.damage != nil
         @phase4_step = 5
         return
       end
       target.skill_effect(@active_battler, @skill)
     end
     # 如果你应用了23种战斗特效的公共事件版脚本请去掉下面几行的注释
      if @common_event_id > 0
        common_event = $data_common_events[@common_event_id]
        $game_system.battle_interpreter.setup(common_event.list, 0)
      end
     @hit_count -= 1
     @phase4_step = 3
   end
end
end
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
3
 楼主| 发表于 2019-7-17 16:19:09 | 显示全部楼层
本帖最后由 taeckle 于 2019-7-17 16:20 编辑
soulsaga 发表于 2019-7-17 11:39
这个脚本只是单个技能的连击数..和你要求的无关..建议换脚本...


这是默认的phase4:

  # ● 刷新画面 (主回合步骤 2 : 开始行动)
  #--------------------------------------------------------------------------
  def update_phase4_step2
    # 如果不是强制行动
    unless @active_battler.current_action.forcing
      # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
      if @active_battler.restriction == 2 or @active_battler.restriction == 3
        # 设置行动为攻击
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
      end
      # 限制为 [不能行动] 的情况下
      if @active_battler.restriction == 4
        # 清除行动强制对像的战斗者
        $game_temp.forcing_battler = nil
        # 移至步骤 1
        @phase4_step = 1
        return
      end
    end
    # 清除对像战斗者
    @target_battlers = []
    # 行动种类分支
    case @active_battler.current_action.kind
    when 0  # 基本
      make_basic_action_result
    when 1  # 特技
      make_skill_action_result
    when 2  # 物品
      make_item_action_result
    end
    # 移至步骤 3
    if @phase4_step == 2
      @phase4_step = 3
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成基本行动结果
  #--------------------------------------------------------------------------
  def make_basic_action_result
    # 攻击的情况下
    if @active_battler.current_action.basic == 0
      # 设置攻击 ID
      @animation1_id = @active_battler.animation1_id
      @animation2_id = @active_battler.animation2_id
      # 行动方的战斗者是敌人的情况下
      if @active_battler.is_a?(Game_Enemy)
        if @active_battler.restriction == 3
          target = $game_troop.random_target_enemy
        elsif @active_battler.restriction == 2
          target = $game_party.random_target_actor
        else
          index = @active_battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        end
      end
      # 行动方的战斗者是角色的情况下
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.restriction == 3
          target = $game_party.random_target_actor
        elsif @active_battler.restriction == 2
          target = $game_troop.random_target_enemy
        else
          index = @active_battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
      end
      # 设置对像方的战斗者序列
      @target_battlers = [target]
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
    # 防御的情况下
    if @active_battler.current_action.basic == 1
      # 帮助窗口显示"防御"
      @help_window.set_text($data_system.words.guard, 1)
      return
    end
    # 逃跑的情况下
    if @active_battler.is_a?(Game_Enemy) and
       @active_battler.current_action.basic == 2
      #  帮助窗口显示"逃跑"
      @help_window.set_text("逃跑", 1)
      # 逃跑
      @active_battler.escape
      return
    end
    # 什么也不做的情况下
    if @active_battler.current_action.basic == 3
      # 清除强制行动对像的战斗者
      $game_temp.forcing_battler = nil
      # 移至步骤 1
      @phase4_step = 1
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置物品或特技对像方的战斗者
  #     scope : 特技或者是物品的范围
  #--------------------------------------------------------------------------
  def set_target_battlers(scope)
    # 行动方的战斗者是敌人的情况下
    if @active_battler.is_a?(Game_Enemy)
      # 效果范围分支
      case scope
      when 1  # 敌单体
        index = @active_battler.current_action.target_index
        @target_battlers.push($game_party.smooth_target_actor(index))
      when 2  # 敌全体
        for actor in $game_party.actors
          if actor.exist?
            @target_battlers.push(actor)
          end
        end
      when 3  # 我方单体
        index = @active_battler.current_action.target_index
        @target_battlers.push($game_troop.smooth_target_enemy(index))
      when 4  # 我方全体
        for enemy in $game_troop.enemies
          if enemy.exist?
            @target_battlers.push(enemy)
          end
        end
      when 5  # 我方单体 (HP 0)
        index = @active_battler.current_action.target_index
        enemy = $game_troop.enemies[index]
        if enemy != nil and enemy.hp0?
          @target_battlers.push(enemy)
        end
      when 6  # 我方全体 (HP 0)
        for enemy in $game_troop.enemies
          if enemy != nil and enemy.hp0?
            @target_battlers.push(enemy)
          end
        end
      when 7  # 使用者
        @target_battlers.push(@active_battler)
      end
    end
    # 行动方的战斗者是角色的情况下
    if @active_battler.is_a?(Game_Actor)
      # 效果范围分支
      case scope
      when 1  # 敌单体
        index = @active_battler.current_action.target_index
        @target_battlers.push($game_troop.smooth_target_enemy(index))
      when 2  # 敌全体
        for enemy in $game_troop.enemies
          if enemy.exist?
            @target_battlers.push(enemy)
          end
        end
      when 3  # 我方单体
        index = @active_battler.current_action.target_index
        @target_battlers.push($game_party.smooth_target_actor(index))
      when 4  # 我方全体
        for actor in $game_party.actors
          if actor.exist?
            @target_battlers.push(actor)
          end
        end
      when 5  # 我方单体 (HP 0)
        index = @active_battler.current_action.target_index
        actor = $game_party.actors[index]
        if actor != nil and actor.hp0?
          @target_battlers.push(actor)
        end
      when 6  # 我方全体 (HP 0)
        for actor in $game_party.actors
          if actor != nil and actor.hp0?
            @target_battlers.push(actor)
          end
        end
      when 7  # 使用者
        @target_battlers.push(@active_battler)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成特技行动结果
  #--------------------------------------------------------------------------
  def make_skill_action_result
    # 获取特技
    @skill = $data_skills[@active_battler.current_action.skill_id]
    # 如果不是强制行动
    unless @active_battler.current_action.forcing
      # 因为 SP 耗尽而无法使用的情况下
      unless @active_battler.skill_can_use?(@skill.id)
        # 清除强制行动对像的战斗者
        $game_temp.forcing_battler = nil
        # 移至步骤 1
        @phase4_step = 1
        return
      end
    end
    # 消耗 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
  #--------------------------------------------------------------------------
  # ● 生成物品行动结果
  #--------------------------------------------------------------------------
  def make_item_action_result
    # 获取物品
    @item = $data_items[@active_battler.current_action.item_id]
    # 因为物品耗尽而无法使用的情况下
    unless $game_party.item_can_use?(@item.id)
      # 移至步骤 1
      @phase4_step = 1
      return
    end
    # 消耗品的情况下
    if @item.consumable
      # 使用的物品减 1
      $game_party.lose_item(@item.id, 1)
    end
    # 在帮助窗口显示物品名
    @help_window.set_text(@item.name, 1)
    # 设置动画 ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # 设置公共事件 ID
    @common_event_id = @item.common_event_id
    # 确定对像
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # 设置对像侧战斗者
    set_target_battlers(@item.scope)
    # 应用物品效果
    for target in @target_battlers
      target.item_effect(@item)
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  #--------------------------------------------------------------------------
  def update_phase4_step3
    # 行动方动画 (ID 为 0 的情况下是白色闪烁)
    if @animation1_id == 0
      @active_battler.white_flash = true
    else
      @active_battler.animation_id = @animation1_id
      @active_battler.animation_hit = true
    end
    # 移至步骤 4
    @phase4_step = 4
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  #--------------------------------------------------------------------------
  def update_phase4_step4
    # 对像方动画
    for target in @target_battlers
      target.animation_id = @animation2_id
      target.animation_hit = (target.damage != "Miss")
    end
    # 限制动画长度、最低 8 帧
    @wait_count = 8
    # 移至步骤 5
    @phase4_step = 5
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  #--------------------------------------------------------------------------
  def update_phase4_step5
    # 隐藏帮助窗口
    @help_window.visible = false
    # 刷新状态窗口
    @status_window.refresh
    # 显示伤害
    for target in @target_battlers
      if target.damage != nil
        target.damage_pop = true
      end
    end
    # 移至步骤 6
    @phase4_step = 6
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 6 : 刷新)
  #--------------------------------------------------------------------------
  def update_phase4_step6
    # 清除强制行动对像的战斗者
    $game_temp.forcing_battler = nil
    # 公共事件 ID 有效的情况下
    if @common_event_id > 0
      # 设置事件
      common_event = $data_common_events[@common_event_id]
      $game_system.battle_interpreter.setup(common_event.list, 0)
    end
    # 移至步骤 1
    @phase4_step = 1
  end
end
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
4
 楼主| 发表于 2019-7-17 23:29:17 | 显示全部楼层
soulsaga 发表于 2019-7-17 16:42
# 設定例
  # SKILL_CHASE[スキルID] = [追加攻撃の攻撃力(%), 連鎖アニメID, オート発動フラグ,
  #   ...

还有为什么有时候每楼的点评一栏我看不到。。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
5
 楼主| 发表于 2019-7-18 23:24:38 | 显示全部楼层
soulsaga 发表于 2019-7-18 10:14
在那楼再点评就看到了..
另外我是叫你还不如用技能调用公用事件强制行动做好过.. ...

那个公共事件强制行动里的“战斗者”设定是神马意思啊?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
6
 楼主| 发表于 2019-7-21 17:19:27 | 显示全部楼层
soulsaga 发表于 2019-7-19 11:08
#==============================================================================
#   组合键连续特技 ...

大神你再帮我看看这个帖子是不是也跟咱的这个问题有联系:

https://rpg.blue/forum.php?mod=v ... p;page=1#pid2707512
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
7
 楼主| 发表于 2019-8-1 20:36:57 | 显示全部楼层
灯笼菜刀王 发表于 2019-8-1 10:15
用公共事件就行了, 简单直接绿色无污染


多谢大神!
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
8
 楼主| 发表于 2019-8-2 07:59:31 | 显示全部楼层
灯笼菜刀王 发表于 2019-8-1 10:15
用公共事件就行了, 简单直接绿色无污染

大神请问下在哪让100号攻击技能调用你写的这个公共事件啊?phase4_step3?
你这个脚本貌似没确定释放技能的目标就是上一次行动的目标啊?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
9
 楼主| 发表于 2019-8-2 12:38:42 | 显示全部楼层
灯笼菜刀王 发表于 2019-8-1 10:15
用公共事件就行了, 简单直接绿色无污染

报告大神,发现了一个BUG,当使用第100号技能后把怪全部打完时会卡死..动不了了。。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9128
在线时间
463 小时
注册时间
2015-5-8
帖子
865
10
 楼主| 发表于 2019-8-2 15:31:13 | 显示全部楼层
taeckle 发表于 2019-8-2 12:38
报告大神,发现了一个BUG,当使用第100号技能后把怪全部打完时会卡死..动不了了。。 ...


大神就是大神,判定敌方或是我方是否还有人存在用3行就表达出来了,我这边用for语句写了半页纸..


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-18 22:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表