public override AttackManager Attack(float damageMultiplier, List <IAttacker> owners) { if (GetAttack == null) { return(null); } AttackManager attack = base.Attack(damageMultiplier, owners); if (attack == null) { return(null); } IAmmo ammo = (IAmmo)attack; ammo.SetInitialWeaponDirection(DirectionalObject.Direction); ammo.SetIntialVelocity(FireVelocity); ammo.SetInitialWeaponPosition(WeaponPosition); owners.ForEach(t => t.ReceiveStoppingPower(stoppingPower)); Instantiate(muzzleFlashEffect, WeaponPosition, transform.rotation, null); return(ammo.GetAttackManager); }
protected Gun(float weight, GunType typeOfGun, TypeOfBoost boostType, IAmmo ammoType) { this.typeOfGun = typeOfGun; Weight = weight; ammo = new Ammo(boostType, ammoType); LoadGunStats(); ApplyBulletMultipliers(ammo); }
public void Reload(IAmmo ammo) { #if UNITY_EDITOR print($"loading in : {ammo}"); #endif ammunition.Enqueue(ammo); audioSource.PlayOneShot(ammoLoad); ammunition.Peek().Select(); }
public void Hit(IAmmo ammo) { ReceiveDamage(ammo.DamageInflicted()); if (IsDown) { DeathSalute(); } }
void ShootBullet() { GameObject bulletInstance = (GameObject)Instantiate(bullet, bulletSpawn.position, Quaternion.identity); if (bulletInstance != null) { IAmmo bc = bulletInstance.GetComponent <IAmmo>(); bc.SetRotation(rotator.rotation.eulerAngles.y); bc.Fire(target); } }
public override AttackManager Attack(float damageMultiplier, List <IAttacker> owners) { AttackManager attack = base.Attack(damageMultiplier, owners); if (attack == null) { return(null); } IAmmo ammo = (IAmmo)attack; ammo.SetInitialWeaponPosition(weaponPivot.position); return(attack); }
public void Fire() { //Debug.Log($"FIRE! Curr ammo: {ammunition.Count}"); if (ammunition.Count > 0) { IAmmo ammo = ammunition.Dequeue(); if (aimPos != Vector3.zero) { ammo.Fire(aimPos, 80, 0); } else { ammo.Fire(camRay.direction, 80, aimDist); } if (ammunition.Count > 0) { ammunition.Peek().Select(); } } }
public Rifle([Named("Tungsten")] IAmmo ammo) { _ammo = ammo; }
private MachineGun(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, IAmmo ammoType) : base(weight, typeOfGun, boostType, ammoType) { }
public void LoadAmmo(IAmmo ammo) { _ammo.Add(ammo); }
private PlasmaCannon(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, IAmmo ammoType) : base(weight, typeOfGun, boostType, ammoType) { }
public bool IsCompatible(IAmmo ammo) => true;
public Ammo(TypeOfBoost boostType, IAmmo ammoType) { this.boostType = boostType; this.ammoType = ammoType; SetBulletMultiplier(TypeBoost); }
public Gun([Named("AP")] IAmmo ammo) { _ammo = ammo; }