楼主: 神秘影子

[已经过期] 怎么设置没有使用者,能同时攻击敌人方和主角方的技能?

[复制链接]
梦石
0
星屑
124
在线时间
900 小时
注册时间
2012-11-13
回帖
845
发表于 2015-6-14 17:30:04 | 显示全部楼层
某合集找到的
[pre lang="ruby"]#==============================================================================
# ★ RGSS3_スコープ拡張 Ver1.01
#==============================================================================
=begin

作者:tomoaky
webサイト:ひきも記 (http://hikimoki.sakura.ne.jp/)

通常攻撃の効果範囲にランダム化、全体化などを追加します、
アクター、職業、武器、防具のメモ欄に以下のタグを書き込んでください。
  <通常攻撃全体化>
  通常攻撃の効果範囲が敵全体になります
  
  <通常攻撃ランダム化>
  通常攻撃の効果範囲が敵 1 体ランダムになります
  ただし、攻撃追加回数が設定されている場合は、ランダムなターゲットへ
  追加攻撃が発生します。

スキル(アイテム)の効果範囲を『敵味方全体』にする、
スキル、アイテムのメモ欄に以下のタグを書き込んでください。
 <敵味方全体>
  
スキル(アイテム)の効果範囲から使用者を除外する、
スキル、アイテムのメモ欄に以下のタグを書き込んでください。
  <使用者除外>

2012.01.11  Ver1.01
 混乱時にエラー落ちする不具合を修正
  
2011.12.19 Ver1.0
  公開

=end

#==============================================================================
# □ 設定項目
#==============================================================================
module TMSCOPEEX
  # 全体化に攻撃追加回数の設定を適用するかどうか、false にすれば
  # 全体化攻撃はすべての敵に1回だけダメージを与えるようになります。
  # 『攻撃追加回数8の武器』と『通常攻撃全体化の装飾品』などを
  # 組み合わせられるとまずい場合は false にしてください。
  APPLY_ALL_REPEATS = true
  
  # 混乱時にも全体化を適用するかどうか、false なら混乱時は単体攻撃になります
  APPLY_ALL_CONFUSION = true
end

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================
class RPG::UsableItem
  #--------------------------------------------------------------------------
  # ● 対象の選択操作が必要か否かを判定する
  #--------------------------------------------------------------------------
  alias tmscopeex_usable_item_need_selection? need_selection?
  def need_selection?
    tmscopeex_usable_item_need_selection? && !for_field?
  end
  #--------------------------------------------------------------------------
  # ○ 敵味方全体スキルかどうかを返す
  #--------------------------------------------------------------------------
  def for_field?
    /<敵味方全体>/ =~ @note
  end
  #--------------------------------------------------------------------------
  # ○ 使用者除外スキルかどうかを返す
  #--------------------------------------------------------------------------
  def for_not_user?
    /<使用者除外>/ =~ @note
  end
end

#==============================================================================
# ■ Game_Action
#==============================================================================
class Game_Action
  #--------------------------------------------------------------------------
  # ● 混乱時のターゲット
  #--------------------------------------------------------------------------
  alias tmscopeex_game_action_confusion_target confusion_target
  def confusion_target
    if subject.actor? && attack? &&
        TMSCOPEEX::APPLY_ALL_CONFUSION && subject.attack_for_all?
      case subject.confusion_level
      when 1
        opponents_unit.alive_members
      when 2
        if rand(2) == 0
          opponents_unit.alive_members
        else
          friends_unit.alive_members
        end
      else
        friends_unit.alive_members
      end
    else
      tmscopeex_game_action_confusion_target
    end
  end
  #--------------------------------------------------------------------------
  # ● 敵に対するターゲット
  #--------------------------------------------------------------------------
  alias tmscopeex_game_action_targets_for_opponents targets_for_opponents
  def targets_for_opponents
    if item.for_field?                    # 敵味方全体
      opponents_unit.alive_members + friends_unit.alive_members -
        (item.for_not_user? ? [subject] : [])
    elsif subject.actor? && attack?
      if subject.attack_for_all?          # 全体化
        num = 1
        num += subject.atk_times_add.to_i if TMSCOPEEX::APPLY_ALL_REPEATS
        opponents_unit.alive_members * num
      elsif subject.attack_for_random?    # ランダム化
        Array.new(1 + subject.atk_times_add.to_i) { opponents_unit.random_target }
      else
        num = 1 + subject.atk_times_add.to_i
        if @target_index < 0
          [opponents_unit.random_target] * num
        else
          [opponents_unit.smooth_target(@target_index)] * num
        end
      end
    else
      tmscopeex_game_action_targets_for_opponents
    end
  end
  #--------------------------------------------------------------------------
  # ● 味方に対するターゲット
  #--------------------------------------------------------------------------
  alias tmscopeex_game_action_targets_for_friends targets_for_friends
  def targets_for_friends
    tmscopeex_game_action_targets_for_friends -
      (item.for_not_user? ? [subject] : [])
  end
end

#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor
  #--------------------------------------------------------------------------
  # ○ 通常攻撃が全体化されているかを返す
  #--------------------------------------------------------------------------
  def attack_for_all?
    text = self.actor.note + self.class.note
    equips.compact.each {|item| text += item.note }
    states.each {|state| text += state.note }
    /<通常攻撃\s*全体化>/ =~ text
  end
  #--------------------------------------------------------------------------
  # ○ 通常攻撃がランダム化されているかを返す
  #--------------------------------------------------------------------------
  def attack_for_random?
    text = self.actor.note + self.class.note
    equips.compact.each {|item| text += item.note }
    states.each {|state| text += state.note }
    /<通常攻撃\s*ランダム化>/ =~ text
  end
  #--------------------------------------------------------------------------
  # ○ 通常攻撃のターゲット選択が必要かどうかを返す
  #--------------------------------------------------------------------------
  def need_attack_selection?
    (!attack_for_all? && !attack_for_random?)
  end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● コマンド[攻撃] 【再定義】
  #--------------------------------------------------------------------------
  def command_attack
    BattleManager.actor.input.set_attack
    if BattleManager.actor.need_attack_selection?
      select_enemy_selection
    else
      next_command
    end
  end
end

[/pre]
用法就不用我说了吧

点评

刚好15天  发表于 2015-6-14 17:32
废弃
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部