you really gotta calm down, marisa...
This commit is contained in:
parent
13bb58ea03
commit
b9fb490dce
68 changed files with 990 additions and 44 deletions
|
|
@ -1,36 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class FireBullet : PlayerAbility
|
||||
{
|
||||
[Header("Projectile Stats")]
|
||||
public int pierceAmount;
|
||||
public float accuracy;
|
||||
public float bulletLifetime;
|
||||
public float projectileSpeed;
|
||||
|
||||
public enum FireMode {Angled, Offset};
|
||||
[Header("Projectile")]
|
||||
public FireMode fireMode = FireMode.Offset;
|
||||
public Vector2 offset;
|
||||
public float angle;
|
||||
[SerializeField] private Projectile projectile;
|
||||
protected override void AbilityEffects()
|
||||
{
|
||||
for (int i = 0; i < projectileCount; i++)
|
||||
{
|
||||
Projectile newProjectile = Instantiate(projectile, thisPlayer.firingPointBase.position, transform.rotation);
|
||||
newProjectile.RotateToTarget(thisPlayer.firingPoint.position);
|
||||
newProjectile.transform.position = thisPlayer.firingPoint.position; //me when i set the position 3 times in a row. but it's to prevent the bullets firing behind marisa
|
||||
if (fireMode == FireMode.Offset && projectileCount > 1)
|
||||
{
|
||||
newProjectile.transform.position += new Vector3(Random.Range(-offset.x, offset.x), Random.Range(-offset.y, offset.y));
|
||||
}
|
||||
newProjectile.pierceAmount = pierceAmount;
|
||||
newProjectile.damage = power;
|
||||
newProjectile.speed = projectileSpeed;
|
||||
newProjectile.lifetime = bulletLifetime;
|
||||
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
|
||||
newProjectile.tag = thisPlayer.tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue