diff --git a/MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs b/MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs index b7e1e8189da0a411a88414cca0d135d37c661840..15aa963ea6f4f5cf4d0eb06519d677547ee3beb8 100644 --- a/MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs +++ b/MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs @@ -16,17 +16,19 @@ namespace BigSock { //protected static readonly GameObject PROJECTILE_BASE = new AttackMovement(); public const string PROJECTILE_NAME = "attack"; - /* - The attack stats of the ability. - */ - public IAttackStats AttackStats { get; set; } - - + + public override ulong Id => 101; + public override string Name => "Basic Player Projectile Attack"; + public override string Description => "A basic projectile shooting attack the player has."; public BasicProjectile1() { - Name = "Basic Player Projectile Attack"; - Id = 101; - Description = "A basic projectile shooting attack the player has."; + AttackStats = new AttackStats{ + Damage = 1f, + Knockback = 1f, + Range = 10f, + ProjectileSpeed = 10f, + AttackSpeed = 1f, + }; } @@ -38,8 +40,21 @@ namespace BigSock { 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); - bullet.GetComponent<AttackMovement>().Actor = actor; + 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;