private static void RollRangedAbilityTwice(MagicWeapon baseWeapon)
        {
            int abilityRoll = MagicItemCreation.Instance.Dices.d100();

            WeaponSpecialAbilitiesTableLine firstAbility = RangedWeaponSpecialAbilitiesTable.GetLineFromDice(abilityRoll, baseWeapon.Quality);

            if (baseWeapon.Abilities == null)
            {
                baseWeapon.Abilities = new List <String>();
            }

            baseWeapon.Abilities.Add(firstAbility.Name);
            baseWeapon.BasePriceModifier = firstAbility.BaseAlterationModifier;

            if (baseWeapon.BasePriceModifier + baseWeapon.AlterationBonus == 10) //arme +5 avec vorpal
            {
                return;
            }

            WeaponSpecialAbilitiesTableLine secondAbility;

            do
            {
                abilityRoll = MagicItemCreation.Instance.Dices.d100();

                secondAbility = RangedWeaponSpecialAbilitiesTable.GetLineFromDice(abilityRoll, baseWeapon.Quality);
            } while (secondAbility.Modify != null || //On reroll tant qu'on tombe sur un cas particulier
                     secondAbility == firstAbility || //ou sur la meme capa
                     !AbilitiesAreCompatible(firstAbility, secondAbility) || //ou sur une capa incompatible
                     (baseWeapon.AlterationBonus + firstAbility.BaseAlterationModifier + secondAbility.BaseAlterationModifier) > 10);    //ou encore que le total des alterations dépasse +10

            baseWeapon.Abilities.Add(secondAbility.Name);
            baseWeapon.BasePriceModifier += secondAbility.BaseAlterationModifier;
        }
        private static bool AbilitiesAreCompatible(WeaponSpecialAbilitiesTableLine firstAbility, WeaponSpecialAbilitiesTableLine secondAbility)
        {
            switch (firstAbility.Name) //On regarde le nom de la premiere capa
            {
            case "Holy":
                return(secondAbility.Name != "Unholy");    //Incompatible si la 2eme est Unholy

            case "Unholy":
                return(secondAbility.Name != "Holy");    //Incompatible si la 2eme est Holy

            default:
                return(true);    //En general les capa sont compatibles
            }
        }
        public override MagicWeapon Create(ItemQuality quality)
        {
            //1. Roll pour avoir l'alteration
            AbstractWeaponTableLine secondRoll;

            do
            {
                int alteration = MagicItemCreation.Instance.Dices.d100();

                secondRoll = WeaponCreation.WeaponsTable.GetLineFromDice(alteration, quality);
            } while (secondRoll.GetType() != typeof(WeaponTableLine)); //On reroll tant qu'on a pas trouvé une ligne qu'on peut utiliser en tant que deuxième roll (si Create existe c'est un cas spécial et donc on ne peut pas l'utiliser)

            MagicWeapon baseWeapon = new MagicWeapon(quality);

            //On ne devrait pas avoir de cas speciaux au deuxieme roll
            baseWeapon.AlterationBonus = secondRoll.AlterationBonus;
            baseWeapon.Type            = ItemType.Weapon;
            baseWeapon.Range           = MagicItemCreation.Instance.ChosenRange;

            //2. Ajout de capa speciale
            //Roll sur la table des capa melee
            if (MagicItemCreation.Instance.ChosenRange == Range.Melee)
            {
                int capa = MagicItemCreation.Instance.Dices.d100();

                WeaponSpecialAbilitiesTableLine ligne = MeleeWeaponSpecialAbilitiesTable.GetLineFromDice(capa, quality);

                if (ligne.Modify != null) //Cas speciaux on appelle la fonction pour modifier
                {
                    ligne.Modify(baseWeapon);
                }
                else //Sinon on modifie a la main
                {
                    baseWeapon.Abilities = new List <String> {
                        ligne.Name
                    };
                    baseWeapon.BasePriceModifier = ligne.BaseAlterationModifier;
                }
            }
            else //Roll sur la table des capa distance
            {
                int capa = MagicItemCreation.Instance.Dices.d100();

                WeaponSpecialAbilitiesTableLine ligne = RangedWeaponSpecialAbilitiesTable.GetLineFromDice(capa, quality);

                if (ligne.Modify != null) //Cas speciaux on appelle la fonction pour modifier
                {
                    ligne.Modify(baseWeapon);
                }
                else //Sinon on modifie a la main
                {
                    baseWeapon.Abilities = new List <String> {
                        ligne.Name
                    };
                    baseWeapon.BasePriceModifier = ligne.BaseAlterationModifier;
                }
            }

            //3. On trouve le prix
            baseWeapon.Price = WeaponCreation.WeaponsTable.GetLineFromAlterationBonus(baseWeapon.AlterationBonus + baseWeapon.BasePriceModifier).Price;

            return(baseWeapon);
        }