public BuffEffect(EffectCast CastInfos, Fighter Target, BuffActiveType ActiveType, BuffDecrementType DecrementType) { this.CastInfos = CastInfos; this.Duration = Target.Fight.CurrentFighter == Target ? CastInfos.Duration + 1 : CastInfos.Duration; this.Caster = CastInfos.Caster; this.Target = Target; this.ActiveType = ActiveType; this.DecrementType = DecrementType; switch (CastInfos.EffectType) { case EffectEnum.ReflectSpell: Target.Fight.SendToFight(new GameEffectInformationsMessage(this.CastInfos.EffectType, this.Target.ActorId, "-1", this.CastInfos.Value2.ToString(), "10", "", this.CastInfos.Duration.ToString(), this.CastInfos.SpellId.ToString())); break; case EffectEnum.ChanceEcaflip: case EffectEnum.AddChatiment: Target.Fight.SendToFight(new GameEffectInformationsMessage(this.CastInfos.EffectType, this.Target.ActorId, this.CastInfos.Value1.ToString(), this.CastInfos.Value2.ToString(), this.CastInfos.Value3.ToString(), "", this.CastInfos.Duration.ToString(), this.CastInfos.SpellId.ToString())); break; case EffectEnum.Porter: Target.Fight.SendToFight(new GameEffectInformationsMessage(this.CastInfos.EffectType, this.Caster.ActorId, this.CastInfos.Value1.ToString(), "", "", "", this.CastInfos.Duration.ToString(), this.CastInfos.SpellId.ToString())); break; default: Target.Fight.SendToFight(new GameEffectInformationsMessage(this.CastInfos.EffectType, this.Target.ActorId, this.CastInfos.Value1.ToString(), "", "", "", this.CastInfos.Duration.ToString(), this.CastInfos.SpellId.ToString())); break; } }
public void AddBuff(EffectCast buff, BuffActiveType active, BuffDecrementType decrement) { buff = buff.CopyToBuff(); if (buff.Target == buff.Target.Fight.CurrentFighter) buff.Duration += 1; myBuffActives[active].Add(buff); myBuffDecrements[decrement].Add(buff); switch (buff.Type) { case EffectEnum.ChanceEcaflip: buff.Target.Fight.Send("GIE" + (int)buff.Type + ';' + buff.Target.ID + ';' + buff.Value1 + ';' + buff.Value2 + ';' + buff.Value3 + ';' + buff.Chance + ';' + buff.Duration + ';' + buff.SpellID); break; default: buff.Target.Fight.Send("GIE" + (int)buff.Type + ';' + buff.Target.ID + ';' + buff.Value1 + ';' + (buff.Value2 == -1 ? "" : buff.Value2.ToString()) + ";;" + buff.Chance + ';' + buff.Duration + ';' + buff.SpellID); break; } }
public void AddBuff(EffectCast buff, BuffActiveType active, BuffDecrementType decrement) { buff = buff.CopyToBuff(); if (buff.Target == buff.Target.Fight.CurrentFighter) { buff.Duration += 1; } myBuffActives[active].Add(buff); myBuffDecrements[decrement].Add(buff); switch (buff.Type) { case EffectEnum.ChanceEcaflip: buff.Target.Fight.Send("GIE" + (int)buff.Type + ';' + buff.Target.ID + ';' + buff.Value1 + ';' + buff.Value2 + ';' + buff.Value3 + ';' + buff.Chance + ';' + buff.Duration + ';' + buff.SpellID); break; default: buff.Target.Fight.Send("GIE" + (int)buff.Type + ';' + buff.Target.ID + ';' + buff.Value1 + ';' + (buff.Value2 == -1 ? "" : buff.Value2.ToString()) + ";;" + buff.Chance + ';' + buff.Duration + ';' + buff.SpellID); break; } }
public bool HasBuff(EffectEnum type, BuffActiveType active) { return(myBuffActives[active].Any(x => x.Type == type)); }