Example #1
0
 public PotionType(int damageValue, PotionEffectType effect, int maxLevel)
 {
     _damageValue = damageValue;
     _effectType  = effect;
     _maxLevel    = maxLevel;
     Values.Add(this);
 }
Example #2
0
 public PotionEffect(PotionEffectType type, int duration, int amplifier, bool ambient = true)
 {
     Debug.Assert(ReferenceEquals(null, type), "effect type cannot be null");
     _type      = type;
     _duration  = duration;
     _amplifier = amplifier;
     _ambient   = ambient;
 }
Example #3
0
        public static PotionType GetByEffect(PotionEffectType effectType)
        {
            if (effectType == null)
            {
                return(WATER);
            }

            foreach (PotionType type in PotionType.Values)
            {
                if (effectType.Equals(type._effectType))
                {
                    return(type);
                }
            }

            return(null);
        }