更新
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using Continentis.MainGame.Character;
|
||||
using DG.Tweening;
|
||||
using Lean.Pool;
|
||||
using SLSFramework.General;
|
||||
using SLSFramework.UModAssistance;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
@@ -96,6 +97,8 @@ namespace Continentis.MainGame.Combat
|
||||
npcs[fraction].Add(npc);
|
||||
characters.Add(npc);
|
||||
combatCharacterViews.Add(view);
|
||||
|
||||
CombatMainManager.Instance.eventCollection.onCharacterJoin.Invoke(npc);
|
||||
}
|
||||
|
||||
SetViewPositions();
|
||||
@@ -229,6 +232,22 @@ namespace Continentis.MainGame.Combat
|
||||
Object.Destroy(character.characterView.gameObject);
|
||||
|
||||
SetViewPositions();
|
||||
CheckCombatEnd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查战斗胜负条件:敌方全灭→胜利,玩家方全灭→失败。
|
||||
/// </summary>
|
||||
private void CheckCombatEnd()
|
||||
{
|
||||
if (enemies.Count == 0)
|
||||
{
|
||||
CombatMainManager.Instance.EndCombat(isVictory: true);
|
||||
}
|
||||
else if (playerHeroes.Count == 0)
|
||||
{
|
||||
CombatMainManager.Instance.EndCombat(isVictory: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,10 +285,9 @@ namespace Continentis.MainGame.Combat
|
||||
enemiesList.AddRange(npcs[Fraction.Ally]);
|
||||
return enemiesList;
|
||||
}
|
||||
else // Neutral
|
||||
else // Neutral:中立单位视所有非中立方为敌人
|
||||
{
|
||||
List<CharacterBase> enemiesList = new List<CharacterBase>();
|
||||
enemiesList.AddRange(npcs[Fraction.Player]);
|
||||
List<CharacterBase> enemiesList = new List<CharacterBase>(playerHeroes);
|
||||
enemiesList.AddRange(npcs[Fraction.Ally]);
|
||||
enemiesList.AddRange(npcs[Fraction.Enemy]);
|
||||
return enemiesList;
|
||||
|
||||
Reference in New Issue
Block a user