literally half of the game
This commit is contained in:
parent
1590b5faa6
commit
b842289076
77 changed files with 11904 additions and 72 deletions
46
Assets/Scripts/Entity/Abilities/Ability.cs
Normal file
46
Assets/Scripts/Entity/Abilities/Ability.cs
Normal 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
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Entity/Abilities/Ability.cs.meta
Normal file
2
Assets/Scripts/Entity/Abilities/Ability.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0057d0e1aa27e88a6922b74c1ef23cc8
|
||||
10
Assets/Scripts/Entity/Abilities/PlayerAbility.cs
Normal file
10
Assets/Scripts/Entity/Abilities/PlayerAbility.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.InputSystem.LowLevel;
|
||||
|
||||
public class PlayerAbility : Ability
|
||||
{
|
||||
[Header("Input")]
|
||||
public KeyCode inputKey; //change to better input system later
|
||||
|
||||
public MouseButton mouseButton; //alternative input
|
||||
}
|
||||
2
Assets/Scripts/Entity/Abilities/PlayerAbility.cs.meta
Normal file
2
Assets/Scripts/Entity/Abilities/PlayerAbility.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e1cd082fa4f5e51d6b807f4914aa021f
|
||||
12
Assets/Scripts/Entity/Abilities/ReisenShoot.cs
Normal file
12
Assets/Scripts/Entity/Abilities/ReisenShoot.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class ReisenShoot : PlayerAbility
|
||||
{
|
||||
[Header("Projectile")]
|
||||
[SerializeField] private Projectile projectile;
|
||||
protected override void AbilityEffects()
|
||||
{
|
||||
base.AbilityEffects();
|
||||
ShootBullet(projectile, GameManager.instance.GetMouseWorldPos());
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Entity/Abilities/ReisenShoot.cs.meta
Normal file
2
Assets/Scripts/Entity/Abilities/ReisenShoot.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d1ac34739e2f9c100901a9488a5d8218
|
||||
Loading…
Add table
Add a link
Reference in a new issue