Esempio n. 1
0
        public static bool RemoveStateBuff(FightActor target, SpellStatesEnum stateId)
        {
            foreach (var state in target.GetBuffs(x => x is StateBuff && ((StateBuff)x).State.Id == (int)stateId).ToArray())
            {
                target.RemoveBuff(state);
            }

            return(true);
        }
        public bool RemoveStateBuff(FightActor target, int stateId)
        {
            var stateBuff = target.GetBuffs().Where(x => x is StateBuff && (x as StateBuff).State.Id == stateId).FirstOrDefault();

            if (stateBuff != null)
            {
                target.RemoveAndDispellBuff(stateBuff);
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public bool IsValidTarget(FightActor actor)
        {
            if (actor.GetBuffs(x => x is SpellImmunityBuff && CastHandler.IsCastedBySpell(((SpellImmunityBuff)x).SpellImmune)).Any())
            {
                return(false);
            }

            var lookup = Targets.ToLookup(x => x.GetType());

            return(lookup.All(x => x.First().IsDisjonction ?
                              x.Any(y => y.IsTargetValid(actor, this)) : x.All(y => y.IsTargetValid(actor, this))));
        }
Esempio n. 4
0
        private void Leave(FightActor actor)
        {
            var buffs = actor.GetBuffs(x => x.Caster == Caster && x.Spell.Id == GlyphSpell.Id).ToArray();

            foreach (var buff in buffs)
            {
                actor.RemoveBuff(buff);
            }

            actor.PositionChanged -= OnPositionChanged;
            m_actorsInside.Remove(actor);
        }
Esempio n. 5
0
        void ReduceBuffsDuration(FightActor actor, short duration)
        {
            foreach (var buff in actor.GetBuffs().Where(buff => buff.Dispellable == FightDispellableEnum.DISPELLABLE).Where(buff => buff.Duration > 0 && buff.Delay == 0).ToArray())
            {
                buff.Duration -= duration;

                if (buff.Duration <= 0)
                {
                    actor.RemoveBuff(buff);
                }
            }

            actor.TriggerBuffs(actor, BuffTriggerType.OnDispelled);
            ContextHandler.SendGameActionFightModifyEffectsDurationMessage(Fight.Clients, Effect.Id, Caster, actor, (short)-duration);
        }