diff --git a/Assets/Prefabs/Sticks/bolasStick.prefab b/Assets/Prefabs/Sticks/bolasStick.prefab index 7a0c327..d83ee12 100644 --- a/Assets/Prefabs/Sticks/bolasStick.prefab +++ b/Assets/Prefabs/Sticks/bolasStick.prefab @@ -152,7 +152,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 531d7966d86bd0c4d83baf58bcb56cd5, type: 3} m_Name: m_EditorClassIdentifier: - _entityLinked: {fileID: 5530763025372097863} + _entityLinked: {fileID: 814896672592409367} --- !u!1 &1167891119861249516 GameObject: m_ObjectHideFlags: 0 @@ -499,7 +499,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 7468362030574254172} - - component: {fileID: 5530763025372097863} + - component: {fileID: 814896672592409367} - component: {fileID: 7802907299062813180} - component: {fileID: 1182150014477180862} - component: {fileID: 5931428661698025033} @@ -530,7 +530,7 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5530763025372097863 +--- !u!114 &814896672592409367 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -539,7 +539,7 @@ MonoBehaviour: m_GameObject: {fileID: 7468362030574254173} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 20821ed53f7f53e4cbdc7b3157c35b97, type: 3} + m_Script: {fileID: 11500000, guid: 4efc1afdf7c559a4cac25dad0d8917cb, type: 3} m_Name: m_EditorClassIdentifier: _lifeBar: {fileID: 9115548409632460044} @@ -1963,7 +1963,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c0fbd934c179894458914437255781c4, type: 3} m_Name: m_EditorClassIdentifier: - _entity: {fileID: 5530763025372097863} + _entity: {fileID: 814896672592409367} _projectile: {fileID: 6962989255644195630, guid: 3df5eaab2a4c1d64bba590ed4e1ac0f7, type: 3} _projectileSpawn: {fileID: 7322466304790414952} --- !u!1 &9107841294774877216 diff --git a/Assets/Prefabs/bolasProjectile.prefab b/Assets/Prefabs/bolasProjectile.prefab index 306ab67..9a25838 100644 --- a/Assets/Prefabs/bolasProjectile.prefab +++ b/Assets/Prefabs/bolasProjectile.prefab @@ -73,6 +73,7 @@ MonoBehaviour: _angle: 0 _speed: 2 _slowIntensity: 0.25 + _slowDuration: 10 --- !u!1 &6962989256011107503 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Ally/Bolas.cs b/Assets/Scripts/Ally/Bolas.cs deleted file mode 100644 index c39cfc9..0000000 --- a/Assets/Scripts/Ally/Bolas.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Bolas : Ally -{ - public override void Start() - { - base.Start(); - } - - public override void Update() - { - base.Update(); - if (IsEnemyDetected) - { - AttackEnemy(); - } - } - - void AttackEnemy() - { - //Attack Cooldown - if (AttackInterval < AttackSpeedWait) - { - Animation.PlayAttackAnim(); - AttackSpeedWait = 0f; - } - AttackSpeedWait += Time.deltaTime; - } - -} diff --git a/Assets/Scripts/Ally/Bolas.cs.meta b/Assets/Scripts/Ally/Bolas.cs.meta deleted file mode 100644 index 656d676..0000000 --- a/Assets/Scripts/Ally/Bolas.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 20821ed53f7f53e4cbdc7b3157c35b97 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Projectile.cs b/Assets/Scripts/Projectile.cs index 1338c7b..271490d 100644 --- a/Assets/Scripts/Projectile.cs +++ b/Assets/Scripts/Projectile.cs @@ -134,6 +134,7 @@ public class Projectile : MonoBehaviour } } + // applies effects on hit protected virtual void ApplyEffects() { } //Getter and Setter diff --git a/Assets/Scripts/Projectile/BolasProjectile.cs b/Assets/Scripts/Projectile/BolasProjectile.cs index 4107b6a..4285796 100644 --- a/Assets/Scripts/Projectile/BolasProjectile.cs +++ b/Assets/Scripts/Projectile/BolasProjectile.cs @@ -6,6 +6,7 @@ public class BolasProjectile : Projectile { [SerializeField] private float _slowIntensity = 0.25f; + [SerializeField] private float _slowDuration = 5f; protected override void ApplyEffects() diff --git a/Assets/Scripts/Status/Slow.cs b/Assets/Scripts/Status/Slow.cs index e282926..6304903 100644 --- a/Assets/Scripts/Status/Slow.cs +++ b/Assets/Scripts/Status/Slow.cs @@ -8,13 +8,19 @@ public class Slow : Status public override void Apply(float duration) { + // reset slow duration _duration += duration; + + // slow entity EntityLinked.SpeedStatusModifier *= _speedModifier; } public override void Unapply() { + // bring entity to normal speed EntityLinked.SpeedStatusModifier /= _speedModifier; + + // stop effect Destroy(this); } diff --git a/Assets/Scripts/Status/Status.cs b/Assets/Scripts/Status/Status.cs index 7cf9095..c331c20 100644 --- a/Assets/Scripts/Status/Status.cs +++ b/Assets/Scripts/Status/Status.cs @@ -14,6 +14,7 @@ public abstract class Status : MonoBehaviour protected virtual void Update() { + // effect timer _duration -= Time.deltaTime; if ( _duration < 0 ) Unapply(); } diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs index 3298566..a8f7a9e 100644 --- a/Assets/Scripts/StatusHandler.cs +++ b/Assets/Scripts/StatusHandler.cs @@ -9,8 +9,13 @@ public class StatusHandler : MonoBehaviour public void ApplySlow(float intensity, float duration) { + // check if effect already applied Slow slow = (Slow)GetStatus(Enum.StatusType.Slow); + + // init effect params slow.Intensity = intensity; + + // apply effect slow.Apply(duration); }