class Scene_Map
#--------------------------------------------------------
# EFS系统 主初始化函数:
#--------------------------------------------------------
#定义EFS系统主初始化(攻击者,防御者,模式=2)
def efs_main_initialize(attacker,defender,mode = 2)
#把进攻者和防守者根据是那队分配 进攻者
#团队组=攻击者。参与者团队?攻击者。队员:防守队员。成员
@team_groups = attacker.player_team ? attacker.member : defender.member
#敌军组 =攻击者。玩家_团队?攻击者。队员:防守队员。成员
@enermy_groups = attacker.player_team ? defender.member : attacker.member
#团队组=攻击者。玩家_团队?攻击者。队员:
@team_army = attacker.player_team ? attacker : defender
#敌军组 =攻击者。玩家_团队?防守队员。成员
@enermy_army = attacker.player_team ? defender : attacker
@team_display_area = [] #团队显示区域=[]
#清空地图切换状态
#@地图已更换 = 不真实的
@map_changed = false
#进入EFS的开关打开了
#游戏临时演员。在efs中=真
$game_temp.inefs = true
#获得出生范围s
#案例模式
case mode
#
when 1..2
get_spawn_areas #获得出生区域
spawn_groups #出生组
when 3
get_spawn_areas_terr_tag #获取出生区域领域标签
spawn_groups_ambush #出生群_伏击
when 4
when 5
end
#设置初始内容
set_initial
@efs_all_dead = false #@efs全部失效=错误
@efs_victory = false # @efs胜利=错误
@efs_escape = false # @efs逃跑=错误
#
#@current_leader.kds if @current_leader1 != nil
#命令全体人
#@定位器 = 0
@lisenter = 0
#@组定位器=[1,2,3,4,5]
@group_lisenter = [1,2,3,4,5]
#战前补充
attacker.refill#攻击者补充
defender.refill#防守者补充
#还原队伍移动方式设置
reset_group_movement#重置组移动
@group_think_counter = 0 #@组思维计数器=0
@group_think_period = 50 #@组思考周期 = 50
#根据战斗模式调整相关######调整基准启用模式
adjust_base_on_mode
end
#--------------------------------------------------------
# 检查是否是玩家控制
#--------------------------------------------------------
def check_player_controll#定义检查_图层_控制
#@团队S。每个做|组|
@team_groups.each do|group|
#组战士每个都做|f|
group.fighter.each do|f|
#如果f是a,则返回true?(EFS_Hero)而不是f.死了?
return true if f.is_a?(EFS_Hero) and not f.dead?
end
end
return false#返回假
end
#--------------------------------------------------------
# 设置队伍
#--------------------------------------------------------
def set_initial # 初始定义设置
for groups in @team_groups # 对于@团队组中的组
for f in groups.fighter # 对于分组中的f。战士
f.setTeam(1) # f.设置团队(1)
end
end
for groups in @enermy_groups # 对于@敌军组中的组
for e in groups.fighter # 对于分组中的e。战士
e.setTeam(2) # e.设置团队(2)
end
end
end
#--------------------------------------------------------
# 重置移动类型
#--------------------------------------------------------
def reset_group_movement # 定义重置组移动
for groups in @team_groups # 对于@团队组中的组
groups.group_move_type = 0 # 组。组移动类型=0
end
for groups in @enermy_groups # 对于@敌军组中的组
groups.group_move_type = 0 # 组。组移动类型=0
end
end
#--------------------------------------------------------
# 放置队长
#--------------------------------------------------------
def deploy_captains#定义放置队长
end
#--------------------------------------------------------
# 设置初始阵形
#--------------------------------------------------------
def group_them_up#定义将它们分组
return if @efs_mode != 2#返回如果@efs模式!=2.
#团队编队=EFS军队编队。new(@团队军队,1)
team_formation = EFS_Army_Formation.new(@team_army,1)
#敌军编队=EFS军队编队。new(@敌军军队,1)
enermy_formation = EFS_Army_Formation.new(@enermy_army,1)
#x大小,y大小 = 团队组建。计算组建_ a(@目标d)
x_size , y_size = team_formation.calculate_formation_a(@target_d)
#x_极限=(@o0[0]-@o1[0])。绝对值
x_limit = (@o0[0] - @o1[0] ).abs
#y_极限=(@o0[0]-@o1[0])。绝对值
y_limit = (@o0[1] - @o1[1] ).abs
if x_size <= x_limit and y_size <= y_limit
team_formation.start(@target_x,@target_y,@target_d)
for groups in @team_groups
next unless groups.aviliable?
for f in groups.fighter
f.moveto(f.goal_x,f.goal_y)
end
end
Notification.post("阵形布置完毕!")
else
Notification.post("由于地形原因,阵形无法施展开!")
manually_group_them_up
end
x_size , y_size = enermy_formation.calculate_formation_a(@e_target_d)
if x_size <= x_limit and y_size <= y_limit
enermy_formation.start(@e_target_x,@e_target_y,@e_target_d)
for groups in @enermy_groups
next unless groups.aviliable?
groups.set_up_rect(groups.captain.direction)
for f in groups.fighter
f.moveto(f.goal_x,f.goal_y)
end
end
end #if
for groups in @team_groups
next unless groups.aviliable?
groups.set_move_type(1)
end
end
#=======================================================
# EFS 战斗模式
# 1 : 混战 (阵形不可用,默认全军冲锋,默认出生点)
# 2 : 正常阵形状 (正常有阵形,默认推进,默认出生点)
# 3 : 伏击战 (守军士气大跌,被夹击包围,伏击出生点)
# 4 : 攻城战 (守军站在墙上指定位置,攻方默认出生点,守军城墙点)
# 5 : 巷战 (有居民助战和乱窜,攻方默认出生点,守方分队出生点)
# 6 : 扫荡战 (抽取部分攻方打守方(每队5人内),混战,默认出生点)
#--------------------------------------------------------
# 根据模式调整
#--------------------------------------------------------
def adjust_base_on_mode
case @efs_mode
when 1
@team_groups.each do|groups|
groups.set_move_type(3)
end
@enermy_groups.each do|groups|
groups.set_move_type(3)
end
when 2
@team_groups.each do|groups|
groups.set_move_type(1)
end
@enermy_groups.each do|groups|
groups.set_move_type(1)
end
when 3
@team_groups.each do|groups|
groups.set_move_type(3)
end
@enermy_groups.each do|groups|
groups.set_move_type(3)
end
when 4
@attacker.member.each do|groups|
groups.set_move_type(3)
end
@defender.member.each do|groups|
groups.set_move_type(1)
end
else
end
end
#--------------------------------------------------------
# 就当作切换地图的函数:
#--------------------------------------------------------
def engage(my_id,e_id)
$game_map.map_id #????
load_or_map_data #记录旧的地图信息
#读取一个地图信息
get_new_map_info
change_map #开始切换地图
end
#--------------------------------------------------------
# 获得出生点位置
#--------------------------------------------------------
def get_spawn_areas
#=====临时标记
b = $game_map.mpname.split(";")
o0 = [b[1].split(",")[0].to_i,b[1].split(",")[1].to_i]
o1 = [b[2].split(",")[0].to_i,b[2].split(",")[1].to_i]
e0 = [b[3].split(",")[0].to_i,b[3].split(",")[1].to_i]
e1 = [b[4].split(",")[0].to_i,b[4].split(",")[1].to_i]
@team_spawn_height = (o0[0]-o1[0]).abs
@team_spawn_width = (o0[1]-o1[1]).abs
@o0 = o0
@o1 = o1
@e0 = e0
@e1 = e1
@efs_enermy_spawn = []
@efs_team_spawn = []
if @attacker.player_team#######
for x in o0[0]..o1[0]
for y in o0[1]..o1[1]
@efs_team_spawn.push([x,y]) if $game_map._passable?(x,y,0)
end
end
make_map_move(@efs_team_spawn)
for x in e0[0]..e1[0]
for y in e0[1]..e1[1]
@efs_enermy_spawn.push([x,y]) if $game_map._passable?(x,y,0)
end
end
else ##########
for x in o0[0]..o1[0]
for y in o0[1]..o1[1]
@efs_enermy_spawn.push([x,y]) if $game_map._passable?(x,y,0)
end
end
make_map_move(@efs_enermy_spawn)
for x in e0[0]..e1[0]
for y in e0[1]..e1[1]
@efs_team_spawn.push([x,y]) if $game_map._passable?(x,y,0)
end
end
end #########
#==========
#make_map_move(@efs_enermy_spawn)
#make_map_move(@efs_team_spawn)
end
def check_formation_size_with_map_spawn_size(d)
calculate_formation_a(d)
end
#--------------------------------------------------------
# 获得出生点位置(地形标记)
# 15 埋伏模式 防守方出生点
# 14 埋伏模式 攻击方出生点 正
# 13 埋伏模式 攻击方出生点 侧 1
# 12 埋伏模式 攻击方出生点 侧 2
# 11
# 10
#--------------------------------------------------------
def get_spawn_areas_terr_tag
@efs_ambush_defender_spawn = []
@efs_ambush_attacker_spawn_0 = []
@efs_ambush_attacker_spawn_1 = []
@efs_ambush_attacker_spawn_2 = []
for x in 0..$game_map.width-1
for y in 0..$game_map.height-1
case $game_map.terrain_tag(x,y)
when 15
@efs_ambush_defender_spawn.push ([x,y])
when 14
@efs_ambush_attacker_spawn_0.push ([x,y])
when 13
@efs_ambush_attacker_spawn_1.push ([x,y])
when 12
@efs_ambush_attacker_spawn_2.push ([x,y])
end
end
end
end
#--------------------------------------------------------
# EFS系统:出生小队 (MODE: 伏击模式)
#--------------------------------------------------------
def spawn_groups_ambush
@current_leader = nil
#获得空地
attacker_groups = @attacker.member
defender_groups = @defender.member
space = @efs_ambush_defender_spawn.clone
#p space[0],space[1],space[2]
#领导check
for i in 0.. @team_groups.size-1
for j in 0.. @team_groups[i].fighter.size-1
@current_leader = @team_groups[i].fighter[j] if @team_groups[i].fighter[j].is_a?(EFS_Hero) and not @team_groups[i].fighter[j].dead?
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-
for i in 0.. defender_groups.size-1
for j in 0.. defender_groups[i].fighter.size-1
if space.size == 0
print "无法散开队伍进行战斗"
else
a = space[0]
next if defender_groups[i].fighter[j].dead?
#生成战斗者
conjure_efs(a[0],a[1],"DEF","theplayer",2,defender_groups[i].fighter[j])
defender_groups[i].fighter[j].setImoprtantData(@current_leader,i+1)
defender_groups[i].fighter[j].set_goal_xy(a[0],a[1])
#删除空地
space.delete([a[0],a[1]])
end #if
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-1
###########
numbers = 0
for i in 0.. @enermy_groups.size-1
for j in 0.. @enermy_groups[i].fighter.size-1
numbers+=1
end
end
one_third_cut = numbers/3
space0 = @efs_ambush_attacker_spawn_0
space1 = @efs_ambush_attacker_spawn_1
space2 = @efs_ambush_attacker_spawn_2
counter_for_num = 0
for i in 0.. attacker_groups.size-1
for j in 0.. attacker_groups[i].fighter.size-1
#make_map_move(space)
if space.size == 0
print "无法散开队伍进行战斗"
else
if counter_for_num < one_third_cut
a = space0[0]
elsif counter_for_num < one_third_cut*2
a = space1[0]
else
a = space2[0]
end
#counter2 += 1
next if attacker_groups[i].fighter[j].dead?
conjure_efs(a[0],a[1],"ATK","player",8,attacker_groups[i].fighter[j])
attacker_groups[i].fighter[j].setImoprtantData(@current_leader,i+1)
attacker_groups[i].fighter[j].set_goal_xy(a[0],a[1])
#删除空地
if counter_for_num < one_third_cut
space0.delete([a[0],a[1]])
elsif counter_for_num < one_third_cut*2
space1.delete([a[0],a[1]])
else
space2.delete([a[0],a[1]])
end
end #if
counter_for_num+=1
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-1
# 重置
@spriteset.dispose
@spriteset = Spriteset_Map.new
end
#--------------------------------------------------------
# 获得新地图信息
#--------------------------------------------------------
def get_new_map_info
#load_data("Data/MapInfos.rxdata")[7].name
list = []
final_list = []
#添加所有备选地图
#p @defender.event.terrain_tag
Map_Info::TERRAIN_MAP[@defender.event.terrain_tag].each do|i|
# p "bang",$game_map.map_id,i
b = load_data("Data/MapInfos.rxdata")[i].name.split(";")
avilible_mode = b[5].split(",")
if Map_Info::SUB_MAPS[$game_map.map_id].include?(i) and avilible_mode.include?(@efs_mode.to_s)
list.push i
end
end
#根据地图大小筛选地图
def_num = @defender.get_alive_num
atk_num = @attacker.get_alive_num
#p list
list.each do|i|
b = load_data("Data/MapInfos.rxdata")[i].name.split(";")
o0 = [b[1].split(",")[0].to_i,b[1].split(",")[1].to_i]
o1 = [b[2].split(",")[0].to_i,b[2].split(",")[1].to_i]
e0 = [b[3].split(",")[0].to_i,b[3].split(",")[1].to_i]
e1 = [b[4].split(",")[0].to_i,b[4].split(",")[1].to_i]
atk_size = (o1[0]-o0[0])*(o1[1]-o0[1])
# x * y
def_size = (e1[0]-e0[0])*(e1[1]-e0[1])
#p atk_size,def_size
final_list.push i if atk_num <= atk_size and def_num <= def_size
end
#最终抽取
new_map = final_list[rand(final_list.size)]
if new_map == nil or load_data("Data/MapInfos.rxdata")[new_map] == nil
p " 无可用地图"
p "DEF NUM, ATK NUM: ", def_num , atk_num
$scene = nil
end
#计算各种坐标
b = load_data("Data/MapInfos.rxdata")[new_map].name.split(";")
o0 = [b[1].split(",")[0].to_i,b[1].split(",")[1].to_i]
o1 = [b[2].split(",")[0].to_i,b[2].split(",")[1].to_i]
e0 = [b[3].split(",")[0].to_i,b[3].split(",")[1].to_i]
e1 = [b[4].split(",")[0].to_i,b[4].split(",")[1].to_i]
if @attacker.player_team
@target_x = (o0[0]+o1[0])/2
@target_y = (o0[1]+o1[1])/2
@e_target_x = (e0[0]+e1[0])/2
@e_target_y = (e0[1]+e1[1])/2
else
@e_target_x = (o0[0]+o1[0])/2
@e_target_y = (o0[1]+o1[1])/2
@target_x = (e0[0]+e1[0])/2
@target_y = (e0[1]+e1[1])/2
end
#目标地图
@target_map_id = new_map
#计算方向
@target_d = get_d_toward(@target_x,@target_y,@e_target_x,@e_target_y)
@e_target_d = get_d_toward(@e_target_x,@e_target_y,@target_x,@target_y)
# p @attacker.player_team,@target_d,@e_target_d
end
#Helper method--------------------------------------
def get_d_toward(x,y,xx,yy)
sx = x - xx
sy = y - yy
if sx.abs > sy.abs
return sx > 0 ? 4 : 6
else
return sy > 0 ? 8 : 2
end
end
#--------------------------------------------------------
# EFS系统:出生小队
#--------------------------------------------------------
def spawn_groups
@current_leader = nil
#获得空地
space = @efs_team_spawn.clone
#p space[0],space[1],space[2]
for i in 0.. @team_groups.size-1
for j in 0.. @team_groups[i].fighter.size-1
@current_leader = @team_groups[i].fighter[j] if @team_groups[i].fighter[j].is_a?(EFS_Hero) and not @team_groups[i].fighter[j].dead?
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-
counter = 0
for i in 0.. @team_groups.size-1
for j in 0.. @team_groups[i].fighter.size-1
#make_map_move(space)
if space.size == 0
print "无法散开队伍进行战斗"
else
#p counter
a = space[counter]
#counter += 1
next if @team_groups[i].fighter[j].dead?
#生成战斗者
conjure_efs(a[0],a[1],"MY","theplayer",2,@team_groups[i].fighter[j])
@team_groups[i].fighter[j].setImoprtantData(@current_leader,i+1)
@team_groups[i].fighter[j].set_goal_xy(a[0],a[1])
# p 1
#删除空地
space.delete([a[0],a[1]])
end #if
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-1
###########
space = @efs_enermy_spawn
counter2 = 0
for i in 0.. @enermy_groups.size-1
for j in 0.. @enermy_groups[i].fighter.size-1
#make_map_move(space)
if space.size == 0
print "无法散开队伍进行战斗"
else
a = space[counter2]
#counter2 += 1
next if @enermy_groups[i].fighter[j].dead?
conjure_efs(a[0],a[1],"EN","player",8,@enermy_groups[i].fighter[j])
@enermy_groups[i].fighter[j].setImoprtantData(@current_leader,i+1)
@enermy_groups[i].fighter[j].set_goal_xy(a[0],a[1])
#删除空地
space.delete([a[0],a[1]])
end #if
end #for j in 0.. @team_groups[i].fighter.size-1
end #for i in 0.. @team_groups.size-1
# 重置
@spriteset.dispose
@spriteset = Spriteset_Map.new
end
#--------------------------------------------------------------------------
# ● 切换地图
#--------------------------------------------------------------------------
def change_map
# 场所移动中、信息显示中、过渡处理中的情况下
if $game_temp.player_transferring or
$game_temp.message_window_showing or
$game_temp.transition_processing
# 结束
return false
end
$game_temp.player_transferring = true
# 设置主角的移动目标
$game_temp.player_new_map_id = @target_map_id
$game_temp.player_new_x = @target_x
$game_temp.player_new_y = @target_y
$game_temp.player_new_direction = @target_d
# 准备过渡
Graphics.freeze
# 设置过渡处理中标志
$game_temp.transition_processing = true
$game_temp.transition_name = ""
return false
#--------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ● 战斗结束返回地图
#--------------------------------------------------------------------------
def back_to_map
# 设置主角的移动目标
$game_temp.player_new_map_id = @or_map_id
$game_temp.player_new_x = @or_x
$game_temp.player_new_y = @or_y
$game_temp.player_new_direction = @or_d
# 准备过渡
Graphics.freeze
# 设置过渡处理中标志
$game_temp.transition_processing = true
$game_temp.transition_name = ""
transfer_player
end
def load_or_map_data
@or_map_id = $game_map.map_id
@or_x = $game_player.x
@or_y = $game_player.y
@or_d = $game_player.direction
end
#--------------------------------------------------------------------------
# ● 生成
#--------------------------------------------------------------------------
def conjure_efs(x,y,name,character_name,d,e)
e.name = name
e.character_name = character_name
e.direction = d
e.moveto(x,y)
e.refresh
$game_map.fighters[$game_map.fighters.size+1] = e
e.setSpawn(x,y)
end
=begin
#--------------------------------------------------------
# 设置初始阵形
#--------------------------------------------------------
def group_them_up
# p @target_d
return if @efs_mode != 2
#calculate_formation_a(d)
#@target_x
team_formation = EFS_Army_Formation.new(@team_army,1)
enermy_formation = EFS_Army_Formation.new(@enermy_army,1)
x_size , y_size = team_formation.calculate_formation_a(@target_d)
x_limit = (@o0[0] - @o1[0] ).abs
y_limit = (@o0[1] - @o1[1] ).abs
if x_size <= x_limit and y_size <= y_limit
team_formation.start(@target_x,@target_y,@target_d)
for groups in @team_groups
next unless groups.aviliable?
#groups.set_up_rect(groups.captain.direction)
for f in groups.fighter
f.moveto(f.goal_x,f.goal_y)
end
end
Notification.post("阵形布置完毕!")
else
Notification.post("由于地形原因,阵形无法施展开!")
end
x_size , y_size = enermy_formation.calculate_formation_a(@e_target_d)
if x_size <= x_limit and y_size <= y_limit
enermy_formation.start(@e_target_x,@e_target_y,@e_target_d)
for groups in @enermy_groups
next unless groups.aviliable?
groups.set_up_rect(groups.captain.direction)
for f in groups.fighter
f.moveto(f.goal_x,f.goal_y)
end
end
end #if
for groups in @team_groups
next unless groups.aviliable?
groups.set_move_type(1)
end
end
=end
def manually_group_them_up#手动定义组主题
#各种刷新
Graphics.update
Input.update
@spriteset.update
#改变画面颜色
$game_screen.start_tone_change(Tone.new(@efs_tone_R,@efs_tone_G,@efs_tone_B), 20)
#等待一会儿
wait_a_moment(true)
#开启消息
Notification.show
for groups in @team_groups
next unless groups.aviliable?
groups.calculate_rect_size(@target_d)
if @target_d == 4 or @target_d == 6
if groups.get_length > @team_spawn_height or groups.get_height > @team_spawn_width
Notification.post(groups.name+"队伍过于庞大无法手动布阵!")
next
end
else
if groups.get_length > @team_spawn_width or groups.get_height > @team_spawn_height
Notification.post(groups.name+"队伍过于庞大无法手动布阵!")
next
end
end
#通知。邮递 组。名称
Notification.post("正在手动部署"+groups.name+",请选择一个一个部署地点。")
#让用户为派生(组)选择目标
let_user_choose_a_goal_for_spawn(groups)
flush_map_makers #平面地图绘制器
end
# 取消使地图移动(@团队显示区域)
cancel_make_map_move(@team_display_area)
# 取消使地图移动( @efs团队生成)
cancel_make_map_move(@efs_team_spawn)
flush_map_makers #平面地图绘制器
end
#定义让用户为出生(组)选择一个目标
def let_user_choose_a_goal_for_spawn(group)
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#临时存储=$游戏玩家。字符名称
temp_storage = $game_player.character_name
#最终x=无[1,2,3,4,5]
final_x = nil
# final_x = [11,14,17,20,20]
#最终y=无[1,2,3,4,5]
# final_y = [20,23,20,17,29]
final_y = nil
#cp=组.队长
cp = group.captain
x = cp.x
y = cp.y
# cp.转向战斗者(cp.找到最近的敌人)
cp.turn_toward_fighter(cp.find_closest_enermy)
#$游戏玩家。字符名称=cp.字符名称
$game_player.character_name = cp.character_name
#游戏玩家。移动(X,Y)
$game_player.moveto(x,y)
#$游戏玩家。透明=错误
$game_player.transparent = false
#游戏玩家方向= cp.方向
$game_player.direction = cp.direction
loop do #循环 do
pl = $game_player#游戏玩家
# @efs最后一个实数x=pl.实数x
@efs_last_real_x = pl.real_x
# @efs最后一个实数y=pl.实数y
@efs_last_real_y = pl.real_y
#游戏系统更新
$game_system.update
#游戏_屏幕更新
$game_screen.update
@spriteset.update#精灵集更新
Input.update #输入更新
# _更新生成(组)的命令和输入
_update_comand_input_for_spawn(group)
Graphics.update#图形更新
if Input.trigger?(Input::C)#如果输入触发器?(输入::C)
if if_user_can_deploy(group)#if-if用户可以部署(组)
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#最终x=游戏玩家.x
final_x = $game_player.x
##最终y=游戏玩家.y
final_y = $game_player.y
break
else
$game_system.se_play($data_system.buzzer_se)
end #user can
end #if
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
#spawn_groups
#break
end
end #loop
#游戏玩家。透明度=真如果@玩家控制
$game_player.transparent = true if @player_controll
#$游戏玩家。字符名称=临时存储
$game_player.character_name = temp_storage
return final_x, final_y
end #def
#--------------------------------------------------------
# EFS系统 主初始化函数:
#--------------------------------------------------------
def _update_comand_input_for_spawn(group)
#-<方向键>------------
if Input.repeat?(Input::UP)
#p $game_screen.tone.red
if @efs_team_spawn.include?([$game_player.x,$game_player.y-1])
$game_system.se_play($data_system.cursor_se)
cancel_make_map_move(@team_display_area)
$game_player.moveto($game_player.x,$game_player.y-1)
display_move_able_groups(group)
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
if Input.repeat?(Input::DOWN)
if @efs_team_spawn.include?([$game_player.x,$game_player.y+1])
$game_system.se_play($data_system.cursor_se)
cancel_make_map_move(@team_display_area)
$game_player.moveto($game_player.x,$game_player.y+1)
display_move_able_groups(group)
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
if Input.repeat?(Input::RIGHT)
if @efs_team_spawn.include?([$game_player.x+1,$game_player.y])
$game_system.se_play($data_system.cursor_se)
cancel_make_map_move(@team_display_area)
$game_player.moveto($game_player.x+1,$game_player.y)
display_move_able_groups(group)
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
if Input.repeat?(Input::LEFT)
if @efs_team_spawn.include?([$game_player.x-1,$game_player.y])
$game_system.se_play($data_system.cursor_se)
cancel_make_map_move(@team_display_area)
$game_player.moveto($game_player.x-1,$game_player.y)
display_move_able_groups(group)
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
def display_move_able_groups(group)
cp = group.captain
cp.set_goal_xy($game_player.x,$game_player.y)
group.set_up_rect(group.captain.direction,1,true,false)
@team_display_area = group.display_grid_of_indiv
make_map_move(@team_display_area)
for f in group.fighter
f.moveto(f.goal_x,f.goal_y)
make_map_team_display(f)
end
end
def if_user_can_deploy(group)
for f in group.fighter
next if f.dead?
x,y = f.x,f.y
if not $game_map.passable?(x,y,10,f) or not @efs_team_spawn.include?([x,y])
return false
end
end
return true
end
def make_map_team_display(f)
x,y = f.x,f.y
if $game_map.passable?(x,y,10,f) and @efs_team_spawn.include?([x,y])
@spriteset.flash_data[x, y] = 0xfe2af2
else
@spriteset.flash_data[x, y] = 0xf84
end
#@efs_team_spawn
#0xf84
end
def flush_map_makers
for x in 0..$game_map.width-1
for y in 0..$game_map.height-1
@spriteset.flash_data[x, y] = 0
end
end
end
end