public DualPistols(StatePlayerController player, Transform firstFirePoint, Transform secondFirePoint, GameObject hitEffect, AudioClip fireSound, LineRenderer rendererRight, LineRenderer rendererLeft, RuntimeAnimatorController animatorController, GameObject shell, Transform ejectPt, Sprite icon) { this.size = Size.LIGHT; this.shotCost = 1f; this.damage = 1; this.fireRate = 0.2f; this.firePt = firstFirePoint; this.secondFirePoint = secondFirePoint; this.bulletTrail = rendererRight; this.bulletTrailLeft = rendererLeft; this.hitEffect = hitEffect; this.fireSound = fireSound; this.ejectPt = ejectPt; this.player = player; this.shell = shell; this.animController = animatorController; this.maxRange = 8f; this.icon = icon; this.recoilVector = new Vector2(1f, 0); roundPool = new Queue <GameObject>(); for (int i = 0; i < 20; i++) { GameObject round = Instantiate(shell, ejectPt.position, Quaternion.identity); round.SetActive(false); roundPool.Enqueue(round); } }
public void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.layer == 8) { StatePlayerController player = collider.GetComponent <StatePlayerController>(); player.addGun((int)gunType); Destroy(gameObject); } }
RailGun(StatePlayerController player, Transform firePt) { size = Size.HEAVY; shotCost = 10; damage = 10; fireRate = 1.0f; this.firePt = firePt; this.player = player; }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { StatePlayerController playerController = other.gameObject.GetComponent <StatePlayerController>(); playerController.AddHealth(1f); Destroy(gameObject); } }
public TVGun(StatePlayerController player, Transform firePoint, GameObject hitEffect, GameObject shotObj, AudioClip fireSound, RuntimeAnimatorController animatorController) { this.size = Size.NORMAL; this.shotCost = 2f; this.damage = 1; this.fireRate = 1.5f; this.firePt = firePoint; this.bullet = shotObj; this.bulletSpeed = 40f; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; }
public RPG(StatePlayerController player, Transform firePoint, GameObject hitEffect, GameObject shotObj, AudioClip fireSound, RuntimeAnimatorController animatorController) { this.size = Size.HEAVY; this.shotCost = 10f; this.damage = 20; this.fireRate = 3f; this.firePt = firePoint; this.bullet = shotObj; this.bulletSpeed = 20f; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; }
public Shotgun(StatePlayerController player, Transform firePoint, GameObject hitEffect, AudioClip fireSound, LineRenderer renderer, RuntimeAnimatorController animatorController) { this.size = Size.NORMAL; this.shotCost = 4f; this.damage = 1; this.fireRate = 0.2f; this.firePt = firePoint; this.bulletTrail = renderer; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.maxRange = 10f; }
public Pistol(StatePlayerController player, Transform firePoint, GameObject hitEffect, AudioClip fireSound, LineRenderer renderer, RuntimeAnimatorController animatorController, float maxRange) { this.size = Size.LIGHT; this.shotCost = 1; this.damage = 1; this.fireRate = 1.0f; this.firePt = firePoint; this.bulletTrail = renderer; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.maxRange = 5f; }
public PythonGun(StatePlayerController playerController, Transform firePt, GameObject hitEffect, GameObject projectile, AudioClip fireSound, RuntimeAnimatorController animatorController, Sprite icon) { size = Size.LIGHT; shotCost = 2f; damage = 2; // damage per snake segment explosion fireRate = 5f; // max snake length this.firePt = firePt; this.hitEffect = hitEffect; this.bullet = projectile; this.bulletSpeed = 10f; //interval (seconds) between snake head moving this.fireSound = fireSound; this.player = playerController; this.animController = animatorController; this.icon = icon; }
public RPG(StatePlayerController player, Transform firePoint, GameObject hitEffect, GameObject shotObj, AudioClip fireSound, RuntimeAnimatorController animatorController) { this.size = Size.HEAVY; this.shotCost = 10f; this.damage = 20; this.fireRate = 3f; this.firePt = firePoint; this.bullet = shotObj; this.bulletSpeed = 20f; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; boxOffset = new Vector2(-0.09087026f, 0f); boxSize = new Vector2(1.417793f, 1.0625f); }
public DualPistols(StatePlayerController player, Transform firstFirePoint, Transform secondFirePoint, GameObject hitEffect, AudioClip fireSound, LineRenderer rendererRight, LineRenderer rendererLeft, RuntimeAnimatorController animatorController) { this.size = Size.LIGHT; this.shotCost = 2f; this.damage = 1; this.fireRate = 0.2f; this.firePt = firstFirePoint; this.secondFirePoint = secondFirePoint; this.bulletTrail = rendererRight; this.bulletTrailLeft = rendererLeft; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.maxRange = 10f; }
public RailGun(StatePlayerController player, Transform firePt, GameObject hitEffect, GameObject shotObj, AudioClip fireSound, RuntimeAnimatorController animatorController, Sprite icon) { size = Size.HEAVY; shotCost = 10f; damage = 10; fireRate = 1.4f; this.firePt = firePt; this.hitEffect = hitEffect; this.bullet = shotObj; this.bulletSpeed = 20f; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.icon = icon; this.charge = .5f; }
public TVGun(StatePlayerController player, Transform firePoint, GameObject hitEffect, GameObject shotObj, AudioClip fireSound, RuntimeAnimatorController animatorController, Sprite icon) { this.size = Size.NORMAL; this.shotCost = 4f; this.damage = 0; this.fireRate = 1.5f; this.firePt = firePoint; this.bullet = shotObj; this.bulletSpeed = 40f; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.icon = icon; this.recoilVector = new Vector2(0f, 0); }
public Shotgun(StatePlayerController player, Transform firePoint, GameObject hitEffect, AudioClip fireSound, GameObject shot_trail, RuntimeAnimatorController animatorController, Sprite icon) { this.size = Size.NORMAL; this.shotCost = 3f; this.damage = 1; this.fireRate = 1f; this.firePt = firePoint; this.bulletTrail = shot_trail.GetComponent <LineRenderer>(); this.shot_trail = shot_trail; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.maxRange = 3f; this.icon = icon; }
public Pistol(StatePlayerController player, Transform firePoint, GameObject hitEffect, AudioClip fireSound, LineRenderer renderer, RuntimeAnimatorController animatorController, GameObject shell, Transform ejectPt) { this.size = Size.LIGHT; this.shotCost = 1f; this.damage = 1; this.fireRate = 0.25f; this.firePt = firePoint; this.bulletTrail = renderer; this.hitEffect = hitEffect; this.fireSound = fireSound; this.player = player; this.animController = animatorController; this.maxRange = 9f; this.shell = shell; this.ejectPt = ejectPt; roundPool = new Queue <GameObject>(); for (int i = 0; i < 20; i++) { GameObject round = Instantiate(shell, ejectPt.position, Quaternion.identity); round.SetActive(false); roundPool.Enqueue(round); } }