示例#1
0
        public override bool Apply()
        {
            bool result;

            foreach (FightActor current in base.GetAffectedActors())
            {
                EffectInteger effectInteger = base.GenerateEffect();
                if (effectInteger == null)
                {
                    result = false;
                    return(result);
                }
                foreach (Buff current2 in
                         from buff in current.GetBuffs().ToArray <Buff>()
                         where buff.Dispellable
                         select buff)
                {
                    Buff expr_71 = current2;
                    expr_71.Duration -= effectInteger.Value;
                    if (current2.Duration <= 0)
                    {
                        current.RemoveAndDispellBuff(current2);
                    }
                }
                ContextHandler.SendGameActionFightModifyEffectsDurationMessage(base.Fight.Clients, base.Caster, current, Convert.ToInt16(-effectInteger.Value));
            }
            result = true;
            return(result);
        }
示例#2
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);
        }