Пример #1
0
        public Buff AddBuffStack(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority)
        {
            int  num = this.FindBuff(buffType.BuffID);
            Buff buff;

            if (num < 0)
            {
                buff = new Buff(buffType, armorType, visualPriority);
                buff.AddStack();
                this.Buffs.Add(buff);
                if (this.sleepState == BuffSleepState.Sleeping)
                {
                    this.sleepState = BuffSleepState.Awake;
                }
                this.SendBuffEvent(EventId.AddedBuff, buff);
            }
            else
            {
                buff = this.Buffs[num];
                if (buffType.Lvl > buff.BuffType.Lvl)
                {
                    buff.UpgradeBuff(buffType);
                }
                buff.AddStack();
            }
            this.OnBuffStackAdded();
            return(buff);
        }
Пример #2
0
 public Buff(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority)
 {
     this.BuffType       = buffType;
     this.ProcCount      = 0;
     this.StackSize      = 0;
     this.msRemaining    = this.BuffType.Duration;
     this.msToNextProc   = this.BuffType.MillisecondsToFirstProc;
     this.armorTypeIndex = (int)armorType;
     this.VisualPriority = visualPriority;
 }
Пример #3
0
 public Buff(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority)
 {
     this.BuffType       = buffType;
     this.ProcCount      = 0;
     this.StackSize      = 0;
     this.msRemaining    = this.BuffType.Duration;
     this.msToNextProc   = this.BuffType.MillisecondsToFirstProc;
     this.armorTypeIndex = (int)armorType;
     this.VisualPriority = visualPriority;
     this.BuffData       = new Dictionary <string, object>();
     if (buffType.Modify == BuffModify.Summon)
     {
         this.Details = Service.StaticDataController.Get <SummonDetailsVO>(buffType.Details);
     }
 }
Пример #4
0
        public void AddAppliedBuff(BuffTypeVO buffVO, BuffVisualPriority visualPriority)
        {
            int  num = this.FindSpecialAttackBuff(buffVO.BuffID);
            Buff buff;

            if (num < 0)
            {
                buff = new Buff(buffVO, ArmorType.FlierVehicle, visualPriority);
                buff.AddStack();
                this.SpecialAttackBuffs.Add(buff);
                return;
            }
            buff = this.SpecialAttackBuffs[num];
            if (buffVO.Lvl > buff.BuffType.Lvl)
            {
                buff.UpgradeBuff(buffVO);
            }
            buff.AddStack();
        }
Пример #5
0
        public Buff AddBuffStack(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority, SmartEntity originator)
        {
            int  num = this.FindBuff(buffType.BuffID);
            Buff buff;

            if (num < 0)
            {
                buff = new Buff(buffType, armorType, visualPriority);
                buff.AddStack();
                this.Buffs.Add(buff);
                if (this.sleepState == BuffSleepState.Sleeping)
                {
                    this.sleepState = BuffSleepState.Awake;
                }
                if (!buff.BuffData.ContainsKey("originator"))
                {
                    buff.BuffData.Add("originator", originator);
                }
                else
                {
                    buff.BuffData["originator"] = originator;
                }
                this.SendBuffEvent(EventId.AddedBuff, buff);
            }
            else
            {
                buff = this.Buffs[num];
                if (buffType.Lvl > buff.BuffType.Lvl)
                {
                    buff.UpgradeBuff(buffType);
                }
                buff.BuffData["originator"] = originator;
                buff.AddStack();
            }
            this.OnBuffStackAdded();
            return(buff);
        }
Пример #6
0
        private void TryAddBuffStack(SmartEntity target, BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority, SmartEntity originator)
        {
            if (target == null || buffType == null || !buffType.WillAffect(armorType))
            {
                return;
            }
            BuffComponent buffComponent = target.BuffComp;

            if (buffComponent == null)
            {
                buffComponent = new BuffComponent();
                target.Add(buffComponent);
            }
            else if (buffComponent.IsBuffPrevented(buffType))
            {
                return;
            }
            buffComponent.AddBuffStack(buffType, armorType, visualPriority, originator);
            buffComponent.RemoveBuffsCanceledBy(buffType);
        }