Esempio n. 1
0
        public override string ToString()
        {
            if (string.IsNullOrEmpty(Msg))
            {
                return(触发单位.ToString() + "获得技能" + AbilityEnum.GetAbilityName(获得的技能));
            }

            return(base.ToString());
        }
Esempio n. 2
0
        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);
        }