diff --git a/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs b/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs new file mode 100644 index 0000000000000000000000000000000000000000..19968e12c872a34d8bd8efeadb6c5423783bc334 --- /dev/null +++ b/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs @@ -0,0 +1,67 @@ +using System.Collections; +using System; +using System.Collections.Generic; + +using UnityEngine; +using UnityEngine.InputSystem; + +using BigSock.Service; + +namespace BigSock { + + /* + Basic projectile attack for the player.. + */ + public class BiggerSlowerProjectile : BaseAttack { + //protected static readonly GameObject PROJECTILE_BASE = new AttackMovement(); + public const string PROJECTILE_NAME = "bullets/bigslowbullet"; + + + public override ulong Id => 102; + public override string Name => "Big Ball"; + public override string Description => "It's big and slow, but it packs a punch."; + + public BiggerSlowerProjectile() { + AttackStats = new AttackStats{ + Damage = 4f, + Knockback = 5f, + Range = 5f, + ProjectileSpeed = 3f, + AttackSpeed = 1f, + }; + + Cooldown = new TimeSpan(0, 0, 0, 2, 0); + } + + + + /* + Activates the ability. + Returns true if the ability was successfully activated. + - Even if nothing was hit, used to indicate that cooldowns should be updated. + This should be overridden in sub-classes for the actual abilities. + */ + protected override bool Activate(Character actor, Vector3? target) { + if(target == null) return false; + + var attack = (AttackStats) AttackStats.Apply(actor.Stats); + attack.Actor = actor; + + + var temp = (target.Value - actor.transform.position); + temp.z = 0; + + var bullet = PrefabService.SINGLETON.Instance(PROJECTILE_NAME, actor.transform.position); + var bulletScript = bullet.GetComponent<AttackMovement>(); + //bulletScript.Actor = actor; + bulletScript.Stats = attack; + bulletScript.Direction = temp.normalized; + + + //MonoBehaviour.Instantiate(PROJECTILE_BASE, (Vector3) actor.transform.position, PROJECTILE_BASE.transform.rotation); + return true; + } + + } + +} \ No newline at end of file diff --git a/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs.meta b/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..b4b06bfec47cf5d0ba33e41cf187242118408045 --- /dev/null +++ b/MrBigsock/Assets/Code/Core/Abilities/BiggerSlowerProjectile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c80b74b32e3dc7745a400cec3fae0641 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: