查看: 3529|回复: 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 ...
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. # 基础脚本▼▲▼ XRXS19. 特殊効果詰め合わせ DamageEX ver.2 ▼▲▼ built 220920
  5. # by 桜雅 在土 (基本) Tetra-Z   (修正)  [url]http://scriptself.jpn.org/x/XRXS19.htm[/url]
  6. #==============================================================================
  7. # ▼▲▼ 战斗特殊效果属性 DamageEX - Plus × RTAB ▼▲▼
  8. #
  9. # 适用环境:RTAB Ver 1.16
  10. #
  11. # by SixRice  (Plus × RTAB改造)     Ver.1.03 2006/8/18
  12. # 从1.03版开始记录每次更新。
  13. #==============================================================================
  14. # 伤害计算流程:
  15. # 1  基础伤害计算                   (Game Battler)
  16. # 2  忽视躲闪判定                   (IGNORE_EVADE)
  17. # 3  修正基础伤害                   (HP_RATE,SP_RATE,CRITICAL_HIT,ADD_VARIANCE)
  18. # 4  固定伤害(取消基础)             (FIXDAMAGE)
  19. # 5  追加伤害计算                   (追加伤害效果类)
  20. # -> 基础伤害(或固定伤害)+追加伤害
  21. # =  总伤害
  22. # 6  修正总伤害                     (HP_DAMAGE,SP_DAMAGE)
  23. # -> 最终伤害
  24. # 7  收招修正使用者的HP/SP          (HP_CORRECT,SP_CORRECT)(1.03)
  25. # 8  根据最终伤害修正使用者的HP/SP  (HP_DRAIN,SP_DRAIN)
  26. #------------------------------------------------------------------------------
  27. module XRXS19
  28. #------------------------------------------------------------------------------
  29. # 一:特殊伤害效果类的属性名称设定
  30. #------------------------------------------------------------------------------  
  31. # 提示:本类属性名称后请添加自定义数值,然后才会生效。(数据库)
  32. #------------------------------------------------------------------------------  
  33. # 提示:本类属性请设为“不计算属性有效度”(XRXS38. 属性修正计算数限制)。
  34. #------------------------------------------------------------------------------  
  35. # 提示:本类属性中如果存在同属性,效果也叠加。
  36. #
  37. # 举例:一个东西同时包含HP吸收50%,HP吸收25%,实际效果为HP吸收75%.
  38. #------------------------------------------------------------------------------
  39.   AT_DAMAGE         = "AT伤害"         # 「修正目标的AT值(行动值)」(1.03)
  40.   HP_DAMAGE         = "HP伤害"         # 「将本次造成的总伤害的x%修正为HP伤害」
  41.   SP_DAMAGE         = "SP伤害"         # 「将本次造成的总伤害的x%修正为SP伤害」
  42.   HP_DRAIN          = "HP吸收"         # 「根据本次最终伤害的x%修正使用者的HP」
  43.   SP_DRAIN          = "SP吸收"         # 「根据本次最终伤害的x%修正使用者的SP」
  44.   HP_RATE           = "现HP威力"       # 「根据使用者HP/MAXHP修正本次基础伤害」
  45.   SP_RATE           = "现SP威力"       # 「根据使用者SP/MAXSP修正本次基础伤害」
  46.   CRITICAL_HIT      = "必杀"           # 「会心一击」   (武器效果通用化)
  47.   IGNORE_EVADE      = "忽视躲闪"       # 「忽视躲闪」   (特技效果武器化)
  48.   ADD_VARIANCE      = "分散度"         # 「追加分散度」 (特技效果武器化)
  49.   FIXDAMAGE         = "固定伤害"       # 「固定伤害值」 (特技效果武器化)
  50. #------------------------------------------------------------------------------
  51. # 提示:本类中“固定伤害值”不能和“会心一击”、“追加分散度”叠加;
  52. #       其余效果均可叠加。   
  53. #------------------------------------------------------------------------------  
  54.   AREA_EXTEND       = "敌方全体"      # 「敌方全体」属性名2
  55.   AREA_ACTOR        = "己方单体"      # 「己方单体」属性名3
  56.   AREA_ACTOR_ALL    = "己方全体"      # 「己方全体」属性名4
  57.   AREA_SELF         = "使用者"        # 「 使用者 」属性名7
  58.   AREA_WHOLE        = "全域化"        # 「 全域化 」属性名8
  59.   AREA_ENEMY_RAND   = "敌方随机"      # 「敌方随机」属性名9
  60.   AREA_ACTOR_RAND   = "己方随机"      # 「己方随机」属性名10
  61.   AREA_ALL_RAND     = "对象随机"      # 「对象随机」属性名11
  62.   SELF_INCLUSION    = "诸刃"          # 「  诸刃  」属性名
  63.   SELF_EXCLUSION    = "自身以外"      # 「自身以外」(与使用者,己方单体叠加无效)
  64. #------------------------------------------------------------------------------  
  65. # 提示:「诸刃」与
  66. #   「使用者」,「己方单体」,「己方全体」,「己方随机」,「对象随机」叠加无效。
  67. #------------------------------------------------------------------------------
  68.   P_STATE           = "发动状态P"      # 「行动时附加自身状态」属性名
  69.   M_STATE           = "发动状态M"      # 「行动时解除自身状态」属性名
  70.   HP_CORRECT        = "收招修正H"      # 「收招时修正使用者HP」属性名(1.03)
  71.   SP_CORRECT        = "收招修正S"      # 「收招时修正使用者SP」属性名(1.03)
  72. #------------------------------------------------------------------------------
  73. # 提示:在这个版本的战斗特殊效果属性中,
  74. #       除了"会心一击" 、"忽视躲闪"、"追加分散度" 这三个效果以外,
  75. #       其他的效果都支持负数,也就是逆转效果。
  76. #
  77. # 举例:想设置一个“敌我皆伤”的特技,只要附带HP吸收属性,效果设为负数就OK了。
  78. #
  79. # 举例:如果把"HP伤害负数" + "作用范围己方"设置为武器属性,
  80. #       就可以设置出回复己方HP的BT武器来。
  81. #
  82. # 更多创意想法等你来发挥!!
  83. #------------------------------------------------------------------------------
  84. # 二:追加伤害效果类的属性名称设定
  85. #------------------------------------------------------------------------------
  86. # 本类采用的英文单词缩写
  87. # NOW(N) = 当前 ;MAX(M) = 最大;DIF(D) = 差值 ;
  88. # HP(H) = 生命 ;SP(S) = 精力 ;  
  89. # TA(T) = target = 目标方;US(U) = user = 使用者 。
  90. #------------------------------------------------------------------------------
  91.   FIXDAMAGE_NOWHPTA = "NHT"            # 「目标方当前HP比例」属性名
  92.   FIXDAMAGE_MAXHPTA = "MHT"            # 「目标方最大HP比例」属性名
  93.   FIXDAMAGE_DIFHPTA = "DHT"            # 「目标方HP差值比例」属性名
  94.   FIXDAMAGE_NOWHPUS = "NHU"            # 「使用者当前HP比例」属性名  
  95.   FIXDAMAGE_MAXHPUS = "MHU"            # 「使用者最大HP比例」属性名
  96.   FIXDAMAGE_DIFHPUS = "DHU"            # 「使用者HP差值比例」属性名
  97.   FIXDAMAGE_NOWSPTA = "NST"            # 「目标方当前SP比例」属性名
  98.   FIXDAMAGE_MAXSPTA = "MST"            # 「目标方最大SP比例」属性名
  99.   FIXDAMAGE_DIFSPTA = "DST"            # 「目标方SP差值比例」属性名
  100.   FIXDAMAGE_NOWSPUS = "NSU"            # 「使用者当前SP比例」属性名
  101.   FIXDAMAGE_MAXSPUS = "MSU"            # 「使用者最大SP比例」属性名
  102.   FIXDAMAGE_DIFSPUS = "DSU"            # 「使用者SP差值比例」属性名
  103. #------------------------------------------------------------------------------
  104. # 提示:本类所有效果均不能互相叠加,具有唯一性;
  105. #       若特技属性中存在多个本类效果,则取最前面一个效果。  
  106. #------------------------------------------------------------------------------
  107. # 提示:特技附加本类属性的情况下,设特技的威力(pow)为比例基数,
  108. #       武器附加本类属性的情况下,设武器攻击力(atk)为比例基数,
  109. #       因此比例基数请通过数据库来设定。
  110. #------------------------------------------------------------------------------
  111. # 提示:本类所有效果均为普通伤害计算之后的追加伤害;
  112. #       本类所有效果“独立计算属性有效度”,不与其他属性有效度进行混合运算。
  113. #------------------------------------------------------------------------------
  114. # 举例1:某特技属性附加"NHT" ,威力为20,其实际效果为:
  115. #        造成 [目标方][当前][HP][20%] 的等量伤害。
  116. #------------------------------------------------------------------------------
  117. # 举例2:由于威力(power)这个值可以设为负数,
  118. #        因此MHT这个属性也可用于制作比例回复HP的特技效果。
  119. #------------------------------------------------------------------------------
  120. end
  121. #==============================================================================
  122. # ■ Game_BattleAction
  123. #==============================================================================
  124. class Game_BattleAction
  125.   attr_accessor :at_damage                # 「AT伤害值」    (Numeric)(1.03)
  126.   attr_accessor :hp_damage                # 「HP伤害率」    (Numeric)
  127.   attr_accessor :sp_damage                # 「SP伤害率」    (Numeric)
  128.   attr_accessor :hp_drain                 # 「HP吸收率」    (Numeric)
  129.   attr_accessor :sp_drain                 # 「SP吸收率」    (Numeric)
  130.   attr_accessor :hp_rate                  # 「现HP威力」    (true/false)
  131.   attr_accessor :sp_rate                  # 「现SP威力」    (true/false)
  132.   attr_accessor :critical_hit             # 「会心一击」    (Numeric)
  133.   attr_accessor :ignore_evade             # 「忽视躲闪」    (true/false)
  134.   attr_accessor :add_variance             # 「追加分散度」  (Numeric)
  135.   attr_accessor :fix_damage               # 「固定伤害值」 (Numeric)
  136.   attr_accessor :special_damage_kind      # 「追加伤害类」  (Numeric)
  137.   attr_accessor :scope_force              # 「对象强制值」  (Numeric)
  138.   attr_accessor :self_inclusion           # 「诸刃」        (true/false)
  139.   attr_accessor :self_exclusion           # 「自身以外」    (true/false)
  140.   attr_accessor :p_state                  # 「行动时附加自身状态」(Numeric)
  141.   attr_accessor :m_state                  # 「行动时解除自身状态」(Numeric)
  142.   attr_accessor :hp_correct               # 「收招时修正使用者HP」(Numeric)(1.03)
  143.   attr_accessor :sp_correct               # 「收招时修正使用者SP」(Numeric)(1.03)
  144.   def at_damage
  145.     return @at_damage.nil? ? 0 : @at_damage
  146. end
  147. #--------------------------------------------------------------------------
  148. # ● clear
  149. #--------------------------------------------------------------------------
  150.   alias xrxs19_clear clear
  151.   def clear
  152.     # recall
  153.     xrxs19_clear
  154.     # 初始化特殊效果
  155.     initialize_xrxs19_special_effect
  156.   end
  157. #--------------------------------------------------------------------------
  158. # ○ 初始化特殊效果
  159. #--------------------------------------------------------------------------
  160.   def initialize_xrxs19_special_effect
  161.     self.at_damage = 0#(1.03)
  162.     self.hp_damage = 0
  163.     self.sp_damage = 0
  164.     self.hp_drain  = 0
  165.     self.sp_drain  = 0
  166.     self.hp_rate  = false
  167.     self.sp_rate  = false
  168.     self.critical_hit = 0
  169.     self.ignore_evade = false
  170.     self.add_variance = 0
  171.     self.fix_damage = 0
  172.     self.special_damage_kind = 0
  173.     self.p_state = 0
  174.     self.m_state = 0
  175.     self.hp_correct = 0#(1.03)
  176.     self.sp_correct = 0#(1.03)
  177.   end
  178. #--------------------------------------------------------------------------
  179. # ○ 特殊效果设置
  180. #--------------------------------------------------------------------------
  181.   def set_xrxs19_special_effect(set)
  182.     # AT伤害值(数值)(1.03)
  183.     self.at_damage = XRXS.element_amount(set, XRXS19::AT_DAMAGE)
  184.     # HP/SP伤害率(数值%)
  185.     self.hp_damage = XRXS.element_percent(set, XRXS19::HP_DAMAGE)
  186.     self.sp_damage = XRXS.element_percent(set, XRXS19::SP_DAMAGE)
  187.     # HP/SP吸收率(数值%)
  188.     self.hp_drain  = XRXS.element_percent(set, XRXS19::HP_DRAIN)
  189.     self.sp_drain  = XRXS.element_percent(set, XRXS19::SP_DRAIN)
  190.     # 现HP/SP威力 (true/false)
  191.     self.hp_rate = XRXS.element_include?(set, XRXS19::HP_RATE)
  192.     self.sp_rate = XRXS.element_include?(set, XRXS19::SP_RATE)
  193.     # 会心一击率(数值%)
  194.     returnar = XRXS.element_check(set, XRXS19::CRITICAL_HIT)
  195.     percent = returnar[0] ? (returnar[2] == 0 ? 100 : returnar[2]) : 0
  196.     self.critical_hit = percent
  197.     # 忽视躲闪 (true/false)
  198.     self.ignore_evade = XRXS.element_include?(set, XRXS19::IGNORE_EVADE)
  199.     # 追加分散度(数值)
  200.     self.add_variance = XRXS.element_amount(set, XRXS19::ADD_VARIANCE)
  201.     # 固定伤害值(数值)
  202.     self.fix_damage = XRXS.element_amount(set, XRXS19::FIXDAMAGE)
  203.     # 追加伤害类
  204.     self.special_damage_kind =
  205.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPTA) ? 1 :
  206.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPTA) ? 2 :
  207.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPTA) ? 3 :
  208.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPUS) ? 4 :
  209.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPUS) ? 5 :
  210.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPUS) ? 6 :
  211.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPTA) ? 7 :
  212.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPTA) ? 8 :
  213.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPTA) ? 9 :
  214.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPUS) ? 10 :
  215.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPUS) ? 11 :
  216.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPUS) ? 12 :      
  217.       0
  218.     # 行动时附加/解除自身状态(ID)
  219.     self.p_state = XRXS.element_amount(set, XRXS19::P_STATE)
  220.     self.m_state = XRXS.element_amount(set, XRXS19::M_STATE)
  221.     # 收招时修正使用者HP/SP(数值)(1.03)
  222.     self.hp_correct = XRXS.element_amount(set, XRXS19::HP_CORRECT)
  223.     self.sp_correct = XRXS.element_amount(set, XRXS19::SP_CORRECT)
  224.   end
  225. #--------------------------------------------------------------------------
  226. # ○ 特殊效果clear
  227. #--------------------------------------------------------------------------
  228.   def clear_xrxs19_special_effect
  229.     self.at_damage = nil#(1.03)
  230.     self.hp_damage = nil
  231.     self.sp_damage = nil
  232.     self.hp_drain  = nil
  233.     self.sp_drain  = nil
  234.     self.hp_rate  = false
  235.     self.sp_rate  = false
  236.     self.critical_hit = nil
  237.     self.ignore_evade = false
  238.     self.add_variance = nil
  239.     self.fix_damage = nil
  240.     self.special_damage_kind = nil
  241.     self.scope_force = 0
  242.     self.self_exclusion = false
  243.     self.self_inclusion = false
  244.     self.p_state = nil
  245.     self.m_state = nil
  246.     self.hp_correct = 0#(1.03)
  247.     self.sp_correct = 0#(1.03)
  248.   end
  249. #--------------------------------------------------------------------------
  250. # ○ 无效化特殊效果
  251. #--------------------------------------------------------------------------
  252.   def nillize_xrxs19_special_effect
  253.     self.scope_force = nil
  254.     self.self_inclusion = nil
  255.     self.self_exclusion = nil
  256.   end
  257. end  
  258. #==============================================================================
  259. # □□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□
  260. #==============================================================================
  261. # ■ Game_Battler
  262. #==============================================================================
  263. class Game_Battler
  264. #--------------------------------------------------------------------------
  265. # ○ 公开实例变量
  266. #--------------------------------------------------------------------------
  267.   attr_accessor :maxat                  # 最大AT#(1.03)
  268.   attr_writer :ignore_evade             #(True为忽视对方躲闪判定)
  269.   attr_writer :hp_rate                  #(True为基础伤害根据HP/MAXHP比例修正)
  270.   attr_writer :sp_rate                  #(True为基础伤害根据SP/MAXSP比例修正)
  271. #--------------------------------------------------------------------------
  272. # ○特殊范围效果设定
  273. #--------------------------------------------------------------------------  
  274.   def set_xrxs19_special_scope(set)
  275. # 范围强制值
  276. self.current_action.scope_force =
  277. XRXS.element_include?(set, XRXS19::AREA_EXTEND)     ? 2 :
  278. XRXS.element_include?(set, XRXS19::AREA_ACTOR)      ? 3 :
  279. XRXS.element_include?(set, XRXS19::AREA_ACTOR_ALL)  ? 4 :
  280. XRXS.element_include?(set, XRXS19::AREA_SELF)       ? 7 :
  281. XRXS.element_include?(set, XRXS19::AREA_WHOLE)      ? 8 :
  282. XRXS.element_include?(set, XRXS19::AREA_ENEMY_RAND) ? 9 :
  283. XRXS.element_include?(set, XRXS19::AREA_ACTOR_RAND) ? 10 :
  284. XRXS.element_include?(set, XRXS19::AREA_ALL_RAND)   ? 11 :
  285. 0
  286. # 诸刃
  287. self.current_action.self_inclusion = XRXS.element_include?(set, XRXS19::SELF_INCLUSION)
  288. # 自身以外
  289. self.current_action.self_exclusion = XRXS.element_include?(set, XRXS19::SELF_EXCLUSION)
  290. end
  291. #--------------------------------------------------------------------------
  292. # ● 新定义状态变化 (+) 发动状态适用
  293. #--------------------------------------------------------------------------
  294.   def pp_state(battler, i)
  295.     # 清除有效标志
  296.     effective = false
  297.       # 无法防御本状态的情况下
  298.       unless self.state_guard?(i)
  299.         # 这个状态如果不是 full 的话就设置有效标志
  300.         effective |= self.state_full?(i) == false
  301.         # 状态为 [不能抵抗] 的情况下
  302.         if $data_states[i].nonresistance
  303.           # 设置状态变化标志
  304.           @state_changed = true
  305.           # 附加状态
  306.           self.state_p[battler].push(i)
  307.         # 这个状态不是 full 的情况下
  308.         elsif self.state_full?(i) == false
  309.           # 将状态的有效度变换为概率、与随机数比较
  310.           if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
  311.             # 设置状态变化标志
  312.             @state_changed = true
  313.             # ステートを付加
  314.             self.add_state(i)
  315.         end
  316.       end
  317.     end
  318.     # 过程结束
  319.     return effective
  320.   end
  321. #--------------------------------------------------------------------------
  322. # ● 可以使用特技的判定
  323. #    skill_id : 特技 ID
  324. #--------------------------------------------------------------------------
  325.   alias xrxs19_skill_can_use? skill_can_use?
  326.   def skill_can_use?(skill_id)
  327.   # 获取特技
  328.   [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[skill_id]
  329.   # 范围计算
  330.   set_xrxs19_special_scope(self.skill_element_set(@skill))
  331.   $data_skills[skill_id].scope = self.current_action.scope_force if self.current_action.scope_force > 0
  332.     # 范围是「自身以外」的情况
  333.     if self.current_action.self_exclusion
  334.       # 获取战斗者
  335.       battlers = (self.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies)
  336.       # 范围的分歧
  337.       case $data_skills[skill_id].scope
  338.       when 3,4,10
  339.         # 获取生存的战斗者数量
  340.         n = 0
  341.         battlers.each {|battler| n += 1 unless battler.dead?}
  342.       when 5,6
  343.         # 获取战斗者总数
  344.         n = battlers.size
  345.       else
  346.         n = 2
  347.       end
  348.       # 对象不存在的情况
  349.       return false if n <= 1
  350.     end
  351.     # recall
  352.     return xrxs19_skill_can_use?(skill_id)
  353.   end   
  354. #--------------------------------------------------------------------------
  355. # ● 判断状态 [无法回避攻击]
  356. #--------------------------------------------------------------------------
  357. alias xrxs19_cant_evade? cant_evade?
  358. def cant_evade?
  359. return true if @ignore_evade
  360. return xrxs19_cant_evade?
  361. end
  362. #--------------------------------------------------------------------------
  363. # ○ 特殊效果设置
  364. #--------------------------------------------------------------------------
  365.   def set_xrxs19_special_effect(set)
  366.     self.current_action.set_xrxs19_special_effect(set)
  367.   end
  368. #--------------------------------------------------------------------------
  369. # ● 应用通常攻击效果
  370. #    attacker : 攻击者 (battler)
  371. #--------------------------------------------------------------------------
  372.   alias xrxs19_attack_effect attack_effect
  373.   def attack_effect(attacker)   
  374.     # 特殊效果:忽视躲闪
  375.       if  attacker.current_action.ignore_evade
  376.       self.ignore_evade = true
  377.     end
  378.     return xrxs19_attack_effect(attacker)
  379.   end
  380. #--------------------------------------------------------------------------
  381. # ● 应用特技效果
  382. #     user  : 特技的使用者 (battler)
  383. #     skill : 特技
  384. #--------------------------------------------------------------------------
  385.   alias xrxs19_skill_effect skill_effect
  386.   def skill_effect(user, skill)
  387.     # 特殊效果:忽视躲闪
  388.     if  user.current_action.ignore_evade
  389.     self.ignore_evade = true
  390.   end
  391.     return xrxs19_skill_effect(user, skill)
  392.   end
  393. #------------------------------------------------------------------------------
  394. # ○ 伤害计算(属于对基本伤害的再处理)
  395. #------------------------------------------------------------------------------
  396. # ● 基础伤害计算请在“应用通常攻击效果” 和“应用特技效果”部分定义  
  397. #------------------------------------------------------------------------------
  398.   alias xrxs19co_x1_damage_effect damage_effect
  399.   def damage_effect(battler, item, skill)
  400.     # recall
  401.     if item == 2 or self.damage[battler].class == String
  402.       return xrxs19co_x1_damage_effect(battler, item)
  403.     end
  404.     # 初始化
  405.     battler.current_action.at_damage    = 0 if battler.current_action.at_damage.nil?#(1.03)
  406.     battler.current_action.hp_damage    = 0 if battler.current_action.hp_damage.nil?
  407.     battler.current_action.sp_damage    = 0 if battler.current_action.sp_damage.nil?
  408.     battler.current_action.hp_drain     = 0 if battler.current_action.hp_drain.nil?
  409.     battler.current_action.sp_drain     = 0 if battler.current_action.sp_drain.nil?
  410.     battler.current_action.critical_hit = 0 if battler.current_action.critical_hit.nil?
  411.     battler.current_action.add_variance = 0 if battler.current_action.add_variance.nil?
  412.     battler.current_action.fix_damage   = 0 if battler.current_action.fix_damage.nil?
  413.     battler.current_action.special_damage_kind = 0 if battler.current_action.special_damage_kind.nil?
  414.     battler.current_action.p_state = 0 if battler.current_action.p_state.nil?
  415.     battler.current_action.m_state = 0 if battler.current_action.m_state.nil?
  416.     battler.current_action.hp_correct = 0 if battler.current_action.hp_correct.nil?#(1.03)
  417.     battler.current_action.sp_correct = 0 if battler.current_action.sp_correct.nil?#(1.03)
  418.     # 解除忽视躲闪
  419.     self.ignore_evade = false         

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

  422.    
  423.     # 特殊效果:追加分散度
  424.   if battler.current_action.add_variance > 0 and self.damage[battler].abs > 0
  425.   amp = [self.damage[battler].abs * battler.current_action.add_variance / 100, 1].max
  426.   self.damage[battler]  += rand(amp+1) + rand(amp+1) - amp
  427. end
  428.     # 特殊效果:现HP威力
  429.     if battler.current_action.hp_rate
  430. self.damage[battler] = self.damage[battler] * battler.hp / battler.maxhp
  431. end
  432.     # 特殊效果:现SP威力
  433.     if battler.current_action.sp_rate
  434. self.damage[battler] = self.damage[battler] * battler.sp / battler.maxsp
  435. end

  436.     # 特殊效果:会心一击
  437.     if battler.current_action.critical_hit > 0
  438.   if self.critical[battler]
  439. self.critical[battler] = false      
  440. self.damage[battler] /= 2           
  441. end
  442.     # critical重新判定
  443.     if rand(100) < battler.current_action.critical_hit
  444. self.critical[battler] = true
  445. self.damage[battler] *= 2
  446. end
  447. end
  448.     # 特殊效果:固定伤害
  449.     if battler.current_action.fix_damage != 0
  450. self.damage[battler] = battler.current_action.fix_damage.to_i
  451. self.critical[battler] = false
  452. end
  453. #------------------------------------------------------------------------------
  454. # 特殊效果:追加伤害效果类计算
  455. #------------------------------------------------------------------------------
  456. case battler.current_action.special_damage_kind
  457.     when 1# 「目标方当前HP比例」
  458.       if skill != nil
  459.       self.damage[battler] += self.hp * skill.power / 100
  460.     else
  461.       self.damage[battler] += self.hp * battler.atk / 10000
  462.     end
  463. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPTA))/100
  464. when 2# 「目标方最大HP比例」
  465.       if skill != nil
  466.       self.damage[battler] += self.maxhp * skill.power / 100
  467.     else
  468.       self.damage[battler] += self.maxhp * battler.atk / 10000
  469.     end   
  470. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPTA))/100
  471.     when 3# 「目标方HP差值比例」
  472.       if skill != nil
  473.       self.damage[battler] += (self.maxhp - self.hp) * skill.power / 100
  474.     else
  475.       self.damage[battler] += (self.maxhp - self.hp) * battler.atk / 10000
  476.     end      
  477. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPTA))/100
  478.     when 4# 「使用者当前HP比例」
  479.       if skill != nil
  480.       self.damage[battler] += battler.hp * skill.power / 100
  481.     else
  482.       self.damage[battler] += battler.hp * battler.atk / 10000
  483.     end
  484. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPUS))/100   
  485.     when 5# 「使用者最大HP比例」
  486.       if skill != nil
  487.       self.damage[battler] += battler.maxhp * skill.power / 100
  488.     else
  489.       self.damage[battler] += battler.maxhp * battler.atk / 10000
  490.     end
  491. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPUS))/100
  492.     when 6# 「使用者HP差值比例」
  493.       if skill != nil
  494.       self.damage[battler] += (battler.maxhp - battler.hp) * skill.power / 100
  495.     else
  496.       self.damage[battler] += (battler.maxhp - battler.hp) * battler.atk / 10000
  497.     end      
  498. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPUS))/100   
  499.     when 7# 「目标方当前SP比例」
  500.       if skill != nil
  501.       self.damage[battler] += self.sp * skill.power / 100
  502.     else
  503.       self.damage[battler] += self.sp * battler.atk / 10000
  504.     end
  505. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPTA))/100
  506.     when 8# 「目标方最大SP比例」   
  507.       if skill != nil
  508.       self.damage[battler] += self.maxsp * skill.power / 100
  509.     else
  510.       self.damage[battler] += self.maxsp * battler.atk / 10000
  511.     end   
  512. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPTA))/100
  513.     when 9# 「目标方SP差值比例」      
  514.       if skill != nil
  515.       self.damage[battler] += (self.maxsp - self.sp) * skill.power / 100
  516.     else
  517.       self.damage[battler] += (self.maxsp - self.sp) * battler.atk / 10000
  518.     end   
  519. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPTA))/100
  520.     when 10# 「使用者当前SP比例」  
  521.       if skill != nil
  522.       self.damage[battler] += battler.sp * skill.power / 100
  523.     else
  524.       self.damage[battler] += battler.sp * battler.atk / 10000
  525.     end
  526. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPUS))/100
  527.     when 11# 「使用者最大SP比例」     
  528.       if skill != nil
  529.       self.damage[battler] += battler.maxsp * skill.power / 100
  530.     else
  531.       self.damage[battler] += battler.maxsp * battler.atk / 10000
  532.     end
  533. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPUS))/100
  534.     when 12# 「使用者SP差值比例」   
  535.       if skill != nil
  536.       self.damage[battler] += (battler.maxsp - battler.sp) * skill.power / 100
  537.     else
  538.       self.damage[battler] += (battler.maxsp - battler.sp) * battler.atk / 10000
  539.     end  
  540. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPUS))/100
  541. end
  542. #------------------------------------------------------------------------------
  543. # 特殊效果:AT伤害值(1.03)
  544.   if battler.current_action.at_damage != 0
  545.   self.at -= battler.current_action.at_damage * self.maxat / 100
  546.   self.at  = 0 if self.at < 0
  547.   self.atp = 100 * self.at / self.maxat
  548. end
  549. # 特殊效果:HP伤害率
  550.   if battler.current_action.hp_damage != 0 and battler.current_action.sp_damage == 0
  551. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  552. end
  553. # 特殊效果:SP伤害率
  554.   if battler.current_action.sp_damage != 0
  555. self.damage_sp[battler] = self.damage[battler] * battler.current_action.sp_damage / 100
  556. self.damage_sp[battler] = self.sp if self.damage_sp[battler] > self.sp
  557. self.damage_sp[battler] = "" if self.sp == 0
  558. self.sp      -= self.damage_sp[battler] if self.damage_sp[battler] != ""
  559.   if battler.current_action.hp_damage != 0 # 特殊效果:HP伤害率
  560. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  561. else
  562. self.damage[battler] = ""
  563. end
  564. end
  565. #------------------------------------------------------------------------------
  566. # 特殊效果:收招修正(1.03)
  567. battler.hp = battler.current_action.hp_correct.to_i if battler.current_action.hp_correct != 0
  568. battler.sp = battler.current_action.sp_correct.to_i if battler.current_action.sp_correct != 0
  569. #------------------------------------------------------------------------------   
  570. # 特殊效果:HP吸收
  571. if battler.current_action.hp_drain != 0
  572.    battler.damage[battler] = 0 if battler.damage[battler] == nil
  573.    drain_point = -1 * self.damage[battler].to_i * battler.current_action.hp_drain / 100
  574.    battler.damage[battler] += drain_point
  575.    battler.hp -= drain_point
  576. if battler.damage[battler] == 0
  577.    battler.damage[battler] = nil
  578.   end
  579. end
  580. # 特殊效果:SP吸收
  581. if battler.current_action.sp_drain != 0
  582.    battler.damage_sp[battler] = 0 if battler.damage_sp[battler] == nil
  583.    drain_point = -1 * self.damage_sp[battler].to_i * battler.current_action.sp_drain / 100
  584.    battler.damage_sp[battler] += drain_point
  585.    battler.sp -= drain_point
  586.    battler.damage_sp[battler] = drain_point
  587. if battler.damage_sp[battler] == 0
  588.    battler.damage_sp[battler] = nil
  589.   end
  590. end
  591.     # recall
  592.     xrxs19co_x1_damage_effect(battler, item)
  593.   end
  594. end

  595. #==============================================================================
  596. # ■ Scene_Battle
  597. #==============================================================================
  598. class Scene_Battle
  599. #------------------------------------------------------------------------------
  600. # ○ ATB_SETUP (ATB = AT Bar,意思不要和RTAB搞错)(1.03)
  601. #------------------------------------------------------------------------------
  602.   alias xrxs19_atb_setup atb_setup
  603.   def atb_setup
  604.     # recall
  605.     xrxs19_atb_setup
  606.     # 保存最大AT
  607.     for battler in $game_party.actors + $game_troop.enemies
  608.       battler.maxat = @max
  609.     end
  610.   end  
  611. #--------------------------------------------------------------------------
  612. # ● 主处理
  613. #--------------------------------------------------------------------------
  614.   alias xrxs19_main main
  615.   def main
  616.     # 清空角色的伤害值
  617.     for actor in $game_party.actors
  618.       actor.damage = nil
  619.     end
  620.     # recall
  621.     xrxs19_main
  622.     # 清空角色的特殊效果设置
  623.     for actor in $game_party.actors
  624.       actor.current_action.clear_xrxs19_special_effect
  625.       actor.current_action.nillize_xrxs19_special_effect
  626.     end
  627.   end
  628. #--------------------------------------------------------------------------
  629. # ● 刷新画面 (主回合步骤 1 : 准备行动)
  630. #--------------------------------------------------------------------------
  631.   alias xrxs19co_x1_update_phase4_step1 update_phase4_step1
  632.   def update_phase4_step1(battler)
  633.     # 清空行动者的伤害值
  634.     battler.damage.clear
  635.     # recall
  636.     xrxs19co_x1_update_phase4_step1(battler)
  637.   end
  638.   
  639. #--------------------------------------------------------------------------
  640. # ● 刷新画面 (主回合步骤 2 : 开始行动)
  641. #--------------------------------------------------------------------------
  642.   alias xrxs19_update_phase4_step2 update_phase4_step2
  643.   def update_phase4_step2(battler)
  644.     # 清空行动者的伤害值
  645.     battler.damage.clear
  646.     # recall
  647.     xrxs19_update_phase4_step2(battler)   
  648.   end
  649. #--------------------------------------------------------------------------
  650. # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
  651. #(武器范围定义必须)
  652. #--------------------------------------------------------------------------
  653.   def update_phase3_enemy_select
  654.     # コマンド選択中に行動不能になった場合
  655.     unless @active_actor.inputable?
  656.       # カメラを元に戻す
  657.       if @camera == "select"
  658.         @spriteset.screen_target(0, 0, 1)
  659.       end
  660.       @active_actor.current_action.clear
  661.       command_delete
  662.       # 次のアクターのコマンド入力へ
  663.       phase3_next_actor
  664.       return
  665.     end
  666.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  667.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  668.   case @active_actor.current_action.scope_force
  669.   when 2,4,6,7,8,9,10,11
  670.         # アクションを設定
  671.         @active_actor.current_action.kind = 0
  672.         @active_actor.current_action.basic = 0
  673.         # スキルの選択を終了
  674.         end_enemy_select
  675.         # 次のアクターのコマンド入力へ
  676.         phase3_next_actor
  677.   when 3
  678.         # アクターアローを更新
  679.     @actor_arrow.update
  680.     # B ボタンが押された場合
  681.     if Input.trigger?(Input::B)
  682.       # キャンセル SE を演奏
  683.       $game_system.se_play($data_system.cancel_se)
  684.       # アクターの選択を終了
  685.       end_enemy_select
  686.       return
  687.     end
  688.     # C ボタンが押された場合
  689.     if Input.trigger?(Input::C)
  690.     # 決定 SE を演奏
  691.       $game_system.se_play($data_system.decision_se)
  692.       # アクションを設定
  693.       @active_actor.current_action.kind = 0
  694.       @active_actor.current_action.basic = 0
  695.       @active_actor.current_action.target_index = @actor_arrow.index
  696.       # アクターの選択を終了
  697.       end_enemy_select
  698.       # 次のアクターのコマンド入力へ
  699.         phase3_next_actor
  700.      end
  701.      else
  702.     # エネミーアローを更新
  703.     @enemy_arrow.update
  704.     # B ボタンが押された場合
  705.     if Input.trigger?(Input::B)
  706.       # キャンセル SE を演奏
  707.       $game_system.se_play($data_system.cancel_se)
  708.       # カメラを元に戻す
  709.       if @camera == "select"
  710.         # カメラの設定
  711.         @camera = "command"
  712.         plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  713.         y = [(plus.abs - 1.5) * 10 , 0].min
  714. #       @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
  715.       end
  716.       # エネミーの選択を終了
  717.       end_enemy_select
  718.       return
  719.     end
  720.     # C ボタンが押された場合
  721.     if Input.trigger?(Input::C)
  722.       # 決定 SE を演奏
  723.       $game_system.se_play($data_system.decision_se)
  724.       # アクションを設定
  725.       @active_actor.current_action.kind = 0
  726.       @active_actor.current_action.basic = 0
  727.       @active_actor.current_action.target_index = @enemy_arrow.index
  728.       # スキルウィンドウ表示中の場合
  729.       if @skill_window != nil
  730.         # アクションを再設定
  731.         @active_actor.current_action.kind = 1
  732.         # スキルの選択を終了
  733.         end_skill_select
  734.       end
  735.       # アイテムウィンドウ表示中の場合
  736.       if @item_window != nil
  737.         # アクションを再設定
  738.         @active_actor.current_action.kind = 2
  739.         # アイテムの選択を終了
  740.         end_item_select
  741.       end
  742.       # エネミーの選択を終了
  743.       end_enemy_select
  744.       # 次のアクターのコマンド入力へ
  745.       phase3_next_actor
  746.       end
  747.     end
  748.   end
  749. #--------------------------------------------------------------------------
  750. # ● 开始选择敌人#(武器范围定义必须)(1.03修正显示BUG)
  751. #--------------------------------------------------------------------------
  752.   def start_enemy_select   
  753.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  754.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  755. if @active_actor.current_action.scope_force == 3
  756.    # 生成敌人箭头
  757.    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
  758.    # 关联帮助窗口
  759.     @actor_arrow.help_window = @help_window
  760.   else
  761.     # 生成敌人箭头
  762.      @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
  763.      # 关联帮助窗口
  764.     @enemy_arrow.help_window = @help_window
  765.     end
  766.     # 无效化角色指令窗口
  767.     @actor_command_window.active = false
  768.     @actor_command_window.visible = false
  769.   end
  770. #--------------------------------------------------------------------------
  771. # ● 结束选择敌人#武器范围定义必须)
  772. #--------------------------------------------------------------------------
  773.   def end_enemy_select
  774.     # 释放敌人箭头
  775.     @enemy_arrow.dispose if @enemy_arrow != nil
  776.     @actor_arrow.dispose if @actor_arrow != nil
  777.     @enemy_arrow = nil
  778.     @actor_arrow = nil
  779.     # 指令为 [战斗] 的情况下
  780.     if @actor_command_window.index == 0
  781.       # 有效化角色指令窗口
  782.       @actor_command_window.active = true
  783.       @actor_command_window.visible = true
  784.       # 隐藏帮助窗口
  785.       @help_window.visible = false
  786.     end
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # ● 基本アクション 準備#(武器范围定义必须)
  790.   #--------------------------------------------------------------------------
  791.   def make_basic_action_preparation(battler)
  792.     # 攻撃の場合
  793.     if battler.current_action.basic == 0
  794.       # アニメーション ID を設定
  795.       battler.anime1 = battler.animation1_id
  796.       battler.anime2 = battler.animation2_id
  797.       # 行動側バトラーがエネミーの場合
  798.       if battler.is_a?(Game_Enemy)
  799.         if battler.restriction == 3
  800.           target = $game_troop.random_target_enemy
  801.         elsif battler.restriction == 2
  802.           target = $game_party.random_target_actor
  803.         else
  804.           index = battler.current_action.target_index
  805.           target = $game_party.smooth_target_actor(index)
  806.         end
  807.       end
  808.       # 行動側バトラーがアクターの場合
  809. battler.set_xrxs19_special_scope(battler.equip_element_set)   
  810.       if battler.is_a?(Game_Actor)
  811.         if battler.restriction == 3
  812.           target = $game_party.random_target_actor
  813.         elsif battler.restriction == 2
  814.           target = $game_troop.random_target_enemy
  815.         elsif battler.current_action.scope_force == 3 # 己方单体
  816.           index = battler.current_action.target_index
  817.           target = $game_party.smooth_target_actor(index)
  818.         else
  819.            
  820.           index = battler.current_action.target_index
  821.           target = $game_troop.smooth_target_enemy(index)
  822.         end
  823.       end
  824.    
  825.       # 対象側バトラーの配列を設定
  826.     case  battler.current_action.scope_force
  827.     when 2 # 敌方全体
  828.         for enemy in $game_troop.enemies
  829.           if enemy.exist?
  830.             battler.target.push(enemy)
  831.           end
  832.         end
  833.     battler.target.push(battler) if battler.current_action.self_inclusion     
  834.     when 4 # 己方全体
  835.         for actor in $game_party.actors
  836.           if actor.exist?
  837.             battler.target.push(actor)
  838.           end
  839.         end
  840.     battler.target -=[battler] if battler.current_action.self_exclusion   
  841.     when 7  # 使用者
  842.       battler.target.push(battler)
  843.          when 8  # 全域化
  844.         for enemy in $game_troop.enemies
  845.           if enemy.exist?
  846.             battler.target.push(enemy)
  847.           end
  848.         end
  849.       for actor in $game_party.actors
  850.           if actor.exist?
  851.             battler.target.push(actor)
  852.           end
  853.         end
  854. battler.target -=[battler] if battler.current_action.self_exclusion
  855.      when 9  # 敌方随机        
  856.         for enemy in $game_troop.enemies
  857.           if enemy.exist?
  858.             battler.target = [$game_troop.random_target_enemy]
  859.           end
  860.         end
  861. battler.target.push(battler) if battler.current_action.self_inclusion
  862.       when 10  # 己方随机
  863.       for actor in $game_party.actors
  864.           if actor.exist?
  865.             battler.target.push(actor)
  866.           end
  867.         end      
  868. battler.target -=[battler] if battler.current_action.self_exclusion
  869. battler.target = [battler.target[rand(battler.target.size)]]
  870.         when 11 #对象随机
  871.       battler.target = []
  872.         for enemy in $game_troop.enemies
  873.           if enemy.exist?
  874.             battler.target.push(enemy)
  875.           end
  876.         end
  877.       for actor in $game_party.actors
  878.           if actor.exist?
  879.             battler.target.push(actor)
  880.           end
  881.         end
  882. battler.target -=[battler] if battler.current_action.self_exclusion
  883. battler.target = [battler.target[rand(battler.target.size)]]
  884. else
  885.       battler.target = [target]
  886. battler.target.push(battler) if battler.current_action.self_inclusion and
  887. battler.current_action.scope_force != 3 and
  888. battler.restriction != 2 and
  889. battler.restriction != 3
  890.       end
  891.       return true
  892.     end
  893.     # 防御の場合
  894.     if battler.current_action.basic == 1
  895.       # ステップ 3 に移行
  896.       battler.phase = 3
  897.       return false
  898.     end
  899. #===============0.15b(RTAB官方更新)===========================================   
  900.     # 逃げるの場合
  901.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  902.       # ステップ 3 に移行
  903.       battler.phase = 3
  904.       return false
  905.     end
  906. #=============================================================================
  907.     # 何もしないの場合
  908.     if battler.current_action.basic == 3
  909.       # ステップ 6 に移行
  910.       battler.phase = 6
  911.       return false
  912.     end
  913.   end  
  914. #--------------------------------------------------------------------------
  915. # ● 生成基本行动结果
  916. #--------------------------------------------------------------------------
  917.   alias xrxs19_make_basic_action_result make_basic_action_result
  918.    def make_basic_action_result(battler)
  919.     # 攻击的情况
  920.     if battler.current_action.basic == 0
  921.       # 获取行动者武器附加的战斗特效
  922.       if battler.is_a?(Game_Actor)
  923.         battler.set_xrxs19_special_effect(battler.equip_element_set)
  924.       # 行动时附加自身状态
  925.         if battler.current_action.p_state > 0
  926.         battler.pp_state(battler,battler.current_action.p_state)
  927.       end
  928.       # 行动时解除自身状态
  929.       if battler.current_action.m_state > 0
  930.         battler.remove_state(battler.current_action.m_state)
  931.       end
  932.       end
  933. end
  934.     # recall
  935.     xrxs19_make_basic_action_result(battler)
  936.   end
  937.   #--------------------------------------------------------------------------
  938.   # ● スキルまたはアイテムの対象側バトラー設定
  939.   #     scope : スキルまたはアイテムの効果範囲
  940.   # (武器范围定义必须)特技/道具的范围定义
  941.   #--------------------------------------------------------------------------
  942.   def set_target_battlers(scope, battler)
  943.     #行动方战斗者是敌方的情况
  944.     if battler.is_a?(Game_Enemy)
  945.      # 效果范围的分歧
  946.       case scope
  947.       when 1  # 敌单体
  948. battler.target.push(battler) if battler.current_action.self_inclusion           
  949.         index =battler.current_action.target_index
  950.         battler.target.push($game_party.smooth_target_actor(index))
  951.         
  952.       when 2  # 敌全体
  953. battler.target.push(battler) if battler.current_action.self_inclusion   
  954.         for actor in $game_party.actors
  955.           if actor.exist?
  956.             battler.target.push(actor)
  957.           end
  958.         end
  959.      
  960.       when 3  # 己方单体
  961.         
  962.         index = battler.current_action.target_index
  963.         battler.target.push($game_troop.smooth_target_enemy(index))
  964.       
  965.       when 4  # 己方全体
  966.         for enemy in $game_troop.enemies
  967.           if enemy.exist?
  968.             battler.target.push(enemy)
  969.           end
  970.         end
  971. battler.target -=[battler] if battler.current_action.self_exclusion        
  972.       when 5  # 己方单体 (HP 0)   
  973.         
  974.         index = battler.current_action.target_index
  975.         enemy = $game_troop.enemies[index]
  976.         if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  977.           battler.target.push(enemy)
  978.         end
  979.         
  980.       when 6  # 己方全体 (HP 0)
  981.         for enemy in $game_troop.enemies
  982.           if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  983.             battler.target.push(enemy)
  984.           end
  985.         end
  986. battler.target -=[battler] if battler.current_action.self_exclusion        
  987.       when 7  # 使用者
  988.         battler.target.push(battler)
  989.       when 8  # 全域化
  990.         for enemy in $game_troop.enemies
  991.           if enemy.exist?
  992.             battler.target.push(enemy)
  993.           end
  994.         end
  995.       for actor in $game_party.actors
  996.           if actor.exist?
  997.             battler.target.push(actor)
  998.           end
  999.         end
  1000. battler.target -=[battler] if battler.current_action.self_exclusion        
  1001.      when 9  # 敌方随机
  1002. battler.target.push(battler) if battler.current_action.self_inclusion        
  1003.              for actor in $game_party.actors
  1004.           if actor.exist?
  1005.             battler.target = [$game_party.random_target_actor]
  1006.           end
  1007.         end
  1008.          
  1009.           when 10  # 己方随机
  1010.         for enemy in $game_troop.enemies
  1011.           if enemy.exist?
  1012.             battler.target.push(enemy)
  1013.           end
  1014.         end
  1015. battler.target -=[battler] if battler.current_action.self_exclusion
  1016. battler.target = [battler.target[rand(battler.target.size)]]
  1017.         when 11 #对象随机
  1018.       battler.target = []
  1019.         for enemy in $game_troop.enemies
  1020.           if enemy.exist?
  1021.             battler.target.push(enemy)
  1022.           end
  1023.         end
  1024.       for actor in $game_party.actors
  1025.           if actor.exist?
  1026.             battler.target.push(actor)
  1027.           end
  1028.         end
  1029. battler.target -=[battler] if battler.current_action.self_exclusion        
  1030. battler.target = [battler.target[rand(battler.target.size)]]         
  1031.       end
  1032.     end
  1033.    
  1034.    
  1035.     #行动方战斗者是己方的情况
  1036.     if battler.is_a?(Game_Actor)
  1037.       # 效果范围的分歧
  1038.       case scope
  1039.       when 1  # 敌单体
  1040.         
  1041.         index = battler.current_action.target_index
  1042.         battler.target.push($game_troop.smooth_target_enemy(index))
  1043. battler.target.push(battler) if battler.current_action.self_inclusion         
  1044.       when 2  # 敌全体
  1045.          
  1046.         for enemy in $game_troop.enemies
  1047.           if enemy.exist?
  1048.             battler.target.push(enemy)
  1049.           end
  1050.         end
  1051. battler.target.push(battler) if battler.current_action.self_inclusion        
  1052.       when 3  # 己方单体
  1053.         
  1054.         index = battler.current_action.target_index
  1055.         battler.target.push($game_party.smooth_target_actor(index))
  1056.         
  1057.       when 4  # 己方全体
  1058.         for actor in $game_party.actors
  1059.           if actor.exist?
  1060.             battler.target.push(actor)
  1061.           end
  1062.         end
  1063. battler.target -=[battler] if battler.current_action.self_exclusion        
  1064.       when 5  # 己方单体 (HP 0)
  1065.         
  1066.         index = battler.current_action.target_index
  1067.         actor = $game_party.actors[index]
  1068.         if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1069.           battler.target.push(actor)
  1070.         end
  1071.         
  1072.       when 6  # 己方全体 (HP 0)
  1073.         for actor in $game_party.actors
  1074.           if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1075.             battler.target.push(actor)
  1076.           end
  1077.         end
  1078. battler.target -=[battler] if battler.current_action.self_exclusion        
  1079.       when 7  # 使用者
  1080.         battler.target.push(battler)
  1081.       when 8  # 全域化
  1082.         for enemy in $game_troop.enemies
  1083.           if enemy.exist?
  1084.             battler.target.push(enemy)
  1085.           end
  1086.         end
  1087.       for actor in $game_party.actors
  1088.           if actor.exist?
  1089.             battler.target.push(actor)
  1090.           end
  1091.         end            
  1092. battler.target -=[battler] if battler.current_action.self_exclusion
  1093.      when 9  # 敌方随机
  1094.       
  1095.         for enemy in $game_troop.enemies
  1096.           if enemy.exist?
  1097.             battler.target = [$game_troop.random_target_enemy]
  1098.           end
  1099.         end
  1100. battler.target.push(battler) if battler.current_action.self_inclusion         
  1101.       when 10  # 己方随机
  1102.       for actor in $game_party.actors
  1103.           if actor.exist?
  1104.             battler.target.push(actor)
  1105.           end
  1106.         end      
  1107. battler.target -=[battler] if battler.current_action.self_exclusion
  1108. battler.target = [battler.target[rand(battler.target.size)]]
  1109.         when 11 #对象随机
  1110.       battler.target = []
  1111.         for enemy in $game_troop.enemies
  1112.           if enemy.exist?
  1113.             battler.target.push(enemy)
  1114.           end
  1115.         end
  1116.       for actor in $game_party.actors
  1117.           if actor.exist?
  1118.             battler.target.push(actor)
  1119.           end
  1120.         end
  1121. battler.target -=[battler] if battler.current_action.self_exclusion
  1122. battler.target = [battler.target[rand(battler.target.size)]]
  1123. end
  1124. end
  1125. end   
  1126. #--------------------------------------------------------------------------
  1127. # ● 生成特技行动结果
  1128. #--------------------------------------------------------------------------
  1129. alias xrxs19_make_skill_action_result make_skill_action_result
  1130.     def make_skill_action_result(battler, plus_id=0)
  1131.     # 获取特技
  1132.     @skill = $data_skills[battler.current_action.skill_id + plus_id]
  1133.     # 获取行动者特技附加的战斗特效
  1134.     battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
  1135.     # 行动时附加自身状态
  1136.           if battler.current_action.p_state > 0
  1137.         battler.pp_state(battler,battler.current_action.p_state)
  1138.       end
  1139.     # 行动时解除自身状态  
  1140.       if battler.current_action.m_state > 0
  1141.         battler.remove_state(battler.current_action.m_state)
  1142.       end
  1143.     # recall
  1144.     xrxs19_make_skill_action_result(battler, plus_id)
  1145.   end
  1146. #--------------------------------------------------------------------------
  1147. # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  1148. #--------------------------------------------------------------------------
  1149.   alias xrxs19_update_phase4_step5 update_phase4_step5
  1150.   def update_phase4_step5(battler)
  1151.     # recall
  1152.     xrxs19_update_phase4_step5(battler)
  1153.     # 行动者伤害表示(HP/SP吸收的表示用)
  1154.     if battler.damage[battler] != nil or
  1155.        battler.damage_sp[battler] != nil
  1156.        battler.damage_pop[battler] = true
  1157.     # 行动者状态栏刷新
  1158.       status_refresh(battler)
  1159.     end
  1160.   end
  1161. end
  1162. #==============================================================================
  1163. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1164. #==============================================================================
复制代码

点评

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部