my HEAD hurts and the SFX is TOO LOUD

This commit is contained in:
Sylvia 2026-04-26 21:49:57 -07:00
parent a3321d361c
commit d4ebf0ca61
41 changed files with 1465 additions and 123 deletions

View file

@ -15,10 +15,19 @@ public class Laser : PlayerAbility
private BeamCollider beamObjectInstance;
public float turnSpeed;
public float offset;
[SerializeField] private AudioClip beamSFX;
[SerializeField] private float beamVolume = 1;
[Header("Weapon Properties")]
[HideInInspector] public List<Entity> enemyList = new();
public float damageDebounceTime;
protected float currentDebounce;
[Header("Charge")]
public float chargeTime;
protected float currentCharge;
[Header("Effects")]
[SerializeField] private CameraShake camShakeScript; //optional
private void Start()
{
CreateBeam();
@ -30,13 +39,30 @@ public class Laser : PlayerAbility
currentDuration = duration;
currentCooldown = cooldown;
currentDebounce = damageDebounceTime;
beamObjectInstance.gameObject.SetActive(true);
transform.Lookat2D(thisPlayer.mouseWorldPos);
currentCharge = chargeTime;
}
protected override void Update()
{
base.Update();
if (currentCharge >= 0 && currentDuration > 0)
{
currentCharge -= Time.deltaTime;
if (currentCharge < 0)
{
AbilityManager.instance.player.thisPlayer.entityAS.PlayOneShot(beamSFX, beamVolume);
beamObjectInstance.gameObject.SetActive(true);
transform.Lookat2D(thisPlayer.mouseWorldPos);
if (camShakeScript)
{
camShakeScript.ShakeCamera(currentDuration);
}
}
else
{
return;
}
}
if (currentDuration > 0)
{
Vector3 direction = (thisPlayer.mouseWorldPos - (Vector2)transform.position).normalized;