Beispiel #1
0
    public void AddSubmachinegunAmmo()
    {
        if (guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft == GunsConstants.EmptyMagazine() && guns[GunsConstants.SubmachinegunGunType()].Ammunition == GunsConstants.EmptyMagazine())
        {
            guns[GunsConstants.SubmachinegunGunType()].Ammunition     = GunsConstants.SubmachinegunMagazineCapacity();
            guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft = GunsConstants.SubmachineStartAmmunitionLeftQuantity();
        }
        else if (guns[GunsConstants.SubmachinegunGunType()].Ammunition == GunsConstants.EmptyMagazine())
        {
            guns[GunsConstants.SubmachinegunGunType()].Ammunition     += GunsConstants.SubmachinegunMagazineCapacity();
            guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft += GunsConstants.SubmachinegunMagazineCapacity();
        }
        else
        {
            guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft += GunsConstants.SubmachineStartAmmunitionLeftQuantity();
        }

        if (guns[GunsConstants.SubmachinegunGunType()].Ammunition > GunsConstants.SubmachinegunMagazineCapacity())
        {
            guns[GunsConstants.SubmachinegunGunType()].Ammunition = GunsConstants.SubmachinegunMagazineCapacity();
        }

        if (guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft > GunsConstants.SubmachinegunTotalAmmunitionCapacity())
        {
            guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft = GunsConstants.SubmachinegunTotalAmmunitionCapacity();
        }
    }
Beispiel #2
0
    private void CreateGuns()
    {
        Gun Pistol = new Gun();

        Pistol.Type           = GunType.Pistol;
        Pistol.AmmunitionLeft = GunsConstants.InfinityAmmunition();;
        Pistol.Ammunition     = 7;

        Gun Submachinegun = new Gun();

        Submachinegun.Type           = GunType.SubMachinegun;
        Submachinegun.AmmunitionLeft = GunsConstants.EmptyMagazine();
        Submachinegun.Ammunition     = GunsConstants.EmptyMagazine();

        Gun Machinegun = new Gun();

        Machinegun.Type           = GunType.Machinegun;
        Machinegun.AmmunitionLeft = GunsConstants.EmptyMagazine();
        Machinegun.Ammunition     = GunsConstants.EmptyMagazine();

        guns = new Gun[3];
        guns[GunsConstants.PistolGunType()]        = Pistol;
        guns[GunsConstants.SubmachinegunGunType()] = Submachinegun;
        guns[GunsConstants.MachinegunGunType()]    = Machinegun;
    }
Beispiel #3
0
    public void Restart()
    {
        if (guns == null || guns.Length == 0)
        {
            CreateGuns();
        }
        guns[GunsConstants.PistolGunType()].Ammunition            = 7;
        guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft = GunsConstants.EmptyMagazine();
        guns[GunsConstants.SubmachinegunGunType()].Ammunition     = GunsConstants.EmptyMagazine();
        guns[GunsConstants.MachinegunGunType()].AmmunitionLeft    = GunsConstants.EmptyMagazine();
        guns[GunsConstants.MachinegunGunType()].Ammunition        = GunsConstants.EmptyMagazine();

        playerLives = 1;
    }
Beispiel #4
0
 public Gun CurrentGun()
 {
     if (guns[GunsConstants.MachinegunGunType()].AmmunitionLeft + guns[GunsConstants.MachinegunGunType()].Ammunition > GunsConstants.EmptyMagazine())
     {
         return(guns[GunsConstants.MachinegunGunType()]);
     }
     else if (guns[GunsConstants.SubmachinegunGunType()].AmmunitionLeft + guns[GunsConstants.SubmachinegunGunType()].Ammunition > GunsConstants.EmptyMagazine())
     {
         return(guns[GunsConstants.SubmachinegunGunType()]);
     }
     else
     {
         return(guns[GunsConstants.PistolGunType()]);
     }
 }
Beispiel #5
0
 private void LoadGunController()
 {
     gunController = carriedGun.GetComponent <GunController>();
     if (gunType == GunsConstants.SubmachinegunGunType())
     {
         health = 2;
         gunController.MediumEnemyGun();
     }
     else if (gunType == GunsConstants.MachinegunGunType())
     {
         health = 3;
         gunController.SuperEnemyGun();
     }
     else if (gunType == GunsConstants.BossGunType())
     {
         health = 6;
         gunController.SuperEnemyGun();
     }
     else
     {
         health = 1;
         gunController.BasicEnemyGun();
     }
 }