添加新技能

This commit is contained in:
milimoe 2026-04-15 00:09:38 +08:00
parent 3dbef64e04
commit 7ac707bdc5
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
3 changed files with 12 additions and 11 deletions

View File

@ -109,9 +109,9 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
); );
} }
public async Task<List<Character>> RequestTargetSelection(Character character, ISkill skill, List<Character> enemys, List<Character> teammates, List<Grid> range) public async Task<List<Character>> RequestTargetSelection(Character character, ISkill skill, List<Character> allEnemys, List<Character> allTeammates, List<Character> enemys, List<Character> teammates, List<Grid> range)
{ {
List<Character> selectable = skill.GetSelectableTargets(character, enemys, teammates); List<Character> selectable = skill.GetSelectableTargets(character, allEnemys, allTeammates, enemys, teammates);
await WriteLine($"请为 {skill.Name} 选择目标 (最多 {skill.RealCanSelectTargetCount(enemys, teammates)} 个)。"); await WriteLine($"请为 {skill.Name} 选择目标 (最多 {skill.RealCanSelectTargetCount(enemys, teammates)} 个)。");
List<Character> targets = await _targetSelectionRequester.RequestInput( List<Character> targets = await _targetSelectionRequester.RequestInput(
async (callback) => await UI.InvokeAsync(() => UI.ShowTargetSelectionUI(character, skill, selectable, enemys, teammates, range, callback)) async (callback) => await UI.InvokeAsync(() => UI.ShowTargetSelectionUI(character, skill, selectable, enemys, teammates, range, callback))

View File

@ -324,17 +324,14 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
hpPercentage.TryAdd(c, c.HP / c.MaxHP); hpPercentage.TryAdd(c, c.HP / c.MaxHP);
} }
double max = hpPercentage.Values.Max(); double max = hpPercentage.Values.Max();
Character winner = hpPercentage.Keys.Where(c => hpPercentage[c] == max).First(); Character winner = hpPercentage.Keys.First(c => hpPercentage[c] == max);
await Controller.WriteLine("[ " + winner + " ] 成为了天选之人!!"); await Controller.WriteLine("[ " + winner + " ] 成为了天选之人!!");
foreach (Character c in characters.Where(c => c != winner && c.HP > 0)) foreach (Character c in characters.Where(c => c != winner && c.HP > 0))
{ {
await Controller.WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。"); await Controller.WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
_gamingQueue.DeathCalculation(winner, c); _gamingQueue.DeathCalculation(winner, c);
} }
if (mgq != null) mgq?.EndGameInfo(winner);
{
mgq.EndGameInfo(winner);
}
} }
result.Add(Msg); result.Add(Msg);
break; break;
@ -586,7 +583,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
return true; return true;
} }
private List<Character> GamingQueue_SelectNormalAttackTargets(GamingQueue queue, Character character, NormalAttack attack, List<Character> enemys, List<Character> teammates, List<Grid> attackRange) private List<Character> GamingQueue_SelectNormalAttackTargets(GamingQueue queue, Character character, NormalAttack attack, List<Character> allEnemys, List<Character> allTeammates, List<Character> enemys, List<Character> teammates, List<Grid> attackRange)
{ {
if (!IsPlayer_OnlyTest(queue, character)) return []; if (!IsPlayer_OnlyTest(queue, character)) return [];
@ -594,6 +591,8 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
List<Character> selectedTargets = SyncAwaiter.WaitResult(Controller.RequestTargetSelection( List<Character> selectedTargets = SyncAwaiter.WaitResult(Controller.RequestTargetSelection(
character, character,
attack, attack,
allEnemys,
allTeammates,
enemys, enemys,
teammates, teammates,
attackRange attackRange
@ -613,7 +612,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
return selectedItem; return selectedItem;
} }
private List<Character> GamingQueue_SelectSkillTargets(GamingQueue queue, Character caster, Skill skill, List<Character> enemys, List<Character> teammates, List<Grid> castRange) private List<Character> GamingQueue_SelectSkillTargets(GamingQueue queue, Character caster, Skill skill, List<Character> allEnemys, List<Character> allTeammates, List<Character> enemys, List<Character> teammates, List<Grid> castRange)
{ {
if (!IsPlayer_OnlyTest(queue, caster)) return []; if (!IsPlayer_OnlyTest(queue, caster)) return [];
@ -626,6 +625,8 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
List<Character>? selectedTargets = SyncAwaiter.WaitResult(Controller.RequestTargetSelection( List<Character>? selectedTargets = SyncAwaiter.WaitResult(Controller.RequestTargetSelection(
caster, caster,
skill, skill,
allEnemys,
allTeammates,
enemys, enemys,
teammates, teammates,
castRange castRange

View File

@ -428,7 +428,7 @@ namespace Milimoe.FunGame.Testing.Tests
return true; return true;
} }
private static List<Character> GamingQueue_SelectNormalAttackTargets(GamingQueue queue, Character character, NormalAttack attack, List<Character> enemys, List<Character> teammates, List<Grid> attackRange) private static List<Character> GamingQueue_SelectNormalAttackTargets(GamingQueue queue, Character character, NormalAttack attack, List<Character> allEnemys, List<Character> allTeammates, List<Character> enemys, List<Character> teammates, List<Grid> attackRange)
{ {
List<Character> characters = []; List<Character> characters = [];
if (IsPlayer_OnlyTest(queue, character)) if (IsPlayer_OnlyTest(queue, character))
@ -530,7 +530,7 @@ namespace Milimoe.FunGame.Testing.Tests
return item; return item;
} }
private static List<Character> GamingQueue_SelectSkillTargets(GamingQueue queue, Character caster, Skill skill, List<Character> enemys, List<Character> teammates, List<Grid> castRange) private static List<Character> GamingQueue_SelectSkillTargets(GamingQueue queue, Character caster, Skill skill, List<Character> allEnemys, List<Character> allTeammates, List<Character> enemys, List<Character> teammates, List<Grid> castRange)
{ {
List<Character> characters = []; List<Character> characters = [];
if (IsPlayer_OnlyTest(queue, caster)) if (IsPlayer_OnlyTest(queue, caster))