literally half of the game

This commit is contained in:
Sylvia 2026-08-27 04:07:01 -07:00
parent 1590b5faa6
commit b842289076
77 changed files with 11904 additions and 72 deletions

View file

@ -0,0 +1,46 @@
using System;
using Core.Extensions;
using UnityEngine;
public class Ability : MonoBehaviour
{
[Header("Flags")]
public bool cooldownBlocked;
public bool blocked;
[Header("Cooldown")]
public float cooldown;
protected float currentCooldown;
[Header("Stats")]
public float power;
public bool TryAbility()
{
if (!blocked && currentCooldown <= 0)
{
currentCooldown = cooldown;
AbilityEffects();
return true;
}
return false;
}
protected virtual void AbilityEffects()
{
}
private void Update()
{
if (currentCooldown > 0 && !cooldownBlocked)
{
currentCooldown -= Time.deltaTime;
}
}
protected void ShootBullet(Projectile projectile, Vector3 direction)
{
Projectile newProjectile = Instantiate(projectile, transform.position, Quaternion.identity);
newProjectile.transform.Lookat2D(direction);
newProjectile.tag = tag; //will have to figure out stats and projectile creation
}
}