コード例 #1
0
ファイル: EffectInteger.cs プロジェクト: Mixi59/Stump
 public bool Equals(EffectInteger other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && other.m_value == m_value);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public bool Equals(EffectInteger other)
 {
     return(!object.ReferenceEquals(null, other) && (object.ReferenceEquals(this, other) || (base.Equals(other) && other.m_value == this.m_value)));
 }
コード例 #5
0
 public EffectInteger(EffectInteger copy) : this(copy.Id, copy.Value, copy)
 {
 }