Beispiel #1
0
 public Amethyst(GemsQuality quality)
     : base(quality)
 {
     this.Strength = 2 + (int)this.Quality;
     this.Agility  = 8 + (int)this.Quality;
     this.Vitality = 4 + (int)this.Quality;
 }
Beispiel #2
0
 public Ruby(GemsQuality quality)
     : base(quality)
 {
     this.Strength = 7 + (int)this.Quality;
     this.Agility  = 2 + (int)this.Quality;
     this.Vitality = 5 + (int)this.Quality;
 }
Beispiel #3
0
 public Emerald(GemsQuality quality)
     : base(quality)
 {
     this.Strength = 1 + (int)this.Quality;
     this.Agility  = 4 + (int)this.Quality;
     this.Vitality = 9 + (int)this.Quality;
 }
Beispiel #4
0
        public override void Execute(List <Weapon> weapons, string[] args)
        {
            string name  = args[1];
            int    index = int.Parse(args[2]);

            string[]    gemTokens          = args[3].Split();
            string      gemQualityAsString = gemTokens[0];
            string      gemType            = gemTokens[1];
            GemsQuality gemQuality         = (GemsQuality)Enum.Parse(typeof(GemsQuality), gemQualityAsString);

            Type type = Assembly
                        .GetExecutingAssembly()
                        .GetTypes()
                        .FirstOrDefault(x => x.Name == gemType);
            var constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public,
                                                  null,
                                                  new Type[] { typeof(GemsQuality) },
                                                  null);

            Gem gem = (Gem)constructor.Invoke(new object[] { gemQuality });

            var weapon = weapons.FirstOrDefault(x => x.Name == name);


            if (weapon.GemPlacement.ContainsKey(index))
            {
                weapon.GemPlacement[index] = gem;
            }
            else
            {
                if (index >= 0 && index < weapon.Stats.NumberOfSockets)
                {
                    weapon.GemPlacement[index] = gem;
                }
            }
        }
Beispiel #5
0
 public Gem(GemsQuality quality)
 {
     this.Quality = quality;
 }