Beispiel #1
0
 protected void CheckEffectFlag()
 {
     this._mainEffect = null;
     this._redoFlag   = false;
     this._undoFlag   = 0;
     this._skillFlag  = EnumSkillFlag.None;
     foreach (var effect in this._effects)
     {
         if (effect.MainFlag && null == this._mainEffect)
         {
             this._mainEffect = effect;
         }
         if (effect.Repeat > 0)
         {
             this._redoFlag = true;
         }
         if (effect.Recycle)
         {
             this._undoFlag = Math.Max(this._undoFlag, (byte)(effect.Last == (short)EnumBuffLast.Undo ? 1 : 2));
         }
         if (this._skillFlag != EnumSkillFlag.Mix)
         {
             this._skillFlag |= effect.DebuffFlag ? EnumSkillFlag.Debuff : EnumSkillFlag.Buff;
         }
     }
 }
Beispiel #2
0
        public void Load(IRawSkill rawSkill)
        {
            this._rawSkill = rawSkill;
            this._skillId  = this._owner.InnerId * 100000 + rawSkill.RawSkillId;
            IEffector effector = null;

            this._skillFlag = EnumSkillFlag.None;
            if (null != rawSkill.MainEffector)
            {
                effector          = rawSkill.MainEffector.Clone(this);
                this.MainEffector = effector;
                this._skillFlag  |= rawSkill.MainEffector.SkillFlag;
                if (effector.RedoFlag || effector.UndoFlag)
                {
                    this.RedoEffectors.Add(effector);
                }
            }
            if (null != rawSkill.SubEffectors && rawSkill.SubEffectors.Count > 0)
            {
                foreach (var item in rawSkill.SubEffectors)
                {
                    effector = item.Clone(this);
                    this.SubEffectors.Add(effector);
                    this._skillFlag |= item.SkillFlag;
                    if (effector.RedoFlag || effector.UndoFlag)
                    {
                        this.RedoEffectors.Add(effector);
                    }
                }
            }
            if (this.Owner is ISkillManager)
            {
                if (rawSkill.CastFlag)
                {
                    this._casters = ((ISkillManager)this.Owner).SkillPlayerList;
                }
                else
                {
                    this._casters = null;
                }
            }
            else if (this.Owner is ISkillPlayer)
            {
                this._casters = new List <ISkillPlayer>();
                this._casters.Add((ISkillPlayer)this.Owner);
            }
            this.CheckRedoFlag();
        }