using System.Collections.Generic; using UnityEngine; namespace Continentis.MainGame.Character { public enum StatusType { //负面状态 Incapacitation = 0, //失能,丧失一切行动能力 Silence = 1, //沉默,无法使用魔法牌 (Magic) Disarm = 2, //缴械,无法使用攻击牌 (Attack) Inhibition = 3, //抑制,无法使用能力牌 (Ability) Heavy = 4, //沉重,无法再抽牌 //正面状态 Invincible = 1000, //无敌 Invisible = 1001, //隐身 //中性状态 Taunt = 2000, //嘲讽 Protected = 2001, //被保护 } public partial class StatusSubmodule : SubmoduleBase { public Dictionary currentStatus; public bool isDead; public StatusSubmodule(CharacterBase character) : base(character) { currentStatus = new Dictionary(); foreach (StatusType statusType in System.Enum.GetValues(typeof(StatusType))) { currentStatus.Add(statusType, 0); } isDead = false; } } public partial class StatusSubmodule { /// /// 添加一层某种状态 /// public void AddStatus(StatusType statusType) { currentStatus[statusType]++; } /// /// 移除某个来源对应的一层状态,注意:如果有其他来源的状态,不会彻底结束状态效果。 /// public void RemoveStatus(StatusType statusType) { currentStatus[statusType]--; currentStatus[statusType] = Mathf.Max(currentStatus[statusType], 0); } /// /// 检查是否有某种状态 /// public bool HasStatus(StatusType statusType) { return currentStatus[statusType] > 0; } } }