diff --git a/MrBigsock/Assets/Code/Character.cs b/MrBigsock/Assets/Code/Character.cs index b2836dc80000b67eb03adbd89c56567c7168b38f..65fcec886ac36cc893e71bbbb3f7c6210f8426f0 100644 --- a/MrBigsock/Assets/Code/Character.cs +++ b/MrBigsock/Assets/Code/Character.cs @@ -145,11 +145,11 @@ namespace BigSock { /* - Add Kcockback. + Add Knockback. */ - //public void KnockBack(float force, Vector2 difference) { - // rb.AddForce(difference * force, ForceMode2D.Impulse); - //} + public void KnockBack(float force, Vector2 difference) { + rb.AddForce(difference * force, ForceMode2D.Impulse); + } public void KnockBack(IAttackStats attack) { Vector2 difference = ((Vector2) transform.position - attack.Source).normalized; //KnockBack(attack.Knockback, difference); diff --git a/MrBigsock/Assets/Code/Core/StatusEffectType.cs.meta b/MrBigsock/Assets/Code/Core/StatusEffectType.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..ea2656d27374d45bd5d1ebe68305c2b1a07ce8dd --- /dev/null +++ b/MrBigsock/Assets/Code/Core/StatusEffectType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b098d33750fa314c975d94a25c5b14f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/MrBigsock/Assets/Code/PlayerController.cs b/MrBigsock/Assets/Code/PlayerController.cs index 5bc4dba32dfdc8f53bf152d2fa3663c4955abc2d..0846bcf016754b51643f1866165dd5815e2d84a5 100644 --- a/MrBigsock/Assets/Code/PlayerController.cs +++ b/MrBigsock/Assets/Code/PlayerController.cs @@ -36,6 +36,7 @@ namespace BigSock { protected IAttack _testAttack; protected IAttack _testAttack2; + protected IAbility _dodge; public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now; @@ -58,13 +59,16 @@ namespace BigSock { //!! DEBUG: Add item to player at start to test if it works. - TryPickUpItem(ItemService.SINGLETON.Get(201)); - TryPickUpItem(ItemService.SINGLETON.Get(201)); - TryPickUpItem(ItemService.SINGLETON.Get(202)); - TryPickUpItem(ItemService.SINGLETON.Get(101)); - var tmp = PrefabService.SINGLETON; + //TryPickUpItem(ItemService.SINGLETON.Get(201)); + //TryPickUpItem(ItemService.SINGLETON.Get(201)); + //TryPickUpItem(ItemService.SINGLETON.Get(202)); + //TryPickUpItem(ItemService.SINGLETON.Get(101)); + + //var tmp = PrefabService.SINGLETON; + _testAttack = (IAttack) AbilityService.SINGLETON.Get(101); _testAttack2 = (IAttack) AbilityService.SINGLETON.Get(102); + _dodge = AbilityService.SINGLETON.Get(201); } @@ -122,12 +126,20 @@ namespace BigSock { } } + // If pressed Z: Big attack. if(Input.GetKey(KeyCode.Z)) { _testAttack2.Use(this, Camera.main.ScreenToWorldPoint(Input.mousePosition)); } + // If pressed X: dodge. + if(Input.GetKey(KeyCode.X)) { + _dodge.Use(this, Camera.main.ScreenToWorldPoint(Input.mousePosition)); + } + + + //!! Code for testing the new item stuff. - if(Input.GetKeyDown(KeyCode.Space)) { + if(Input.GetKeyDown(KeyCode.M)) { var item = ItemService.SINGLETON.GetRandom(); // new ItemRunningShoes(); TryPickUpItem(item); }