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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
跳转到指定楼层
1
发表于 2017-2-3 21:29:42 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本来是没问题 但是插了战斗特效以后 战斗一打人就出错 表示不解 删掉战斗特效这个脚本以后又正常了 不懂是哪里出问题{:2_258:}

Lv5.捕梦者 (版主)

梦石
1
星屑
23984
在线时间
3339 小时
注册时间
2011-7-8
帖子
3926

开拓者

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
3
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
4
 楼主| 发表于 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出来的第一个地方 楼下第二个地方 大大帮看一看有没有问题
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
5
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
6
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
7
 楼主| 发表于 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
战斗特效这段
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
8
发表于 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 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
9
 楼主| 发表于 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 (18.87 KB, 下载次数: 8)

QQ图片20170209112707.png

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
168
在线时间
39 小时
注册时间
2011-8-12
帖子
15
10
 楼主| 发表于 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 ...

RUBY 代码复制
  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.     # 基本伤害
  422.     self.damage[battler] = self.damage[battler].to_i
  423.  
  424.  
  425.     # 特殊效果:追加分散度
  426.   if battler.current_action.add_variance > 0 and self.damage[battler].abs > 0
  427.   amp = [self.damage[battler].abs * battler.current_action.add_variance / 100, 1].max
  428.   self.damage[battler]  += rand(amp+1) + rand(amp+1) - amp
  429. end
  430.     # 特殊效果:现HP威力
  431.     if battler.current_action.hp_rate
  432. self.damage[battler] = self.damage[battler] * battler.hp / battler.maxhp
  433. end
  434.     # 特殊效果:现SP威力
  435.     if battler.current_action.sp_rate
  436. self.damage[battler] = self.damage[battler] * battler.sp / battler.maxsp
  437. end
  438.  
  439.     # 特殊效果:会心一击
  440.     if battler.current_action.critical_hit > 0
  441.   if self.critical[battler]
  442. self.critical[battler] = false      
  443. self.damage[battler] /= 2           
  444. end
  445.     # critical重新判定
  446.     if rand(100) < battler.current_action.critical_hit
  447. self.critical[battler] = true
  448. self.damage[battler] *= 2
  449. end
  450. end
  451.     # 特殊效果:固定伤害
  452.     if battler.current_action.fix_damage != 0
  453. self.damage[battler] = battler.current_action.fix_damage.to_i
  454. self.critical[battler] = false
  455. end
  456. #------------------------------------------------------------------------------
  457. # 特殊效果:追加伤害效果类计算
  458. #------------------------------------------------------------------------------
  459. case battler.current_action.special_damage_kind
  460.     when 1# 「目标方当前HP比例」
  461.       if skill != nil
  462.       self.damage[battler] += self.hp * skill.power / 100
  463.     else
  464.       self.damage[battler] += self.hp * battler.atk / 10000
  465.     end
  466. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPTA))/100
  467. when 2# 「目标方最大HP比例」
  468.       if skill != nil
  469.       self.damage[battler] += self.maxhp * skill.power / 100
  470.     else
  471.       self.damage[battler] += self.maxhp * battler.atk / 10000
  472.     end   
  473. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPTA))/100
  474.     when 3# 「目标方HP差值比例」
  475.       if skill != nil
  476.       self.damage[battler] += (self.maxhp - self.hp) * skill.power / 100
  477.     else
  478.       self.damage[battler] += (self.maxhp - self.hp) * battler.atk / 10000
  479.     end      
  480. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPTA))/100
  481.     when 4# 「使用者当前HP比例」
  482.       if skill != nil
  483.       self.damage[battler] += battler.hp * skill.power / 100
  484.     else
  485.       self.damage[battler] += battler.hp * battler.atk / 10000
  486.     end
  487. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPUS))/100   
  488.     when 5# 「使用者最大HP比例」
  489.       if skill != nil
  490.       self.damage[battler] += battler.maxhp * skill.power / 100
  491.     else
  492.       self.damage[battler] += battler.maxhp * battler.atk / 10000
  493.     end
  494. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPUS))/100
  495.     when 6# 「使用者HP差值比例」
  496.       if skill != nil
  497.       self.damage[battler] += (battler.maxhp - battler.hp) * skill.power / 100
  498.     else
  499.       self.damage[battler] += (battler.maxhp - battler.hp) * battler.atk / 10000
  500.     end      
  501. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPUS))/100   
  502.     when 7# 「目标方当前SP比例」
  503.       if skill != nil
  504.       self.damage[battler] += self.sp * skill.power / 100
  505.     else
  506.       self.damage[battler] += self.sp * battler.atk / 10000
  507.     end
  508. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPTA))/100
  509.     when 8# 「目标方最大SP比例」   
  510.       if skill != nil
  511.       self.damage[battler] += self.maxsp * skill.power / 100
  512.     else
  513.       self.damage[battler] += self.maxsp * battler.atk / 10000
  514.     end   
  515. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPTA))/100
  516.     when 9# 「目标方SP差值比例」      
  517.       if skill != nil
  518.       self.damage[battler] += (self.maxsp - self.sp) * skill.power / 100
  519.     else
  520.       self.damage[battler] += (self.maxsp - self.sp) * battler.atk / 10000
  521.     end   
  522. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPTA))/100
  523.     when 10# 「使用者当前SP比例」  
  524.       if skill != nil
  525.       self.damage[battler] += battler.sp * skill.power / 100
  526.     else
  527.       self.damage[battler] += battler.sp * battler.atk / 10000
  528.     end
  529. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPUS))/100
  530.     when 11# 「使用者最大SP比例」     
  531.       if skill != nil
  532.       self.damage[battler] += battler.maxsp * skill.power / 100
  533.     else
  534.       self.damage[battler] += battler.maxsp * battler.atk / 10000
  535.     end
  536. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPUS))/100
  537.     when 12# 「使用者SP差值比例」   
  538.       if skill != nil
  539.       self.damage[battler] += (battler.maxsp - battler.sp) * skill.power / 100
  540.     else
  541.       self.damage[battler] += (battler.maxsp - battler.sp) * battler.atk / 10000
  542.     end  
  543. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPUS))/100
  544. end
  545. #------------------------------------------------------------------------------
  546. # 特殊效果:AT伤害值(1.03)
  547.   if battler.current_action.at_damage != 0
  548.   self.at -= battler.current_action.at_damage * self.maxat / 100
  549.   self.at  = 0 if self.at < 0
  550.   self.atp = 100 * self.at / self.maxat
  551. end
  552. # 特殊效果:HP伤害率
  553.   if battler.current_action.hp_damage != 0 and battler.current_action.sp_damage == 0
  554. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  555. end
  556. # 特殊效果:SP伤害率
  557.   if battler.current_action.sp_damage != 0
  558. self.damage_sp[battler] = self.damage[battler] * battler.current_action.sp_damage / 100
  559. self.damage_sp[battler] = self.sp if self.damage_sp[battler] > self.sp
  560. self.damage_sp[battler] = "" if self.sp == 0
  561. self.sp      -= self.damage_sp[battler] if self.damage_sp[battler] != ""
  562.   if battler.current_action.hp_damage != 0 # 特殊效果:HP伤害率
  563. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  564. else
  565. self.damage[battler] = ""
  566. end
  567. end
  568. #------------------------------------------------------------------------------
  569. # 特殊效果:收招修正(1.03)
  570. battler.hp = battler.current_action.hp_correct.to_i if battler.current_action.hp_correct != 0
  571. battler.sp = battler.current_action.sp_correct.to_i if battler.current_action.sp_correct != 0
  572. #------------------------------------------------------------------------------   
  573. # 特殊效果:HP吸收
  574. if battler.current_action.hp_drain != 0
  575.    battler.damage[battler] = 0 if battler.damage[battler] == nil
  576.    drain_point = -1 * self.damage[battler].to_i * battler.current_action.hp_drain / 100
  577.    battler.damage[battler] += drain_point
  578.    battler.hp -= drain_point
  579. if battler.damage[battler] == 0
  580.    battler.damage[battler] = nil
  581.   end
  582. end
  583. # 特殊效果:SP吸收
  584. if battler.current_action.sp_drain != 0
  585.    battler.damage_sp[battler] = 0 if battler.damage_sp[battler] == nil
  586.    drain_point = -1 * self.damage_sp[battler].to_i * battler.current_action.sp_drain / 100
  587.    battler.damage_sp[battler] += drain_point
  588.    battler.sp -= drain_point
  589.    battler.damage_sp[battler] = drain_point
  590. if battler.damage_sp[battler] == 0
  591.    battler.damage_sp[battler] = nil
  592.   end
  593. end
  594.     # recall
  595.     xrxs19co_x1_damage_effect(battler, item)
  596.   end
  597. end
  598.  
  599. #==============================================================================
  600. # ■ Scene_Battle
  601. #==============================================================================
  602. class Scene_Battle
  603. #------------------------------------------------------------------------------
  604. # ○ ATB_SETUP (ATB = AT Bar,意思不要和RTAB搞错)(1.03)
  605. #------------------------------------------------------------------------------
  606.   alias xrxs19_atb_setup atb_setup
  607.   def atb_setup
  608.     # recall
  609.     xrxs19_atb_setup
  610.     # 保存最大AT
  611.     for battler in $game_party.actors + $game_troop.enemies
  612.       battler.maxat = @max
  613.     end
  614.   end  
  615. #--------------------------------------------------------------------------
  616. # ● 主处理
  617. #--------------------------------------------------------------------------
  618.   alias xrxs19_main main
  619.   def main
  620.     # 清空角色的伤害值
  621.     for actor in $game_party.actors
  622.       actor.damage = nil
  623.     end
  624.     # recall
  625.     xrxs19_main
  626.     # 清空角色的特殊效果设置
  627.     for actor in $game_party.actors
  628.       actor.current_action.clear_xrxs19_special_effect
  629.       actor.current_action.nillize_xrxs19_special_effect
  630.     end
  631.   end
  632. #--------------------------------------------------------------------------
  633. # ● 刷新画面 (主回合步骤 1 : 准备行动)
  634. #--------------------------------------------------------------------------
  635.   alias xrxs19co_x1_update_phase4_step1 update_phase4_step1
  636.   def update_phase4_step1(battler)
  637.     # 清空行动者的伤害值
  638.     battler.damage.clear
  639.     # recall
  640.     xrxs19co_x1_update_phase4_step1(battler)
  641.   end
  642.  
  643. #--------------------------------------------------------------------------
  644. # ● 刷新画面 (主回合步骤 2 : 开始行动)
  645. #--------------------------------------------------------------------------
  646.   alias xrxs19_update_phase4_step2 update_phase4_step2
  647.   def update_phase4_step2(battler)
  648.     # 清空行动者的伤害值
  649.     battler.damage.clear
  650.     # recall
  651.     xrxs19_update_phase4_step2(battler)   
  652.   end
  653. #--------------------------------------------------------------------------
  654. # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
  655. #(武器范围定义必须)
  656. #--------------------------------------------------------------------------
  657.   def update_phase3_enemy_select
  658.     # コマンド選択中に行動不能になった場合
  659.     unless @active_actor.inputable?
  660.       # カメラを元に戻す
  661.       if @camera == "select"
  662.         @spriteset.screen_target(0, 0, 1)
  663.       end
  664.       @active_actor.current_action.clear
  665.       command_delete
  666.       # 次のアクターのコマンド入力へ
  667.       phase3_next_actor
  668.       return
  669.     end
  670.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  671.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  672.   case @active_actor.current_action.scope_force
  673.   when 2,4,6,7,8,9,10,11
  674.         # アクションを設定
  675.         @active_actor.current_action.kind = 0
  676.         @active_actor.current_action.basic = 0
  677.         # スキルの選択を終了
  678.         end_enemy_select
  679.         # 次のアクターのコマンド入力へ
  680.         phase3_next_actor
  681.   when 3
  682.         # アクターアローを更新
  683.     @actor_arrow.update
  684.     # B ボタンが押された場合
  685.     if Input.trigger?(Input::B)
  686.       # キャンセル SE を演奏
  687.       $game_system.se_play($data_system.cancel_se)
  688.       # アクターの選択を終了
  689.       end_enemy_select
  690.       return
  691.     end
  692.     # C ボタンが押された場合
  693.     if Input.trigger?(Input::C)
  694.     # 決定 SE を演奏
  695.       $game_system.se_play($data_system.decision_se)
  696.       # アクションを設定
  697.       @active_actor.current_action.kind = 0
  698.       @active_actor.current_action.basic = 0
  699.       @active_actor.current_action.target_index = @actor_arrow.index
  700.       # アクターの選択を終了
  701.       end_enemy_select
  702.       # 次のアクターのコマンド入力へ
  703.         phase3_next_actor
  704.      end
  705.      else
  706.     # エネミーアローを更新
  707.     @enemy_arrow.update
  708.     # B ボタンが押された場合
  709.     if Input.trigger?(Input::B)
  710.       # キャンセル SE を演奏
  711.       $game_system.se_play($data_system.cancel_se)
  712.       # カメラを元に戻す
  713.       if @camera == "select"
  714.         # カメラの設定
  715.         @camera = "command"
  716.         plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  717.         y = [(plus.abs - 1.5) * 10 , 0].min
  718. #       @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
  719.       end
  720.       # エネミーの選択を終了
  721.       end_enemy_select
  722.       return
  723.     end
  724.     # C ボタンが押された場合
  725.     if Input.trigger?(Input::C)
  726.       # 決定 SE を演奏
  727.       $game_system.se_play($data_system.decision_se)
  728.       # アクションを設定
  729.       @active_actor.current_action.kind = 0
  730.       @active_actor.current_action.basic = 0
  731.       @active_actor.current_action.target_index = @enemy_arrow.index
  732.       # スキルウィンドウ表示中の場合
  733.       if @skill_window != nil
  734.         # アクションを再設定
  735.         @active_actor.current_action.kind = 1
  736.         # スキルの選択を終了
  737.         end_skill_select
  738.       end
  739.       # アイテムウィンドウ表示中の場合
  740.       if @item_window != nil
  741.         # アクションを再設定
  742.         @active_actor.current_action.kind = 2
  743.         # アイテムの選択を終了
  744.         end_item_select
  745.       end
  746.       # エネミーの選択を終了
  747.       end_enemy_select
  748.       # 次のアクターのコマンド入力へ
  749.       phase3_next_actor
  750.       end
  751.     end
  752.   end
  753. #--------------------------------------------------------------------------
  754. # ● 开始选择敌人#(武器范围定义必须)(1.03修正显示BUG)
  755. #--------------------------------------------------------------------------
  756.   def start_enemy_select   
  757.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  758.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  759. if @active_actor.current_action.scope_force == 3
  760.    # 生成敌人箭头
  761.    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
  762.    # 关联帮助窗口
  763.     @actor_arrow.help_window = @help_window
  764.   else
  765.     # 生成敌人箭头
  766.      @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
  767.      # 关联帮助窗口
  768.     @enemy_arrow.help_window = @help_window
  769.     end
  770.     # 无效化角色指令窗口
  771.     @actor_command_window.active = false
  772.     @actor_command_window.visible = false
  773.   end
  774. #--------------------------------------------------------------------------
  775. # ● 结束选择敌人#武器范围定义必须)
  776. #--------------------------------------------------------------------------
  777.   def end_enemy_select
  778.     # 释放敌人箭头
  779.     @enemy_arrow.dispose if @enemy_arrow != nil
  780.     @actor_arrow.dispose if @actor_arrow != nil
  781.     @enemy_arrow = nil
  782.     @actor_arrow = nil
  783.     # 指令为 [战斗] 的情况下
  784.     if @actor_command_window.index == 0
  785.       # 有效化角色指令窗口
  786.       @actor_command_window.active = true
  787.       @actor_command_window.visible = true
  788.       # 隐藏帮助窗口
  789.       @help_window.visible = false
  790.     end
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ● 基本アクション 準備#(武器范围定义必须)
  794.   #--------------------------------------------------------------------------
  795.   def make_basic_action_preparation(battler)
  796.     # 攻撃の場合
  797.     if battler.current_action.basic == 0
  798.       # アニメーション ID を設定
  799.       battler.anime1 = battler.animation1_id
  800.       battler.anime2 = battler.animation2_id
  801.       # 行動側バトラーがエネミーの場合
  802.       if battler.is_a?(Game_Enemy)
  803.         if battler.restriction == 3
  804.           target = $game_troop.random_target_enemy
  805.         elsif battler.restriction == 2
  806.           target = $game_party.random_target_actor
  807.         else
  808.           index = battler.current_action.target_index
  809.           target = $game_party.smooth_target_actor(index)
  810.         end
  811.       end
  812.       # 行動側バトラーがアクターの場合
  813. battler.set_xrxs19_special_scope(battler.equip_element_set)   
  814.       if battler.is_a?(Game_Actor)
  815.         if battler.restriction == 3
  816.           target = $game_party.random_target_actor
  817.         elsif battler.restriction == 2
  818.           target = $game_troop.random_target_enemy
  819.         elsif battler.current_action.scope_force == 3 # 己方单体
  820.           index = battler.current_action.target_index
  821.           target = $game_party.smooth_target_actor(index)
  822.         else
  823.  
  824.           index = battler.current_action.target_index
  825.           target = $game_troop.smooth_target_enemy(index)
  826.         end
  827.       end
  828.  
  829.       # 対象側バトラーの配列を設定
  830.     case  battler.current_action.scope_force
  831.     when 2 # 敌方全体
  832.         for enemy in $game_troop.enemies
  833.           if enemy.exist?
  834.             battler.target.push(enemy)
  835.           end
  836.         end
  837.     battler.target.push(battler) if battler.current_action.self_inclusion     
  838.     when 4 # 己方全体
  839.         for actor in $game_party.actors
  840.           if actor.exist?
  841.             battler.target.push(actor)
  842.           end
  843.         end
  844.     battler.target -=[battler] if battler.current_action.self_exclusion   
  845.     when 7  # 使用者
  846.       battler.target.push(battler)
  847.          when 8  # 全域化
  848.         for enemy in $game_troop.enemies
  849.           if enemy.exist?
  850.             battler.target.push(enemy)
  851.           end
  852.         end
  853.       for actor in $game_party.actors
  854.           if actor.exist?
  855.             battler.target.push(actor)
  856.           end
  857.         end
  858. battler.target -=[battler] if battler.current_action.self_exclusion
  859.      when 9  # 敌方随机        
  860.         for enemy in $game_troop.enemies
  861.           if enemy.exist?
  862.             battler.target = [$game_troop.random_target_enemy]
  863.           end
  864.         end
  865. battler.target.push(battler) if battler.current_action.self_inclusion
  866.       when 10  # 己方随机
  867.       for actor in $game_party.actors
  868.           if actor.exist?
  869.             battler.target.push(actor)
  870.           end
  871.         end      
  872. battler.target -=[battler] if battler.current_action.self_exclusion
  873. battler.target = [battler.target[rand(battler.target.size)]]
  874.         when 11 #对象随机
  875.       battler.target = []
  876.         for enemy in $game_troop.enemies
  877.           if enemy.exist?
  878.             battler.target.push(enemy)
  879.           end
  880.         end
  881.       for actor in $game_party.actors
  882.           if actor.exist?
  883.             battler.target.push(actor)
  884.           end
  885.         end
  886. battler.target -=[battler] if battler.current_action.self_exclusion
  887. battler.target = [battler.target[rand(battler.target.size)]]
  888. else
  889.       battler.target = [target]
  890. battler.target.push(battler) if battler.current_action.self_inclusion and
  891. battler.current_action.scope_force != 3 and
  892. battler.restriction != 2 and
  893. battler.restriction != 3
  894.       end
  895.       return true
  896.     end
  897.     # 防御の場合
  898.     if battler.current_action.basic == 1
  899.       # ステップ 3 に移行
  900.       battler.phase = 3
  901.       return false
  902.     end
  903. #===============0.15b(RTAB官方更新)===========================================   
  904.     # 逃げるの場合
  905.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  906.       # ステップ 3 に移行
  907.       battler.phase = 3
  908.       return false
  909.     end
  910. #=============================================================================
  911.     # 何もしないの場合
  912.     if battler.current_action.basic == 3
  913.       # ステップ 6 に移行
  914.       battler.phase = 6
  915.       return false
  916.     end
  917.   end  
  918. #--------------------------------------------------------------------------
  919. # ● 生成基本行动结果
  920. #--------------------------------------------------------------------------
  921.   alias xrxs19_make_basic_action_result make_basic_action_result
  922.    def make_basic_action_result(battler)
  923.     # 攻击的情况
  924.     if battler.current_action.basic == 0
  925.       # 获取行动者武器附加的战斗特效
  926.       if battler.is_a?(Game_Actor)
  927.         battler.set_xrxs19_special_effect(battler.equip_element_set)
  928.       # 行动时附加自身状态
  929.         if battler.current_action.p_state > 0
  930.         battler.pp_state(battler,battler.current_action.p_state)
  931.       end
  932.       # 行动时解除自身状态
  933.       if battler.current_action.m_state > 0
  934.         battler.remove_state(battler.current_action.m_state)
  935.       end
  936.       end
  937. end
  938.     # recall
  939.     xrxs19_make_basic_action_result(battler)
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   # ● スキルまたはアイテムの対象側バトラー設定
  943.   #     scope : スキルまたはアイテムの効果範囲
  944.   # (武器范围定义必须)特技/道具的范围定义
  945.   #--------------------------------------------------------------------------
  946.   def set_target_battlers(scope, battler)
  947.     #行动方战斗者是敌方的情况
  948.     if battler.is_a?(Game_Enemy)
  949.      # 效果范围的分歧
  950.       case scope
  951.       when 1  # 敌单体
  952. battler.target.push(battler) if battler.current_action.self_inclusion           
  953.         index =battler.current_action.target_index
  954.         battler.target.push($game_party.smooth_target_actor(index))
  955.  
  956.       when 2  # 敌全体
  957. battler.target.push(battler) if battler.current_action.self_inclusion   
  958.         for actor in $game_party.actors
  959.           if actor.exist?
  960.             battler.target.push(actor)
  961.           end
  962.         end
  963.  
  964.       when 3  # 己方单体
  965.  
  966.         index = battler.current_action.target_index
  967.         battler.target.push($game_troop.smooth_target_enemy(index))
  968.  
  969.       when 4  # 己方全体
  970.         for enemy in $game_troop.enemies
  971.           if enemy.exist?
  972.             battler.target.push(enemy)
  973.           end
  974.         end
  975. battler.target -=[battler] if battler.current_action.self_exclusion        
  976.       when 5  # 己方单体 (HP 0)   
  977.  
  978.         index = battler.current_action.target_index
  979.         enemy = $game_troop.enemies[index]
  980.         if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  981.           battler.target.push(enemy)
  982.         end
  983.  
  984.       when 6  # 己方全体 (HP 0)
  985.         for enemy in $game_troop.enemies
  986.           if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  987.             battler.target.push(enemy)
  988.           end
  989.         end
  990. battler.target -=[battler] if battler.current_action.self_exclusion        
  991.       when 7  # 使用者
  992.         battler.target.push(battler)
  993.       when 8  # 全域化
  994.         for enemy in $game_troop.enemies
  995.           if enemy.exist?
  996.             battler.target.push(enemy)
  997.           end
  998.         end
  999.       for actor in $game_party.actors
  1000.           if actor.exist?
  1001.             battler.target.push(actor)
  1002.           end
  1003.         end
  1004. battler.target -=[battler] if battler.current_action.self_exclusion        
  1005.      when 9  # 敌方随机
  1006. battler.target.push(battler) if battler.current_action.self_inclusion        
  1007.              for actor in $game_party.actors
  1008.           if actor.exist?
  1009.             battler.target = [$game_party.random_target_actor]
  1010.           end
  1011.         end
  1012.  
  1013.           when 10  # 己方随机
  1014.         for enemy in $game_troop.enemies
  1015.           if enemy.exist?
  1016.             battler.target.push(enemy)
  1017.           end
  1018.         end
  1019. battler.target -=[battler] if battler.current_action.self_exclusion
  1020. battler.target = [battler.target[rand(battler.target.size)]]
  1021.         when 11 #对象随机
  1022.       battler.target = []
  1023.         for enemy in $game_troop.enemies
  1024.           if enemy.exist?
  1025.             battler.target.push(enemy)
  1026.           end
  1027.         end
  1028.       for actor in $game_party.actors
  1029.           if actor.exist?
  1030.             battler.target.push(actor)
  1031.           end
  1032.         end
  1033. battler.target -=[battler] if battler.current_action.self_exclusion        
  1034. battler.target = [battler.target[rand(battler.target.size)]]         
  1035.       end
  1036.     end
  1037.  
  1038.  
  1039.     #行动方战斗者是己方的情况
  1040.     if battler.is_a?(Game_Actor)
  1041.       # 效果范围的分歧
  1042.       case scope
  1043.       when 1  # 敌单体
  1044.  
  1045.         index = battler.current_action.target_index
  1046.         battler.target.push($game_troop.smooth_target_enemy(index))
  1047. battler.target.push(battler) if battler.current_action.self_inclusion         
  1048.       when 2  # 敌全体
  1049.  
  1050.         for enemy in $game_troop.enemies
  1051.           if enemy.exist?
  1052.             battler.target.push(enemy)
  1053.           end
  1054.         end
  1055. battler.target.push(battler) if battler.current_action.self_inclusion        
  1056.       when 3  # 己方单体
  1057.  
  1058.         index = battler.current_action.target_index
  1059.         battler.target.push($game_party.smooth_target_actor(index))
  1060.  
  1061.       when 4  # 己方全体
  1062.         for actor in $game_party.actors
  1063.           if actor.exist?
  1064.             battler.target.push(actor)
  1065.           end
  1066.         end
  1067. battler.target -=[battler] if battler.current_action.self_exclusion        
  1068.       when 5  # 己方单体 (HP 0)
  1069.  
  1070.         index = battler.current_action.target_index
  1071.         actor = $game_party.actors[index]
  1072.         if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1073.           battler.target.push(actor)
  1074.         end
  1075.  
  1076.       when 6  # 己方全体 (HP 0)
  1077.         for actor in $game_party.actors
  1078.           if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1079.             battler.target.push(actor)
  1080.           end
  1081.         end
  1082. battler.target -=[battler] if battler.current_action.self_exclusion        
  1083.       when 7  # 使用者
  1084.         battler.target.push(battler)
  1085.       when 8  # 全域化
  1086.         for enemy in $game_troop.enemies
  1087.           if enemy.exist?
  1088.             battler.target.push(enemy)
  1089.           end
  1090.         end
  1091.       for actor in $game_party.actors
  1092.           if actor.exist?
  1093.             battler.target.push(actor)
  1094.           end
  1095.         end            
  1096. battler.target -=[battler] if battler.current_action.self_exclusion
  1097.      when 9  # 敌方随机
  1098.  
  1099.         for enemy in $game_troop.enemies
  1100.           if enemy.exist?
  1101.             battler.target = [$game_troop.random_target_enemy]
  1102.           end
  1103.         end
  1104. battler.target.push(battler) if battler.current_action.self_inclusion         
  1105.       when 10  # 己方随机
  1106.       for actor in $game_party.actors
  1107.           if actor.exist?
  1108.             battler.target.push(actor)
  1109.           end
  1110.         end      
  1111. battler.target -=[battler] if battler.current_action.self_exclusion
  1112. battler.target = [battler.target[rand(battler.target.size)]]
  1113.         when 11 #对象随机
  1114.       battler.target = []
  1115.         for enemy in $game_troop.enemies
  1116.           if enemy.exist?
  1117.             battler.target.push(enemy)
  1118.           end
  1119.         end
  1120.       for actor in $game_party.actors
  1121.           if actor.exist?
  1122.             battler.target.push(actor)
  1123.           end
  1124.         end
  1125. battler.target -=[battler] if battler.current_action.self_exclusion
  1126. battler.target = [battler.target[rand(battler.target.size)]]
  1127. end
  1128. end
  1129. end   
  1130. #--------------------------------------------------------------------------
  1131. # ● 生成特技行动结果
  1132. #--------------------------------------------------------------------------
  1133. alias xrxs19_make_skill_action_result make_skill_action_result
  1134.     def make_skill_action_result(battler, plus_id=0)
  1135.     # 获取特技
  1136.     @skill = $data_skills[battler.current_action.skill_id + plus_id]
  1137.     # 获取行动者特技附加的战斗特效
  1138.     battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
  1139.     # 行动时附加自身状态
  1140.           if battler.current_action.p_state > 0
  1141.         battler.pp_state(battler,battler.current_action.p_state)
  1142.       end
  1143.     # 行动时解除自身状态  
  1144.       if battler.current_action.m_state > 0
  1145.         battler.remove_state(battler.current_action.m_state)
  1146.       end
  1147.     # recall
  1148.     xrxs19_make_skill_action_result(battler, plus_id)
  1149.   end
  1150. #--------------------------------------------------------------------------
  1151. # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  1152. #--------------------------------------------------------------------------
  1153.   alias xrxs19_update_phase4_step5 update_phase4_step5
  1154.   def update_phase4_step5(battler)
  1155.     # recall
  1156.     xrxs19_update_phase4_step5(battler)
  1157.     # 行动者伤害表示(HP/SP吸收的表示用)
  1158.     if battler.damage[battler] != nil or
  1159.        battler.damage_sp[battler] != nil
  1160.        battler.damage_pop[battler] = true
  1161.     # 行动者状态栏刷新
  1162.       status_refresh(battler)
  1163.     end
  1164.   end
  1165. end
  1166. #==============================================================================
  1167. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1168. #==============================================================================

点评

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 22:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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