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(); } }
// 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(); } }
/// <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); } }
void InvokeGrenade() { AnimatorClipInfo[] clipInfo = playerController.anim.GetCurrentAnimatorClipInfo(0); if (clipInfo.Length != 0) { if (clipInfo[0].clip.name == "anm_Hartman_Fire") { //Debug.Log("i pulled the trigger with the GRENADEAssaultRifle in \"WeaponAssaultRifle\""); GameObject grenade = Instantiate(projectileGrenade, chokes.position, chokes.rotation) as GameObject; GrenadeController gctrl = grenade.GetComponent <GrenadeController>(); gctrl.baseDamage = grenadesDmg; gctrl.SetSource(gameObject); // Use to assign the marine as target to the alien magazineGrenade--; playerController.timerActiveJustHaveShoote = 0f; // Use to animation, see PlayerController PlayFlashShoot(); ReloadGrenade(); gameObject.GetComponent <WeaponControllerHartman>().playerCanShootAfterReload = false; PlaySoundFireGrenade(); /*GUI*/ playerController.DisplayInfoWeapon2(playerAmmo.ammoCarriedType1, magazineGrenade); } } }