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

@ -39,12 +39,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
public override void OnEffectLost(Character character)
{
if (character.PrimaryAttribute == PrimaryAttribute.INT)
{
ResetEffect(character, false);
}
}
private void ResetEffect(Character character, bool isAdd)
{
@ -107,12 +104,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
c.ExINT -= ;
c.ExSTR += ;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
if ()
{
ResetEffect(character, false);
}
}
}
else
{
if (c.PrimaryAttribute == PrimaryAttribute.STR)
@ -126,8 +120,6 @@ namespace Oshima.FunGame.OshimaModules.Skills
c.ExINT += ;
= 0;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
if (!)
{
ResetEffect(character, true);
}
}
@ -135,4 +127,3 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
}
}

View File

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

View File

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

View File

@ -125,6 +125,10 @@ namespace Oshima.FunGame.OshimaServers.Service
Level = slevel
};
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()));
// 因赋予了装备,所以清除排序重新排
actionQueue.ClearQueue();
actionQueue.InitCharacterQueue(characters);
// 初始化队列,准备开始游戏
actionQueue.InitActionQueue();
actionQueue.SetCharactersToAIControl(false, characters);
if (PrintOut) Console.WriteLine();
@ -226,7 +229,7 @@ namespace Oshima.FunGame.OshimaServers.Service
user.Username = FunGameService.GenerateRandomChineseUserName();
user.Inventory.Credits = 20;
Character thisCharacter = shuffledCharacters[cid];
thisCharacter.User = user;
//thisCharacter.User = user;
if (cid % 2 == 0)
{
@ -238,9 +241,9 @@ namespace Oshima.FunGame.OshimaServers.Service
}
}
// 添加到团队字典,第一个用户为队长
tg.AddTeam($"{group1.First().User.Username}的小队", group1);
tg.AddTeam($"{group2.First().User.Username}的小队", group2);
// 添加到团队字典,第一个为队长
tg.AddTeam($"{group1.First()}的小队", group1);
tg.AddTeam($"{group2.First()}的小队", group2);
foreach (string team in tg.Teams.Keys)
{