查看: 3503|回复: 11

[已经过期] 如何让特定的敌人攻击可以进行连击,恢复血量等……

[复制链接]
梦石
0
星屑
1442
在线时间
171 小时
注册时间
2019-10-4
回帖
162
发表于 2020-4-2 23:26:33 | 显示全部楼层 |阅读模式

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

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

×
比如说,敌方队伍有个二刀流剑客,可以进行二次连击。攻击己方。就是说让敌人可以进行连击。我想就是有些敌人有点特殊效果,比如说吸血鬼攻击也可以吸血。恢复自身血量
梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2020-4-3 01:55:04 | 显示全部楼层
默认战斗的话,可以看我签名里的《战斗调用公共事件》

点评

范例里是有连击的吧?你如果是攻击触发攻击,需要加一个开关,关闭的时候触发连击并打开开关,打开的时候不触发连击并关闭。  发表于 2020-5-24 18:33
我看过了,但是我肯定自己修改的是错误了,敌方连击进行攻击再一次攻击会停不下来,进入死循环直到把己方人全部砍死,公共事件有点缺陷  发表于 2020-5-23 23:33

评分

参与人数 1赞 +1 收起 理由
taeckle + 1 很强!

查看全部评分

熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
1442
在线时间
171 小时
注册时间
2019-10-4
回帖
162
 楼主| 发表于 2020-4-19 17:41:49 | 显示全部楼层
guoxiaomi 发表于 2020-4-3 01:55
默认战斗的话,可以看我签名里的《战斗调用公共事件》

你那个我看了,我看的有点蒙。不过我还是谢谢,我自己使用很简单的战斗公共事件实现了,就是在敌人血量降低到某个数值,设置敌人行动攻击连续触发。在中断事件同样达成了连击效果
回复

使用道具 举报

梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
回帖
2014
发表于 2020-4-20 12:16:15 | 显示全部楼层
表示菜鸟纵版都有以上功能。
不过我也是顺手加进去,因为以前攻击两下,全体,吸血什么的几乎是标配。尝试搜索“攻击两次”,“吸血”等关键字看能找到没有。
回复

使用道具 举报

梦石
0
星屑
1442
在线时间
171 小时
注册时间
2019-10-4
回帖
162
 楼主| 发表于 2020-4-22 10:46:50 | 显示全部楼层
enghao_lim 发表于 2020-4-20 12:16
表示菜鸟纵版都有以上功能。
不过我也是顺手加进去,因为以前攻击两下,全体,吸血什么的几乎是标 ...

我是想设置更强大的敌人,是敌方吸取自方的血量,敌方可以进行二连,你说可行吗
回复

使用道具 举报

梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
回帖
2014
发表于 2020-4-24 15:38:39 | 显示全部楼层
契约师Vi 发表于 2020-4-22 10:46
我是想设置更强大的敌人,是敌方吸取自方的血量,敌方可以进行二连,你说可行吗 ...

其实我已经告诉你完全可行了……
看来你连“菜鸟纵版”都没搜索过……
算了我人好,把脚本扒出来给你好了。

举例:
添加一个名为 ☆攻*2 的属性后,不管武器,状态只要勾上这个武器一律视为可攻击两次;敌人则是改属性有效度为B那该敌人默认就会攻击两次。

如果要攻击三次就是 ☆攻*3,以此类推。

其他效果基本同设置方法,只是关键字就不同。

根据你说的效果,只要那个敌人同时拥有以下的属性有效度即可。

ss.png

