From e7a03f71ec0550b2736fd42825b3a36144f4a745 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 14 Jul 2025 19:13:43 -0400 Subject: [PATCH 1/7] created bolas unit --- .../UI/cards/icons/icon_card_bolas.png | Bin 0 -> 7547 bytes .../UI/cards/icons/icon_card_bolas.png.meta | 147 ++ Assets/Design/UnitCards/Bolas.asset | 18 + Assets/Design/UnitCards/Bolas.asset.meta | 8 + .../Design/UnitUpgrades/Upgrade_Bolas.asset | 17 + .../UnitUpgrades/Upgrade_Bolas.asset.meta | 8 + Assets/Prefabs/Sticks/bolasStick.prefab | 2119 +++++++++++++++++ Assets/Prefabs/Sticks/bolasStick.prefab.meta | 7 + Assets/Prefabs/Sticks/slingerStick.prefab | 1 + .../UnitPlacementButtons.prefab | 257 +- Assets/Scenes/Game.unity | 64 + 11 files changed, 2603 insertions(+), 43 deletions(-) create mode 100644 Assets/Art/Sprites/UI/cards/icons/icon_card_bolas.png create mode 100644 Assets/Art/Sprites/UI/cards/icons/icon_card_bolas.png.meta create mode 100644 Assets/Design/UnitCards/Bolas.asset create mode 100644 Assets/Design/UnitCards/Bolas.asset.meta create mode 100644 Assets/Design/UnitUpgrades/Upgrade_Bolas.asset create mode 100644 Assets/Design/UnitUpgrades/Upgrade_Bolas.asset.meta create mode 100644 Assets/Prefabs/Sticks/bolasStick.prefab create mode 100644 Assets/Prefabs/Sticks/bolasStick.prefab.meta diff --git a/Assets/Art/Sprites/UI/cards/icons/icon_card_bolas.png b/Assets/Art/Sprites/UI/cards/icons/icon_card_bolas.png new file mode 100644 index 0000000000000000000000000000000000000000..0b8be099e6096a51ec245891124bd5f167f36849 GIT binary patch literal 7547 zcmV->9fabEP)AejDGnAo&6)`A^g1tr8xVBgmjWs5kXqxGpb+fzi_$R-~Zg!JR*_i#47}vPA z-2dKhW?akx1sOzTo^!r~fhq4d^W@&=-uK@78W`xIhaP(9p@$xN=%I%mdg!5t9(w4Z z#{j5EpJ1s>j~3w1I7LQmNO}51)@Z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4yAQuz(`wd5&5aVoL%Wpzz2>$YP6X={K=HTPDzPzU52 zy1WNH^w2{OJ@n8+4?XnILx=c(*j;Y=^<*?&0000EWmrjOO-%qQ00008000000002e RQ Date: Mon, 14 Jul 2025 23:44:00 -0400 Subject: [PATCH 2/7] implemented bolas + status effect mechanic --- Assets/Prefabs/Sticks/bolasStick.prefab | 44 ++-- Assets/Prefabs/bolasProjectile.prefab | 231 ++++++++++++++++++ Assets/Prefabs/bolasProjectile.prefab.meta | 7 + Assets/Scripts/Ally/Ally.cs | 1 - Assets/Scripts/Ally/Bolas.cs | 32 +++ Assets/Scripts/Ally/Bolas.cs.meta | 11 + Assets/Scripts/Entity.cs | 14 +- Assets/Scripts/Enum.cs | 5 + Assets/Scripts/Projectile.cs | 37 +-- Assets/Scripts/Projectile.meta | 8 + Assets/Scripts/Projectile/BolasProjectile.cs | 18 ++ .../Projectile/BolasProjectile.cs.meta | 11 + Assets/Scripts/Root.cs | 3 +- Assets/Scripts/Status.meta | 8 + Assets/Scripts/Status/Slow.cs | 29 +++ Assets/Scripts/Status/Slow.cs.meta | 11 + Assets/Scripts/Status/Status.cs | 26 ++ Assets/Scripts/Status/Status.cs.meta | 11 + Assets/Scripts/StatusHandler.cs | 40 +++ Assets/Scripts/StatusHandler.cs.meta | 11 + 20 files changed, 515 insertions(+), 43 deletions(-) create mode 100644 Assets/Prefabs/bolasProjectile.prefab create mode 100644 Assets/Prefabs/bolasProjectile.prefab.meta create mode 100644 Assets/Scripts/Ally/Bolas.cs create mode 100644 Assets/Scripts/Ally/Bolas.cs.meta create mode 100644 Assets/Scripts/Projectile.meta create mode 100644 Assets/Scripts/Projectile/BolasProjectile.cs create mode 100644 Assets/Scripts/Projectile/BolasProjectile.cs.meta create mode 100644 Assets/Scripts/Status.meta create mode 100644 Assets/Scripts/Status/Slow.cs create mode 100644 Assets/Scripts/Status/Slow.cs.meta create mode 100644 Assets/Scripts/Status/Status.cs create mode 100644 Assets/Scripts/Status/Status.cs.meta create mode 100644 Assets/Scripts/StatusHandler.cs create mode 100644 Assets/Scripts/StatusHandler.cs.meta diff --git a/Assets/Prefabs/Sticks/bolasStick.prefab b/Assets/Prefabs/Sticks/bolasStick.prefab index 3796679..7a0c327 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: 6069600615579642376} + _entityLinked: {fileID: 5530763025372097863} --- !u!1 &1167891119861249516 GameObject: m_ObjectHideFlags: 0 @@ -499,10 +499,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 7468362030574254172} + - component: {fileID: 5530763025372097863} - component: {fileID: 7802907299062813180} - component: {fileID: 1182150014477180862} - component: {fileID: 5931428661698025033} - - component: {fileID: 6069600615579642376} - component: {fileID: 577648786767256172} m_Layer: 0 m_Name: bolasStick @@ -530,6 +530,24 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5530763025372097863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7468362030574254173} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 20821ed53f7f53e4cbdc7b3157c35b97, type: 3} + m_Name: + m_EditorClassIdentifier: + _lifeBar: {fileID: 9115548409632460044} + _hp: 4 + _speed: 0 + _attack_damage: 1 + _attack_interval: 4 + _enemy: {fileID: 0} --- !u!50 &7802907299062813180 Rigidbody2D: serializedVersion: 4 @@ -592,24 +610,6 @@ MonoBehaviour: playableSounds: - {fileID: 11400000, guid: 24352f713d54a924c98784212780e0da, type: 2} - {fileID: 11400000, guid: 155d3b4d90b751748a35f21d3074b910, type: 2} ---- !u!114 &6069600615579642376 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7468362030574254173} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4efc1afdf7c559a4cac25dad0d8917cb, type: 3} - m_Name: - m_EditorClassIdentifier: - _lifeBar: {fileID: 9115548409632460044} - _hp: 4 - _speed: 0 - _attack_damage: 1 - _attack_interval: 4 - _enemy: {fileID: 0} --- !u!82 &577648786767256172 AudioSource: m_ObjectHideFlags: 0 @@ -1963,8 +1963,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c0fbd934c179894458914437255781c4, type: 3} m_Name: m_EditorClassIdentifier: - _entity: {fileID: 6069600615579642376} - _projectile: {fileID: 6962989255644195630, guid: 869a03bba705e8d4485aa73daad773dc, type: 3} + _entity: {fileID: 5530763025372097863} + _projectile: {fileID: 6962989255644195630, guid: 3df5eaab2a4c1d64bba590ed4e1ac0f7, type: 3} _projectileSpawn: {fileID: 7322466304790414952} --- !u!1 &9107841294774877216 GameObject: diff --git a/Assets/Prefabs/bolasProjectile.prefab b/Assets/Prefabs/bolasProjectile.prefab new file mode 100644 index 0000000..306ab67 --- /dev/null +++ b/Assets/Prefabs/bolasProjectile.prefab @@ -0,0 +1,231 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6962989255644195630 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6962989255644195631} + - component: {fileID: -1491803373025033585} + - component: {fileID: 2924140018079318964} + m_Layer: 0 + m_Name: bolasProjectile + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6962989255644195631 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6962989255644195630} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -6.61, y: -0.638, z: 1.8112363} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6962989256011107500} + - {fileID: 6802302589573039538} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &-1491803373025033585 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6962989255644195630} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 4 +--- !u!114 &2924140018079318964 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6962989255644195630} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: af32629f84318134799756134098abf9, type: 3} + m_Name: + m_EditorClassIdentifier: + _detectionLinked: {fileID: 4130391605812397686} + straightProjectile: 1 + _angle: 0 + _speed: 2 + _slowIntensity: 0.25 +--- !u!1 &6962989256011107503 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6962989256011107500} + - component: {fileID: 6962989256011107501} + m_Layer: 0 + m_Name: sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6962989256011107500 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6962989256011107503} + m_LocalRotation: {x: 0, y: -0, z: 0.7071068, w: -0.7071068} + m_LocalPosition: {x: 0.0259, y: 0.01, z: 0} + m_LocalScale: {x: 0.5394133, y: 0.56488746, z: 0.9686} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6962989255644195631} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 270} +--- !u!212 &6962989256011107501 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6962989256011107503} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 364159097 + m_SortingLayer: 1 + m_SortingOrder: 4 + m_Sprite: {fileID: 21300000, guid: b28a7c5aeb45b224983f69339965c55d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1.06, y: 1.69} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &8726647054546243319 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6802302589573039538} + - component: {fileID: 7006189111012443782} + - component: {fileID: 4130391605812397686} + m_Layer: 0 + m_Name: detection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6802302589573039538 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8726647054546243319} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6962989255644195631} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &7006189111012443782 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8726647054546243319} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.16277367, y: 0.016521543} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.3744527, y: 0.17825907} + m_EdgeRadius: 0 +--- !u!114 &4130391605812397686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8726647054546243319} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 531d7966d86bd0c4d83baf58bcb56cd5, type: 3} + m_Name: + m_EditorClassIdentifier: + _entityLinked: {fileID: 0} diff --git a/Assets/Prefabs/bolasProjectile.prefab.meta b/Assets/Prefabs/bolasProjectile.prefab.meta new file mode 100644 index 0000000..f90d30b --- /dev/null +++ b/Assets/Prefabs/bolasProjectile.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3df5eaab2a4c1d64bba590ed4e1ac0f7 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Ally/Ally.cs b/Assets/Scripts/Ally/Ally.cs index 0fcb14b..a29a110 100644 --- a/Assets/Scripts/Ally/Ally.cs +++ b/Assets/Scripts/Ally/Ally.cs @@ -11,7 +11,6 @@ public class Ally : Entity public override float SpeedMultiplier => GlobalConfig.Instance.Current.allySpeedMultiplier; public float PopulationCost => GlobalConfig.Instance.Current.populationCostPerUnit; - public override void Update() { base.Update(); diff --git a/Assets/Scripts/Ally/Bolas.cs b/Assets/Scripts/Ally/Bolas.cs new file mode 100644 index 0000000..c39cfc9 --- /dev/null +++ b/Assets/Scripts/Ally/Bolas.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..656d676 --- /dev/null +++ b/Assets/Scripts/Ally/Bolas.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20821ed53f7f53e4cbdc7b3157c35b97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Entity.cs b/Assets/Scripts/Entity.cs index 943edda..29b3f01 100644 --- a/Assets/Scripts/Entity.cs +++ b/Assets/Scripts/Entity.cs @@ -23,6 +23,10 @@ public abstract class Entity : LevelObject private Shader _shaderSpritesDefault; private SpriteRenderer[] _spriteRenderers; private AudioPlayerComponent _audioPlayerComponent; + private StatusHandler _statusHandler; + + // status modifiers + private float _speedStatusModifier = 1; //Enemy Spotted private bool _isEnemyDetected = false; @@ -36,11 +40,12 @@ public abstract class Entity : LevelObject _spriteRenderers = GetComponentsInChildren(true); _audioPlayerComponent = GetComponent(); Animation = gameObject.AddComponent(); + _statusHandler = gameObject.AddComponent(); } public virtual void Update() { Animation.AttackSpeedMultiplier = AttackSpeedMultiplier; - Animation.SpeedMultiplier = SpeedMultiplier; + Animation.SpeedMultiplier = SpeedMultiplier * SpeedStatusModifier; _lifeBar.gameObject.SetActive(_lifeBar.value <= 0.99f); } @@ -121,7 +126,7 @@ public abstract class Entity : LevelObject public int Hp => (int)(_hp * HpMultiplier); - public float Speed => _speed * SpeedMultiplier; + public float Speed => _speed * SpeedMultiplier * SpeedStatusModifier; public int AttackDamage { @@ -157,6 +162,11 @@ public abstract class Entity : LevelObject public SpriteRenderer[] SpriteRenderers { get { return _spriteRenderers; } } + public StatusHandler StatusHandler { + get => _statusHandler; + } + public float SpeedStatusModifier { get => _speedStatusModifier; set => _speedStatusModifier = value; } + #region [LevelManager code] public override bool Equals(ILevelObject other) { diff --git a/Assets/Scripts/Enum.cs b/Assets/Scripts/Enum.cs index 08bcd5c..e4cd7ed 100644 --- a/Assets/Scripts/Enum.cs +++ b/Assets/Scripts/Enum.cs @@ -13,4 +13,9 @@ public class Enum Farm = 2, BerryBush = 3 } + public enum StatusType + { + Slow = 0, + SpeedBoost = 1, + } } diff --git a/Assets/Scripts/Projectile.cs b/Assets/Scripts/Projectile.cs index f513ef9..1338c7b 100644 --- a/Assets/Scripts/Projectile.cs +++ b/Assets/Scripts/Projectile.cs @@ -22,7 +22,7 @@ public class Projectile : MonoBehaviour private Vector2 _vectorStart; private Vector2 _vectorEnd; - + private int _damage; private float _enemySpeed; private Entity _target; @@ -38,14 +38,14 @@ public class Projectile : MonoBehaviour private float _initialXDistance; private float _initialYDistance; - private void Start() + private void Start() { _rigidbodyProjectile = GetComponent(); _initialX = transform.position.x; _initialY = transform.position.y; _destinationX = _vectorEnd.x - _initialX - _enemySpeed; _destinationY = _vectorEnd.y - _initialY; - + _detectionLinked.gameObject.GetComponent().EntityLinked = _target; _detectionLinked.gameObject.GetComponent().ProjectileDamage = _damage; @@ -53,13 +53,13 @@ public class Projectile : MonoBehaviour _initialYDistance = Mathf.Abs(_initialY - _destinationY); } - private void Update() + protected virtual void Update() { if (straightProjectile) { - transform.position = Vector2.Lerp(new Vector2(_initialX, _initialY), - new Vector2(_vectorEnd.x, _vectorEnd.y), _time/_duration); + transform.position = Vector2.Lerp(new Vector2(_initialX, _initialY), + new Vector2(_vectorEnd.x, _vectorEnd.y), _time / _duration); DetStraigthArrowAngle(); @@ -70,15 +70,16 @@ public class Projectile : MonoBehaviour if (transform.position.x >= _vectorEnd.x) { + ApplyEffects(); Destroy(this.gameObject); } return; } float x = _speedTime; - float y = (_angle*-Mathf.Pow(x, 2) + _destinationX * x); + float y = (_angle * -Mathf.Pow(x, 2) + _destinationX * x); - transform.position = new Vector2(_initialX + x*_angle, _initialY + y); + transform.position = new Vector2(_initialX + x * _angle, _initialY + y); // Move projectile angle according to distance with target float lerpStep = (_destinationX - transform.position.x) / _initialXDistance; @@ -87,19 +88,20 @@ public class Projectile : MonoBehaviour _speedTime += _speed * Time.deltaTime; - if(y < 0) { + if (y < 0) + { Destroy(this.gameObject); } } - private void DetStraigthArrowAngle() + protected virtual void DetStraigthArrowAngle() { - if(_target != null) _enemyPosY = _target.Position.y; + if (_target != null) _enemyPosY = _target.Position.y; float angleX = (_destinationX) / _initialXDistance; float angleY = (_destinationY) / _initialYDistance; - + //Obtenir la difference entre la position Y du chateau et de l'ennemie. float diffY = transform.position.y - _enemyPosY; @@ -114,23 +116,26 @@ public class Projectile : MonoBehaviour //Si cette distance est plus petite qu'un certain nombre, on utilise un calcul differents //pour determine l'angle que la fleche doit prendre. if (angleX > 0.23) lerpStepS = Mathf.Rad2Deg * Mathf.Atan(angleX / angleY); - + //Si la position est negative, on utilise un calcul different pour determiner l'angle. //(Il faudra tester si ca marche lorsque le chateau pourrait tirer en arriere). else if (angleX >= 0) lerpStepS = Mathf.Rad2Deg * Mathf.Atan(angleY / angleX); //Calcul utilise pour tenter de mieux faire fonctionner l'angle de la fleche lorsque l'ennemi est //proche de l'unite. - else { + else + { lerpStepS = -Mathf.Rad2Deg * Mathf.Atan(angleY / angleX); - } - + } + float angleS = Mathf.Lerp(lerpStepS, 0, 0); transform.eulerAngles = new Vector3(0, 0, angleS); } } + protected virtual void ApplyEffects() { } + //Getter and Setter public float EnemySpeed { diff --git a/Assets/Scripts/Projectile.meta b/Assets/Scripts/Projectile.meta new file mode 100644 index 0000000..579c88f --- /dev/null +++ b/Assets/Scripts/Projectile.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 796c5970b01ebd249b04e1a0598abc7c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Projectile/BolasProjectile.cs b/Assets/Scripts/Projectile/BolasProjectile.cs new file mode 100644 index 0000000..4107b6a --- /dev/null +++ b/Assets/Scripts/Projectile/BolasProjectile.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BolasProjectile : Projectile +{ + [SerializeField] + private float _slowIntensity = 0.25f; + private float _slowDuration = 5f; + + protected override void ApplyEffects() + { + if (Target.StatusHandler) + { + Target.StatusHandler.ApplySlow(_slowIntensity, _slowDuration); + } + } +} diff --git a/Assets/Scripts/Projectile/BolasProjectile.cs.meta b/Assets/Scripts/Projectile/BolasProjectile.cs.meta new file mode 100644 index 0000000..fd0561e --- /dev/null +++ b/Assets/Scripts/Projectile/BolasProjectile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af32629f84318134799756134098abf9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Root.cs b/Assets/Scripts/Root.cs index 338cc8f..b5a6d3e 100644 --- a/Assets/Scripts/Root.cs +++ b/Assets/Scripts/Root.cs @@ -41,8 +41,7 @@ public class Root : MonoBehaviour _newArrow.GetComponent().EnemySpeed = _entity.Enemy.Speed; _newArrow.GetComponent().VectorStart = _rigidbodyAlly.position; _newArrow.GetComponent().VectorEnd = _rigidbodyOpponent.position; - _newArrow.GetComponent().Target = _entity.Enemy; - + _newArrow.GetComponent().Target = _entity.Enemy; } public void PlaySound(string soundName) diff --git a/Assets/Scripts/Status.meta b/Assets/Scripts/Status.meta new file mode 100644 index 0000000..d472446 --- /dev/null +++ b/Assets/Scripts/Status.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53425a7650ca89b438da0796d0bd79ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Status/Slow.cs b/Assets/Scripts/Status/Slow.cs new file mode 100644 index 0000000..e282926 --- /dev/null +++ b/Assets/Scripts/Status/Slow.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Slow : Status +{ + private float _speedModifier; + + public override void Apply(float duration) + { + _duration += duration; + EntityLinked.SpeedStatusModifier *= _speedModifier; + } + + public override void Unapply() + { + EntityLinked.SpeedStatusModifier /= _speedModifier; + Destroy(this); + } + + /// + /// A higher intensity results in a stronger slow. + /// Example: An intensity of 0.99 multiplies the entity's speed by 0.01 (which would result in a really low speed) + /// + public float Intensity { + get => 1 - _speedModifier; + set => _speedModifier = _speedModifier == 0 ? 1 - value : _speedModifier + (1 - _speedModifier) * value; + } +} diff --git a/Assets/Scripts/Status/Slow.cs.meta b/Assets/Scripts/Status/Slow.cs.meta new file mode 100644 index 0000000..6904878 --- /dev/null +++ b/Assets/Scripts/Status/Slow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b89154fc4d657474e988151a13f82fc5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Status/Status.cs b/Assets/Scripts/Status/Status.cs new file mode 100644 index 0000000..7cf9095 --- /dev/null +++ b/Assets/Scripts/Status/Status.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class Status : MonoBehaviour +{ + private Entity entityLinked; + protected float _duration; + + protected virtual void Start() + { + EntityLinked = GetComponent(); + } + + protected virtual void Update() + { + _duration -= Time.deltaTime; + if ( _duration < 0 ) Unapply(); + } + + public abstract void Apply(float duration); + public abstract void Unapply(); + + public Entity EntityLinked { get => entityLinked; set => entityLinked = value; } + +} diff --git a/Assets/Scripts/Status/Status.cs.meta b/Assets/Scripts/Status/Status.cs.meta new file mode 100644 index 0000000..c0841ee --- /dev/null +++ b/Assets/Scripts/Status/Status.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8cd371169b5f23347994997e816d1d0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs new file mode 100644 index 0000000..3298566 --- /dev/null +++ b/Assets/Scripts/StatusHandler.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class StatusHandler : MonoBehaviour +{ + private Entity _entityLinked; + private Dictionary activeStatuses = new(); + + public void ApplySlow(float intensity, float duration) + { + Slow slow = (Slow)GetStatus(Enum.StatusType.Slow); + slow.Intensity = intensity; + slow.Apply(duration); + } + + // please add status to switch case everytime you design one! + private Status GetStatus(Enum.StatusType type) + { + Status status; + activeStatuses.TryGetValue(Enum.StatusType.Slow, out status); + if (!status) + { + switch (type) + { + case Enum.StatusType.Slow: + status = gameObject.AddComponent(); + break; + default: break; + } + } + status.EntityLinked = _entityLinked; + return status; + } + + private void Start() + { + _entityLinked = gameObject.GetComponent(); ; + } +} diff --git a/Assets/Scripts/StatusHandler.cs.meta b/Assets/Scripts/StatusHandler.cs.meta new file mode 100644 index 0000000..375babf --- /dev/null +++ b/Assets/Scripts/StatusHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1a590a40aadfa24ab3c0d725467255f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- 2.34.1 From 2cfeb398cac7fcd17d7d00abd5a4d971c7ce9531 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 15 Jul 2025 00:17:29 -0400 Subject: [PATCH 3/7] cleaned up and commented bolas --- Assets/Prefabs/Sticks/bolasStick.prefab | 10 +++--- Assets/Prefabs/bolasProjectile.prefab | 1 + Assets/Scripts/Ally/Bolas.cs | 32 -------------------- Assets/Scripts/Ally/Bolas.cs.meta | 11 ------- Assets/Scripts/Projectile.cs | 1 + Assets/Scripts/Projectile/BolasProjectile.cs | 1 + Assets/Scripts/Status/Slow.cs | 6 ++++ Assets/Scripts/Status/Status.cs | 1 + Assets/Scripts/StatusHandler.cs | 5 +++ 9 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 Assets/Scripts/Ally/Bolas.cs delete mode 100644 Assets/Scripts/Ally/Bolas.cs.meta 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); } -- 2.34.1 From 747fc76846daca347b593d7cf9e5bd3a13459b1c Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 15 Jul 2025 00:47:52 -0400 Subject: [PATCH 4/7] fixed bug relating to bolas slow duration --- Assets/Prefabs/bolasProjectile.prefab | 2 +- Assets/Scripts/Status/Slow.cs | 19 +++++++++++++------ Assets/Scripts/StatusHandler.cs | 8 ++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/bolasProjectile.prefab b/Assets/Prefabs/bolasProjectile.prefab index 9a25838..5288fd8 100644 --- a/Assets/Prefabs/bolasProjectile.prefab +++ b/Assets/Prefabs/bolasProjectile.prefab @@ -73,7 +73,7 @@ MonoBehaviour: _angle: 0 _speed: 2 _slowIntensity: 0.25 - _slowDuration: 10 + _slowDuration: 5 --- !u!1 &6962989256011107503 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Status/Slow.cs b/Assets/Scripts/Status/Slow.cs index 6304903..098ad06 100644 --- a/Assets/Scripts/Status/Slow.cs +++ b/Assets/Scripts/Status/Slow.cs @@ -1,24 +1,31 @@ using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting.YamlDotNet.Core.Tokens; using UnityEngine; public class Slow : Status { - private float _speedModifier; + private float _latestSpeedModifier; + private float _cumulativeSpeedModifier = 1; public override void Apply(float duration) { // reset slow duration - _duration += duration; + _duration = Mathf.Max(_duration, duration); // slow entity - EntityLinked.SpeedStatusModifier *= _speedModifier; + EntityLinked.SpeedStatusModifier *= _latestSpeedModifier; + + // store cumulative speed modifier to revert it later + _cumulativeSpeedModifier *= _latestSpeedModifier; } public override void Unapply() { // bring entity to normal speed - EntityLinked.SpeedStatusModifier /= _speedModifier; + Debug.Log(EntityLinked.SpeedStatusModifier); + EntityLinked.SpeedStatusModifier /= _cumulativeSpeedModifier; + Debug.Log(EntityLinked.SpeedStatusModifier); // stop effect Destroy(this); @@ -29,7 +36,7 @@ public class Slow : Status /// Example: An intensity of 0.99 multiplies the entity's speed by 0.01 (which would result in a really low speed) /// public float Intensity { - get => 1 - _speedModifier; - set => _speedModifier = _speedModifier == 0 ? 1 - value : _speedModifier + (1 - _speedModifier) * value; + get => 1 - _latestSpeedModifier; + set => _latestSpeedModifier = 1 - value; } } diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs index a8f7a9e..6b948ea 100644 --- a/Assets/Scripts/StatusHandler.cs +++ b/Assets/Scripts/StatusHandler.cs @@ -23,7 +23,11 @@ public class StatusHandler : MonoBehaviour private Status GetStatus(Enum.StatusType type) { Status status; + + // check if status already exists activeStatuses.TryGetValue(Enum.StatusType.Slow, out status); + + // if status doesn't exist, create it if (!status) { switch (type) @@ -33,8 +37,12 @@ public class StatusHandler : MonoBehaviour break; default: break; } + activeStatuses.Add(type, status); } + + // link entity to status status.EntityLinked = _entityLinked; + return status; } -- 2.34.1 From a1a2823a96d7a2f3dc3c84499581ed7df6f5f6cd Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 15 Jul 2025 01:14:54 -0400 Subject: [PATCH 5/7] tweaked slow stacking logic --- Assets/Scripts/Entity.cs | 2 +- Assets/Scripts/Status/Slow.cs | 26 ++++++++++++++------------ Assets/Scripts/StatusHandler.cs | 9 +++++++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/Entity.cs b/Assets/Scripts/Entity.cs index 29b3f01..a1f2f25 100644 --- a/Assets/Scripts/Entity.cs +++ b/Assets/Scripts/Entity.cs @@ -26,7 +26,7 @@ public abstract class Entity : LevelObject private StatusHandler _statusHandler; // status modifiers - private float _speedStatusModifier = 1; + private float _speedStatusModifier = 1f; //Enemy Spotted private bool _isEnemyDetected = false; diff --git a/Assets/Scripts/Status/Slow.cs b/Assets/Scripts/Status/Slow.cs index 098ad06..01be7d2 100644 --- a/Assets/Scripts/Status/Slow.cs +++ b/Assets/Scripts/Status/Slow.cs @@ -5,8 +5,8 @@ using UnityEngine; public class Slow : Status { - private float _latestSpeedModifier; - private float _cumulativeSpeedModifier = 1; + private float _previousSpeedModifier = 1f; + private float _speedModifier = 1f; public override void Apply(float duration) { @@ -14,18 +14,15 @@ public class Slow : Status _duration = Mathf.Max(_duration, duration); // slow entity - EntityLinked.SpeedStatusModifier *= _latestSpeedModifier; - - // store cumulative speed modifier to revert it later - _cumulativeSpeedModifier *= _latestSpeedModifier; + EntityLinked.SpeedStatusModifier /= _previousSpeedModifier; + Debug.Log(_speedModifier); + EntityLinked.SpeedStatusModifier *= _speedModifier; } public override void Unapply() { // bring entity to normal speed - Debug.Log(EntityLinked.SpeedStatusModifier); - EntityLinked.SpeedStatusModifier /= _cumulativeSpeedModifier; - Debug.Log(EntityLinked.SpeedStatusModifier); + EntityLinked.SpeedStatusModifier /= _speedModifier; // stop effect Destroy(this); @@ -35,8 +32,13 @@ public class Slow : Status /// A higher intensity results in a stronger slow. /// Example: An intensity of 0.99 multiplies the entity's speed by 0.01 (which would result in a really low speed) /// - public float Intensity { - get => 1 - _latestSpeedModifier; - set => _latestSpeedModifier = 1 - value; + public float Intensity + { + get => 1 - _speedModifier; + set + { + _previousSpeedModifier = _speedModifier; + _speedModifier = Mathf.Min(_speedModifier, 1 - value); + } } } diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs index 6b948ea..13ac9f6 100644 --- a/Assets/Scripts/StatusHandler.cs +++ b/Assets/Scripts/StatusHandler.cs @@ -27,7 +27,7 @@ public class StatusHandler : MonoBehaviour // check if status already exists activeStatuses.TryGetValue(Enum.StatusType.Slow, out status); - // if status doesn't exist, create it + // if status doesn't exist, instantiate it if (!status) { switch (type) @@ -37,7 +37,12 @@ public class StatusHandler : MonoBehaviour break; default: break; } - activeStatuses.Add(type, status); + + // if key value pair doesn't exist, create it + if (!activeStatuses.ContainsKey(type)) + { + activeStatuses.Add(type, status); + } } // link entity to status -- 2.34.1 From 2475a5289e3ee6efac8b157ea750e15ea0d5c6e6 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 15 Jul 2025 01:37:28 -0400 Subject: [PATCH 6/7] fix bug relating to slow effect stacking --- Assets/Scripts/Status/Slow.cs | 1 - Assets/Scripts/Status/Status.cs | 1 + Assets/Scripts/StatusHandler.cs | 7 ++++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Status/Slow.cs b/Assets/Scripts/Status/Slow.cs index 01be7d2..bc4b4f3 100644 --- a/Assets/Scripts/Status/Slow.cs +++ b/Assets/Scripts/Status/Slow.cs @@ -15,7 +15,6 @@ public class Slow : Status // slow entity EntityLinked.SpeedStatusModifier /= _previousSpeedModifier; - Debug.Log(_speedModifier); EntityLinked.SpeedStatusModifier *= _speedModifier; } diff --git a/Assets/Scripts/Status/Status.cs b/Assets/Scripts/Status/Status.cs index c331c20..fd7ea92 100644 --- a/Assets/Scripts/Status/Status.cs +++ b/Assets/Scripts/Status/Status.cs @@ -5,6 +5,7 @@ using UnityEngine; public abstract class Status : MonoBehaviour { private Entity entityLinked; + [SerializeField] protected float _duration; protected virtual void Start() diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs index 13ac9f6..6f4b85d 100644 --- a/Assets/Scripts/StatusHandler.cs +++ b/Assets/Scripts/StatusHandler.cs @@ -25,7 +25,7 @@ public class StatusHandler : MonoBehaviour Status status; // check if status already exists - activeStatuses.TryGetValue(Enum.StatusType.Slow, out status); + activeStatuses.TryGetValue(type, out status); // if status doesn't exist, instantiate it if (!status) @@ -39,10 +39,15 @@ public class StatusHandler : MonoBehaviour } // if key value pair doesn't exist, create it + // else update the existing one if (!activeStatuses.ContainsKey(type)) { activeStatuses.Add(type, status); } + else + { + activeStatuses[type] = status; + } } // link entity to status -- 2.34.1 From 52cb78bf426b6253c4193cb1791113ce6aed47f4 Mon Sep 17 00:00:00 2001 From: Adam Salah Date: Tue, 22 Jul 2025 03:15:19 -0400 Subject: [PATCH 7/7] small review changes --- Assets/Scenes/Game.unity | 74 +++++++++++++++++---------------- Assets/Scripts/Projectile.cs | 2 +- Assets/Scripts/Status/Status.cs | 4 +- Assets/Scripts/StatusHandler.cs | 2 +- 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 2d4dd3b..50f2f48 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -3159,11 +3159,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 703543387231767793, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 703543387231767793, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 703543387231767793, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3171,15 +3171,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 703543387231767793, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -6.0372024 objectReference: {fileID: 0} - target: {fileID: 708615230013985822, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 708615230013985822, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 708615230013985822, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3187,7 +3187,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 708615230013985822, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -26.874405 objectReference: {fileID: 0} - target: {fileID: 907652128201574320, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_IsActive @@ -3231,11 +3231,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 907652128862280229, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 907652128862280229, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 907652128862280229, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3243,7 +3243,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 907652128862280229, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -5 objectReference: {fileID: 0} - target: {fileID: 1361171379191865150, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y @@ -3343,11 +3343,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3181429381540750253, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3181429381540750253, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3181429381540750253, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3355,7 +3355,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3181429381540750253, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -47.711605 objectReference: {fileID: 0} - target: {fileID: 3964878483247902818, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y @@ -3495,11 +3495,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5139721980499987197, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5139721980499987197, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5139721980499987197, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3507,15 +3507,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5139721980499987197, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -47.711605 objectReference: {fileID: 0} - target: {fileID: 5316389173819650276, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5316389173819650276, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5316389173819650276, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3523,15 +3523,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5316389173819650276, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -26.874405 objectReference: {fileID: 0} - target: {fileID: 5319145879937787915, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5319145879937787915, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5319145879937787915, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3539,7 +3539,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5319145879937787915, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -6.0372024 objectReference: {fileID: 0} - target: {fileID: 5639720393060989426, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y @@ -3575,11 +3575,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5639720394252960041, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5639720394252960041, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5639720394252960041, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3587,7 +3587,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5639720394252960041, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -103.3 objectReference: {fileID: 0} - target: {fileID: 7106892478087422172, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y @@ -3607,11 +3607,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7106892479276285262, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7106892479276285262, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7106892479276285262, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3619,7 +3619,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7106892479276285262, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -26.874405 objectReference: {fileID: 0} - target: {fileID: 7106892479944355554, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y @@ -3671,11 +3671,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7112938881271752097, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7112938881271752097, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7112938881271752097, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3683,15 +3683,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7112938881271752097, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y + value: -6.0372024 + objectReference: {fileID: 0} + - target: {fileID: 7488888111208117106, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} + propertyPath: m_IsActive value: 0 objectReference: {fileID: 0} - target: {fileID: 7488888111208117109, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7488888111208117109, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7488888111208117109, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3699,15 +3703,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7488888111208117109, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -299.90002 objectReference: {fileID: 0} - target: {fileID: 7797049475554395991, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7797049475554395991, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7797049475554395991, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.x @@ -3715,7 +3719,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7797049475554395991, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -47.711605 objectReference: {fileID: 0} - target: {fileID: 8992921944992653498, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3} propertyPath: m_AnchorMax.y diff --git a/Assets/Scripts/Projectile.cs b/Assets/Scripts/Projectile.cs index 271490d..5862d26 100644 --- a/Assets/Scripts/Projectile.cs +++ b/Assets/Scripts/Projectile.cs @@ -53,7 +53,7 @@ public class Projectile : MonoBehaviour _initialYDistance = Mathf.Abs(_initialY - _destinationY); } - protected virtual void Update() + private void Update() { if (straightProjectile) { diff --git a/Assets/Scripts/Status/Status.cs b/Assets/Scripts/Status/Status.cs index fd7ea92..8fb9721 100644 --- a/Assets/Scripts/Status/Status.cs +++ b/Assets/Scripts/Status/Status.cs @@ -8,12 +8,12 @@ public abstract class Status : MonoBehaviour [SerializeField] protected float _duration; - protected virtual void Start() + private void Start() { EntityLinked = GetComponent(); } - protected virtual void Update() + private void Update() { // effect timer _duration -= Time.deltaTime; diff --git a/Assets/Scripts/StatusHandler.cs b/Assets/Scripts/StatusHandler.cs index 6f4b85d..119b1b3 100644 --- a/Assets/Scripts/StatusHandler.cs +++ b/Assets/Scripts/StatusHandler.cs @@ -58,6 +58,6 @@ public class StatusHandler : MonoBehaviour private void Start() { - _entityLinked = gameObject.GetComponent(); ; + _entityLinked = gameObject.GetComponent(); } } -- 2.34.1