예제 #1
0
 public void RefreshAmmoHUD()
 {
     /* GUI */
     if (playerController.playerDisplay)
     {
         playerController.DisplayInfoWeapon1(playerAmmo.ammoCarriedType0, assaultRifle.magazineBullet);
         playerController.DisplayInfoWeapon2(playerAmmo.ammoCarriedType1, assaultRifle.magazineGrenade);
         playerController.playerDisplay.ammo1.DisplayBullet();
         playerController.playerDisplay.ammo2.DisplayGrenade();
     }
 }
예제 #2
0
        // Use this for initialization
        void Start()
        {
            StartWeaponDoubleGuns();  // TODO : Change this maybe with savegames

            /*GUI*/
            if (playerController.playerDisplay)
            {
                playerController.DisplayInfoWeapon1(playerAmmo.ammoCarriedType0, doubleGuns.magazine);
                playerController.DisplayInfoWeapon2(playerAmmo.ammoCarriedType1, flamethrower.magazine);
                playerController.DisplayInfoIndexWeapon(indexActiveWeapon);
                playerController.playerDisplay.ammo1.DisplayBullet();
                playerController.playerDisplay.ammo2.DisplayFlame();
            }
        }
 public void RefreshAmmoHUD()
 {
     Debug.Log("func - RefreshAmmoHUD from WPC");
     /*GUI*/
     if (playerController.playerDisplay)
     {
         Debug.Log("PlayerDisplay is here...");
         playerController.DisplayInfoWeapon1(playerAmmo.ammoCarriedType0, doubleGuns.magazine);
         playerController.DisplayInfoWeapon2(playerAmmo.ammoCarriedType1, flamethrower.magazine);
         playerController.DisplayInfoIndexWeapon(indexActiveWeapon);
         playerController.playerDisplay.ammo1.DisplayBullet();
         playerController.playerDisplay.ammo2.DisplayFlame();
     }
 }
예제 #4
0
        void InvokeBullet()
        {
            AnimatorClipInfo[] clipInfo = playerController.anim.GetCurrentAnimatorClipInfo(0);
            if (clipInfo.Length != 0)
            {
                if (clipInfo.Length == 1)
                {
                    if (clipInfo[0].clip.name == "anm_Hartman_Fire" && CheckMagazineBullet()) // Check if the player is in the good animation and re check ammo
                    {
                        //Debug.Log("i pulled the trigger with the AssaultRifle in \"WeaponAssaultRifle\"");
                        GameObject       bullet = Instantiate(projectileBullet, chokes.position, chokes.rotation) as GameObject;
                        BulletController bctrl  = bullet.GetComponent <BulletController>();
                        bctrl.baseDamage = bulletsDmg;
                        bctrl.SetSource(gameObject); // Use to assign the marine as target to the alien
                        magazineBullet--;
                        canConstantFireNextBullet = false;
                        playerController.timerActiveJustHaveShoote = 0f; // Use to animation, see PlayerController
                        PlayFlashShoot();
                        PlaySoundFireBullet();

                        /*GUI*/
                        playerController.DisplayInfoWeapon1(playerAmmo.ammoCarriedType0, magazineBullet);
                    }
                }
                //Debug.Log("clipinfo lengt : " + clipInfo.Length);
            }
        }
예제 #5
0
        /// <summary>
        /// Used to refile ammo when ammo box picked up
        /// </summary>
        public void PickUpAmmo(AmmoType ammoType, int amount)
        {
            PlayerController pc = GameController.Player;

            if (ammoType == AmmoType.AmmoType0)
            {
                ammoCarriedType0 += amount;

                if (pc.isCarter())
                {
                    pc.DisplayInfoWeapon1(ammoCarriedType0, pc.weapCCarter.doubleGuns.magazine);
                }
                else
                {
                    pc.DisplayInfoWeapon1(ammoCarriedType0, pc.weapCHartman.assaultRifle.magazineBullet);
                }
            }
            else
            {
                ammoCarriedType1 += amount;

                if (pc.isCarter())
                {
                    pc.DisplayInfoWeapon2(ammoCarriedType1, pc.weapCCarter.flamethrower.magazine);
                }
                else
                {
                    pc.DisplayInfoWeapon2(ammoCarriedType1, pc.weapCHartman.assaultRifle.magazineGrenade);
                }
            }

            GameController.NotifyPlayer("+" + amount + " Ammo !", Color.green, 1);

            /*SOUNDS*/

            if (sndPickUp)
            {
                AudioSource listener = GetComponent <AudioSource>();
                listener.PlayOneShot(sndPickUp, 2.5f);
            }
        }