脚本没什么好看的……[pre lang="ruby"]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 菜鸟纵版 v 0.4 by enghao_lim (小lim)
# 03 【战斗特效】插件
# date: 2010/11/11(光棍节快乐!)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 说明帮助
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# 01 就是一些基本的战斗特效,设置几乎都是直接在数据库里,简单。
#
# 02 攻击次数就是攻击的次数,与彩虹连击那种效果是不一样的,如默认的"☆攻*2",
#    就代表攻击两次,"☆攻*3"就是攻击三次,可以多设。详情见范例。
#
# 03 吸收也就是攻击过后吸收部分的攻击化为hp,设置方式是像"☆吸*100",就是 100
#    一百八仙的把攻击吸收,"☆吸*50"就是吸收50 %,设置雷同攻击次数设置。
#
# 04 护体效果就是用SP来抵挡伤害。
#
# 05 会心一击就是更改会心一击的几率,"☆会*100"就是一百八仙的会心一击几率。
#
# 06 全体攻击是特地为武器设的,持有该属性的武器,敌人,或者持有该状态的角色将
#    可以执行全体攻击。
#
# 07 重生就是死了会复活的状态,可以多设。
#
# 08 总共六种效果,可是贯穿了许多种类的设置,绝对可以做出付出强悍的组合战斗特
#    效。
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# PS: 以下为一些基本设置
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module VBattle

  # - | 设 | 置 | 从 | 此 | 开 | 始 | - - - - - - - - - - - - - - - - - - - -

  # 攻击次数 的属性名称(敌人,技能,武器,与状态)
  Element_multi_attack = "☆攻*"

  # 吸收 的属性名称(敌人,技能,武器,物品)
  Element_absorb = "☆吸*"

  # 护体 的属性名称(防具,状态,敌人)
  Element_protect = "☆护"

  # 会心一击(技能,状态,敌人,武器)
  Element_critical = "☆会*"

  # 全体攻击(武器,状态,敌人)
  Element_full_scope = "☆全"

  # 重生 状态的ID(数组)
  State_revive = [17]

  # 重生 所会恢复的HP %
  Hp_revive = 50

  # 重生 时播放的动画
  Ani_revive = 26

  # - | 设 | 置 | 到 | 此 | 结 | 束 | - - - - - - - - - - - - - - - - - - - -

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取连续攻击属性数组
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def self.get_multi_attack_element
    elements = load_data("data/System.rxdata").elements
    result = []
    (0...elements.size).each{|i|
      if elements.include?(Element_multi_attack)
        result.push(i)
      end
    }
    return result
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取吸收攻击属性数组
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def self.get_absorb_element
    elements = load_data("data/System.rxdata").elements
    result = []
    (0...elements.size).each{|i|
      if elements.include?(Element_absorb)
        result.push(i)
      end
    }
    return result
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取会心一击属性数组
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def self.get_critical_element
    elements = load_data("data/System.rxdata").elements
    result = []
    (0...elements.size).each{|i|
      if elements.include?(Element_critical)
        result.push(i)
      end
    }
    return result
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取护体属性编号
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def self.get_protect_element
    elements = load_data("data/System.rxdata").elements
    result = 0
    (0...elements.size).each{|i|
      if elements == Element_protect
        result = i
        break
      end
    }
    return result
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取全体攻击属性编号
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def self.get_full_scope_element
    elements = load_data("data/System.rxdata").elements
    result = 0
    (0...elements.size).each{|i|
      if elements == Element_full_scope
        result = i
        break
      end
    }
    return result
  end

