mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-22 03:49:35 +08:00
修复问题
This commit is contained in:
parent
fd2bf430c3
commit
2d74f76bd4
@ -322,15 +322,27 @@ namespace Oshima.Core.Utils
|
|||||||
// 团队模式
|
// 团队模式
|
||||||
if (isTeam)
|
if (isTeam)
|
||||||
{
|
{
|
||||||
// 打乱原始数组的顺序
|
// 打乱角色列表
|
||||||
IEnumerable<Character> shuffledCharacters = characters.OrderBy(c => Random.Shared.Next());
|
List<Character> shuffledCharacters = characters.OrderBy(c => Random.Shared.Next()).ToList();
|
||||||
|
|
||||||
// 计算分割点
|
// 创建两个团队
|
||||||
int splitIndex = shuffledCharacters.Count() / 2;
|
List<Character> group1 = [];
|
||||||
|
List<Character> group2 = [];
|
||||||
|
|
||||||
// 分成两个数组
|
// 将角色交替分配到两个团队中
|
||||||
List<Character> group1 = shuffledCharacters.Take(splitIndex).ToList();
|
for (int cid = 0; cid < shuffledCharacters.Count; cid++)
|
||||||
List<Character> group2 = shuffledCharacters.Skip(splitIndex).ToList();
|
{
|
||||||
|
if (cid % 2 == 0)
|
||||||
|
{
|
||||||
|
group1.Add(shuffledCharacters[cid]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
group2.Add(shuffledCharacters[cid]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加到团队字典
|
||||||
actionQueue.Teams.Add("队伍一", group1);
|
actionQueue.Teams.Add("队伍一", group1);
|
||||||
actionQueue.Teams.Add("队伍二", group2);
|
actionQueue.Teams.Add("队伍二", group2);
|
||||||
}
|
}
|
||||||
@ -345,6 +357,13 @@ namespace Oshima.Core.Utils
|
|||||||
{
|
{
|
||||||
Msg = "";
|
Msg = "";
|
||||||
if (i == 998)
|
if (i == 998)
|
||||||
|
{
|
||||||
|
if (isTeam)
|
||||||
|
{
|
||||||
|
WriteLine("两队打到天昏地暗,流局了!!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
WriteLine($"=== 终局审判 ===");
|
WriteLine($"=== 终局审判 ===");
|
||||||
Dictionary<Character, double> 他们的血量百分比 = [];
|
Dictionary<Character, double> 他们的血量百分比 = [];
|
||||||
@ -364,6 +383,7 @@ namespace Oshima.Core.Utils
|
|||||||
result.Add(Msg);
|
result.Add(Msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 检查是否有角色可以行动
|
// 检查是否有角色可以行动
|
||||||
Character? characterToAct = actionQueue.NextCharacter();
|
Character? characterToAct = actionQueue.NextCharacter();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user