예제 #1
0
 public void ApplyStatusEffect(DD4EStatusEffect newStatusEffect)
 {
     // Extend the duration of Status Effect with similar effect
     if (StatusEffects.Exists(s => s.IsSameEffect(newStatusEffect)))
     {
         var newDamageEffect = (newStatusEffect as DD4EDamageModifier);
         if (newDamageEffect != null)
         {
             var index = StatusEffects.IndexOf(StatusEffects.Find(s => s.IsSameEffect(newStatusEffect)));
             if (newDamageEffect.DamageAmount > (StatusEffects[index] as DD4EDamageModifier).DamageAmount)
             {
                 StatusEffects[index] = newStatusEffect;
             }
         }
         else
         {
             var index = StatusEffects.IndexOf(StatusEffects.Find(s => s.IsSameEffect(newStatusEffect)));
             StatusEffects[index].Duration = newStatusEffect.Duration;
         }
     }
     else
     {
         StatusEffects.Add(newStatusEffect);
     }
     OnPropertyChanged("StatusEffects");
 }
예제 #2
0
        public virtual DD4EStatusEffect Copy()
        {
            var newStatus = new DD4EStatusEffect(Type, Source, Duration);

            newStatus.SaveModifier = this.SaveModifier;
            return(newStatus);
        }
예제 #3
0
 public override bool IsSameEffect(DD4EStatusEffect other)
 {
     if (base.IsSameEffect(other))
     {
         var otherDamage = (other as DD4EDamageModifier);
         if (otherDamage != null)
         {
             return(this.DamageType == otherDamage.DamageType);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
예제 #4
0
 public virtual bool IsSameEffect(DD4EStatusEffect other)
 {
     return(this.Type == other.Type);
 }
예제 #5
0
 public override bool IsSameEffect(DD4EStatusEffect other)
 {
     return(this.Type == other.Type);
 }