end

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◇ RPG
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module RPG
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 技能
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  class Skill
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 连续攻击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def multi_attack
      result = 1
      for element in VBattle::get_multi_attack_element
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_multi_attack).to_i
          result = a if a > result
        end
      end
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 吸收
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def absorb
      result = 0
      VBattle::get_absorb_element.each{|element|
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_absorb).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 会心一击追击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def critical_chance
      result = 0
      VBattle::get_critical_element.each{|element|
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_critical).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 获取属性
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    alias old_b_element_set element_set
    def element_set
      result = old_b_element_set
      for element in VBattle::get_multi_attack_element
        result.delete(element)
      end
      for element in VBattle::get_absorb_element
        result.delete(element)
      end
      for element in VBattle::get_critical_element
        result.delete(element)
      end
      result.delete(VBattle::get_full_scope_element)
      result.delete(VBattle::get_protect_element)
      return result
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 武器
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  class Weapon
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 连续攻击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def multi_attack
      result = 1
      for element in VBattle::get_multi_attack_element
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_multi_attack).to_i
          result = a if a > result
        end
      end
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 吸收
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def absorb
      result = 0
      VBattle::get_absorb_element.each{|element|
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_absorb).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 会心一击追击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def critical_chance
      result = 0
      VBattle::get_critical_element.each{|element|
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_critical).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 全体追击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def full_scope
      return true if @element_set.include?(VBattle::get_full_scope_element)
      return false
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 获取属性
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    alias old_b_element_set element_set
    def element_set
      result = old_b_element_set
      for element in VBattle::get_multi_attack_element
        result.delete(element)
      end
      for element in VBattle::get_absorb_element
        result.delete(element)
      end
      for element in VBattle::get_critical_element
        result.delete(element)
      end
      result.delete(VBattle::get_full_scope_element)
      result.delete(VBattle::get_protect_element)
      return result
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 防具
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  class Armor
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 护体
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def protect?
      return false if VBattle::get_protect_element == 0
      return @guard_element_set.include?(VBattle::get_protect_element)
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 物品
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  class Item
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 吸收
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def absorb
      result = 0
      VBattle::get_absorb_element.each{|element|
        if @element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_absorb).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 获取属性
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    alias old_b_element_set element_set
    def element_set
      result = old_b_element_set
      for element in VBattle::get_multi_attack_element
        result.delete(element)
      end
      for element in VBattle::get_absorb_element
        result.delete(element)
      end
      for element in VBattle::get_critical_element
        result.delete(element)
      end
      result.delete(VBattle::get_full_scope_element)
      result.delete(VBattle::get_protect_element)
      return result
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 状态
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  class State
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 连续攻击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def multi_attack
      result = 1
      for element in VBattle::get_multi_attack_element
        if @guard_element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_multi_attack).to_i
          result = a if a > result
        end
      end
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 护体
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def protect?
      return false if VBattle::get_protect_element == 0
      return @guard_element_set.include?(VBattle::get_protect_element)
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 会心一击追击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def critical_chance
      result = 0
      VBattle::get_critical_element.each{|element|
        if @guard_element_set.include?(element)
          a = $data_system.elements[element].delete(VBattle::Element_critical).to_i
          result = a if a > result
        end
      }
      result = 100 if result > 100
      return result
    end
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # ◆ 全体追击
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def full_scope
      return true if @guard_element_set.include?(VBattle::get_full_scope_element)
      return false
    end
  end
