Exemplo n.º 1
0
    public static void Fire(WeaponUpgradeTypeEnum type, Projectile projectile, float force, IShotLocations shotLocations)
    {
        switch (type)
        {
        case WeaponUpgradeTypeEnum.None:
            break;

        case WeaponUpgradeTypeEnum.Normal:
            NormalShot(projectile, force, shotLocations.Normal().position);
            break;

        case WeaponUpgradeTypeEnum.Left:
            NormalShot(projectile, force, shotLocations.Left().position);
            break;

        case WeaponUpgradeTypeEnum.Right:
            NormalShot(projectile, force, shotLocations.Right().position);
            break;

        case WeaponUpgradeTypeEnum.Double:
            break;

        case WeaponUpgradeTypeEnum.AngleLeft:
            AngleShot(projectile, force, shotLocations.Normal().position, 20);
            break;

        case WeaponUpgradeTypeEnum.AngleRight:
            AngleShot(projectile, force, shotLocations.Normal().position, -20);
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
    public void AddWeapon(WeaponUpgradeTypeEnum type, float?expireInSeconds = null)
    {
        var existingType = currentWeapons.FirstOrDefault(x => x.Weapon == type);

        if (existingType == null)
        {
            currentWeapons.Add(new WeaponType(type, expireInSeconds));
        }
        else if (expireInSeconds.HasValue)
        {
            existingType.ExpiresInSeconds = expireInSeconds.Value;
        }
    }
Exemplo n.º 3
0
 public void AddWeapon(WeaponUpgradeTypeEnum type, float?expireInSeconds = null)
 {
     playerShoot.AddWeapon(type, expireInSeconds);
 }
Exemplo n.º 4
0
 public WeaponType(WeaponUpgradeTypeEnum weapon, float?expiresInSeconds)
 {
     Weapon           = weapon;
     ExpiresInSeconds = expiresInSeconds;
 }