rpg maker xp脚本跟随脚本

RPG&Maker&XP脚本-人物跟随
# ------------------------------------------------------------------------
# 本脚本来自,转载自,转载请保留此信息
# ------------------------------------------------------------------------
# ▼▲▼ XRXS13. パ?ティ列车移动 ver.1.02 ▼▲▼
# by fukuyama
# Train_Actor
module Train_Actor
#是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
#开关打开,跟随的人物就消失了(其实只是变成透明而已)
TRANSPARENT_SWITCH = true
TRANSPARENT_SWITCHES_INDEX = 50
#举例:第一个为true,第二个为50,则打开50号开关,后面的人都没了。
#跟随人数的最大数目,可以更改为2、3什么的。
TRAIN_ACTOR_SIZE_MAX = 4
#Input::DOWN = 2
#Input::LEFT = 4
#Input::RIGHT = 6
#Input::UP = 6
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
class Game_Party_Actor & Game_Character
def initialize
@through = true
def setup(actor)
# キャラクタ?のファイル名と色相を设定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
@character_name = ""
@character_hue = 0
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
super(height)
#--------------------------------------------------------------------------
# ● 下に移动
# turn_enabled : その场での向き?更を许可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
# 通行可能な场合
if passable?(@x, @y, Input::DOWN)
# 下を向く
# 座标を更新
#--------------------------------------------------------------------------
# ● 左に移动
# turn_enabled : その场での向き?更を许可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
# 通行可能な场合
if passable?(@x, @y, Input::LEFT)
# 左を向く
# 座标を更新
#--------------------------------------------------------------------------
# ● 右に移动
# turn_enabled : その场での向き?更を许可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
# 通行可能な场合
if passable?(@x, @y, Input::RIGHT)
# 右を向く
turn_right
# 座标を更新
#--------------------------------------------------------------------------
# ● 上に移动
# turn_enabled : その场での向き?更を许可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
# 通行可能な场合
if passable?(@x, @y, Input::UP)
# 上を向く
# 座标を更新
#--------------------------------------------------------------------------
# ● 左下に移动
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない场合
unless @direction_fix
# 右向きだった场合は左を、上向きだった场合は下を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction
== Input::UP ? Input::DOWN : @direction)
# 下→左、左→下 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1,
Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y,
Input::DOWN))
# 座标を更新
#--------------------------------------------------------------------------
# ● 右下に移动
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない场合
unless @direction_fix
# 左向きだった场合は右を、上向きだった场合は下を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction
== Input::UP ? Input::DOWN : @direction)
# 下→右、右→下 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1,
Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y,
Input::DOWN))
# 座标を更新
#--------------------------------------------------------------------------
# ● 左上に移动
#--------------------------------------------------------------------------
def move_upper_left
# 向き固定でない场合
unless @direction_fix
# 右向きだった场合は左を、下向きだった场合は上を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction
== Input::DOWN ? Input::UP : @direction)
# 上→左、左→上 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1,
Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y,
Input::UP))
# 座标を更新
#--------------------------------------------------------------------------
# ● 右上に移动
#--------------------------------------------------------------------------
def move_upper_right
# 向き固定でない场合
unless @direction_fix
# 左向きだった场合は右を、下向きだった场合は上を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction
== Input::DOWN ? Input::UP : @direction)
# 上→右、右→上 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1,
Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y,
Input::UP))
# 座标を更新
attr_writer :move_speed
attr_writer :step_anime
module Spriteset_Map_Module
def setup_actor_character_sprites?
return @setup_actor_character_sprites_flag != nil
def setup_actor_character_sprites(characters)
if !setup_actor_character_sprites?
index_game_player = 0
@character_sprites.each_index do |i|
if @character_sprites[i].character.instance_of?(Game_Player)
index_game_player = i
for character in characters.reverse
@character_sprites.unshift(
Sprite_Character.new(@viewport1, character)
@setup_actor_character_sprites_flag = true
module Scene_Map_Module
def setup_actor_character_sprites(characters)
@spriteset.setup_actor_character_sprites(characters)
module Game_Party_Module
def set_transparent_actors(transparent)
@transparent = transparent
def setup_actor_character_sprites
if @characters == nil
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(actors[i])
$scene.class.method_defined?('setup_actor_character_sprites')
$scene.setup_actor_character_sprites(@characters)
def update_party_actors
setup_actor_character_sprites
transparent = $game_player.transparent
if transparent == false
if TRANSPARENT_SWITCH
transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
for character in @characters
character.transparent = transparent
character.move_speed = $game_player.move_speed
character.step_anime = $game_player.step_anime
character.update
def moveto_party_actors( x, y )
setup_actor_character_sprites
for character in @characters
character.moveto( x, y )
if @move_list == nil
@move_list = []
move_list_setup
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
@move_list.each_index do |i|
if @characters[i] != nil
case @move_list[i].type
when Input::DOWN
@characters[i].move_down(@move_list[i].args[0])
when Input::LEFT
@characters[i].move_left(@move_list[i].args[0])
when Input::RIGHT
@characters[i].move_right(@move_list[i].args[0])
when Input::UP
@characters[i].move_up(@move_list[i].args[0])
when DOWN_LEFT
@characters[i].move_lower_left
when DOWN_RIGHT
@characters[i].move_lower_right
when UP_LEFT
@characters[i].move_upper_left
when UP_RIGHT
@characters[i].move_upper_right
@characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
class Move_List_Element
def initialize(type,args)
@type = type
@args = args
def type() return @type end
def args() return @args end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list[i] = nil
def add_move_list(type,*args)
@move_list.unshift(Move_List_Element.new(type,args)).pop
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::DOWN,turn_enabled)
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::LEFT,turn_enabled)
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::RIGHT,turn_enabled)
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::UP,turn_enabled)
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
def move_upper_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
def move_upper_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
module Game_Player_Module
def update
$game_party.update_party_actors
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
def move_down(turn_enabled = true)
if passable?(@x, @y, Input::DOWN)
$game_party.move_down_party_actors(turn_enabled)
super(turn_enabled)
def move_left(turn_enabled = true)
if passable?(@x, @y, Input::LEFT)
$game_party.move_left_party_actors(turn_enabled)
super(turn_enabled)
def move_right(turn_enabled = true)
if passable?(@x, @y, Input::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
super(turn_enabled)
def move_up(turn_enabled = true)
if passable?(@x, @y, Input::UP)
$game_party.move_up_party_actors(turn_enabled)
super(turn_enabled)
def move_lower_left
# 下→左、左→下 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1,
Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y,
Input::DOWN))
$game_party.move_lower_left_party_actors
def move_lower_right
# 下→右、右→下 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1,
Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y,
Input::DOWN))
$game_party.move_lower_right_party_actors
def move_upper_left
# 上→左、左→上 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1,
Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y,
Input::UP))
$game_party.move_upper_left_party_actors
def move_upper_right
# 上→右、右→上 のどちらかのコ?スが通行可能な场合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1,
Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y,
Input::UP))
$game_party.move_upper_right_party_actors
def jump(x_plus, y_plus)
# 新しい座标を计算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算?が (0,0) の场合か、ジャンプ先が通行可能な场合
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y,
$game_party.jump_party_actors(x_plus, y_plus)
super(x_plus, y_plus)
attr_reader :move_speed
attr_reader :step_anime
end # module Train_Actor
class Game_Party
include Train_Actor::Game_Party_Module
class Game_Player
include Train_Actor::Game_Player_Module
class Spriteset_Map
include Train_Actor::Spriteset_Map_Module
class Scene_Map
include Train_Actor::Scene_Map_Module
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。&&&&rpg maker xp脚本集合
rpg maker xp脚本集合
内含193个脚本编辑集合,非常有用,很好的一个选择
若举报审核通过,可奖励20下载分
被举报人:
xuyanhu808
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动***等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
VIP下载&&免积分60元/年(1200次)
您可能还需要
开发技术下载排行查看: 2634|回复: 3
RPG Maker XP 自动反击 脚本
阅读权限150
在线时间 小时
# ▼▲▼ XRXS27. 特殊効果 SuperEX「反击」 ver.1.05 ▼▲▼
#========================================================================
# □ 自定义设定
#========================================================================
class Game_Battler
&&# 反击的状态名
&&STATE_COUNTER_NAME = '反击'
#========================================================================
# ◇ 说明文档
#=======================================================================
#****Warning! 重新定义了 Game_Actor#skill_can_use? ****
#对于身中“反击”状态的角色,当收到单独的攻击的时候会自动反击
#反击的模式可以在下面设定
#-cr (counter react)下面设定可以反击的挨打设定,
# 比如设定一个状态名为“反击 -crm”,则受到魔法攻击的时候会自动反击
#-crp&&(physical)=&遭到通常攻击,物理攻击的时候反击
#-crm&&(masic)=&遭到魔法攻击的时候反击
#-cre7 (element)=&遭到属性ID编号为7的攻击的时候反击。
#-ca (counter act)下面设定反击行为
#比如设置一个状态名叫做“反击 -cas19”,那么受到攻击的时候就会用19号特技反击。
#-cas1 (skill)=&使用编号为1的技能
#-cai1 (item)=&使用编号为1的物品。
#-caa&&(attack)=&使用物理攻击反击。
#-cae&&(escape)=&逃跑,敌人使用
#-cac&&(copy)=&受けたスキルをそのまま反击。未テスト(笑
#何もつけない場合は通常攻撃反击になります。(不懂……?@_@?)
#注意和即时战斗的共同使用问题……
#举例:设置一个状态,使得遭遇物理攻击的时候使用物品4,“反击 -crp -cai4”
#========================================================================
# ■ Game_Battler (分割定義 1)
#========================================================================
class Game_Battler
&&#-----------------------------------------------------------------------
&&# ● オブジェクト初期化
&&#-----------------------------------------------------------------------
&&def states=(states)
& & @states = states
&&#-----------------------------------------------------------------------
&&# ● オブジェクト初期化
&&#-----------------------------------------------------------------------
&&alias original_initialize_before_counter_action initialize
&&def initialize
& & original_initialize_before_counter_action()
& & @counter_action = Game_BattleAction.new
&&#-----------------------------------------------------------------------
&&#-----------------------------------------------------------------------
&&alias original_current_action_before_counter_action current_action
&&def current_action
& && &if @counter_action.cleared?
& && &&&return original_current_action_before_counter_action()
& && &else
& && &&&return @counter_action
&&#-----------------------------------------------------------------------
&&#-----------------------------------------------------------------------
&&def counter_action
& & return @counter_action
&&#-----------------------------------------------------------------------
&&#-----------------------------------------------------------------------
&&def counter_acting?
& & if [email=!@counter_action.cleared]!@counter_action.cleared[/email]?
& && &return true
& && &return false
&&#-----------------------------------------------------------------------
&&# ● 戦闘不能判定
&&#-----------------------------------------------------------------------
&&#alias original_dead_before_counter_action dead?
&&#def dead?
&&#&&if self.counter_acting?
&&#& & return false
&&#& & return original_dead_before_counter_action()
&&#----------------------------------------------------------------------
&&#----------------------------------------------------------------------
&&def counter_action_for(attacker, skill = nil)
& & #カウンターからのカウンターは発生しない
& & if attacker.counter_acting?
& && &return
& & #動けない場合存在しない場合は発生しない
& & #if !self.movable? || !self.exist?
& & #&&return
& & if attacker.is_a?(Game_Actor)
& && &if self.is_a?(Game_Actor)#味方からの攻撃はカウンター不可
& && &&&return
& && &ind = $game_party.get_index_by(attacker)
& && &s_ind = $game_troop.get_index_by(self)
& & elsif attacker.is_a?(Game_Enemy)
& && &if self.is_a?(Game_Enemy)#味方からの攻撃はカウンター不可
& && &&&return
& && &ind = $game_troop.get_index_by(attacker)
& && &s_ind = $game_party.get_index_by(self)
& & if ind.nil? || s_ind.nil?
& && &return
& & act_kind = 'a'
& & act_id = 0
& & for id in @states
& && &if $data_states[id].name =~ /^#{STATE_COUNTER_NAME}/
& && &&&react_cond = false
& && &&&react_succ = false
& && &&&for opt in $data_states[id].options
& && && & if opt =~ /^cr([pmedns])([0-9]*)/
& && && && &kind = $1
& && && && &id = $2.to_i
& && && && &react_cond = true
& && && && &case kind
& && && && &when 'p'
& && && && &&&if skill.nil? || skill.atk_f &= 100
& && && && && & react_succ = true
& && && && &&&end
& && && && &when 'm'
& && && && &&&if !skill.nil? && skill.int_f &= 100
& && && && && & react_succ = true
& && && && &&&end
& && && && &when 'e'
& && && && &&&if id.nil? || id.zero?
& && && && && & next
& && && && &&&elsif skill.nil? #武器の攻撃属性
& && && && && & if attacker.is_a?(Game_Actor) && !$data_weapons[@weapon_id].nil?
& && && && && && &if $data_weapons[@weapon_id].element_set.include?(id)
& && && && && && &&&react_succ = true
& && && && && && &end
& && && && && & end
& && && && &&&elsif skill.element_set.include?(id)#スキルの攻撃属性
& && && && && & react_succ = true
& && && && &&&end
& && && && &when 'n'#相手攻撃無効カウンター
& && && && &&&no_attack = true
& && && && &when 's'#回避時カウンター
& && && && &&&miss_attack = true
& && && && &when 'd'#死亡カウンター
& && && && &&&if self.dead? && self.movable?
& && && && && & react_succ = true
& && && && &&&end
& && && && &end
& && && && &
& && && & elsif opt =~ /^ca([asime])([0-9]*)/
& && && && &act_kind = $1
& && && && &act_id = $2.to_i
& && && && &act_cond = true
& && && & end
& && &&&end
& && &&&if (!react_cond || react_succ)#反击条件が無い・もしくは条件に一致
& && && & counter = true#カウンター成功
& && && & break
& && &&&else
& && && & next
& && &&&end
& & if !counter#カウンター成功していなかった場合
& && &return
& & # 相手攻撃無効カウンターありならダメージ戻し
& & if no_attack == true
& && &if self.damage != &被对手闪开了!&
& && &&&self.hp += self.damage
& && &&&self.damage = &反击!!&
& && &&&self.critical = false
& && &&&@state_changed = false
& && &&&self.states = @old_states
& & # 回避時カウンターありでミスじゃないときはさよなら
& & if miss_attack == true and self.damage != &被对手闪开了!&
& && &return
& & if act_kind == 'c'
& && &if skill.nil?
& && &&&act_kind = 'a'
& && &else
& && &&&act_kind = 's'
& && &&&act_id = skill.id
& & case act_kind
& & when 's'#skill kind:1 basic0
& && &s = $data_skills[act_id]
& && &if s.nil? || ![0,1].include?(s.occasion) || !self.skill_can_use?(act_id)
& && &&&return
& && &self.counter_action.skill_id = act_id
& && &self.counter_action.kind = 1
& && &if [1,2].include?(s.scope)#1,2で敵単体、敵全体。
& && &&&self.counter_action.target_index = ind
& && &else
& && &&&self.counter_action.target_index = s_ind
& & when 'i'#item kind:2 basic:0
& && &i = $data_items[act_id]
& && &if !self.is_a?(Game_Actor) || i.nil? || ![0,1].include?(i.occasion) || !$game_party.item_can_use?(act_id)
& && &&&return
& && &self.counter_action.item_id = act_id
& && &self.counter_action.kind = 2
& && &if [1,2].include?(i.scope)#1,2で敵単体、敵全体。
& && &&&self.counter_action.target_index = ind
& && &else
& && &&&self.counter_action.target_index = s_ind
& & when 'a'#通常攻撃 kind:0 basic:0
& && &self.counter_action.kind = 0
& && &self.counter_action.target_index = ind
& && &self.counter_action.basic = 0
& & when 'e'#escape kind:0 basic:2
& && &if !self.is_a?(Game_Enemy)
& && &&&return
& && &self.counter_action.kind = 0
& && &self.counter_action.target_index = ind
& && &self.counter_action.basic = 2& && &
& & return
&&#----------------------------------------------------------------------
&&# ● 通常攻撃の効果適用
&&#& &&&attacker : 攻撃者 (バトラー)
&&#----------------------------------------------------------------------
&&alias original_attack_effect_before_counter_action attack_effect
&&def attack_effect(attacker)
& & @old_states = self.states.clone
& & val = original_attack_effect_before_counter_action(attacker)
& & self.counter_action_for(attacker)
& & return val
&&#----------------------------------------------------------------------
&&# ● スキルの効果適用
&&#& &&&user&&: スキルの使用者 (バトラー)
&&#& &&&skill : スキル
&&#----------------------------------------------------------------------
&&alias original_skill_effect_before_counter_action skill_effect
&&def skill_effect(attacker, skill)
& & @old_states = self.states.clone
& & val = original_skill_effect_before_counter_action(attacker, skill)
& & self.counter_action_for(attacker, skill)
& & return val
#=======================================================================
# ■ Game_Actor
#--------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
# の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
#=======================================================================
class Game_Actor & Game_Battler
&&#----------------------------------------------------------------------
&&# ● スキルの使用可能判定
&&#& &&&skill_id : スキル ID
&&#----------------------------------------------------------------------
&&def skill_can_use?(skill_id)
& & #if not skill_learn?(skill_id)
& & #&&return false
& & return super
#========================================================================
# ■ Game_BattleAction
#-------------------------------------------------------------------------
#  アクション (戦闘中の行動) を扱うクラスです。このクラスは Game_Battler クラ
# スの内部で使用されます。
#========================================================================
class Game_BattleAction
&&alias :xp_original_initialize :initialize
&&def initialize
& & xp_original_initialize()
& & @turn_move_times = 0
&&#-----------------------------------------------------------------------
&&# ● クリア判定
&&#-----------------------------------------------------------------------
&&def cleared?
& & if @speed == 0 && @kind == 0 && @basic == 3 && @skill_id == 0 && @item_id == 0 && @target_index == -1 && @forcing == false
& && &return true
& && &return false
#=========================================================================
# ■ Game_Party
#--------------------------------------------------------------------------
#  パーティを扱うクラスです。ゴールドやアイテムなどの情報が含まれます。このク
# ラスのインスタンスは $game_party で参照されます。
#=========================================================================
class Game_Party
&&#----------------------------------------------------------------------
&&#----------------------------------------------------------------------
&&def get_index_by(actor)
& & for i in ()
& && &if @actors.equal?(actor)
& && &&&return i
& & return nil
#==========================================================================
# ■ Game_Troop
#--------------------------------------------------------------------------
#  トループを扱うクラスです。このクラスのインスタンスは $game_troop で参照さ
# れます。
#==========================================================================
class Game_Troop
&&#----------------------------------------------------------------------
&&#----------------------------------------------------------------------
&&def get_index_by(enemy)
& & for i in ()
& && &if @enemies.equal?(enemy)
& && &&&return i
& & return nil
#==========================================================================
# ■ Scene_Battle (分割定義 4)
#--------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==========================================================================
class Scene_Battle
&&#----------------------------------------------------------------------
&&# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
&&#----------------------------------------------------------------------
&&alias original_update_phase4_step6_before_counter_action update_phase4_step6
&&def update_phase4_step6
& & original_update_phase4_step6_before_counter_action()
& & clear_counter_action(@active_battler)
& & activate_counter_action(@action_battlers)
&&#----------------------------------------------------------------------
&&#----------------------------------------------------------------------
&&def clear_counter_action(active_battler)
& & #既にカウンターを行ったバトラーのカウンターアクションをクリア
& & if active_battler.nil?
& && &return
& & if !active_battler.counter_acting?
& && &return
& & active_battler.counter_action.clear
& & return
&&#----------------------------------------------------------------------
&&#----------------------------------------------------------------------
&&def activate_counter_action(action_battlers)& &
& & #カウンター状態になったバトラーを一回だけアクションバトラーズにアンシフト
& & if !action_battlers[0].nil?
& && &if action_battlers[0].counter_acting?#既にカウンター行動待機バトラーが居た場合
& && &&&return
& & counter_battlers = []
& & $game_party.actors.each{|a|
& && &if a.counter_acting?
& && &&&counter_battlers.push(a)
& & $game_troop.enemies.each{|e|
& && &if e.counter_acting?
& && &&&counter_battlers.push(e)
& & counter_battlers = counter_battlers.sort_by{|b| b.agi}
& & counter_battlers.each{ |b|
& && &action_battlers.unshift(b)
& & #p action_battlers.collect{|b| b.name}
& & return
#=============================
#CPバトル対応。
#ターンバトルの人は必要なし。
#=============================
class Game_Battler
&&if method_defined?(:cp)
& & alias original_cp_before_counter_action cp
& & def cp
& && &if self.counter_acting?
& && &&&return 65535
& && &else
& && &&&return original_cp_before_counter_action()
&&if method_defined?(:cp=)
& & alias original_cp_before_counter_action= cp=
& & def cp=(n)
& && &if self.counter_acting?
& && &&&return
& && &else
& && &&&self.original_cp_before_counter_action = n
#=============================
#ここまで。
#=============================
&&#---------------------------------------------------------------------
&&#---------------------------------------------------------------------
module RPG
&&class State
& & def name
& && &if @new_name.nil?
& && &&&name_setting()
& && &return @new_name
& & def options
& && &if @options.nil?
& && &&&name_setting()
& && &return @options
& & def name_setting
& && &names = @name.split(/ +-/)
& && &@new_name = names.shift
& && &if @new_name.nil?
& && &&&@new_name = ''
& && &@options = names
& && &if @options.nil?
& && &&&@options = []
阅读权限99
在线时间 小时
继续收&&顺便刷个贴
不耍不灌水吧
阅读权限50
在线时间 小时
幻想の領主
阅读权限30
在线时间 小时
我想学习一下。
尝试插入LZ的这个脚本试试看。
Powered by

参考资料

 

随机推荐