end

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◆ Game_Battler
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Game_Battler
  attr_accessor :revive_ani
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 初始化
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  alias old_b_initialize initialize
  def initialize
    old_b_initialize
    @revive_ani = 0
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 更改对hp的写入
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def hp=(n)
    if !$scene.is_a?(Scene_Battle)
      org_hp(n)
      return
    end
    # 护体
    if n < @hp and self.protect?
      damage = @hp - n
      if self.sp >= damage
        self.sp -= damage
      else
        dif = damage - self.sp
        new_hp = @hp-dif
        self.sp = 0
        org_hp(new_hp)
      end
    else
      org_hp(n)
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 原版的hp写入
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def org_hp(hp)
    # 重生
    id = 0
    revive = false
    @states.each{|state|
      if VBattle::State_revive.include?(state)
        id = state
        revive = true
        break
      end
    }
    if hp <= 0 and revive
      remove_state(id)
      @revive_ani = VBattle::Ani_revive
    end
    # 原本的hp写入方式
    @hp = [[hp, maxhp].min, 0].max
    # 解除附加的战斗不能状态
    for i in 1...$data_states.size
      if $data_states.zero_hp
        if self.dead?
          add_state(i)
        else
          remove_state(i)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 应用通常攻击效果
  #     attacker : 攻击者 (battler)
  #--------------------------------------------------------------------------
  def attack_effect(attacker)
    # 清除会心一击标志
    self.critical = false
    # 第一命中判定
    hit_result = (rand(100) < attacker.hit)
    # 命中的情况下
    if hit_result == true
      # 计算基本伤害
      atk = [attacker.atk - self.pdef / 2, 0].max
      self.damage = atk * (20 + attacker.str) / 20
      # 属性修正
      self.damage *= elements_correct(attacker.element_set)
      self.damage /= 100
      # 伤害符号正确的情况下
      if self.damage > 0
        # 会心一击修正
        if attacker.critical_chance > 0
          if rand(100) < attacker.critical_chance
            self.damage *= 2
            self.critical = true
          end
        else
          if rand(100) < 4 * attacker.dex / self.agi
            self.damage *= 2
            self.critical = true
          end
        end
        # 防御修正
        if self.guarding?
          self.damage /= 2
        end
      end
      # 分散
      if self.damage.abs > 0
        amp = [self.damage.abs * 15 / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # 第二命中判定
      eva = 8 * self.agi / attacker.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
    end
    # 命中的情况下
    if hit_result == true
      # 状态冲击解除
      remove_states_shock
      # HP 的伤害计算
      self.hp -= self.damage
      # 状态变化
      @state_changed = false
      states_plus(attacker.plus_state_set)
      states_minus(attacker.minus_state_set)
    # Miss 的情况下
    else
      # 伤害设置为 "Miss"
      self.damage = "Miss"
      # 清除会心一击标志
      self.critical = false
    end
    # 过程结束
    return true
  end
  #--------------------------------------------------------------------------
  # ● 应用特技效果
  #     user  : 特技的使用者 (battler)
  #     skill : 特技
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    # 清除会心一击标志
    self.critical = false
    # 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
    # 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
    if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
       ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
      # 过程结束
      return false
    end
    # 清除有效标志
    effective = false
    # 公共事件 ID 是有效的情况下,设置为有效标志
    effective |= skill.common_event_id > 0
    # 第一命中判定
    hit = skill.hit
    if skill.atk_f > 0
      hit *= user.hit / 100
    end
    hit_result = (rand(100) < hit)
    # 不确定的特技的情况下设置为有效标志
    effective |= hit < 100
    # 命中的情况下
    if hit_result == true
      # 计算威力
      power = skill.power + user.atk * skill.atk_f / 100
      if power > 0
        power -= self.pdef * skill.pdef_f / 200
        power -= self.mdef * skill.mdef_f / 200
        power = [power, 0].max
      end
      # 计算倍率
      rate = 20
      rate += (user.str * skill.str_f / 100)
      rate += (user.dex * skill.dex_f / 100)
      rate += (user.agi * skill.agi_f / 100)
      rate += (user.int * skill.int_f / 100)
      # 计算基本伤害
      self.damage = power * rate / 20
      # 属性修正
      self.damage *= elements_correct(skill.element_set)
      self.damage /= 100
      # 伤害符号正确的情况下
      if self.damage > 0
        if skill.critical_chance > 0
          self.damage *= 2
          self.critical = true
        end
        # 防御修正
        if self.guarding?
          self.damage /= 2
        end
      end
      # 分散
      if skill.variance > 0 and self.damage.abs > 0
        amp = [self.damage.abs * skill.variance / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # 第二命中判定
      eva = 8 * self.agi / user.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
      # 不确定的特技的情况下设置为有效标志
      effective |= hit < 100
    end
    # 命中的情况下
    if hit_result == true
      # 威力 0 以外的物理攻击的情况下
      if skill.power != 0 and skill.atk_f > 0
        # 状态冲击解除
        remove_states_shock
        # 设置有效标志
        effective = true
      end
      # HP 的伤害减法运算
      last_hp = self.hp
      self.hp -= self.damage
      effective |= self.hp != last_hp
      # 状态变化
      @state_changed = false
      effective |= states_plus(skill.plus_state_set)
      effective |= states_minus(skill.minus_state_set)
      # 威力为 0 的场合
      if skill.power == 0
        # 伤害设置为空的字串
        self.damage = ""
        # 状态没有变化的情况下
        unless @state_changed
          # 伤害设置为 "Miss"
          self.damage = "Miss"
        end
      end
    # Miss 的情况下
    else
      # 伤害设置为 "Miss"
      self.damage = "Miss"
    end
    # 不在战斗中的情况下
    unless $game_temp.in_battle
      # 伤害设置为 nil
      self.damage = nil
    end
    # 过程结束
    return effective
  end
end
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◆ Game_BattleAction
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Game_BattleAction
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是否是普通攻击
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_attack?
    return (@kind == 0 and @basic == 0)
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是否是使用特技
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_skill?
    return (@kind == 1)
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是否是使用物品
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_item?
    return (@kind == 2)
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是否是普通防御
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_defend?
    return (@kind == 0 and @basic == 1)
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是否是逃跑
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_run?
    return (@kind == 0 and @basic == 2)
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 是不是什么也不做
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def is_nothing?
    return (@kind == 0 and ![0,1,2].include?(@basic))
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 直接获取技能
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def skill
    return $data_skills[@skill_id]
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 直接获取物品
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def item
    return $data_items[@item_id]
  end
end
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◆ Game_Actor
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Game_Actor
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取攻击次数
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def multi_attack
    result = 1
    if @weapons_id != 0
      result = $data_weapons[@weapon_id].multi_attack
    end
    for state in @states
      result = $data_states[state].multi_attack if $data_states[state].multi_attack > result
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取吸收八仙率
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def absorb
    value = 0
    if @current_action.is_attack?
      value = $data_weapons[@weapon_id].absorb if @weapon_id != 0
    elsif @current_action.is_skill?
      value = @current_action.skill.absorb
    elsif @current_action.is_item?
      value = @current_action.item.absorb
    end
    return value
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 护体
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def protect?
    result = false
    result |= $data_armors[@armor1_id].protect? if @armor1_id > 0
    result |= $data_armors[@armor2_id].protect? if @armor2_id > 0
    result |= $data_armors[@armor3_id].protect? if @armor3_id > 0
    result |= $data_armors[@armor4_id].protect? if @armor4_id > 0
    for state in @states
      result |= $data_states[state].protect?
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 会心一击追加
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def critical_chance
    result = 0
    if @weapon_id != 0
      result = $data_weapons[@weapon_id].critical_chance
    end
    for state in @states
      result = $data_states[state].critical_chance if\
               $data_states[state].critical_chance > result
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 普通全体攻击
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def full_scope_attack
    result = false
    result |= $data_weapons[@weapon_id].full_scope if @weapon_id > 0
    result |= @states.any?{|state|$data_states[state].full_scope}
    return result
  end
end

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◆ Game_Enemy
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Game_Enemy
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取攻击次数
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def multi_attack
    result = 1
    for element in VBattle::get_multi_attack_element
      a = $data_enemies[@enemy_id].element_ranks[element]
      b = $data_system.elements[element].delete(VBattle::Element_multi_attack).to_i
      result = b if a != 3 and b > result
    end
    for state in @states
      result = $data_states[state].multi_attack if $data_states[state].multi_attack > result
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取吸收八仙率
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def absorb
    result = 0
    if @current_action.is_attack?
      for element in VBattle::get_absorb_element
        a = $data_enemies[@enemy_id].element_ranks[element]
        b = $data_system.elements[element].delete(VBattle::Element_absorb).to_i
        result = b if a != 3 and b > result
      end
    elsif @current_action.is_skill?
      result = @current_action.skill.absorb
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 护体
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def protect?
    result = false
    result |= ($data_enemies[@enemy_id].\
              element_ranks[VBattle::get_protect_element] != 3\
              if VBattle::get_protect_element != 0)
    for state in @states
      result |= $data_states[state].protect?
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 获取会心一击几率
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def critical_chance
    result = 0
    if @current_action.is_attack?
      for element in VBattle::get_critical_element
        a = $data_enemies[@enemy_id].element_ranks[element]
        b = $data_system.elements[element].delete(VBattle::Element_critical).to_i
        result = b if a != 3 and b > result
      end
    end
    for state in @states
      result = $data_states[state].critical_chance if\
               $data_states[state].critical_chance > result
    end
    return result
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 全体攻击
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  def full_scope_attack
    result = false
    result |= ($data_enemies[@enemy_id].\
              element_ranks[VBattle::get_full_scope_element] != 3\
              if VBattle::get_full_scope_element != 0)
    result |= @states.any?{|state|$data_states[state].full_scope}
    return result
  end
end

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ◆ Scene_Battle
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 生成基本行动结果
  #--------------------------------------------------------------------------
  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]
      set_target_battlers(2) if @active_battler.full_scope_attack
      # 应用通常攻击效果
      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
  #--------------------------------------------------------------------------
  # ● 刷新画面 (角色命令回合 : 基本命令)
  #--------------------------------------------------------------------------
  def update_phase3_basic_command
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 转向前一个角色的指令输入
      phase3_prior_actor
      return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 角色指令窗口光标位置分之
      case @actor_command_window.index
      when 0  # 攻击
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
        if @active_battler.full_scope_attack
          phase3_next_actor
        else
          # 开始选择敌人
          start_enemy_select
        end
      when 1  # 特技
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 1
        # 开始选择特技
        start_skill_select
      when 2  # 防御
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        # 转向下一位角色的指令输入
        phase3_next_actor
      when 3  # 物品
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 2
        # 开始选择物品
        start_item_select
      end
      return
    end
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 准备行动
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  alias old_b_update_phase4_step1 update_phase4_step1
  def update_phase4_step1
    old_b_update_phase4_step1
    @attack_turn = 1
    if @active_battler.is_a?(Game_Battler)
      if @active_battler.current_action.is_attack?
        @attack_turn = @active_battler.multi_attack
      elsif @active_battler.current_action.is_skill?
        @attack_turn = @active_battler.current_action.skill.multi_attack
      end
    end
    @max_attack_turn = @attack_turn
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 显示伤害
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  alias old_b_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    if @active_battler.absorb > 0
      absorb = 0
      for battler in @target_battlers
        if battler.damage.is_a?(Numeric) and battler.damage > 0
          absorb += battler.damage
        end
      end
      if absorb > 0
        @active_battler.damage = -absorb*@active_battler.absorb/100
      end
    end
    old_b_update_phase4_step5
  end
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # ◆ 刷新
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  alias old_b_update_phase4_step6 update_phase4_step6
  def update_phase4_step6
    @attack_turn -= 1 if @attack_turn > 0
    @target_battlers.each{|target|
      if target.revive_ani != 0 and target.dead?
        target.hp = target.maxhp * VBattle::Hp_revive / 100
        target.animation_id = target.revive_ani
        target.damage = "复活"
        target.damage_pop = true
        target.revive_ani = 0
      end
    }
    all_target_dead = @target_battlers.all?{|b|b.dead?}
    if @active_battler.damage.is_a?(Numeric)
      @active_battler.hp -= @active_battler.damage
      @active_battler.damage_pop = true
      @active_battler.animation_id = 15
      @status_window.refresh
    end
    if @attack_turn == 0 or all_target_dead
      old_b_update_phase4_step6
    else
      @phase4_step = 2
    end
  end
end[/pre]

点评

菜鸟横版我看过啦。,但是还是不会啊,除非用了你的菜鸟战斗方式,方法是这样我懂,怎么实现是关键,不懂写具体的。属性怎么定义  发表于 2020-5-19 22:58
回复 1 0

使用道具 举报

梦石
0
星屑
1327
在线时间
206 小时
注册时间
2019-3-30
回帖
22
发表于 2020-4-26 00:58:41 | 显示全部楼层
@enghao_lim 大佬你这个我默认战斗的会提示错误有联系方式吗?地图行走变得非常卡
回复

使用道具 举报

梦石
0
星屑
1327
在线时间
206 小时
注册时间
2019-3-30
回帖
22
发表于 2020-4-26 01:00:40 | 显示全部楼层
冥域圣君 发表于 2020-4-26 00:58
@enghao_lim 大佬你这个我默认战斗的会提示错误有联系方式吗?地图行走变得非常卡 ...

@enghao_lim
回复

使用道具 举报

梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
回帖
2014
发表于 2020-5-18 00:06:42 | 显示全部楼层
冥域圣君 发表于 2020-4-26 00:58
@enghao_lim 大佬你这个我默认战斗的会提示错误有联系方式吗?地图行走变得非常卡 ...

你得贴出错误啊。
我测试了默认战斗并没有问题的说,而且这脚本和行走图扯不上关系,何来变卡一说。
如果你还用了其他脚本我就不能保证兼容性了。
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部