Exemplo n.º 1
0
 public WeaponDefinition()
 {
     if (Game1.Random.Next(100) >= 35)
         Prefix =
            Prefix =
             (WeaponPrefix)
                 Game1.Random.Next((int) Enum.GetValues(typeof (WeaponPrefix)).Cast<WeaponPrefix>().Last() + 1);
     if (Game1.Random.Next(100) >= (Prefix == WeaponPrefix.NONE ? 35 : 75))
     {
         Suffix =
             (WeaponSuffix)
                 Game1.Random.Next((int) Enum.GetValues(typeof (WeaponSuffix)).Cast<WeaponSuffix>().Last() + 1);
         if ((int) Prefix == (int) Suffix) Suffix = WeaponSuffix.NONE;
     }
     Type = (WeaponType)Game1.Random.Next((int)Enum.GetValues(typeof(WeaponType)).Cast<WeaponType>().Last() + 1);
 }
Exemplo n.º 2
0
        public Weapon(WeaponType type, WeaponWeight weight, WeaponPrefix prefix, WeaponInfix infix, WeaponSuffix suffix)
        {
            this.itemClass = ItemClass.Weapon;
            this.type      = type;
            this.weight    = weight;
            this.prefix    = prefix;
            this.infix     = infix;
            this.suffix    = suffix;

            attackBonus = 0;
            attackMult  = 1;
            speedMult   = 1;
            hpBonus     = 0;

            switch (prefix)
            {
            case WeaponPrefix.Great:
                attackMult = 1.15;
                break;

            case WeaponPrefix.Mighty:
                attackMult = 1.25;
                break;

            case WeaponPrefix.Masterful:
                attackMult = 1.4;
                break;

            case WeaponPrefix.Soldier:
                attackMult = 1.2;
                break;

            case WeaponPrefix.Knight:
                attackMult = 1.3;
                break;

            case WeaponPrefix.Captain:
                attackMult = 1.45;
                break;

            case WeaponPrefix.Ogre:
                attackMult = 1.3;
                break;

            case WeaponPrefix.Titan:
                attackMult = 1.4;
                break;

            case WeaponPrefix.Dragon:
                attackMult = 1.6;
                break;

            case WeaponPrefix.Medic:
                hpBonus = 20;
                break;

            case WeaponPrefix.Doctor:
                hpBonus = 30;
                break;

            case WeaponPrefix.Surgeon:
                hpBonus = 40;
                break;
            }

            switch (infix)
            {
            case WeaponInfix.Bronze:
                attackBonus = 10;
                break;

            case WeaponInfix.Steel:
                attackBonus = 15;
                break;

            case WeaponInfix.Silver:
                attackBonus = 20;
                break;

            case WeaponInfix.Platinum:
                attackBonus = 25;
                break;

            case WeaponInfix.Titanium:
                attackBonus = 30;
                break;

            case WeaponInfix.Diamond:
                attackBonus = 35;
                break;

            case WeaponInfix.Obsidian:
                attackBonus = 40;
                break;
            }

            switch (suffix)
            {
            case WeaponSuffix.Wind:
                speedMult = 1.15;
                break;

            case WeaponSuffix.Gale:
                speedMult = 1.2;
                break;

            case WeaponSuffix.Storm:
                speedMult = 1.25;
                break;
            }

            string weightStr, prefixStr, infixStr, typeStr, suffixStr;

            weightStr = weight.ToString();

            prefixStr = prefix.ToString();
            if (prefixApostrophes.Contains(prefix))
            {
                prefixStr += "'s";
            }

            infixStr = infix.ToString();

            typeStr = type.ToString();

            suffixStr = suffix.ToString();
            if (suffix == WeaponSuffix.Sight)
            {
                suffixStr = "True " + suffixStr;
            }
            if (!suffixNoThes.Contains(suffix))
            {
                suffixStr = "of the " + suffixStr;
            }

            name = String.Join(" ", new[] {
                weightStr, prefixStr, infixStr, typeStr, suffixStr
            });
        }
Exemplo n.º 3
0
 public WeaponDefinition()
 {
     if (Game1.Random.Next(100) >= 35)
         Prefix =
            Prefix =
             (WeaponPrefix)
                 Game1.Random.Next((int) Enum.GetValues(typeof (WeaponPrefix)).Cast<WeaponPrefix>().Last() + 1);
     if (Game1.Random.Next(100) >= (Prefix == WeaponPrefix.NONE ? 35 : 75))
     {
         Suffix =
             (WeaponSuffix)
                 Game1.Random.Next((int) Enum.GetValues(typeof (WeaponSuffix)).Cast<WeaponSuffix>().Last() + 1);
         if ((int) Prefix == (int) Suffix) Suffix = WeaponSuffix.NONE;
     }
     Type = (WeaponType)Game1.Random.Next((int)Enum.GetValues(typeof(WeaponType)).Cast<WeaponType>().Last() + 1);
 }
Exemplo n.º 4
0
 public void SetPrefixRandom()
 {
     prefixList = (WeaponPrefix)UnityEngine.Random.Range(0, System.Enum.GetValues(typeof(WeaponPrefix)).Length);
 }
Exemplo n.º 5
0
 public void SetPrefix(WeaponPrefix _prefix)
 {
     prefixList = _prefix;
 }