using System.Collections.Generic; using SepCore.Definition; namespace SepCore.Battle { /// /// 单场战斗的运行时单位,仅 BattleRuntime 及其协作者读写。 /// UI 与探索层通过 BattleUnitView 读取,不直接持有本类型。 /// internal sealed class BattleUnit { /// /// 本场战斗单位的唯一运行时标识;重复配置的敌人拥有不同 ID。 /// public readonly int UnitId; /// /// 阵营。 /// public readonly BattleFaction Faction; /// /// 配置标识:玩家为 CharacterId,敌人为 EnemyConfigId。 /// public readonly int ConfigId; /// /// 同阵营同速度的最终并列规则顺序。 /// public readonly int PartyOrder; /// /// HP 上限。 /// public readonly int MaxHp; /// /// MP 上限。 /// public readonly int MaxMp; /// /// 攻击。 /// public readonly int Atk; /// /// 魔力。 /// public readonly int Mat; /// /// 当前 HP。 /// public int CurrentHp; /// /// 当前 MP。 /// public int CurrentMp; /// /// 当前速度;可被战斗内效果修改。 /// public int Speed; /// /// 是否阵亡。 /// public bool IsDefeated; /// /// 是否已逃跑。 /// public bool IsEscaped; /// /// 当前剩余状态。 /// public readonly List Statuses = new List(); /// /// 该单位可用的行动配置 ID。 /// public readonly List ActionIds = new List(); public BattleUnit(int unitId, BattleFaction faction, int configId, int partyOrder, int currentHp, int maxHp, int currentMp, int maxMp, int atk, int mat, int speed) { UnitId = unitId; Faction = faction; ConfigId = configId; PartyOrder = partyOrder; CurrentHp = currentHp; MaxHp = maxHp; CurrentMp = currentMp; MaxMp = maxMp; Atk = atk; Mat = mat; Speed = speed; } } }