修改结算

This commit is contained in:
wuwenbo 2026-05-22 17:15:30 +08:00
parent 399b2f13a9
commit a8cf65fbef
2 changed files with 24 additions and 14 deletions

View File

@ -491,7 +491,7 @@ namespace TH1_Logic.MatchConfig
if (map == null || info == null) return;
if (info.IsFinished) return;
// 客观胜利条件blockingPlayerId 是非 AI 玩家自己,且仍存活,且其他所有玩家都已不存活
// 客观胜利条件blockingPlayerId 是非 AI 玩家自己,且仍存活,且非本队对手都已不存活
var self = map.PlayerMap.GetPlayerData(blockingPlayerId);
if (self == null || !self.IsSurvival) return;
@ -499,7 +499,12 @@ namespace TH1_Logic.MatchConfig
{
if (p == null) continue;
if (p.Id == blockingPlayerId) continue;
if (p.IsSurvival) return; // 还有人活着,不触发兜底
if (map.MapConfig != null
&& map.MapConfig.ArePlayersInSameTeam(blockingPlayerId, p.Id))
{
continue;
}
if (p.IsSurvival) return; // 还有非本队对手活着,不触发兜底
}
// 命中:取证 + 强制结算

View File

@ -20,7 +20,7 @@ namespace TH1_Logic.MatchConfig
None = 0,
// 持续存活时间>={param1}回合
SurviveOrLoseMatch = 1,
// 场上已经死亡玩家数量>={param1}但是我存活, -x表示 N-xN为总人数
// 场上已经死亡玩家数量+同队存活玩家数量>={param1}但是我存活, -x表示 N-xN为总人数
OtherDie = 2,
// 得分排名 <={param1}
ScoreWin = 3,
@ -156,7 +156,7 @@ namespace TH1_Logic.MatchConfig
case PlayerTaskType.SurviveOrLoseMatch:
return "持续存活时间>={param1}回合";
case PlayerTaskType.OtherDie:
return "场上已经死亡玩家数量>={param1}但是我存活, -x表示 N-xN为总人数";
return "场上已经死亡玩家数量+同队存活玩家数量>={param1}但是我存活, -x表示 N-xN为总人数";
case PlayerTaskType.ScoreWin:
return "得分排名 <={param1}";
case PlayerTaskType.ScoreValue:
@ -227,7 +227,7 @@ namespace TH1_Logic.MatchConfig
/// <summary>
/// 场上已经死亡玩家数量>={param1}但是我存活, -x表示 N-xN为总人数
/// 场上已经死亡玩家数量+同队存活玩家数量>={param1}但是我存活, -x表示 N-xN为总人数
/// </summary>
public class OtherDiePlayerTaskLogic : PlayerTaskLogicBase
{
@ -245,19 +245,24 @@ namespace TH1_Logic.MatchConfig
info.IsSuccess = false;
return;
}
var playerList = map.PlayerMap.PlayerDataList;
var dieCount = 0;
foreach (var p in map.PlayerMap.PlayerDataList)
var aliveTeammateCount = 0;
foreach (var p in playerList)
{
if (!p.IsSurvival) dieCount++;
else if (p.Id != player.Id
&& map.MapConfig != null
&& map.MapConfig.ArePlayersInSameTeam(player.Id, p.Id))
{
aliveTeammateCount++;
}
}
var settlementCount = dieCount + aliveTeammateCount;
info.Param1Cur = settlementCount;
var targetCount = info.Param1 >= 0 ? info.Param1 : playerList.Count + info.Param1;
if (info.Param1 >= 0 && dieCount >= info.Param1)
{
info.IsSettlement = true;
info.IsSuccess = true;
}
if (info.Param1 < 0 && dieCount >= map.PlayerMap.PlayerDataList.Count + info.Param1)
if (settlementCount >= targetCount)
{
info.IsSettlement = true;
info.IsSuccess = true;
@ -503,4 +508,4 @@ namespace TH1_Logic.MatchConfig
}
}
}
}
}