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

Changed main attack to the chargable one.

parent e59add40
No related branches found
No related tags found
1 merge request!62New primary attack.
...@@ -42,6 +42,7 @@ namespace BigSock { ...@@ -42,6 +42,7 @@ namespace BigSock {
protected IAttack _testAttack; protected IAttack _testAttack;
protected IAttack _testAttack2; protected IAttack _testAttack2;
protected IAttack _testAttack3;
protected IAbility _dodge; protected IAbility _dodge;
public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now; public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now;
...@@ -80,8 +81,9 @@ namespace BigSock { ...@@ -80,8 +81,9 @@ namespace BigSock {
//var tmp = PrefabService.SINGLETON; //var tmp = PrefabService.SINGLETON;
//var tmp = SpriteService.SINGLETON; //var tmp = SpriteService.SINGLETON;
_testAttack = (IAttack) AbilityService.SINGLETON.Get(101); _testAttack = (IAttack) AbilityService.SINGLETON.Get(104);
_testAttack2 = (IAttack) AbilityService.SINGLETON.Get(102); _testAttack2 = (IAttack) AbilityService.SINGLETON.Get(102);
_testAttack3 = (IAttack) AbilityService.SINGLETON.Get(101);
_dodge = AbilityService.SINGLETON.Get(201); _dodge = AbilityService.SINGLETON.Get(201);
} }
...@@ -151,7 +153,10 @@ namespace BigSock { ...@@ -151,7 +153,10 @@ namespace BigSock {
else if(Input.GetKeyUp(key)) { else if(Input.GetKeyUp(key)) {
par.ChargeTime = Time.time - chargeStarts[key]; par.ChargeTime = Time.time - chargeStarts[key];
var t = ability.Use(par); var t = ability.Use(par);
if(!t) Debug.Log($"[PlayerController.CheckAbilityInput({key})] {ability.Name} not fired ({par.ChargeTime}/{ability.MinCharge})"); if(!t) {
if(par.ChargeTime < ability.MinCharge)
Debug.Log($"[PlayerController.CheckAbilityInput({key})] {ability.Name} not fired ({par.ChargeTime:N3} < {ability.MinCharge:N3})");
}
} }
break; break;
default: default:
...@@ -184,6 +189,7 @@ namespace BigSock { ...@@ -184,6 +189,7 @@ namespace BigSock {
CheckAbilityInput(KeyCode.Z, _testAttack2); CheckAbilityInput(KeyCode.Z, _testAttack2);
// Check ability 3. // Check ability 3.
CheckAbilityInput(KeyCode.X, _dodge); CheckAbilityInput(KeyCode.X, _dodge);
CheckAbilityInput(KeyCode.C, _testAttack3);
//if(Input.GetKeyDown(KeyCode.Z)) Debug.Log($"[PlayerController.Update()] Z was pressed."); //if(Input.GetKeyDown(KeyCode.Z)) Debug.Log($"[PlayerController.Update()] Z was pressed.");
......
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