本帖最后由 金芒芒 于 2023-6-1 14:43 编辑
等中午休息的时候试一下
开关10只是启动10号公共事件,公共事件启动后显示一张图片然后等待10秒图片消失,然后关闭10号开关
@efs_after_battle_level = judge_battle_level p Wzj::EFS_AFTER_BATTLE_TEXT[@efs_after_battle_level] if @efs_after_battle_level == 10 $game_switches[51] = true #true Notification.post("10号开关已经打开") end if @efs_after_battle_level == 9 $game_switches[52] = true Notification.post("9号开关已经打开") end if @efs_after_battle_level == 8 $game_switches[53] = true Notification.post("8号开关已经打开") end if @efs_after_battle_level == 7 $game_switches[54] = true Notification.post("7号开关已经打开") end if @efs_after_battle_level == 6 $game_switches[55] = true Notification.post("6号开关已经打开") end if @efs_after_battle_level == 5 $game_switches[56] = true Notification.post("5号开关已经打开") end if @efs_after_battle_level == 4 $game_switches[57] = true Notification.post("4号开关已经打开") end if @efs_after_battle_level == 3 $game_switches[58] = true Notification.post("3号开关已经打开") end if @efs_after_battle_level == 2 $game_switches[59] = true Notification.post("2号开关已经打开") end if @efs_after_battle_level == 1 $game_switches[60] = true Notification.post("1号开关已经打开") end if @efs_after_battle_level == 0 $game_switches[61] = true Notification.post("11号开关已经打开") end
@efs_after_battle_level = judge_battle_level
p Wzj::EFS_AFTER_BATTLE_TEXT[@efs_after_battle_level]
if @efs_after_battle_level == 10
$game_switches[51] = true #true
Notification.post("10号开关已经打开")
end
if @efs_after_battle_level == 9
$game_switches[52] = true
Notification.post("9号开关已经打开")
end
if @efs_after_battle_level == 8
$game_switches[53] = true
Notification.post("8号开关已经打开")
end
if @efs_after_battle_level == 7
$game_switches[54] = true
Notification.post("7号开关已经打开")
end
if @efs_after_battle_level == 6
$game_switches[55] = true
Notification.post("6号开关已经打开")
end
if @efs_after_battle_level == 5
$game_switches[56] = true
Notification.post("5号开关已经打开")
end
if @efs_after_battle_level == 4
$game_switches[57] = true
Notification.post("4号开关已经打开")
end
if @efs_after_battle_level == 3
$game_switches[58] = true
Notification.post("3号开关已经打开")
end
if @efs_after_battle_level == 2
$game_switches[59] = true
Notification.post("2号开关已经打开")
end
if @efs_after_battle_level == 1
$game_switches[60] = true
Notification.post("1号开关已经打开")
end
if @efs_after_battle_level == 0
$game_switches[61] = true
Notification.post("11号开关已经打开")
end
def judge_battle_level#定义判断_战斗_级别 team_sum = 0 #团队总数=0 enermy_sum = 0 #敌人总数=0 @team_groups.each do |groups|#@团队。每个人做|组| #团队总数 += 组。启动时处于活动状态 team_sum += groups.alive_while_starting end #@敌人团体。每个做|组| @enermy_groups.each do |groups| #敌人总数 += 组。启动时处于活动状态 enermy_sum += groups.alive_while_starting end team_down = 0 #团队总数=0 enermy_down = 0 #敌人总数=0 #对于$游戏地图中的f。战士值 for f in $game_map.fighters.values if f.team == 1 #如果f。团队==1 if f.dead? #如果f.死了? team_down += 1 #团队朝下+=1 end else#========否则 if f.dead? #如果f.死了? enermy_down += 1 #敌人团队朝下+=1 end end #if team end #do # 团队_r= 团队落后。至f/团队总和 team_r = team_down.to_f/team_sum # 敌人团队_r= 敌人团队落后。至f/敌人团队总和 enermy_r = enermy_down.to_f/enermy_sum if @efs_victory #如果@efs获胜 # 得分=(5队r*5+敌人_r*5)。整数 score = (5-team_r*5+enermy_r*5).round #得分=[[得分,6].最大值,10].最小值 score = [[score,6].max,10].min else #否则 #得分=10-(团队_r*5+ 5-敌人_r*5).整数 score = 10 - (team_r*5+ 5-enermy_r*5).round #得分 = [[得分,0].最大值,4].最小值 score = [[score,0].max,4].min end if score == 10 @efs_after_battle_level == 10 end if score == 9 @efs_after_battle_level == 9 end if score == 8 @efs_after_battle_level == 8 end if score == 7 @efs_after_battle_level == 7 end if score == 6 @efs_after_battle_level == 6 end if score == 5 @efs_after_battle_level == 5 end if score == 4 @efs_after_battle_level == 4 end if score == 3 @efs_after_battle_level == 3 end if score == 2 @efs_after_battle_level == 2 end if score == 1 @efs_after_battle_level == 1 end if score == 0 @efs_after_battle_level == 11 end return score#刷新得分 # -----------战斗结束平分开关---- end
def judge_battle_level#定义判断_战斗_级别
team_sum = 0 #团队总数=0
enermy_sum = 0 #敌人总数=0
@team_groups.each do |groups|#@团队。每个人做|组|
#团队总数 += 组。启动时处于活动状态
team_sum += groups.alive_while_starting
end
#@敌人团体。每个做|组|
@enermy_groups.each do |groups|
#敌人总数 += 组。启动时处于活动状态
enermy_sum += groups.alive_while_starting
end
team_down = 0 #团队总数=0
enermy_down = 0 #敌人总数=0
#对于$游戏地图中的f。战士值
for f in $game_map.fighters.values
if f.team == 1 #如果f。团队==1
if f.dead? #如果f.死了?
team_down += 1 #团队朝下+=1
end
else#========否则
if f.dead? #如果f.死了?
enermy_down += 1 #敌人团队朝下+=1
end
end #if team
end #do
# 团队_r= 团队落后。至f/团队总和
team_r = team_down.to_f/team_sum
# 敌人团队_r= 敌人团队落后。至f/敌人团队总和
enermy_r = enermy_down.to_f/enermy_sum
if @efs_victory #如果@efs获胜
# 得分=(5队r*5+敌人_r*5)。整数
score = (5-team_r*5+enermy_r*5).round
#得分=[[得分,6].最大值,10].最小值
score = [[score,6].max,10].min
else #否则
#得分=10-(团队_r*5+ 5-敌人_r*5).整数
score = 10 - (team_r*5+ 5-enermy_r*5).round
#得分 = [[得分,0].最大值,4].最小值
score = [[score,0].max,4].min
end
if score == 10
@efs_after_battle_level == 10
end
if score == 9
@efs_after_battle_level == 9
end
if score == 8
@efs_after_battle_level == 8
end
if score == 7
@efs_after_battle_level == 7
end
if score == 6
@efs_after_battle_level == 6
end
if score == 5
@efs_after_battle_level == 5
end
if score == 4
@efs_after_battle_level == 4
end
if score == 3
@efs_after_battle_level == 3
end
if score == 2
@efs_after_battle_level == 2
end
if score == 1
@efs_after_battle_level == 1
end
if score == 0
@efs_after_battle_level == 11
end
return score#刷新得分
# -----------战斗结束平分开关----
end
|