#=================================================
# ■ 技能组别范围
#
=begin
使用方法:设置技能的作用范围为四个随机敌人,原有的4随机敌人定义被取消。
改自九夜神尊的技能组别范围
=end
class RPG::UsableItem < RPG::BaseItem
#------------------------------------------------
# ●需要选择
#------------------------------------------------
def need_selection?
[1, 6,7, 9].include?(@scope)
end
#------------------------------------------------
# ●随机对象
#------------------------------------------------
def for_random?
[3, 4, 5].include?(@scope)
end
#------------------------------------------------
# ●组别对象
#------------------------------------------------
def for_group?
@scope==6
end
end
#encoding:utf-8
#==============================================================================
# ■ Game_Action
#------------------------------------------------------------------------------
# 处理战斗中的行动的类。本类在 Game_Battler 类的内部使用。
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# ● 目标为敌人
#--------------------------------------------------------------------------
alias swtf_targets_for_opponents targets_for_opponents
def targets_for_opponents
if $data_skills[80].note.include?("横排")
if item.for_group?
return opponents_unit.group_target1(@target_index)
end
else #$data_skills[80].note.include?("竖排")
if item.for_group?
return opponents_unit.group_target2(@target_index)
end
end
swtf_targets_for_opponents
end
end
#encoding:utf-8
#==============================================================================
# ■ Game_Unit
#------------------------------------------------------------------------------
# 管理游戏单位的类。是 Game_Party 和 Game_Troop 类的父类。
#==============================================================================
class Game_Unit
#--------------------------------------------------------------------------
# ● 决定组别目标
#
#--------------------------------------------------------------------------
def group_target1(index) #横排目标数据
group1 = []
member = members[index]
members.each do |enemy|
if enemy.enemy_id == $game_troop.members[0].enemy_id
group1.push enemy if enemy.alive?
end
if enemy.enemy_id == $game_troop.members[1].enemy_id
group1.push enemy if enemy.alive?
end
if enemy.enemy_id == $game_troop.members[2].enemy_id
group1.push enemy if enemy.alive?
end
end
return group1
end
def group_target2(index) #竖排目标数据
group2 = []
member = members[index]
members.each do |enemy|
if enemy.enemy_id == $game_troop.members[1].enemy_id
group2.push enemy if enemy.alive?
end
if enemy.enemy_id == $game_troop.members[4].enemy_id
group2.push enemy if enemy.alive?
end
end
return group2
end
end