public override string ToString() { if (string.IsNullOrEmpty(Msg)) { return(触发单位.ToString() + "获得技能" + AbilityEnum.GetAbilityName(获得的技能)); } return(base.ToString()); }
public bool GetAbility() { int haveCount = BitOperator.GetBinaryCount(this.Ability); int ablitity = AbilityEnum.RandomAbility(); int abilityCount = BitOperator.GetBinaryCount(ablitity); if (this.MaxAbilityCount >= (haveCount + abilityCount) && !this.IsHaveAbility(ablitity)) { this.Ability |= ablitity; GameMessage.AddMsg(new AbilityMessage() { 触发单位 = this, 获得的技能 = ablitity }); return(true); } return(false); }