Skip to content
Snippets Groups Projects
Commit 7f4af08a authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Simplified the process by adding `GetAbilityParam()`.

parent 52ac1683
Branches main
No related tags found
1 merge request!56New ability fire rework. (Charging)
......@@ -151,6 +151,18 @@ namespace BigSock {
}
/*
Gets the AbilityParams we want.
*/
public virtual IAbilityParam GetAbilityParam(Vector2? targetPos) {
return new AbilityParam{
Actor = this,
TargetPos = targetPos,
MovementDir = moveDir,
};
}
/*
Add Knockback.
......
......@@ -125,11 +125,12 @@ namespace BigSock {
Regenerate();
// Object w/ parameters for abilities.
var par = new AbilityParam{
Actor = this,
TargetPos = Camera.main.ScreenToWorldPoint(Input.mousePosition),
MovementDir = moveDir,
};
var par = GetAbilityParam(Camera.main.ScreenToWorldPoint(Input.mousePosition));
//var par = new AbilityParam{
// Actor = this,
// TargetPos = Camera.main.ScreenToWorldPoint(Input.mousePosition),
// MovementDir = moveDir,
//};
// If pressed Soace or LMB: Regular attack.
......
......@@ -74,11 +74,12 @@ namespace BigSock {
// Object w/ parameters for abilities.
var par = new AbilityParam{
Actor = this,
TargetPos = target.position,
MovementDir = moveDir,
};
var par = GetAbilityParam(target.position);
//var par = new AbilityParam{
// Actor = this,
// TargetPos = target.position,
// MovementDir = moveDir,
//};
_testAttack.Use(par);
......
......@@ -72,12 +72,13 @@ namespace BigSock {
if(DateTime.Now >= NextTimeStateCanChange && target != null) {
// Object w/ parameters for abilities.
var par = new AbilityParam{
Actor = this,
TargetPos = target.position,
MovementDir = moveDir,
};
var par = GetAbilityParam(target.position);
//var par = new AbilityParam{
// Actor = this,
// TargetPos = target.position,
// MovementDir = moveDir,
//};
_testAttack.Use(par);
State = State.Attacking;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment