查看: 3409|回复: 17

[已经过期] RTAB系统1782行出错

[复制链接]
梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
发表于 2017-2-3 21:29:42 | 显示全部楼层 |阅读模式

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

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

×
QQ图片20170203212920.png QQ截图20170203213120.png 本来是没问题 但是插了战斗特效以后 战斗一打人就出错 表示不解 删掉战斗特效这个脚本以后又正常了 不懂是哪里出问题{:2_258:}
梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2017-2-6 19:29:18 | 显示全部楼层
没用过rtab,这个报错一般是你把 1 个参数传递给了需要 2 个参数的方法。1782 行是哪个方法呢?可以发出来看看吗
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-6 20:52:10 | 显示全部楼层
guoxiaomi 发表于 2017-2-6 19:29
没用过rtab,这个报错一般是你把 1 个参数传递给了需要 2 个参数的方法。1782 行是哪个方法呢?可以发出来 ...

make_skill_action_result(battler) 就这一句 不明白什么意思没法改

点评

或者把这一行上下文发出来看看?可能加个 skill 就完了…… 不过我没有用过RTAB,上面的分析也只是从报错判断的。  发表于 2017-2-7 14:42
对啊,这个报错就算因为,make_skill_action_result()需要2个参数,一个是battler,另一个可能是skill?你Ctrl + F 搜索make_skill_action_result看看具体怎么写的  发表于 2017-2-7 14:41
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-7 20:05:28 | 显示全部楼层
guoxiaomi 发表于 2017-2-6 19:29
没用过rtab,这个报错一般是你把 1 个参数传递给了需要 2 个参数的方法。1782 行是哪个方法呢?可以发出来 ...

#--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  #--------------------------------------------------------------------------
  def update_phase4_step2(battler)
    # 強制アクションでなければ
    unless battler.current_action.forcing
      # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
      if battler.restriction == 2 or battler.restriction == 3
        # アクションに攻撃を設定
        battler.current_action.kind = 0
        battler.current_action.basic = 0
      end
    end
    # アクションの種別で分岐
    case battler.current_action.kind
    when 0  # 基本
      if fin?
        battler.phase = 6
        return
      end
      make_basic_action_result(battler)
    when 1  # スキル
      if fin? and $data_skills[battler.current_action.skill_id].scope == 1..2
        battler.phase = 6
        return
      end
      make_skill_action_result(battler)
    when 2  # アイテム
      if fin? and $data_items[battler.current_action.item_id].scope == 1..2
        battler.phase = 6
        return
      end
      make_item_action_result(battler)
    end
    if battler.phase == 2
      # ステップ 3 に移行
      battler.phase = 3
    end
  end
这是搜索make_skill_action_result出来的第一个地方 楼下第二个地方 大大帮看一看有没有问题
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-7 20:06:19 | 显示全部楼层
#--------------------------------------------------------------------------
  # ● スキルアクション 結果作成
  #--------------------------------------------------------------------------
  def make_skill_action_result(battler)
    # スキルを取得
    @skill = $data_skills[battler.current_action.skill_id]
    # 連携スキルであるかどうか確認
    speller = synthe?(battler)
    # 強制アクションでなければ
    unless battler.current_action.forcing
      # SP 切れなどで使用できなくなった場合
      if speller == nil
        unless battler.skill_can_use?(@skill.id)
          # ステップ 6 に移行
          battler.phase = 6
         return
        end
      end
    end
    # SP 消費
    temp = false
    if speller != nil
      for spell in speller
        if spell.current_action.spell_id == 0
          spell.sp -= @skill.sp_cost
        else
          spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost
        end
        # ステータスウィンドウをリフレッシュ
        status_refresh(spell)
      end
    else
      battler.sp -= @skill.sp_cost
      # ステータスウィンドウをリフレッシュ
      status_refresh(battler)
    end
    # アニメーション ID を設定
    battler.anime1 = @skill.animation1_id
    battler.anime2 = @skill.animation2_id
    # コモンイベント ID を設定
    battler.event = @skill.common_event_id
    # 対象側バトラーを設定
    set_target_battlers(@skill.scope, battler)
    # スキルの効果を適用
    for target in battler.target
      if speller != nil
        damage = 0
        d_result = false
        effective = false
        state_p = []
        state_m = []
        for spell in speller
          if spell.current_action.spell_id != 0
            @skill = $data_skills[spell.current_action.spell_id]
          end
          effective |= target.skill_effect(spell, @skill)
          if target.damage[spell].class != String
            d_result = true
            damage += target.damage[spell]
          elsif effective
            effect = target.damage[spell]
          end
          state_p += target.state_p[spell]
          state_m += target.state_m[spell]
          target.damage.delete(spell)
          target.state_p.delete(spell)
          target.state_m.delete(spell)
        end
        if d_result
          target.damage[battler] = damage
        elsif effective
          target.damage[battler] = effect
        else
          target.damage[battler] = 0
        end
        target.state_p[battler] = state_p
        target.state_m[battler] = state_m
      else
        target.skill_effect(battler, @skill)
      end
    end
  end
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-7 20:11:51 | 显示全部楼层
guoxiaomi 发表于 2017-2-6 19:29
没用过rtab,这个报错一般是你把 1 个参数传递给了需要 2 个参数的方法。1782 行是哪个方法呢?可以发出来 ...

我在战斗特效这个脚本里发现了一句make_skill_action_result(battler, plus_id),之后把原来RTAB脚本里的make_skill_action_result(battler)改成这句结果1782还是错 不过变成了NameError

点评

很可能是战斗特效脚本重新定义了make_skill_action_result方法要求2个参数,battler和plusid。然后这里的使用就报错了。可以发一下战斗特效的那段内容吗?  发表于 2017-2-8 00:24
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-8 16:47:03 | 显示全部楼层
guoxiaomi 发表于 2017-2-6 19:29
没用过rtab,这个报错一般是你把 1 个参数传递给了需要 2 个参数的方法。1782 行是哪个方法呢?可以发出来 ...

#--------------------------------------------------------------------------
# ● 生成特技行动结果
#--------------------------------------------------------------------------
  alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(battler, plus_id)
    # 获取特技
    @skill = $data_skills[battler.current_action.skill_id + plus_id]
    # 获取行动者特技附加的战斗特效
    battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
    # 行动时附加自身状态
          if battler.current_action.p_state > 0
        battler.pp_state(battler,battler.current_action.p_state)
      end
    # 行动时解除自身状态  
      if battler.current_action.m_state > 0
        battler.remove_state(battler.current_action.m_state)
      end
    # recall
    xrxs19_make_skill_action_result(battler, plus_id)
  end
战斗特效这段
回复

使用道具 举报

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2017-2-8 20:31:07 | 显示全部楼层
lulu908 发表于 2017-2-8 16:47
#--------------------------------------------------------------------------
# ● 生成特技行动结果
...

alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(battler, plus_id=0)
    # 获取特技

点评

这个就要楼主测验了才知道结果了,既然不兼容那么肯定会残缺一些功能吧。  发表于 2017-2-8 22:48
和我想的一样,我也想知道具体plus_id应该设置成什么默认值  发表于 2017-2-8 22:02

评分

参与人数 1星屑 +15 收起 理由
guoxiaomi + 15 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-9 11:24:07 | 显示全部楼层
夜狠简单 发表于 2017-2-8 20:31
alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(ba ...



#--------------------------------------------------------------------------
# ● 生成特技行动结果
#--------------------------------------------------------------------------
alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(battler, plus_id=0)
    # 获取特技
    @skill = $data_skills[battler.current_action.skill_id + plus_id]
    # 获取行动者特技附加的战斗特效
    battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
    # 行动时附加自身状态
          if battler.current_action.p_state > 0
        battler.pp_state(battler,battler.current_action.p_state)
      end
    # 行动时解除自身状态  
      if battler.current_action.m_state > 0
        battler.remove_state(battler.current_action.m_state)
      end
    # recall
    xrxs19_make_skill_action_result(battler, plus_id)
  end
倒数第二行就是1148
QQ图片20170209112707.png

点评

高级编辑用代码框把这个脚本完整的发出来吧- -  发表于 2017-2-9 12:15
再补充一点,我修改了自带的暴击率计算和暴击伤害公式之后RTAB战斗特效就和RTAB战斗系统冲突,在脚本原工程也是这样 但是单独用RTAB战斗能正常使用  发表于 2017-2-9 11:30
回复

使用道具 举报

梦石
0
星屑
173
在线时间
40 小时
注册时间
2011-8-12
回帖
12
 楼主| 发表于 2017-2-9 15:21:17 | 显示全部楼层
夜狠简单 发表于 2017-2-8 20:31
alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(ba ...

[pre lang="ruby" line="1"]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# 基础脚本▼▲▼ XRXS19. 特殊効果詰め合わせ DamageEX ver.2 ▼▲▼ built 220920
# by 桜雅 在土 (基本) Tetra-Z   (修正)  http://scriptself.jpn.org/x/XRXS19.htm
#==============================================================================
# ▼▲▼ 战斗特殊效果属性 DamageEX - Plus × RTAB ▼▲▼
#
# 适用环境:RTAB Ver 1.16
#
# by SixRice  (Plus × RTAB改造)     Ver.1.03 2006/8/18
# 从1.03版开始记录每次更新。
#==============================================================================
# 伤害计算流程:
# 1  基础伤害计算                   (Game Battler)
# 2  忽视躲闪判定                   (IGNORE_EVADE)
# 3  修正基础伤害                   (HP_RATE,SP_RATE,CRITICAL_HIT,ADD_VARIANCE)
# 4  固定伤害(取消基础)             (FIXDAMAGE)
# 5  追加伤害计算                   (追加伤害效果类)
# -> 基础伤害(或固定伤害)+追加伤害
# =  总伤害
# 6  修正总伤害                     (HP_DAMAGE,SP_DAMAGE)
# -> 最终伤害
# 7  收招修正使用者的HP/SP          (HP_CORRECT,SP_CORRECT)(1.03)
# 8  根据最终伤害修正使用者的HP/SP  (HP_DRAIN,SP_DRAIN)
#------------------------------------------------------------------------------
module XRXS19
#------------------------------------------------------------------------------
# 一:特殊伤害效果类的属性名称设定
#------------------------------------------------------------------------------  
# 提示:本类属性名称后请添加自定义数值,然后才会生效。(数据库)
#------------------------------------------------------------------------------  
# 提示:本类属性请设为“不计算属性有效度”(XRXS38. 属性修正计算数限制)。
#------------------------------------------------------------------------------  
# 提示:本类属性中如果存在同属性,效果也叠加。
#
# 举例:一个东西同时包含HP吸收50%,HP吸收25%,实际效果为HP吸收75%.
#------------------------------------------------------------------------------
  AT_DAMAGE         = "AT伤害"         # 「修正目标的AT值(行动值)」(1.03)
  HP_DAMAGE         = "HP伤害"         # 「将本次造成的总伤害的x%修正为HP伤害」
  SP_DAMAGE         = "SP伤害"         # 「将本次造成的总伤害的x%修正为SP伤害」
  HP_DRAIN          = "HP吸收"         # 「根据本次最终伤害的x%修正使用者的HP」
  SP_DRAIN          = "SP吸收"         # 「根据本次最终伤害的x%修正使用者的SP」
  HP_RATE           = "现HP威力"       # 「根据使用者HP/MAXHP修正本次基础伤害」
  SP_RATE           = "现SP威力"       # 「根据使用者SP/MAXSP修正本次基础伤害」
  CRITICAL_HIT      = "必杀"           # 「会心一击」   (武器效果通用化)
  IGNORE_EVADE      = "忽视躲闪"       # 「忽视躲闪」   (特技效果武器化)
  ADD_VARIANCE      = "分散度"         # 「追加分散度」 (特技效果武器化)
  FIXDAMAGE         = "固定伤害"       # 「固定伤害值」 (特技效果武器化)
#------------------------------------------------------------------------------
# 提示:本类中“固定伤害值”不能和“会心一击”、“追加分散度”叠加;
#       其余效果均可叠加。   
#------------------------------------------------------------------------------  
  AREA_EXTEND       = "敌方全体"      # 「敌方全体」属性名2
  AREA_ACTOR        = "己方单体"      # 「己方单体」属性名3
  AREA_ACTOR_ALL    = "己方全体"      # 「己方全体」属性名4
  AREA_SELF         = "使用者"        # 「 使用者 」属性名7
  AREA_WHOLE        = "全域化"        # 「 全域化 」属性名8
  AREA_ENEMY_RAND   = "敌方随机"      # 「敌方随机」属性名9
  AREA_ACTOR_RAND   = "己方随机"      # 「己方随机」属性名10
  AREA_ALL_RAND     = "对象随机"      # 「对象随机」属性名11
  SELF_INCLUSION    = "诸刃"          # 「  诸刃  」属性名
  SELF_EXCLUSION    = "自身以外"      # 「自身以外」(与使用者,己方单体叠加无效)
#------------------------------------------------------------------------------  
# 提示:「诸刃」与
#   「使用者」,「己方单体」,「己方全体」,「己方随机」,「对象随机」叠加无效。
#------------------------------------------------------------------------------
  P_STATE           = "发动状态P"      # 「行动时附加自身状态」属性名
  M_STATE           = "发动状态M"      # 「行动时解除自身状态」属性名
  HP_CORRECT        = "收招修正H"      # 「收招时修正使用者HP」属性名(1.03)
  SP_CORRECT        = "收招修正S"      # 「收招时修正使用者SP」属性名(1.03)
#------------------------------------------------------------------------------
# 提示:在这个版本的战斗特殊效果属性中,
#       除了"会心一击" 、"忽视躲闪"、"追加分散度" 这三个效果以外,
#       其他的效果都支持负数,也就是逆转效果。
#
# 举例:想设置一个“敌我皆伤”的特技,只要附带HP吸收属性,效果设为负数就OK了。
#
# 举例:如果把"HP伤害负数" + "作用范围己方"设置为武器属性,
#       就可以设置出回复己方HP的BT武器来。
#
# 更多创意想法等你来发挥!!
#------------------------------------------------------------------------------
# 二:追加伤害效果类的属性名称设定
#------------------------------------------------------------------------------
# 本类采用的英文单词缩写
# NOW(N) = 当前 ;MAX(M) = 最大;DIF(D) = 差值 ;
# HP(H) = 生命 ;SP(S) = 精力 ;  
# TA(T) = target = 目标方;US(U) = user = 使用者 。
#------------------------------------------------------------------------------
  FIXDAMAGE_NOWHPTA = "NHT"            # 「目标方当前HP比例」属性名
  FIXDAMAGE_MAXHPTA = "MHT"            # 「目标方最大HP比例」属性名
  FIXDAMAGE_DIFHPTA = "DHT"            # 「目标方HP差值比例」属性名
  FIXDAMAGE_NOWHPUS = "NHU"            # 「使用者当前HP比例」属性名  
  FIXDAMAGE_MAXHPUS = "MHU"            # 「使用者最大HP比例」属性名
  FIXDAMAGE_DIFHPUS = "DHU"            # 「使用者HP差值比例」属性名
  FIXDAMAGE_NOWSPTA = "NST"            # 「目标方当前SP比例」属性名
  FIXDAMAGE_MAXSPTA = "MST"            # 「目标方最大SP比例」属性名
  FIXDAMAGE_DIFSPTA = "DST"            # 「目标方SP差值比例」属性名
  FIXDAMAGE_NOWSPUS = "NSU"            # 「使用者当前SP比例」属性名
  FIXDAMAGE_MAXSPUS = "MSU"            # 「使用者最大SP比例」属性名
  FIXDAMAGE_DIFSPUS = "DSU"            # 「使用者SP差值比例」属性名
#------------------------------------------------------------------------------
# 提示:本类所有效果均不能互相叠加,具有唯一性;
#       若特技属性中存在多个本类效果,则取最前面一个效果。  
#------------------------------------------------------------------------------
# 提示:特技附加本类属性的情况下,设特技的威力(pow)为比例基数,
#       武器附加本类属性的情况下,设武器攻击力(atk)为比例基数,
#       因此比例基数请通过数据库来设定。
#------------------------------------------------------------------------------
# 提示:本类所有效果均为普通伤害计算之后的追加伤害;
#       本类所有效果“独立计算属性有效度”,不与其他属性有效度进行混合运算。
#------------------------------------------------------------------------------
# 举例1:某特技属性附加"NHT" ,威力为20,其实际效果为:
#        造成 [目标方][当前][HP][20%] 的等量伤害。
#------------------------------------------------------------------------------
# 举例2:由于威力(power)这个值可以设为负数,
#        因此MHT这个属性也可用于制作比例回复HP的特技效果。
#------------------------------------------------------------------------------
end
#==============================================================================
# ■ Game_BattleAction
#==============================================================================
class Game_BattleAction
  attr_accessor :at_damage                # 「AT伤害值」    (Numeric)(1.03)
  attr_accessor :hp_damage                # 「HP伤害率」    (Numeric)
  attr_accessor :sp_damage                # 「SP伤害率」    (Numeric)
  attr_accessor :hp_drain                 # 「HP吸收率」    (Numeric)
  attr_accessor :sp_drain                 # 「SP吸收率」    (Numeric)
  attr_accessor :hp_rate                  # 「现HP威力」    (true/false)
  attr_accessor :sp_rate                  # 「现SP威力」    (true/false)
  attr_accessor :critical_hit             # 「会心一击」    (Numeric)
  attr_accessor :ignore_evade             # 「忽视躲闪」    (true/false)
  attr_accessor :add_variance             # 「追加分散度」  (Numeric)
  attr_accessor :fix_damage               # 「固定伤害值」 (Numeric)
  attr_accessor :special_damage_kind      # 「追加伤害类」  (Numeric)
  attr_accessor :scope_force              # 「对象强制值」  (Numeric)
  attr_accessor :self_inclusion           # 「诸刃」        (true/false)
  attr_accessor :self_exclusion           # 「自身以外」    (true/false)
  attr_accessor :p_state                  # 「行动时附加自身状态」(Numeric)
  attr_accessor :m_state                  # 「行动时解除自身状态」(Numeric)
  attr_accessor :hp_correct               # 「收招时修正使用者HP」(Numeric)(1.03)
  attr_accessor :sp_correct               # 「收招时修正使用者SP」(Numeric)(1.03)
  def at_damage
    return @at_damage.nil? ? 0 : @at_damage
end
#--------------------------------------------------------------------------
# ● clear
#--------------------------------------------------------------------------
  alias xrxs19_clear clear
  def clear
    # recall
    xrxs19_clear
    # 初始化特殊效果
    initialize_xrxs19_special_effect
  end
#--------------------------------------------------------------------------
# ○ 初始化特殊效果
#--------------------------------------------------------------------------
  def initialize_xrxs19_special_effect
    self.at_damage = 0#(1.03)
    self.hp_damage = 0
    self.sp_damage = 0
    self.hp_drain  = 0
    self.sp_drain  = 0
    self.hp_rate  = false
    self.sp_rate  = false
    self.critical_hit = 0
    self.ignore_evade = false
    self.add_variance = 0
    self.fix_damage = 0
    self.special_damage_kind = 0
    self.p_state = 0
    self.m_state = 0
    self.hp_correct = 0#(1.03)
    self.sp_correct = 0#(1.03)
  end
#--------------------------------------------------------------------------
# ○ 特殊效果设置
#--------------------------------------------------------------------------
  def set_xrxs19_special_effect(set)
    # AT伤害值(数值)(1.03)
    self.at_damage = XRXS.element_amount(set, XRXS19::AT_DAMAGE)
    # HP/SP伤害率(数值%)
    self.hp_damage = XRXS.element_percent(set, XRXS19::HP_DAMAGE)
    self.sp_damage = XRXS.element_percent(set, XRXS19::SP_DAMAGE)
    # HP/SP吸收率(数值%)
    self.hp_drain  = XRXS.element_percent(set, XRXS19::HP_DRAIN)
    self.sp_drain  = XRXS.element_percent(set, XRXS19::SP_DRAIN)
    # 现HP/SP威力 (true/false)
    self.hp_rate = XRXS.element_include?(set, XRXS19::HP_RATE)
    self.sp_rate = XRXS.element_include?(set, XRXS19::SP_RATE)
    # 会心一击率(数值%)
    returnar = XRXS.element_check(set, XRXS19::CRITICAL_HIT)
    percent = returnar[0] ? (returnar[2] == 0 ? 100 : returnar[2]) : 0
    self.critical_hit = percent
    # 忽视躲闪 (true/false)
    self.ignore_evade = XRXS.element_include?(set, XRXS19::IGNORE_EVADE)
    # 追加分散度(数值)
    self.add_variance = XRXS.element_amount(set, XRXS19::ADD_VARIANCE)
    # 固定伤害值(数值)
    self.fix_damage = XRXS.element_amount(set, XRXS19::FIXDAMAGE)
    # 追加伤害类
    self.special_damage_kind =
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPTA) ? 1 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPTA) ? 2 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPTA) ? 3 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPUS) ? 4 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPUS) ? 5 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPUS) ? 6 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPTA) ? 7 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPTA) ? 8 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPTA) ? 9 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPUS) ? 10 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPUS) ? 11 :
      XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPUS) ? 12 :      
      0
    # 行动时附加/解除自身状态(ID)
    self.p_state = XRXS.element_amount(set, XRXS19::P_STATE)
    self.m_state = XRXS.element_amount(set, XRXS19::M_STATE)
    # 收招时修正使用者HP/SP(数值)(1.03)
    self.hp_correct = XRXS.element_amount(set, XRXS19::HP_CORRECT)
    self.sp_correct = XRXS.element_amount(set, XRXS19::SP_CORRECT)
  end
#--------------------------------------------------------------------------
# ○ 特殊效果clear
#--------------------------------------------------------------------------
  def clear_xrxs19_special_effect
    self.at_damage = nil#(1.03)
    self.hp_damage = nil
    self.sp_damage = nil
    self.hp_drain  = nil
    self.sp_drain  = nil
    self.hp_rate  = false
    self.sp_rate  = false
    self.critical_hit = nil
    self.ignore_evade = false
    self.add_variance = nil
    self.fix_damage = nil
    self.special_damage_kind = nil
    self.scope_force = 0
    self.self_exclusion = false
    self.self_inclusion = false
    self.p_state = nil
    self.m_state = nil
    self.hp_correct = 0#(1.03)
    self.sp_correct = 0#(1.03)
  end
#--------------------------------------------------------------------------
# ○ 无效化特殊效果
#--------------------------------------------------------------------------
  def nillize_xrxs19_special_effect
    self.scope_force = nil
    self.self_inclusion = nil
    self.self_exclusion = nil
  end
end  
#==============================================================================
# □□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ○ 公开实例变量
#--------------------------------------------------------------------------
  attr_accessor :maxat                  # 最大AT#(1.03)
  attr_writer :ignore_evade             #(True为忽视对方躲闪判定)
  attr_writer :hp_rate                  #(True为基础伤害根据HP/MAXHP比例修正)
  attr_writer :sp_rate                  #(True为基础伤害根据SP/MAXSP比例修正)
#--------------------------------------------------------------------------
# ○特殊范围效果设定
#--------------------------------------------------------------------------  
  def set_xrxs19_special_scope(set)
# 范围强制值
self.current_action.scope_force =
XRXS.element_include?(set, XRXS19::AREA_EXTEND)     ? 2 :
XRXS.element_include?(set, XRXS19::AREA_ACTOR)      ? 3 :
XRXS.element_include?(set, XRXS19::AREA_ACTOR_ALL)  ? 4 :
XRXS.element_include?(set, XRXS19::AREA_SELF)       ? 7 :
XRXS.element_include?(set, XRXS19::AREA_WHOLE)      ? 8 :
XRXS.element_include?(set, XRXS19::AREA_ENEMY_RAND) ? 9 :
XRXS.element_include?(set, XRXS19::AREA_ACTOR_RAND) ? 10 :
XRXS.element_include?(set, XRXS19::AREA_ALL_RAND)   ? 11 :
0
# 诸刃
self.current_action.self_inclusion = XRXS.element_include?(set, XRXS19::SELF_INCLUSION)
# 自身以外
self.current_action.self_exclusion = XRXS.element_include?(set, XRXS19::SELF_EXCLUSION)
end
#--------------------------------------------------------------------------
# ● 新定义状态变化 (+) 发动状态适用
#--------------------------------------------------------------------------
  def pp_state(battler, i)
    # 清除有效标志
    effective = false
      # 无法防御本状态的情况下
      unless self.state_guard?(i)
        # 这个状态如果不是 full 的话就设置有效标志
        effective |= self.state_full?(i) == false
        # 状态为 [不能抵抗] 的情况下
        if $data_states.nonresistance
          # 设置状态变化标志
          @state_changed = true
          # 附加状态
          self.state_p[battler].push(i)
        # 这个状态不是 full 的情况下
        elsif self.state_full?(i) == false
          # 将状态的有效度变换为概率、与随机数比较
          if rand(100) < [0,100,80,60,40,20,0][self.state_ranks]
            # 设置状态变化标志
            @state_changed = true
            # ステートを付加
            self.add_state(i)
        end
      end
    end
    # 过程结束
    return effective
  end
#--------------------------------------------------------------------------
# ● 可以使用特技的判定
#    skill_id : 特技 ID
#--------------------------------------------------------------------------
  alias xrxs19_skill_can_use? skill_can_use?
  def skill_can_use?(skill_id)
  # 获取特技
  @skill = $data_skills[skill_id]
  # 范围计算
  set_xrxs19_special_scope(self.skill_element_set(@skill))
  $data_skills[skill_id].scope = self.current_action.scope_force if self.current_action.scope_force > 0
    # 范围是「自身以外」的情况
    if self.current_action.self_exclusion
      # 获取战斗者
      battlers = (self.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies)
      # 范围的分歧
      case $data_skills[skill_id].scope
      when 3,4,10
        # 获取生存的战斗者数量
        n = 0
        battlers.each {|battler| n += 1 unless battler.dead?}
      when 5,6
        # 获取战斗者总数
        n = battlers.size
      else
        n = 2
      end
      # 对象不存在的情况
      return false if n <= 1
    end
    # recall
    return xrxs19_skill_can_use?(skill_id)
  end   
#--------------------------------------------------------------------------
# ● 判断状态 [无法回避攻击]
#--------------------------------------------------------------------------
alias xrxs19_cant_evade? cant_evade?
def cant_evade?
return true if @ignore_evade
return xrxs19_cant_evade?
end
#--------------------------------------------------------------------------
# ○ 特殊效果设置
#--------------------------------------------------------------------------
  def set_xrxs19_special_effect(set)
    self.current_action.set_xrxs19_special_effect(set)
  end
#--------------------------------------------------------------------------
# ● 应用通常攻击效果
#    attacker : 攻击者 (battler)
#--------------------------------------------------------------------------
  alias xrxs19_attack_effect attack_effect
  def attack_effect(attacker)   
    # 特殊效果:忽视躲闪
      if  attacker.current_action.ignore_evade
      self.ignore_evade = true
    end
    return xrxs19_attack_effect(attacker)
  end
#--------------------------------------------------------------------------
# ● 应用特技效果
#     user  : 特技的使用者 (battler)
#     skill : 特技
#--------------------------------------------------------------------------
  alias xrxs19_skill_effect skill_effect
  def skill_effect(user, skill)
    # 特殊效果:忽视躲闪
    if  user.current_action.ignore_evade
    self.ignore_evade = true
  end
    return xrxs19_skill_effect(user, skill)
  end
#------------------------------------------------------------------------------
# ○ 伤害计算(属于对基本伤害的再处理)
#------------------------------------------------------------------------------
# ● 基础伤害计算请在“应用通常攻击效果” 和“应用特技效果”部分定义  
#------------------------------------------------------------------------------
  alias xrxs19co_x1_damage_effect damage_effect
  def damage_effect(battler, item, skill)
    # recall
    if item == 2 or self.damage[battler].class == String
      return xrxs19co_x1_damage_effect(battler, item)
    end
    # 初始化
    battler.current_action.at_damage    = 0 if battler.current_action.at_damage.nil?#(1.03)
    battler.current_action.hp_damage    = 0 if battler.current_action.hp_damage.nil?
    battler.current_action.sp_damage    = 0 if battler.current_action.sp_damage.nil?
    battler.current_action.hp_drain     = 0 if battler.current_action.hp_drain.nil?
    battler.current_action.sp_drain     = 0 if battler.current_action.sp_drain.nil?
    battler.current_action.critical_hit = 0 if battler.current_action.critical_hit.nil?
    battler.current_action.add_variance = 0 if battler.current_action.add_variance.nil?
    battler.current_action.fix_damage   = 0 if battler.current_action.fix_damage.nil?
    battler.current_action.special_damage_kind = 0 if battler.current_action.special_damage_kind.nil?
    battler.current_action.p_state = 0 if battler.current_action.p_state.nil?
    battler.current_action.m_state = 0 if battler.current_action.m_state.nil?
    battler.current_action.hp_correct = 0 if battler.current_action.hp_correct.nil?#(1.03)
    battler.current_action.sp_correct = 0 if battler.current_action.sp_correct.nil?#(1.03)
    # 解除忽视躲闪
    self.ignore_evade = false         

    # 基本伤害
    self.damage[battler] = self.damage[battler].to_i

   
    # 特殊效果:追加分散度
  if battler.current_action.add_variance > 0 and self.damage[battler].abs > 0
  amp = [self.damage[battler].abs * battler.current_action.add_variance / 100, 1].max
  self.damage[battler]  += rand(amp+1) + rand(amp+1) - amp
end
    # 特殊效果:现HP威力
    if battler.current_action.hp_rate
self.damage[battler] = self.damage[battler] * battler.hp / battler.maxhp
end
    # 特殊效果:现SP威力
    if battler.current_action.sp_rate
self.damage[battler] = self.damage[battler] * battler.sp / battler.maxsp
end

    # 特殊效果:会心一击
    if battler.current_action.critical_hit > 0
  if self.critical[battler]
self.critical[battler] = false      
self.damage[battler] /= 2           
end
    # critical重新判定
    if rand(100) < battler.current_action.critical_hit
self.critical[battler] = true
self.damage[battler] *= 2
end
end
    # 特殊效果:固定伤害
    if battler.current_action.fix_damage != 0
self.damage[battler] = battler.current_action.fix_damage.to_i
self.critical[battler] = false
end
#------------------------------------------------------------------------------
# 特殊效果:追加伤害效果类计算
#------------------------------------------------------------------------------
case battler.current_action.special_damage_kind
    when 1# 「目标方当前HP比例」
      if skill != nil
      self.damage[battler] += self.hp * skill.power / 100
    else
      self.damage[battler] += self.hp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPTA))/100
when 2# 「目标方最大HP比例」
      if skill != nil
      self.damage[battler] += self.maxhp * skill.power / 100
    else
      self.damage[battler] += self.maxhp * battler.atk / 10000
    end   
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPTA))/100
    when 3# 「目标方HP差值比例」
      if skill != nil
      self.damage[battler] += (self.maxhp - self.hp) * skill.power / 100
    else
      self.damage[battler] += (self.maxhp - self.hp) * battler.atk / 10000
    end      
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPTA))/100
    when 4# 「使用者当前HP比例」
      if skill != nil
      self.damage[battler] += battler.hp * skill.power / 100
    else
      self.damage[battler] += battler.hp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPUS))/100   
    when 5# 「使用者最大HP比例」
      if skill != nil
      self.damage[battler] += battler.maxhp * skill.power / 100
    else
      self.damage[battler] += battler.maxhp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPUS))/100
    when 6# 「使用者HP差值比例」
      if skill != nil
      self.damage[battler] += (battler.maxhp - battler.hp) * skill.power / 100
    else
      self.damage[battler] += (battler.maxhp - battler.hp) * battler.atk / 10000
    end      
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPUS))/100   
    when 7# 「目标方当前SP比例」
      if skill != nil
      self.damage[battler] += self.sp * skill.power / 100
    else
      self.damage[battler] += self.sp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPTA))/100
    when 8# 「目标方最大SP比例」   
      if skill != nil
      self.damage[battler] += self.maxsp * skill.power / 100
    else
      self.damage[battler] += self.maxsp * battler.atk / 10000
    end   
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPTA))/100
    when 9# 「目标方SP差值比例」      
      if skill != nil
      self.damage[battler] += (self.maxsp - self.sp) * skill.power / 100
    else
      self.damage[battler] += (self.maxsp - self.sp) * battler.atk / 10000
    end   
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPTA))/100
    when 10# 「使用者当前SP比例」  
      if skill != nil
      self.damage[battler] += battler.sp * skill.power / 100
    else
      self.damage[battler] += battler.sp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPUS))/100
    when 11# 「使用者最大SP比例」     
      if skill != nil
      self.damage[battler] += battler.maxsp * skill.power / 100
    else
      self.damage[battler] += battler.maxsp * battler.atk / 10000
    end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPUS))/100
    when 12# 「使用者SP差值比例」   
      if skill != nil
      self.damage[battler] += (battler.maxsp - battler.sp) * skill.power / 100
    else
      self.damage[battler] += (battler.maxsp - battler.sp) * battler.atk / 10000
    end  
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPUS))/100
end
#------------------------------------------------------------------------------
# 特殊效果:AT伤害值(1.03)
  if battler.current_action.at_damage != 0
  self.at -= battler.current_action.at_damage * self.maxat / 100
  self.at  = 0 if self.at < 0
  self.atp = 100 * self.at / self.maxat
end
# 特殊效果:HP伤害率
  if battler.current_action.hp_damage != 0 and battler.current_action.sp_damage == 0
self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
end
# 特殊效果:SP伤害率
  if battler.current_action.sp_damage != 0
self.damage_sp[battler] = self.damage[battler] * battler.current_action.sp_damage / 100
self.damage_sp[battler] = self.sp if self.damage_sp[battler] > self.sp
self.damage_sp[battler] = "" if self.sp == 0
self.sp      -= self.damage_sp[battler] if self.damage_sp[battler] != ""
  if battler.current_action.hp_damage != 0 # 特殊效果:HP伤害率
self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
else
self.damage[battler] = ""
end
end
#------------------------------------------------------------------------------
# 特殊效果:收招修正(1.03)
battler.hp = battler.current_action.hp_correct.to_i if battler.current_action.hp_correct != 0
battler.sp = battler.current_action.sp_correct.to_i if battler.current_action.sp_correct != 0
#------------------------------------------------------------------------------   
# 特殊效果:HP吸收
if battler.current_action.hp_drain != 0
   battler.damage[battler] = 0 if battler.damage[battler] == nil
   drain_point = -1 * self.damage[battler].to_i * battler.current_action.hp_drain / 100
   battler.damage[battler] += drain_point
   battler.hp -= drain_point
if battler.damage[battler] == 0
   battler.damage[battler] = nil
  end
end
# 特殊效果:SP吸收
if battler.current_action.sp_drain != 0
   battler.damage_sp[battler] = 0 if battler.damage_sp[battler] == nil
   drain_point = -1 * self.damage_sp[battler].to_i * battler.current_action.sp_drain / 100
   battler.damage_sp[battler] += drain_point
   battler.sp -= drain_point
   battler.damage_sp[battler] = drain_point
if battler.damage_sp[battler] == 0
   battler.damage_sp[battler] = nil
  end
end
    # recall
    xrxs19co_x1_damage_effect(battler, item)
  end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#------------------------------------------------------------------------------
# ○ ATB_SETUP (ATB = AT Bar,意思不要和RTAB搞错)(1.03)
#------------------------------------------------------------------------------
  alias xrxs19_atb_setup atb_setup
  def atb_setup
    # recall
    xrxs19_atb_setup
    # 保存最大AT
    for battler in $game_party.actors + $game_troop.enemies
      battler.maxat = @max
    end
  end  
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
  alias xrxs19_main main
  def main
    # 清空角色的伤害值
    for actor in $game_party.actors
      actor.damage = nil
    end
    # recall
    xrxs19_main
    # 清空角色的特殊效果设置
    for actor in $game_party.actors
      actor.current_action.clear_xrxs19_special_effect
      actor.current_action.nillize_xrxs19_special_effect
    end
  end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 1 : 准备行动)
#--------------------------------------------------------------------------
  alias xrxs19co_x1_update_phase4_step1 update_phase4_step1
  def update_phase4_step1(battler)
    # 清空行动者的伤害值
    battler.damage.clear
    # recall
    xrxs19co_x1_update_phase4_step1(battler)
  end
  
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 2 : 开始行动)
#--------------------------------------------------------------------------
  alias xrxs19_update_phase4_step2 update_phase4_step2
  def update_phase4_step2(battler)
    # 清空行动者的伤害值
    battler.damage.clear
    # recall
    xrxs19_update_phase4_step2(battler)   
  end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
#(武器范围定义必须)
#--------------------------------------------------------------------------
  def update_phase3_enemy_select
    # コマンド選択中に行動不能になった場合
    unless @active_actor.inputable?
      # カメラを元に戻す
      if @camera == "select"
        @spriteset.screen_target(0, 0, 1)
      end
      @active_actor.current_action.clear
      command_delete
      # 次のアクターのコマンド入力へ
      phase3_next_actor
      return
    end
    @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
    @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  case @active_actor.current_action.scope_force
  when 2,4,6,7,8,9,10,11
        # アクションを設定
        @active_actor.current_action.kind = 0
        @active_actor.current_action.basic = 0
        # スキルの選択を終了
        end_enemy_select
        # 次のアクターのコマンド入力へ
        phase3_next_actor
  when 3
        # アクターアローを更新
    @actor_arrow.update
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # アクターの選択を終了
      end_enemy_select
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
    # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      # アクションを設定
      @active_actor.current_action.kind = 0
      @active_actor.current_action.basic = 0
      @active_actor.current_action.target_index = @actor_arrow.index
      # アクターの選択を終了
      end_enemy_select
      # 次のアクターのコマンド入力へ
        phase3_next_actor
     end
     else
    # エネミーアローを更新
    @enemy_arrow.update
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # カメラを元に戻す
      if @camera == "select"
        # カメラの設定
        @camera = "command"
        plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
        y = [(plus.abs - 1.5) * 10 , 0].min
#       @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
      end
      # エネミーの選択を終了
      end_enemy_select
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      # アクションを設定
      @active_actor.current_action.kind = 0
      @active_actor.current_action.basic = 0
      @active_actor.current_action.target_index = @enemy_arrow.index
      # スキルウィンドウ表示中の場合
      if @skill_window != nil
        # アクションを再設定
        @active_actor.current_action.kind = 1
        # スキルの選択を終了
        end_skill_select
      end
      # アイテムウィンドウ表示中の場合
      if @item_window != nil
        # アクションを再設定
        @active_actor.current_action.kind = 2
        # アイテムの選択を終了
        end_item_select
      end
      # エネミーの選択を終了
      end_enemy_select
      # 次のアクターのコマンド入力へ
      phase3_next_actor
      end
    end
  end
#--------------------------------------------------------------------------
# ● 开始选择敌人#(武器范围定义必须)(1.03修正显示BUG)
#--------------------------------------------------------------------------
  def start_enemy_select   
    @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
    @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
if @active_actor.current_action.scope_force == 3
   # 生成敌人箭头
   @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
   # 关联帮助窗口
    @actor_arrow.help_window = @help_window
  else
    # 生成敌人箭头
     @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
     # 关联帮助窗口
    @enemy_arrow.help_window = @help_window
    end
    # 无效化角色指令窗口
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
#--------------------------------------------------------------------------
# ● 结束选择敌人#武器范围定义必须)
#--------------------------------------------------------------------------
  def end_enemy_select
    # 释放敌人箭头
    @enemy_arrow.dispose if @enemy_arrow != nil
    @actor_arrow.dispose if @actor_arrow != nil
    @enemy_arrow = nil
    @actor_arrow = nil
    # 指令为 [战斗] 的情况下
    if @actor_command_window.index == 0
      # 有效化角色指令窗口
      @actor_command_window.active = true
      @actor_command_window.visible = true
      # 隐藏帮助窗口
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # ● 基本アクション 準備#(武器范围定义必须)
  #--------------------------------------------------------------------------
  def make_basic_action_preparation(battler)
    # 攻撃の場合
    if battler.current_action.basic == 0
      # アニメーション ID を設定
      battler.anime1 = battler.animation1_id
      battler.anime2 = battler.animation2_id
      # 行動側バトラーがエネミーの場合
      if battler.is_a?(Game_Enemy)
        if battler.restriction == 3
          target = $game_troop.random_target_enemy
        elsif battler.restriction == 2
          target = $game_party.random_target_actor
        else
          index = battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        end
      end
      # 行動側バトラーがアクターの場合
battler.set_xrxs19_special_scope(battler.equip_element_set)   
      if battler.is_a?(Game_Actor)
        if battler.restriction == 3
          target = $game_party.random_target_actor
        elsif battler.restriction == 2
          target = $game_troop.random_target_enemy
        elsif battler.current_action.scope_force == 3 # 己方单体
          index = battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        else
           
          index = battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
      end
   
      # 対象側バトラーの配列を設定
    case  battler.current_action.scope_force
    when 2 # 敌方全体
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
    battler.target.push(battler) if battler.current_action.self_inclusion     
    when 4 # 己方全体
        for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
    battler.target -=[battler] if battler.current_action.self_exclusion   
    when 7  # 使用者
      battler.target.push(battler)
         when 8  # 全域化
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion
     when 9  # 敌方随机        
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target = [$game_troop.random_target_enemy]
          end
        end
battler.target.push(battler) if battler.current_action.self_inclusion
      when 10  # 己方随机
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end      
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
        when 11 #对象随机
      battler.target = []
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
else
      battler.target = [target]
battler.target.push(battler) if battler.current_action.self_inclusion and
battler.current_action.scope_force != 3 and
battler.restriction != 2 and
battler.restriction != 3
      end
      return true
    end
    # 防御の場合
    if battler.current_action.basic == 1
      # ステップ 3 に移行
      battler.phase = 3
      return false
    end
#===============0.15b(RTAB官方更新)===========================================   
    # 逃げるの場合
    if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
      # ステップ 3 に移行
      battler.phase = 3
      return false
    end
#=============================================================================
    # 何もしないの場合
    if battler.current_action.basic == 3
      # ステップ 6 に移行
      battler.phase = 6
      return false
    end
  end  
#--------------------------------------------------------------------------
# ● 生成基本行动结果
#--------------------------------------------------------------------------
  alias xrxs19_make_basic_action_result make_basic_action_result
   def make_basic_action_result(battler)
    # 攻击的情况
    if battler.current_action.basic == 0
      # 获取行动者武器附加的战斗特效
      if battler.is_a?(Game_Actor)
        battler.set_xrxs19_special_effect(battler.equip_element_set)
      # 行动时附加自身状态
        if battler.current_action.p_state > 0
        battler.pp_state(battler,battler.current_action.p_state)
      end
      # 行动时解除自身状态
      if battler.current_action.m_state > 0
        battler.remove_state(battler.current_action.m_state)
      end
      end
end
    # recall
    xrxs19_make_basic_action_result(battler)
  end
  #--------------------------------------------------------------------------
  # ● スキルまたはアイテムの対象側バトラー設定
  #     scope : スキルまたはアイテムの効果範囲
  # (武器范围定义必须)特技/道具的范围定义
  #--------------------------------------------------------------------------
  def set_target_battlers(scope, battler)
    #行动方战斗者是敌方的情况
    if battler.is_a?(Game_Enemy)
     # 效果范围的分歧
      case scope
      when 1  # 敌单体
battler.target.push(battler) if battler.current_action.self_inclusion           
        index =battler.current_action.target_index
        battler.target.push($game_party.smooth_target_actor(index))
        
      when 2  # 敌全体
battler.target.push(battler) if battler.current_action.self_inclusion   
        for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
     
      when 3  # 己方单体
        
        index = battler.current_action.target_index
        battler.target.push($game_troop.smooth_target_enemy(index))
      
      when 4  # 己方全体
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
      when 5  # 己方单体 (HP 0)   
        
        index = battler.current_action.target_index
        enemy = $game_troop.enemies[index]
        if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
          battler.target.push(enemy)
        end
        
      when 6  # 己方全体 (HP 0)
        for enemy in $game_troop.enemies
          if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
            battler.target.push(enemy)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
      when 7  # 使用者
        battler.target.push(battler)
      when 8  # 全域化
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
     when 9  # 敌方随机
battler.target.push(battler) if battler.current_action.self_inclusion        
             for actor in $game_party.actors
          if actor.exist?
            battler.target = [$game_party.random_target_actor]
          end
        end
         
          when 10  # 己方随机
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
        when 11 #对象随机
      battler.target = []
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
battler.target = [battler.target[rand(battler.target.size)]]         
      end
    end
   
   
    #行动方战斗者是己方的情况
    if battler.is_a?(Game_Actor)
      # 效果范围的分歧
      case scope
      when 1  # 敌单体
        
        index = battler.current_action.target_index
        battler.target.push($game_troop.smooth_target_enemy(index))
battler.target.push(battler) if battler.current_action.self_inclusion         
      when 2  # 敌全体
         
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
battler.target.push(battler) if battler.current_action.self_inclusion        
      when 3  # 己方单体
        
        index = battler.current_action.target_index
        battler.target.push($game_party.smooth_target_actor(index))
        
      when 4  # 己方全体
        for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
      when 5  # 己方单体 (HP 0)
        
        index = battler.current_action.target_index
        actor = $game_party.actors[index]
        if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
          battler.target.push(actor)
        end
        
      when 6  # 己方全体 (HP 0)
        for actor in $game_party.actors
          if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion        
      when 7  # 使用者
        battler.target.push(battler)
      when 8  # 全域化
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end            
battler.target -=[battler] if battler.current_action.self_exclusion
     when 9  # 敌方随机
      
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target = [$game_troop.random_target_enemy]
          end
        end
battler.target.push(battler) if battler.current_action.self_inclusion         
      when 10  # 己方随机
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end      
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
        when 11 #对象随机
      battler.target = []
        for enemy in $game_troop.enemies
          if enemy.exist?
            battler.target.push(enemy)
          end
        end
      for actor in $game_party.actors
          if actor.exist?
            battler.target.push(actor)
          end
        end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
end
end
end   
#--------------------------------------------------------------------------
# ● 生成特技行动结果
#--------------------------------------------------------------------------
alias xrxs19_make_skill_action_result make_skill_action_result
    def make_skill_action_result(battler, plus_id=0)
    # 获取特技
    @skill = $data_skills[battler.current_action.skill_id + plus_id]
    # 获取行动者特技附加的战斗特效
    battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
    # 行动时附加自身状态
          if battler.current_action.p_state > 0
        battler.pp_state(battler,battler.current_action.p_state)
      end
    # 行动时解除自身状态  
      if battler.current_action.m_state > 0
        battler.remove_state(battler.current_action.m_state)
      end
    # recall
    xrxs19_make_skill_action_result(battler, plus_id)
  end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 5 : 显示伤害)
#--------------------------------------------------------------------------
  alias xrxs19_update_phase4_step5 update_phase4_step5
  def update_phase4_step5(battler)
    # recall
    xrxs19_update_phase4_step5(battler)
    # 行动者伤害表示(HP/SP吸收的表示用)
    if battler.damage[battler] != nil or
       battler.damage_sp[battler] != nil
       battler.damage_pop[battler] = true
    # 行动者状态栏刷新
      status_refresh(battler)
    end
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================[/pre]

点评

1148行把括号里的‘, plus_id’删掉,我现在思考的是,可能是脚本顺序排列有问题?  发表于 2017-2-11 17:02
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部