GamiingQueue优化

This commit is contained in:
milimoe 2025-06-22 05:12:54 +08:00
parent 88af0b3ad0
commit 4737780742
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
4 changed files with 16 additions and 19 deletions

View File

@ -40,10 +40,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override void OnEffectLost(Character character) public override void OnEffectLost(Character character)
{ {
if (character.PrimaryAttribute == PrimaryAttribute.INT) ResetEffect(character, false);
{
ResetEffect(character, false);
}
} }
private void ResetEffect(Character character, bool isAdd) private void ResetEffect(Character character, bool isAdd)
@ -107,10 +104,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
c.ExINT -= ; c.ExINT -= ;
c.ExSTR += ; c.ExSTR += ;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
if () ResetEffect(character, false);
{
ResetEffect(character, false);
}
} }
} }
else else
@ -126,10 +120,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
c.ExINT += ; c.ExINT += ;
= 0; = 0;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
if (!) ResetEffect(character, true);
{
ResetEffect(character, true);
}
} }
} }
} }

View File

@ -171,6 +171,7 @@ namespace Oshima.FunGame.OshimaServers
{ {
SendAllGamingMessage(obj, data, str); SendAllGamingMessage(obj, data, str);
}); });
actionQueue.InitActionQueue();
actionQueue.SetCharactersToAIControl(false, inGameCharacters); actionQueue.SetCharactersToAIControl(false, inGameCharacters);
// 总游戏时长 // 总游戏时长

View File

@ -35,6 +35,7 @@ namespace Oshima.FunGame.OshimaServers.Service
MaxRespawnTimes = maxRespawnTimes, MaxRespawnTimes = maxRespawnTimes,
MaxScoreToWin = maxScoreToWin MaxScoreToWin = maxScoreToWin
}; };
actionQueue.InitActionQueue();
actionQueue.SetCharactersToAIControl(false, characters); actionQueue.SetCharactersToAIControl(false, characters);
foreach (Character dead in characters) foreach (Character dead in characters)
{ {
@ -251,6 +252,7 @@ namespace Oshima.FunGame.OshimaServers.Service
MaxRespawnTimes = maxRespawnTimes, MaxRespawnTimes = maxRespawnTimes,
MaxScoreToWin = maxScoreToWin MaxScoreToWin = maxScoreToWin
}; };
actionQueue.InitActionQueue();
actionQueue.SetCharactersToAIControl(false, characters); actionQueue.SetCharactersToAIControl(false, characters);
foreach (Character dead in characters) foreach (Character dead in characters)
{ {

View File

@ -125,6 +125,10 @@ namespace Oshima.FunGame.OshimaServers.Service
Level = slevel Level = slevel
}; };
c.Skills.Add(); c.Skills.Add();
foreach (Effect e in c.Effects)
{
e.OnEffectLost(c);
}
} }
// 创建顺序表并排序 // 创建顺序表并排序
@ -201,9 +205,8 @@ namespace Oshima.FunGame.OshimaServers.Service
// 显示角色信息 // 显示角色信息
if (PrintOut) characters.ForEach(c => Console.WriteLine(c.GetInfo())); if (PrintOut) characters.ForEach(c => Console.WriteLine(c.GetInfo()));
// 因赋予了装备,所以清除排序重新排 // 初始化队列,准备开始游戏
actionQueue.ClearQueue(); actionQueue.InitActionQueue();
actionQueue.InitCharacterQueue(characters);
actionQueue.SetCharactersToAIControl(false, characters); actionQueue.SetCharactersToAIControl(false, characters);
if (PrintOut) Console.WriteLine(); if (PrintOut) Console.WriteLine();
@ -226,7 +229,7 @@ namespace Oshima.FunGame.OshimaServers.Service
user.Username = FunGameService.GenerateRandomChineseUserName(); user.Username = FunGameService.GenerateRandomChineseUserName();
user.Inventory.Credits = 20; user.Inventory.Credits = 20;
Character thisCharacter = shuffledCharacters[cid]; Character thisCharacter = shuffledCharacters[cid];
thisCharacter.User = user; //thisCharacter.User = user;
if (cid % 2 == 0) if (cid % 2 == 0)
{ {
@ -238,9 +241,9 @@ namespace Oshima.FunGame.OshimaServers.Service
} }
} }
// 添加到团队字典,第一个用户为队长 // 添加到团队字典,第一个为队长
tg.AddTeam($"{group1.First().User.Username}的小队", group1); tg.AddTeam($"{group1.First()}的小队", group1);
tg.AddTeam($"{group2.First().User.Username}的小队", group2); tg.AddTeam($"{group2.First()}的小队", group2);
foreach (string team in tg.Teams.Keys) foreach (string team in tg.Teams.Keys)
{ {