protected Gem(GemQuality quality, int strengthModifier, int agilityModifier, int vitalityModifier)
 {
     this.Quality           = quality;
     this.StreangthModifier = strengthModifier + (int)this.Quality;
     this.AgilityModifier   = agilityModifier + (int)this.Quality;
     this.VitalityModifier  = vitalityModifier + (int)this.Quality;
 }
    private static void AddSocket(string[] inputTokens)
    {
        string  weaponName  = inputTokens[1];
        IWeapon weapon      = weapons.First(w => w.Name == weaponName);
        int     socketIndex = int.Parse(inputTokens[2]);

        string[] gemTokens = inputTokens[3].Split(' ', StringSplitOptions.RemoveEmptyEntries);

        GemQuality quality = Enum.Parse <GemQuality>(gemTokens[0]);

        Type gemType = Type.GetType(gemTokens[1]);

        if (gemType == null)
        {
            throw new ArgumentException("Invalid Gem Type!");
        }

        if (!typeof(IGem).IsAssignableFrom(gemType))
        {
            throw new ArgumentException("Invalid Gem!");
        }

        IGem gem = (IGem)Activator.CreateInstance(gemType, new object[] { quality });

        if (socketIndex >= 0 && socketIndex < weapon.Gems.Length)
        {
            weapon.Gems[socketIndex] = gem;
        }
    }
Example #3
0
        public override int GetHashCode()
        {
            var hash = 3;

            hash = 53 * hash + (Name?.GetHashCode() ?? 0);
            hash = 53 * hash + (TypeLine?.GetHashCode() ?? 0);
            hash = 53 * hash + (Variation?.GetHashCode() ?? 0);
            hash = 53 * hash + (Links.GetHashCode());
            hash = 53 * hash + (GemLevel.GetHashCode());
            hash = 53 * hash + (GemQuality.GetHashCode());
            hash = 53 * hash + (MapTier.GetHashCode());
            hash = 53 * hash + (GemCorrupted.GetHashCode());
            hash = 53 * hash + FrameType;

            return(hash);
        }
 public Amethyst(GemQuality quality) : base(quality, 2, 8, 4)
 {
 }
Example #5
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (typeof(Key) != obj.GetType())
            {
                return(false);
            }

            var other = (Key)obj;

            if (FrameType != other.FrameType)
            {
                return(false);
            }

            if (!Name?.Equals(other.Name) ?? (other.Name != null))
            {
                return(false);
            }

            if (!TypeLine?.Equals(other.TypeLine) ?? (other.TypeLine != null))
            {
                return(false);
            }

            if (!Variation?.Equals(other.Variation) ?? (other.Variation != null))
            {
                return(false);
            }

            if (!Links?.Equals(other.Links) ?? (other.Links != null))
            {
                return(false);
            }

            if (!GemLevel?.Equals(other.GemLevel) ?? (other.GemLevel != null))
            {
                return(false);
            }

            if (!GemQuality?.Equals(other.GemQuality) ?? (other.GemQuality != null))
            {
                return(false);
            }

            if (!MapTier?.Equals(other.MapTier) ?? (other.MapTier != null))
            {
                return(false);
            }

            if (!GemCorrupted?.Equals(other.GemCorrupted) ?? (other.GemCorrupted != null))
            {
                return(false);
            }

            return(true);
        }
 public Emerald(GemQuality quality) : base(quality, 1, 4, 9)
 {
 }
Example #7
0
 public Ruby(GemQuality quality) : base(quality, 7, 2, 5)
 {
 }