예제 #1
0
파일: Gen.cs 프로젝트: bjshumway/SE2-SDS
    public static RangedWeapon rangedWeapon(int level)
    {
        string  name     = rangedWeaponTypes[ran.Next(rangedWeaponTypes.Length)] + " of " + adjective();
        decimal weight   = ((decimal)ran.NextDouble() * 10) + 1;
        bool    tradable = true;
        decimal value    = (decimal)ran.Next((int)(level * 0.5), (int)(level * 2));

        Weapon.weaponType type = (Weapon.weaponType)ran.Next(0, 3);

        return(new RangedWeapon(
                   name,
                   weight,
                   tradable,
                   value,
                   level,
                   type,

                   /* Tooltip Text */
                   name + "\r\n" +
                   "Ranged Weapon" + "\r\n" +
                   "Weight: " + weight.ToString() + "\r\n" +
                   "Tradable: " + ((tradable) ? "Yes" : "No") + "\r\n" +
                   "Value: " + value.ToString() + "\r\n" +
                   "Level: " + level.ToString()
                   ));
    }
예제 #2
0
    public void Attack()
    {
        Weapon.weaponType type = activeWeapon.type;

        if (type == Weapon.weaponType.ranged)
        {
            activeWeapon.WeaponRangedAttack();
        }
        else if (type == Weapon.weaponType.melee)
        {
            //StartCoroutine("FreezeRotation", activeWeapon.GetComponent<Weapon>().attackAnim.length);
            //StartCoroutine(freezeRotationCoroutine);
            activeWeapon.WeaponMeleeAttack();
        }
    }