public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { var rand = new AsyncRandom(); var max = m_dicenum >= m_diceface ? m_dicenum : m_diceface; var min = m_dicenum <= m_diceface ? m_dicenum : m_diceface; if (min == 0) { min = max; } if (type == EffectGenerationType.MaxEffects && Template.Operator == "+") { return(new EffectInteger(Id, Template.Operator != "-" ? max : min, this)); } if (type == EffectGenerationType.MinEffects) { return(new EffectInteger(Id, Template.Operator != "-" ? min : max, this)); } if (min != 0) { return(new EffectInteger(Id, (short)rand.Next(min, max + 1), this)); } return(max == 0 ? new EffectInteger(Id, m_value, this) : new EffectInteger(Id, max, this)); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { var rand = new AsyncRandom(); if (type == EffectGenerationType.MaxEffects && Template.Operator == "+") { return(new EffectInteger(Id, Template.Operator != "-" ? ValueMax : ValueMin, this)); } if (type == EffectGenerationType.MinEffects) { return(new EffectInteger(Id, Template.Operator != "-" ? ValueMin : ValueMax, this)); } return(new EffectInteger(Id, (short)rand.Next(ValueMin, ValueMax + 1), this)); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { AsyncRandom asyncRandom = new AsyncRandom(); EffectBase result; if (type == EffectGenerationType.MaxEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? this.ValueMax : this.ValueMin, this); } else { if (type == EffectGenerationType.MinEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? this.ValueMin : this.ValueMax, this); } else { result = new EffectInteger(base.Id, (short)asyncRandom.Next((int)this.ValueMin, (int)(this.ValueMax + 1)), this); } } return(result); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { AsyncRandom asyncRandom = new AsyncRandom(); short num = (this.m_dicenum >= this.m_diceface) ? this.m_dicenum : this.m_diceface; short num2 = (this.m_dicenum <= this.m_diceface) ? this.m_dicenum : this.m_diceface; EffectBase result; if (type == EffectGenerationType.MaxEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? num : num2, this); } else { if (type == EffectGenerationType.MinEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? num2 : num, this); } else { if (num2 == 0) { if (num == 0) { result = new EffectInteger(base.Id, this.m_value, this); } else { result = new EffectInteger(base.Id, num, this); } } else { result = new EffectInteger(base.Id, (short)asyncRandom.Next((int)num2, (int)(num + 1)), this); } } } return(result); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { return(new EffectDate(this)); }
public virtual EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { return(new EffectBase(this)); }