From 592a55cecc6101607eb98994aae0adbf026678c5 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 29 Sep 2025 15:41:16 +0100 Subject: [PATCH] Event Driven Broker working --- Assets/--2025/Prefabs.meta | 8 + Assets/--2025/Prefabs/BrokerSubs.meta | 8 + .../BrokerSubs/BrokerSubscribers.prefab | 490 ++++++++++++++++++ .../BrokerSubs/BrokerSubscribers.prefab.meta | 7 + .../Panoramics/FS002/FS002_Night.mat | 2 +- .../Bosses/BossEnemyPrefabTemplate.prefab | 65 ++- .../Enemies/BasicEnemyPrefabTemplate.prefab | 78 ++- Assets/Resources/PlayerPrefab.prefab | 78 ++- .../Scripts/AbilitySystem/Base/BaseEffect.cs | 2 +- Assets/Scripts/AbilitySystem/DamageType.cs | 2 +- .../AbilitySystem/Effects/AbsorbEffect.cs | 8 +- .../Effects/AbsorbEffectInstance.cs | 4 +- .../Effects/DamageIncomeModifierEffect.cs | 8 +- .../DamageIncomeModifierEffectInstance.cs | 4 +- .../Effects/DamageOutputModifierEffect.cs | 8 +- .../DamageOutputModifierEffectInstance.cs | 4 +- .../Effects/DamageOverTimeEffect.cs | 8 +- .../Effects/InstantValueEffect.cs | 74 ++- .../Effects/MovementSpeedModifierEffect.cs | 8 +- .../MovementSpeedModifierEffectInstance.cs | 4 +- .../Effects/OverTimeValueEffect.cs | 2 +- .../AbilitySystem/Effects/StatusEffect.cs | 4 +- .../Effects/StatusEffectInstance.cs | 2 +- .../AbilitySystem/Effects/TauntEffect.cs | 2 +- Assets/Scripts/EntityBroker.meta | 8 + .../Scripts/EntityBroker/AbsorbInterceptor.cs | 13 + .../EntityBroker/AbsorbInterceptor.cs.meta | 2 + .../BasicStatAmplificationCalculator.cs | 54 ++ .../BasicStatAmplificationCalculator.cs.meta | 2 + .../BasicStatMitigationCalculator.cs | 46 ++ .../BasicStatMitigationCalculator.cs.meta | 2 + .../Scripts/EntityBroker/BlockInterceptor.cs | 55 ++ .../EntityBroker/BlockInterceptor.cs.meta | 2 + .../Scripts/EntityBroker/BrokerInterceptor.cs | 17 + .../EntityBroker/BrokerInterceptor.cs.meta | 2 + Assets/Scripts/EntityBroker/DebugBroker.cs | 23 + .../Scripts/EntityBroker/DebugBroker.cs.meta | 2 + .../Scripts/EntityBroker/DodgeInterceptor.cs | 38 ++ .../EntityBroker/DodgeInterceptor.cs.meta | 2 + .../InvulnerabilityInterceptor.cs | 33 ++ .../InvulnerabilityInterceptor.cs.meta | 2 + .../Scripts/EntityBroker/OnProcInterceptor.cs | 30 ++ .../EntityBroker/OnProcInterceptor.cs.meta | 2 + .../EntityBroker/ScrollingTextInterceptor.cs | 78 +++ .../ScrollingTextInterceptor.cs.meta | 2 + .../EventDrivenHooks/EntityEventBroker.cs | 19 + .../EventDrivenHooks/EventBrokerArgs.cs | 38 +- Assets/Scripts/Game/GameConstants.cs | 17 + Assets/Scripts/Health.cs | 155 ++---- .../Networking/NetworkedAreaOfEffect.cs | 2 +- .../NetworkedAreaOfEffectOverTime.cs | 2 +- .../Networking/NetworkedBaseAbility.cs | 2 +- .../Scripts/Networking/NetworkedChanneling.cs | 2 +- .../Networking/NetworkedDrainProjectile.cs | 2 +- .../Scripts/Networking/NetworkedProjectile.cs | 2 +- ...ectileAreaOfEffectOverTimeWithTickEvent.cs | 2 +- Assets/Scripts/Networking/NetworkedSlash.cs | 2 +- .../NetworkedSlashWithOnHitEvent.cs | 2 +- 58 files changed, 1375 insertions(+), 167 deletions(-) create mode 100644 Assets/--2025/Prefabs.meta create mode 100644 Assets/--2025/Prefabs/BrokerSubs.meta create mode 100644 Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab create mode 100644 Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab.meta create mode 100644 Assets/Scripts/EntityBroker.meta create mode 100644 Assets/Scripts/EntityBroker/AbsorbInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/AbsorbInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs create mode 100644 Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs.meta create mode 100644 Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs create mode 100644 Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs.meta create mode 100644 Assets/Scripts/EntityBroker/BlockInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/BlockInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/BrokerInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/BrokerInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/DebugBroker.cs create mode 100644 Assets/Scripts/EntityBroker/DebugBroker.cs.meta create mode 100644 Assets/Scripts/EntityBroker/DodgeInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/DodgeInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/OnProcInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/OnProcInterceptor.cs.meta create mode 100644 Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs create mode 100644 Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs.meta diff --git a/Assets/--2025/Prefabs.meta b/Assets/--2025/Prefabs.meta new file mode 100644 index 00000000..52a333b6 --- /dev/null +++ b/Assets/--2025/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c66a065b0cc34174380bf1111aa72616 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/--2025/Prefabs/BrokerSubs.meta b/Assets/--2025/Prefabs/BrokerSubs.meta new file mode 100644 index 00000000..5bf7cc5d --- /dev/null +++ b/Assets/--2025/Prefabs/BrokerSubs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6543c8250c403db4b8b8535b3d1be177 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab b/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab new file mode 100644 index 00000000..602ea664 --- /dev/null +++ b/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab @@ -0,0 +1,490 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &249077042724776013 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1695802727639733595} + m_Layer: 0 + m_Name: BrokerSubscribers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1695802727639733595 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249077042724776013} + serializedVersion: 2 + 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: + - {fileID: 2853615639420944899} + - {fileID: 1232807570145535296} + - {fileID: 6120897361266337676} + - {fileID: 1697226282428441736} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1733137101069889769 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5990858872549904705} + - component: {fileID: 2494219991902293302} + m_Layer: 0 + m_Name: DodgeInterceptor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5990858872549904705 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1733137101069889769} + serializedVersion: 2 + 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: 1232807570145535296} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2494219991902293302 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1733137101069889769} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8d39f28a2e6c02142bc8324864197f17, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::DodgeInterceptor +--- !u!1 &2318014710392499544 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1232807570145535296} + m_Layer: 0 + m_Name: Defensive + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1232807570145535296 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2318014710392499544} + serializedVersion: 2 + 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: + - {fileID: 6328867119063477148} + - {fileID: 5990858872549904705} + - {fileID: 6088225706018485977} + - {fileID: 5849716072256962441} + - {fileID: 8352337540601452143} + m_Father: {fileID: 1695802727639733595} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2724019130660558827 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6328867119063477148} + - component: {fileID: 5855006294068340926} + m_Layer: 0 + m_Name: Invulnerability Interceptor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6328867119063477148 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2724019130660558827} + serializedVersion: 2 + 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: 1232807570145535296} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5855006294068340926 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2724019130660558827} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70d74dc17186ed945a577a1128c5abcf, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::InvulnerabilityInterceptor +--- !u!1 &4243324413299554944 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6088225706018485977} + - component: {fileID: 8776386938783335057} + m_Layer: 0 + m_Name: BlockInterceptor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6088225706018485977 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4243324413299554944} + serializedVersion: 2 + 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: 1232807570145535296} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8776386938783335057 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4243324413299554944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de50151b619d6514ab411a712451bceb, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::BlockInterceptor +--- !u!1 &5545969874706421989 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3145042774550608289} + - component: {fileID: 7287908039399585062} + m_Layer: 0 + m_Name: OnProcInterceptor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3145042774550608289 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5545969874706421989} + serializedVersion: 2 + 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: 2853615639420944899} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7287908039399585062 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5545969874706421989} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 64dc3a191522d6a419b6c81e6124b294, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnProcInterceptor +--- !u!1 &6223985906228516018 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 670601208020570842} + - component: {fileID: 7962962154595671713} + m_Layer: 0 + m_Name: Stat Amplification Calculator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &670601208020570842 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6223985906228516018} + serializedVersion: 2 + 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: 2853615639420944899} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7962962154595671713 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6223985906228516018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c7b2480158261a438df4665d65f6dad, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::DamageStatInfluenceCalculator +--- !u!1 &6616939419038775985 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5849716072256962441} + - component: {fileID: 7027586121535414508} + m_Layer: 0 + m_Name: Stat Mitigation Calculator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5849716072256962441 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6616939419038775985} + serializedVersion: 2 + 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: 1232807570145535296} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7027586121535414508 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6616939419038775985} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1c1e936b3b0b3bb4ebb8f7712f4a9519, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::MitigationStatInfluenceCalculator +--- !u!1 &6704403151289934996 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2853615639420944899} + m_Layer: 0 + m_Name: Offensive + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2853615639420944899 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6704403151289934996} + serializedVersion: 2 + 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: + - {fileID: 670601208020570842} + - {fileID: 3145042774550608289} + m_Father: {fileID: 1695802727639733595} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8090521145083935055 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1697226282428441736} + - component: {fileID: 8950652633152938477} + m_Layer: 0 + m_Name: ScrollingText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1697226282428441736 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8090521145083935055} + serializedVersion: 2 + 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: 1695802727639733595} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8950652633152938477 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8090521145083935055} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2e114c4f93ba174094e346fbcc13b35, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::ScrollingTextInterceptor + scrollingTextPrefab: {fileID: 677595231222924942, guid: abe5cfbb1d6d9454aa835afceb136dcf, type: 3} +--- !u!1 &8129443511885267172 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6120897361266337676} + - component: {fileID: 5941911214416994426} + m_Layer: 0 + m_Name: debugger + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6120897361266337676 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8129443511885267172} + serializedVersion: 2 + 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: 1695802727639733595} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5941911214416994426 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8129443511885267172} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c8f1bcfcc537b724790bed2579b95d27, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::DebugBroker +--- !u!1 &8299296301867067610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8352337540601452143} + m_Layer: 0 + m_Name: AbsorbInterceptor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8352337540601452143 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8299296301867067610} + serializedVersion: 2 + 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: 1232807570145535296} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab.meta b/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab.meta new file mode 100644 index 00000000..979c18e2 --- /dev/null +++ b/Assets/--2025/Prefabs/BrokerSubs/BrokerSubscribers.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5af9cc65c5861e64389b48c310b2a507 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fantasy Skybox FREE/Panoramics/FS002/FS002_Night.mat b/Assets/Fantasy Skybox FREE/Panoramics/FS002/FS002_Night.mat index 5fbd2a63..180522f4 100644 --- a/Assets/Fantasy Skybox FREE/Panoramics/FS002/FS002_Night.mat +++ b/Assets/Fantasy Skybox FREE/Panoramics/FS002/FS002_Night.mat @@ -78,7 +78,7 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _Rotation: 44.39648 + - _Rotation: 4.523739 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 diff --git a/Assets/Resources/Bosses/BossEnemyPrefabTemplate.prefab b/Assets/Resources/Bosses/BossEnemyPrefabTemplate.prefab index d1270d71..713b0353 100644 --- a/Assets/Resources/Bosses/BossEnemyPrefabTemplate.prefab +++ b/Assets/Resources/Bosses/BossEnemyPrefabTemplate.prefab @@ -181,6 +181,7 @@ Transform: - {fileID: 3432148482415062284} - {fileID: 3750971928869404957} - {fileID: 7838257382413254639} + - {fileID: 3836317520712105059} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2278116590711127941 @@ -302,14 +303,12 @@ MonoBehaviour: onResourceChanged: m_PersistentCalls: m_Calls: [] - scrollingTextPrefab: {fileID: 677595231222924942, guid: abe5cfbb1d6d9454aa835afceb136dcf, type: 3} onMaxHealthChanged: m_PersistentCalls: m_Calls: [] onDeath: m_PersistentCalls: m_Calls: [] - invulnerable: 0 OnInvulnerabilityStateChanged: m_PersistentCalls: m_Calls: [] @@ -2719,6 +2718,68 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 4924407620164273521, guid: 2e56f69e0872f744daa6c9080ecf3040, type: 3} m_PrefabInstance: {fileID: 2278116590852655140} m_PrefabAsset: {fileID: 0} +--- !u!1001 &2501157974374623544 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2278116590711127942} + m_Modifications: + - target: {fileID: 249077042724776013, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_Name + value: BrokerSubscribers + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} +--- !u!4 &3836317520712105059 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + m_PrefabInstance: {fileID: 2501157974374623544} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2530550917352013872 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Enemies/BasicEnemyPrefabTemplate.prefab b/Assets/Resources/Enemies/BasicEnemyPrefabTemplate.prefab index 801d179c..4556a928 100644 --- a/Assets/Resources/Enemies/BasicEnemyPrefabTemplate.prefab +++ b/Assets/Resources/Enemies/BasicEnemyPrefabTemplate.prefab @@ -210,6 +210,7 @@ GameObject: - component: {fileID: 1708233211970282804} - component: {fileID: 3548758441599693011} - component: {fileID: 1708233211970282803} + - component: {fileID: 891689845601428566} - component: {fileID: 1708233211970282801} - component: {fileID: 1708233211970282802} - component: {fileID: 1708233211970282800} @@ -260,6 +261,7 @@ Transform: - {fileID: 4934109709913625504} - {fileID: 5407316254601908039} - {fileID: 4530741588054097262} + - {fileID: 7974138968714045337} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1040714684719195971 @@ -380,6 +382,18 @@ MonoBehaviour: m_EditorClassIdentifier: targetTag: - {fileID: 11400000, guid: 3ac5bfbf7e1fbdd4baec1c17bd3d874c, type: 2} +--- !u!114 &891689845601428566 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1040714684719195968} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45e09b6617beed447a13265764139f69, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::EntityEventBroker --- !u!114 &1708233211970282801 MonoBehaviour: m_ObjectHideFlags: 0 @@ -402,14 +416,12 @@ MonoBehaviour: onResourceChanged: m_PersistentCalls: m_Calls: [] - scrollingTextPrefab: {fileID: 677595231222924942, guid: abe5cfbb1d6d9454aa835afceb136dcf, type: 3} onMaxHealthChanged: m_PersistentCalls: m_Calls: [] onDeath: m_PersistentCalls: m_Calls: [] - invulnerable: 0 OnInvulnerabilityStateChanged: m_PersistentCalls: m_Calls: [] @@ -12637,3 +12649,65 @@ Transform: m_CorrespondingSourceObject: {fileID: 4117085477522148337, guid: 71f8f31539e61b84bb2fa8ad6759aaae, type: 3} m_PrefabInstance: {fileID: 8225954557497083062} m_PrefabAsset: {fileID: 0} +--- !u!1001 &8728370511498064578 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1040714684719195969} + m_Modifications: + - target: {fileID: 249077042724776013, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_Name + value: BrokerSubscribers + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} +--- !u!4 &7974138968714045337 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + m_PrefabInstance: {fileID: 8728370511498064578} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Resources/PlayerPrefab.prefab b/Assets/Resources/PlayerPrefab.prefab index 5757b9ce..85a4b000 100644 --- a/Assets/Resources/PlayerPrefab.prefab +++ b/Assets/Resources/PlayerPrefab.prefab @@ -341,6 +341,7 @@ GameObject: - component: {fileID: 8509861251009166870} - component: {fileID: 4486792688999778717} - component: {fileID: 8867901703884003658} + - component: {fileID: 7730173163958082525} - component: {fileID: 8273564744905798527} - component: {fileID: 9176951908243474339} - component: {fileID: 9115515025738910048} @@ -406,6 +407,7 @@ Transform: - {fileID: 4176597637354617670} - {fileID: 5787010535312454557} - {fileID: 6063186782999826210} + - {fileID: 7193893066637267766} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &489555198890004946 @@ -582,6 +584,18 @@ MonoBehaviour: m_EditorClassIdentifier: targetTag: - {fileID: 11400000, guid: 9e6b298c2ce2856418b205442417a433, type: 2} +--- !u!114 &7730173163958082525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480331571121010796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45e09b6617beed447a13265764139f69, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::EntityEventBroker --- !u!114 &8273564744905798527 MonoBehaviour: m_ObjectHideFlags: 0 @@ -658,14 +672,12 @@ MonoBehaviour: onResourceChanged: m_PersistentCalls: m_Calls: [] - scrollingTextPrefab: {fileID: 677595231222924942, guid: abe5cfbb1d6d9454aa835afceb136dcf, type: 3} onMaxHealthChanged: m_PersistentCalls: m_Calls: [] onDeath: m_PersistentCalls: m_Calls: [] - invulnerable: 0 OnInvulnerabilityStateChanged: m_PersistentCalls: m_Calls: [] @@ -5251,6 +5263,68 @@ Transform: m_CorrespondingSourceObject: {fileID: 492420, guid: 3eb967bebaa6eb94ba9b9730e57ba98d, type: 3} m_PrefabInstance: {fileID: 7855196656215761319} m_PrefabAsset: {fileID: 0} +--- !u!1001 &8384968279408871021 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8785094005405139760} + m_Modifications: + - target: {fileID: 249077042724776013, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_Name + value: BrokerSubscribers + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} +--- !u!4 &7193893066637267766 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1695802727639733595, guid: 5af9cc65c5861e64389b48c310b2a507, type: 3} + m_PrefabInstance: {fileID: 8384968279408871021} + m_PrefabAsset: {fileID: 0} --- !u!1001 &8519582500096383220 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/AbilitySystem/Base/BaseEffect.cs b/Assets/Scripts/AbilitySystem/Base/BaseEffect.cs index 1bc00e3e..af3bdabc 100644 --- a/Assets/Scripts/AbilitySystem/Base/BaseEffect.cs +++ b/Assets/Scripts/AbilitySystem/Base/BaseEffect.cs @@ -8,7 +8,7 @@ public class BaseEffect : ScriptableObject public List tags = new List(); public List influencingStats = new List(); - public virtual void ApplyEffect(Taggable user, List targets) { } + public virtual void ApplyEffect(Taggable user, List targets, BaseAbility source) { } public virtual BaseEffect CreateRuntimeInstance() { diff --git a/Assets/Scripts/AbilitySystem/DamageType.cs b/Assets/Scripts/AbilitySystem/DamageType.cs index a0ad0873..6a0a3f8e 100644 --- a/Assets/Scripts/AbilitySystem/DamageType.cs +++ b/Assets/Scripts/AbilitySystem/DamageType.cs @@ -7,7 +7,7 @@ public enum DamageType } [System.Serializable] -public enum DamageApplicationMethod +public enum EffectApplicationMethod { Hit, Tick diff --git a/Assets/Scripts/AbilitySystem/Effects/AbsorbEffect.cs b/Assets/Scripts/AbilitySystem/Effects/AbsorbEffect.cs index 9fbf2f41..66b4af3b 100644 --- a/Assets/Scripts/AbilitySystem/Effects/AbsorbEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/AbsorbEffect.cs @@ -12,9 +12,9 @@ public class AbsorbEffect : StatusEffect AbsorbEffectInstance targetAbsorbEffect; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); if(applyToTargetsHit) { @@ -23,14 +23,14 @@ public class AbsorbEffect : StatusEffect if (IsAlliedTarget(user, target)) { targetAbsorbEffect = target.GetComponent(); - targetAbsorbEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetAbsorbEffect.ApplyEffect(this, CalculateFinalAmount(user), source); } } } if (applyToSelf) { targetAbsorbEffect = user.GetComponent(); - targetAbsorbEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetAbsorbEffect.ApplyEffect(this, CalculateFinalAmount(user), source); //targetAbsorbEffect.owner.RPC(nameof(targetAbsorbEffect.RPC_ApplyAbsorbEffect), targetAbsorbEffect.owner.Owner, StatusEffectIndexer.Instance.StatusEffects.IndexOf(this)); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/AbsorbEffectInstance.cs b/Assets/Scripts/AbilitySystem/Effects/AbsorbEffectInstance.cs index 0874e11b..cf269430 100644 --- a/Assets/Scripts/AbilitySystem/Effects/AbsorbEffectInstance.cs +++ b/Assets/Scripts/AbilitySystem/Effects/AbsorbEffectInstance.cs @@ -52,9 +52,9 @@ public class AbsorbEffectInstance : StatusEffectInstance return highestAmount; } - public override void ApplyEffect(StatusEffect effect, float value) + public override void ApplyEffect(StatusEffect effect, float value, BaseAbility source) { - base.ApplyEffect(effect, value); + base.ApplyEffect(effect, value, source); } protected override void AddStack(StatusEffect addedEffect, float value) diff --git a/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffect.cs b/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffect.cs index 2fb54273..7f24ca26 100644 --- a/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffect.cs @@ -14,9 +14,9 @@ public class DamageIncomeModifierEffect : StatusEffect DamageIncomeModifierEffectInstance targetDamageIncomeModifierEffect; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); if (applyToTargetsHit) { @@ -27,13 +27,13 @@ public class DamageIncomeModifierEffect : StatusEffect if (user.AlliedTagsContains(target.targetTag)) continue; } targetDamageIncomeModifierEffect = target.GetComponent(); - targetDamageIncomeModifierEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetDamageIncomeModifierEffect.ApplyEffect(this, CalculateFinalAmount(user), source); } } if(applyToSelf) { targetDamageIncomeModifierEffect = user.GetComponent(); - targetDamageIncomeModifierEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetDamageIncomeModifierEffect.ApplyEffect(this, CalculateFinalAmount(user), source); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffectInstance.cs b/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffectInstance.cs index c6da9edd..261ff3e7 100644 --- a/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffectInstance.cs +++ b/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffectInstance.cs @@ -27,9 +27,9 @@ public class DamageIncomeModifierEffectInstance : StatusEffectInstance return highestAmount; } - public override void ApplyEffect(StatusEffect effect, float value) + public override void ApplyEffect(StatusEffect effect, float value, BaseAbility source) { - base.ApplyEffect(effect, value); + base.ApplyEffect(effect, value, source); } protected override void AddStack(StatusEffect addedEffect, float value) diff --git a/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffect.cs b/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffect.cs index c3d76aea..a38f768f 100644 --- a/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffect.cs @@ -14,9 +14,9 @@ public class DamageOutputModifierEffect : StatusEffect DamageOutputModifierEffectInstance targetDamageOutputModifierEffect; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); if (applyToTargetsHit) { @@ -27,13 +27,13 @@ public class DamageOutputModifierEffect : StatusEffect if (!user.AlliedTagsContains(target.targetTag)) continue; } targetDamageOutputModifierEffect = target.GetComponent(); - targetDamageOutputModifierEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetDamageOutputModifierEffect.ApplyEffect(this, CalculateFinalAmount(user), source); } } if(applyToSelf) { targetDamageOutputModifierEffect = user.GetComponent(); - targetDamageOutputModifierEffect.ApplyEffect(this, CalculateFinalAmount(user)); + targetDamageOutputModifierEffect.ApplyEffect(this, CalculateFinalAmount(user), source); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffectInstance.cs b/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffectInstance.cs index 196eff1f..725bf8a2 100644 --- a/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffectInstance.cs +++ b/Assets/Scripts/AbilitySystem/Effects/DamageOutputModifierEffectInstance.cs @@ -28,9 +28,9 @@ public class DamageOutputModifierEffectInstance : StatusEffectInstance } - public override void ApplyEffect(StatusEffect effect, float value) + public override void ApplyEffect(StatusEffect effect, float value, BaseAbility source) { - base.ApplyEffect(effect, value); + base.ApplyEffect(effect, value, source); } protected override void AddStack(StatusEffect addedEffect, float value) diff --git a/Assets/Scripts/AbilitySystem/Effects/DamageOverTimeEffect.cs b/Assets/Scripts/AbilitySystem/Effects/DamageOverTimeEffect.cs index cebabeda..72e3081c 100644 --- a/Assets/Scripts/AbilitySystem/Effects/DamageOverTimeEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/DamageOverTimeEffect.cs @@ -15,9 +15,9 @@ public class DamageOverTimeEffect : StatusEffect private CharacterStats stats; private DamageOutputModifierEffectInstance damageOutputModifier; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); finalTickValue = CalculateFinalDamage(user); @@ -26,13 +26,13 @@ public class DamageOverTimeEffect : StatusEffect foreach (Taggable target in targets) { BaseDamageOverTimeEffectInstance dotInstance = GetOrAddCorrectInstance(target); - dotInstance.ApplyEffect(this, finalTickValue); + dotInstance.ApplyEffect(this, finalTickValue, source); } } if (applyToSelf) { BaseDamageOverTimeEffectInstance dotInstance = GetOrAddCorrectInstance(user); - dotInstance.ApplyEffect(this, finalTickValue); + dotInstance.ApplyEffect(this, finalTickValue, source); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/InstantValueEffect.cs b/Assets/Scripts/AbilitySystem/Effects/InstantValueEffect.cs index 907d6c86..8d7ae66d 100644 --- a/Assets/Scripts/AbilitySystem/Effects/InstantValueEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/InstantValueEffect.cs @@ -22,13 +22,17 @@ public class InstantValueEffect : BaseEffect ClassResource classResource; private float finalValue; + private EntityEventBroker userBroker; private CharacterStats stats; private DamageOutputModifierEffectInstance damageOutputModifier; private bool isCrit; - public override void ApplyEffect(Taggable user, List targets) + + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { if (user == null) return; + userBroker = user.GetComponent(); + foreach (Taggable target in targets) { if (target == null) continue; @@ -56,12 +60,72 @@ public class InstantValueEffect : BaseEffect { targetHealth = target.GetComponent(); if (targetHealth != null) - targetHealth.ChangeValue(GetCorrectValueSign(user, target), (int)damageType, isCrit); + { + ApplyEffect(user, target, source, targets.Count); + //targetHealth.ChangeValue(GetCorrectValueSign(user, target), (int)damageType, isCrit); + } //targetHealth.ChangeValue(target.targetTag == TargettingTag.Enemy ? -value : value); } } } + private void ApplyEffect(Taggable user, Taggable target, BaseAbility source, int totalTargetsHit) + { + if (user == null) + { + Debug.LogError("ApplyEffect user is null"); + return; + } + if (target == null) + { + Debug.LogError("ApplyEffect target is null"); + return; + } + + + if (user.AlliedTagsContains(target.targetTag)) + { + HealArgs args = new HealArgs() + { + source = source, + effect = this, + user = user, + target = target, + currentValue = baseValue, + isCrit = false, + applicationMethod = EffectApplicationMethod.Hit, + totalTargetsHit = totalTargetsHit + }; + userBroker.OnOutgoingHeal.Invoke(args); + + userBroker.OnOutgoingHealProcessed.Invoke(args); + + targetHealth.ApplyHeal(args); + } + else + { + DamageArgs args = new DamageArgs() + { + source = source, + effect = this, + user = user, + target = target, + currentValue = -baseValue, + isCrit = false, + targetDead = false, + applicationMethod = EffectApplicationMethod.Hit, + totalTargetsHit = totalTargetsHit + }; + + userBroker.OnOutgoingDamage.Invoke(args); + + userBroker.OnOutgoingDamageProcessed.Invoke(args); + + targetHealth.ApplyDamage(args); + } + + } + private float GetCorrectValueSign(Taggable user, Taggable target) { if (user == null) return 0; @@ -75,14 +139,14 @@ public class InstantValueEffect : BaseEffect - if(user.AlliedTagsContains(target.targetTag)) + if (user.AlliedTagsContains(target.targetTag)) { - if (target.IsFriendlyNPC()) + if (target.IsFriendlyNPC()) return (finalValue * FriendlyNPCTargetMultiplier); else return (finalValue * AlliedTargetMultiplier); } - else + else return (-finalValue * EnemyTargetMultiplier); } diff --git a/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffect.cs b/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffect.cs index e22cb120..ac1d083a 100644 --- a/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffect.cs @@ -11,9 +11,9 @@ public class MovementSpeedModifierEffect : StatusEffect MovementSpeedModifierEffectInstance targetMovementSpeedModifierEffect; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); if (applyToTargetsHit) { @@ -22,14 +22,14 @@ public class MovementSpeedModifierEffect : StatusEffect //if (IsAlliedTarget(user, target)) //{ targetMovementSpeedModifierEffect = target.GetComponent(); - targetMovementSpeedModifierEffect.ApplyEffect(this, GetCorrectValueSign(user, target)); + targetMovementSpeedModifierEffect.ApplyEffect(this, GetCorrectValueSign(user, target), source); //} } } if (applyToSelf) { targetMovementSpeedModifierEffect = user.GetComponent(); - targetMovementSpeedModifierEffect.ApplyEffect(this, GetCorrectValueSign(user, user)); + targetMovementSpeedModifierEffect.ApplyEffect(this, GetCorrectValueSign(user, user), source); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffectInstance.cs b/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffectInstance.cs index 9338c0dd..2f6b182d 100644 --- a/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffectInstance.cs +++ b/Assets/Scripts/AbilitySystem/Effects/MovementSpeedModifierEffectInstance.cs @@ -59,9 +59,9 @@ public class MovementSpeedModifierEffectInstance : StatusEffectInstance } - public override void ApplyEffect(StatusEffect effect, float value) + public override void ApplyEffect(StatusEffect effect, float value, BaseAbility source) { - base.ApplyEffect(effect, value); + base.ApplyEffect(effect, value, source); UpdateNavMeshAgentSpeed(); } public void ToggleCastPenalty(bool isOn) diff --git a/Assets/Scripts/AbilitySystem/Effects/OverTimeValueEffect.cs b/Assets/Scripts/AbilitySystem/Effects/OverTimeValueEffect.cs index 52c90d79..c62de3cb 100644 --- a/Assets/Scripts/AbilitySystem/Effects/OverTimeValueEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/OverTimeValueEffect.cs @@ -9,7 +9,7 @@ public class OverTimeValueEffect : BaseEffect public float duration; public float tickRate; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { foreach (Taggable target in targets) { diff --git a/Assets/Scripts/AbilitySystem/Effects/StatusEffect.cs b/Assets/Scripts/AbilitySystem/Effects/StatusEffect.cs index 0ccbf157..582b40af 100644 --- a/Assets/Scripts/AbilitySystem/Effects/StatusEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/StatusEffect.cs @@ -11,9 +11,9 @@ public class StatusEffect : BaseEffect [Header("Should be toggled only when you want to apply the effect ONLY to yourself")] public bool applyToSelf; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { - base.ApplyEffect(user, targets); + base.ApplyEffect(user, targets, source); } } diff --git a/Assets/Scripts/AbilitySystem/Effects/StatusEffectInstance.cs b/Assets/Scripts/AbilitySystem/Effects/StatusEffectInstance.cs index 0d6a0766..01a37985 100644 --- a/Assets/Scripts/AbilitySystem/Effects/StatusEffectInstance.cs +++ b/Assets/Scripts/AbilitySystem/Effects/StatusEffectInstance.cs @@ -27,7 +27,7 @@ public class StatusEffectInstance : MonoBehaviour taggable = GetComponentInParent(); } - public virtual void ApplyEffect(StatusEffect effect, float value) + public virtual void ApplyEffect(StatusEffect effect, float value, BaseAbility source) { if (CanAddStack()) { diff --git a/Assets/Scripts/AbilitySystem/Effects/TauntEffect.cs b/Assets/Scripts/AbilitySystem/Effects/TauntEffect.cs index 64599bf1..d62c218e 100644 --- a/Assets/Scripts/AbilitySystem/Effects/TauntEffect.cs +++ b/Assets/Scripts/AbilitySystem/Effects/TauntEffect.cs @@ -9,7 +9,7 @@ public class TauntEffect : BaseEffect { BasicEnemyNPCController enemyNPCController; - public override void ApplyEffect(Taggable user, List targets) + public override void ApplyEffect(Taggable user, List targets, BaseAbility source) { foreach (Taggable target in targets) { diff --git a/Assets/Scripts/EntityBroker.meta b/Assets/Scripts/EntityBroker.meta new file mode 100644 index 00000000..cca7b5ea --- /dev/null +++ b/Assets/Scripts/EntityBroker.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5c03ab3a39f232d45a604da2da1597d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs b/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs new file mode 100644 index 00000000..5b1d33b4 --- /dev/null +++ b/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs @@ -0,0 +1,13 @@ +using UnityEngine; + +public class AbsorbInterceptor : BrokerInterceptor +{ + + + protected override void Awake() + { + base.Awake(); + } + + +} diff --git a/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs.meta b/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs.meta new file mode 100644 index 00000000..21c07d07 --- /dev/null +++ b/Assets/Scripts/EntityBroker/AbsorbInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6de99a6f4bb244b4f98a4f762ad5c485 \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs b/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs new file mode 100644 index 00000000..4cac7fcf --- /dev/null +++ b/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs @@ -0,0 +1,54 @@ +using Kryz.CharacterStats; +using Kryz.CharacterStats.Examples; +using UnityEngine; + +public class BasicStatAmplificationCalculator : BrokerInterceptor +{ + float finalValue; + + protected override void Awake() + { + base.Awake(); + + broker.OnOutgoingDamage.Subscribe(CalculateDamageModsBasedOnStats, GameConstants.BrokerEventPriority.BasicStatAmplification); + } + + private void CalculateDamageModsBasedOnStats(DamageArgs args) + { + finalValue = args.currentValue; + + if (stats == null) + { + Debug.LogError("character stat influence calculator: stats null"); + return; + } + foreach (var statInfluence in args.effect.influencingStats) + { + if (stats.primaryStatsDictionary.TryGetValue(statInfluence.statTag.name.ToLower(), out CharacterStat stat)) + { + finalValue += stat.Value * statInfluence.percentInfluence; + } + else if (stats.secondaryStatsDictionary.TryGetValue(statInfluence.statTag.name.ToLower(), out CharacterStat secondaryStat)) + { + finalValue += secondaryStat.Value * statInfluence.percentInfluence; + } + if (statInfluence.statTag.name.ToLower().Contains("Attack")) args.damageType = DamageType.Attack; + else if (statInfluence.statTag.name.ToLower().Contains("Spell")) args.damageType = DamageType.Spell; + } + if (IsCrit(stats)) + { + finalValue *= (1 + stats.GetStat("critdamage").Value / 100f); + args.isCrit = true; + } + else + args.isCrit = false; + + args.currentValue = finalValue; + } + + private bool IsCrit(CharacterStats stats) + { + return MathHelpers.RollChancePercent(stats.GetStat("critchance").Value); + //return Random.Range(0, 100) < stats.CritChance.Value; + } +} \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs.meta b/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs.meta new file mode 100644 index 00000000..95c6b2a6 --- /dev/null +++ b/Assets/Scripts/EntityBroker/BasicStatAmplificationCalculator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7c7b2480158261a438df4665d65f6dad \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs b/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs new file mode 100644 index 00000000..76ba77ab --- /dev/null +++ b/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +public class BasicStatMitigationCalculator : BrokerInterceptor +{ + float percentStatMitigation; + float reducedDamage; + float finalValue; + + protected override void Awake() + { + base.Awake(); + + broker.OnIncomingDamage.Subscribe(HandleStatMitigation, GameConstants.BrokerEventPriority.BasicStatMitigation); + } + + private void HandleStatMitigation(DamageArgs args) + { + if (args.currentValue >= 0) return; + + finalValue = args.currentValue; + + switch (args.damageType) + { + case DamageType.Attack: + default: + { + percentStatMitigation = Mathf.Clamp((stats.GetStat("armor").Value * GameConstants.CharacterStatsBalancing.PercentArmorIntoDamageReduction), 0, GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromArmor); + } + break; + case DamageType.Spell: + { + percentStatMitigation = Mathf.Clamp((stats.GetStat("magicresistance").Value * GameConstants.CharacterStatsBalancing.PercentMagicResistanceIntoDamageReduction), 0, GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromMagicResistance); + } + break; + } + + reducedDamage = args.currentValue * percentStatMitigation; + finalValue += Mathf.Abs(reducedDamage); + //Debug.Log(gameObject.name + " receiving dmg = " + incomingValue + $" after mitigations from {(dmgType == DamageType.Attack ? nameof(character.Armor) : nameof(character.MagicResistance))}"); + + if (finalValue > 0) //avoid damage ultra mitigated turning into healing + finalValue = 0; + } + + +} diff --git a/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs.meta b/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs.meta new file mode 100644 index 00000000..c44bfec8 --- /dev/null +++ b/Assets/Scripts/EntityBroker/BasicStatMitigationCalculator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1c1e936b3b0b3bb4ebb8f7712f4a9519 \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/BlockInterceptor.cs b/Assets/Scripts/EntityBroker/BlockInterceptor.cs new file mode 100644 index 00000000..b750b8c7 --- /dev/null +++ b/Assets/Scripts/EntityBroker/BlockInterceptor.cs @@ -0,0 +1,55 @@ +using Kryz.CharacterStats.Examples; +using UnityEngine; + +public class BlockInterceptor : BrokerInterceptor +{ + float percentStatMitigation; + float finalValue; + float reducedDamage; + + protected override void Awake() + { + base.Awake(); + + broker.OnIncomingDamage.Subscribe(HandleBlockMitigation, GameConstants.BrokerEventPriority.Block); + } + + + protected void HandleBlockMitigation(DamageArgs args) + { + if (args.currentValue >= 0) return; + + BlockArgs blockArgs = new BlockArgs() + { + user = user, + blockedSuccessfully = false + }; + + if(HasBlocked()) + { + Debug.Log("Blocked!"); + + percentStatMitigation = MathHelpers.NormalizePercentageDecimal(stats.GetStat("blockeffectiveness").Value); + + percentStatMitigation = Mathf.Clamp(percentStatMitigation, 0, GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromBlock); + + reducedDamage = args.currentValue * percentStatMitigation; + finalValue += Mathf.Abs(reducedDamage); + + if (finalValue > 0) //avoid damage ultra mitigated turning into healing + finalValue = 0; + + blockArgs.blockedSuccessfully = true; + + args.currentValue = finalValue; + } + + broker.OnBlock.Invoke(blockArgs); + } + + + protected bool HasBlocked() + { + return MathHelpers.RollChancePercent(stats.GetStat("blockchance").Value); + } +} diff --git a/Assets/Scripts/EntityBroker/BlockInterceptor.cs.meta b/Assets/Scripts/EntityBroker/BlockInterceptor.cs.meta new file mode 100644 index 00000000..5a49c6f8 --- /dev/null +++ b/Assets/Scripts/EntityBroker/BlockInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: de50151b619d6514ab411a712451bceb \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/BrokerInterceptor.cs b/Assets/Scripts/EntityBroker/BrokerInterceptor.cs new file mode 100644 index 00000000..841011fa --- /dev/null +++ b/Assets/Scripts/EntityBroker/BrokerInterceptor.cs @@ -0,0 +1,17 @@ +using Kryz.CharacterStats.Examples; +using UnityEngine; + +public class BrokerInterceptor : MonoBehaviour +{ + protected EntityEventBroker broker; + protected CharacterStats stats; + protected Taggable user; + + + protected virtual void Awake() + { + user = GetComponentInParent(); + broker = GetComponentInParent(); + stats = GetComponentInParent(); + } +} diff --git a/Assets/Scripts/EntityBroker/BrokerInterceptor.cs.meta b/Assets/Scripts/EntityBroker/BrokerInterceptor.cs.meta new file mode 100644 index 00000000..286f4173 --- /dev/null +++ b/Assets/Scripts/EntityBroker/BrokerInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5dd87999338696648828a2b8640e8d5b \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/DebugBroker.cs b/Assets/Scripts/EntityBroker/DebugBroker.cs new file mode 100644 index 00000000..1c284791 --- /dev/null +++ b/Assets/Scripts/EntityBroker/DebugBroker.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +public class DebugBroker : MonoBehaviour +{ + EntityEventBroker broker; + + private void Awake() + { + broker = GetComponentInParent(); + + broker.OnIncomingDamage.Subscribe((x) => DebugDamageArgs("dealing damage to", x)); + broker.OnIncomingDamageProcessed.Subscribe((x) => DebugDamageArgs("dealing damage to", x)); + + broker.OnOutgoingDamage.Subscribe((x) => DebugDamageArgs("dealing damage to", x)); + broker.OnOutgoingDamageProcessed.Subscribe((x) => DebugDamageArgs("dealing damage to", x)); + } + + + private void DebugDamageArgs(string prefix, DamageArgs args) + { + Debug.Log($"Broker Debugger: {args.user}'s {args.effect.name} {prefix}: {args.target} => {args.currentValue}, isCrit? {args.isCrit}, dmgType={args.damageType}, targets hit total ={args.totalTargetsHit}"); + } +} diff --git a/Assets/Scripts/EntityBroker/DebugBroker.cs.meta b/Assets/Scripts/EntityBroker/DebugBroker.cs.meta new file mode 100644 index 00000000..88524524 --- /dev/null +++ b/Assets/Scripts/EntityBroker/DebugBroker.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8f1bcfcc537b724790bed2579b95d27 \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/DodgeInterceptor.cs b/Assets/Scripts/EntityBroker/DodgeInterceptor.cs new file mode 100644 index 00000000..642e8dde --- /dev/null +++ b/Assets/Scripts/EntityBroker/DodgeInterceptor.cs @@ -0,0 +1,38 @@ +using Kryz.CharacterStats.Examples; +using UnityEngine; + +public class DodgeInterceptor : BrokerInterceptor +{ + protected override void Awake() + { + base.Awake(); + + broker.OnIncomingDamage.Subscribe(HandleDodge, GameConstants.BrokerEventPriority.Dodge); + } + + private void HandleDodge(DamageArgs args) + { + DodgeArgs dodgeArgs = new DodgeArgs() + { + user = user, + dodgedSuccessfully = false + }; + + if (HasDodged()) + { + Debug.Log("Dodged!"); + + + dodgeArgs.dodgedSuccessfully = true; + + args.currentValue = 0f; + } + + broker.OnDodge.Invoke(dodgeArgs); + } + + protected bool HasDodged() + { + return MathHelpers.RollChancePercent(stats.GetStat("dodgechance").Value); + } +} diff --git a/Assets/Scripts/EntityBroker/DodgeInterceptor.cs.meta b/Assets/Scripts/EntityBroker/DodgeInterceptor.cs.meta new file mode 100644 index 00000000..db0f9863 --- /dev/null +++ b/Assets/Scripts/EntityBroker/DodgeInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8d39f28a2e6c02142bc8324864197f17 \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs b/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs new file mode 100644 index 00000000..dc4e7c27 --- /dev/null +++ b/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +public class InvulnerabilityInterceptor : BrokerInterceptor +{ + Health health; + + protected override void Awake() + { + base.Awake(); + + health = GetComponentInParent(); + + broker.OnIncomingDamage.Subscribe(HandleInvulnerability, GameConstants.BrokerEventPriority.Invulnerability); + } + + + private void HandleInvulnerability(DamageArgs args) + { + InvulnerabilityArgs invulnerabilityArgs = new InvulnerabilityArgs() + { + user = user, + isImmune = false + }; + + if(health.Invulnerable) + { + args.currentValue = 0; + invulnerabilityArgs.isImmune = true; + } + + broker.OnInvulnerable.Invoke(invulnerabilityArgs); + } +} diff --git a/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs.meta b/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs.meta new file mode 100644 index 00000000..6271373c --- /dev/null +++ b/Assets/Scripts/EntityBroker/InvulnerabilityInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 70d74dc17186ed945a577a1128c5abcf \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/OnProcInterceptor.cs b/Assets/Scripts/EntityBroker/OnProcInterceptor.cs new file mode 100644 index 00000000..eac97ea3 --- /dev/null +++ b/Assets/Scripts/EntityBroker/OnProcInterceptor.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +public class OnProcInterceptor : BrokerInterceptor +{ + EntityEventBroker sourceBroker; + + protected override void Awake() + { + base.Awake(); + + broker.OnIncomingDamageProcessed.Subscribe(HandlePossibleProcs, GameConstants.BrokerEventPriority.Procs); + } + + private void HandlePossibleProcs(DamageArgs args) + { + if (args.currentValue <= 0) return; + + sourceBroker = args.user.GetComponent(); + + if (args.isCrit) + sourceBroker.OnCrit.Invoke(args); + else if (args.applicationMethod == EffectApplicationMethod.Hit) + sourceBroker.OnHit.Invoke(args); + else + sourceBroker.OnTick.Invoke(args); + + if (args.targetDead) + sourceBroker.OnKill.Invoke(args); + } +} diff --git a/Assets/Scripts/EntityBroker/OnProcInterceptor.cs.meta b/Assets/Scripts/EntityBroker/OnProcInterceptor.cs.meta new file mode 100644 index 00000000..d545100e --- /dev/null +++ b/Assets/Scripts/EntityBroker/OnProcInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 64dc3a191522d6a419b6c81e6124b294 \ No newline at end of file diff --git a/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs b/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs new file mode 100644 index 00000000..b3bccddd --- /dev/null +++ b/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs @@ -0,0 +1,78 @@ +using UnityEngine; + +public class ScrollingTextInterceptor : BrokerInterceptor +{ + public ScrollingText scrollingTextPrefab; + protected ScrollingText scrollingText; + + protected override void Awake() + { + base.Awake(); + + broker.OnInvulnerable.Subscribe(OnInvulnerable); + broker.OnDodge.Subscribe(OnDodge); + broker.OnBlock.Subscribe(OnBlock); + broker.OnIncomingDamageProcessed.Subscribe(OnDamage); + broker.OnIncomingHealProcessed.Subscribe(OnHeal); + } + + private void OnInvulnerable(InvulnerabilityArgs args) + { + if (!args.isImmune) return; + + if (scrollingTextPrefab != null) + { + scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); + + scrollingText.Show("Invulnerable", Color.gray, 1.5f); + } + } + + private void OnDodge(DodgeArgs args) + { + if (!args.dodgedSuccessfully) return; + + + if (scrollingTextPrefab != null) + { + scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); + + scrollingText.ShowDodge("Dodge!"); + } + } + + private void OnBlock(BlockArgs args) + { + if (!args.blockedSuccessfully) return; + + if (scrollingTextPrefab != null) + { + scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); + + scrollingText.ShowBlock("Blocked!"); + } + } + + private void OnDamage(DamageArgs args) + { + if (scrollingTextPrefab != null && args.currentValue < 0) + { + scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); + + if (args.isCrit) + scrollingText.ShowCrit(args.currentValue.ToString("0.0")); + else + scrollingText.ShowHit(args.currentValue.ToString("0.0")); + + } + } + private void OnHeal(HealArgs args) + { + if (scrollingTextPrefab != null && args.currentValue > 0) + { + scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); + + scrollingText.ShowHeal(args.currentValue.ToString("0.0")); + } + } +} diff --git a/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs.meta b/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs.meta new file mode 100644 index 00000000..545e0117 --- /dev/null +++ b/Assets/Scripts/EntityBroker/ScrollingTextInterceptor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d2e114c4f93ba174094e346fbcc13b35 \ No newline at end of file diff --git a/Assets/Scripts/EventDrivenHooks/EntityEventBroker.cs b/Assets/Scripts/EventDrivenHooks/EntityEventBroker.cs index bd28fc7a..30d82857 100644 --- a/Assets/Scripts/EventDrivenHooks/EntityEventBroker.cs +++ b/Assets/Scripts/EventDrivenHooks/EntityEventBroker.cs @@ -5,9 +5,26 @@ using UnityEngine.Events; public class EntityEventBroker : MonoBehaviour { + public OrderedEvent OnOutgoingHeal = new OrderedEvent(); + public OrderedEvent OnOutgoingHealProcessed = new OrderedEvent(); + + public OrderedEvent OnIncomingHeal = new OrderedEvent(); + public OrderedEvent OnIncomingHealProcessed = new OrderedEvent(); + public OrderedEvent OnOutgoingDamage = new OrderedEvent(); + public OrderedEvent OnOutgoingDamageProcessed = new OrderedEvent(); + + public OrderedEvent OnHit = new OrderedEvent(); + public OrderedEvent OnTick = new OrderedEvent(); + public OrderedEvent OnCrit = new OrderedEvent(); + public OrderedEvent OnKill = new OrderedEvent(); public OrderedEvent OnIncomingDamage = new OrderedEvent(); + public OrderedEvent OnIncomingDamageProcessed = new OrderedEvent(); + + public OrderedEvent OnInvulnerable = new OrderedEvent(); + public OrderedEvent OnDodge = new OrderedEvent(); + public OrderedEvent OnBlock = new OrderedEvent(); } @@ -44,6 +61,8 @@ public class OrderedEvent } + + //Example usage: /*public class FireHelmetEffect : MonoBehaviour diff --git a/Assets/Scripts/EventDrivenHooks/EventBrokerArgs.cs b/Assets/Scripts/EventDrivenHooks/EventBrokerArgs.cs index 5607cff5..56d16235 100644 --- a/Assets/Scripts/EventDrivenHooks/EventBrokerArgs.cs +++ b/Assets/Scripts/EventDrivenHooks/EventBrokerArgs.cs @@ -5,10 +5,44 @@ using UnityEngine.Events; public class DamageArgs { + public BaseAbility source; + public BaseEffect effect; public Taggable user; - public List targets; + public Taggable target; public float currentValue; public DamageType damageType; - public DamageApplicationMethod applicationMethod; + public EffectApplicationMethod applicationMethod; public bool isCrit; + public int totalTargetsHit; + public bool targetDead; +} + +public class HealArgs +{ + public BaseAbility source; + public BaseEffect effect; + public Taggable user; + public Taggable target; + public float currentValue; + public EffectApplicationMethod applicationMethod; + public bool isCrit; + public int totalTargetsHit; +} + +public class InvulnerabilityArgs +{ + public Taggable user; + public bool isImmune; +} + +public class DodgeArgs +{ + public Taggable user; + public bool dodgedSuccessfully; +} + +public class BlockArgs +{ + public Taggable user; + public bool blockedSuccessfully; } \ No newline at end of file diff --git a/Assets/Scripts/Game/GameConstants.cs b/Assets/Scripts/Game/GameConstants.cs index 668dd4cb..2cd9376f 100644 --- a/Assets/Scripts/Game/GameConstants.cs +++ b/Assets/Scripts/Game/GameConstants.cs @@ -81,6 +81,23 @@ public static class GameConstants } + [System.Serializable] + public static class BrokerEventPriority + { + public const int BasicStatAmplification = 0; + public const int PassiveEffects = 5; + public const int TemporaryAmplificationMods = 10; + + + public const int Invulnerability = 0; + public const int Dodge = 2; + public const int Block = 3; + public const int BasicStatMitigation = 5; + public const int TemporaryMitigationMods = 10; + public const int Absorb = 15; + public const int Procs = 30; + } + public static class Input { // Movement diff --git a/Assets/Scripts/Health.cs b/Assets/Scripts/Health.cs index feaea738..eae1d9e2 100644 --- a/Assets/Scripts/Health.cs +++ b/Assets/Scripts/Health.cs @@ -7,9 +7,7 @@ using UnityEngine.Events; public class Health : Resource { protected CharacterStats character; - - public ScrollingText scrollingTextPrefab; - protected ScrollingText scrollingText; + protected EntityEventBroker broker; protected AbsorbEffectInstance absorbEffectInstance; protected DamageIncomeModifierEffectInstance damageIncomeModifierEffectInstance; @@ -20,7 +18,7 @@ public class Health : Resource private bool noCost = false; public bool NoCost => noCost; - public bool invulnerable = false; + protected bool invulnerable = false; public bool Invulnerable => invulnerable; float incomingValue; @@ -40,6 +38,7 @@ public class Health : Resource protected virtual void Awake() { + broker = GetComponent(); character = GetComponent(); absorbEffectInstance = GetComponent(); damageIncomeModifierEffectInstance = GetComponent(); @@ -90,70 +89,6 @@ public class Health : Resource } } - protected bool HasDodged() - { - return MathHelpers.RollChancePercent(character.GetStat("dodgechance").Value); - } - protected bool HasBlocked() - { - return MathHelpers.RollChancePercent(character.GetStat("blockchance").Value); - } - - protected void HandleBlockMitigation() - { - if (incomingValue >= 0) return; - - Debug.Log("Blocked!"); - - if (scrollingTextPrefab != null) - { - scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); - - scrollingText.ShowBlock("Blocked!"); - } - - percentStatMitigation = MathHelpers.NormalizePercentageDecimal(character.GetStat("blockeffectiveness").Value); - - percentStatMitigation = Mathf.Clamp(percentStatMitigation, 0, GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromBlock); - - reducedDamage = incomingValue * percentStatMitigation; - incomingValue += Mathf.Abs(reducedDamage); - - if (incomingValue > 0) //avoid damage ultra mitigated turning into healing - incomingValue = 0; - - } - - protected void HandleStatMitigation(DamageType dmgType) - { - if (incomingValue < 0) - { - switch (dmgType) - { - case DamageType.Attack: - default: - { - percentStatMitigation = Mathf.Clamp((character.GetStat("armor").Value * GameConstants.CharacterStatsBalancing.PercentArmorIntoDamageReduction), 0,GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromArmor); - } - break; - case DamageType.Spell: - { - percentStatMitigation = Mathf.Clamp((character.GetStat("magicresistance").Value * GameConstants.CharacterStatsBalancing.PercentMagicResistanceIntoDamageReduction), 0, GameConstants.CharacterStatsBalancing.MaximumPercentDamageReductionFromMagicResistance); - } - break; - } - - - //Debug.Log(gameObject.name + " mitigating = " + percentStatMitigation + " percent"); - reducedDamage = incomingValue * percentStatMitigation; - incomingValue += Mathf.Abs(reducedDamage); - //Debug.Log(gameObject.name + " receiving dmg = " + incomingValue + $" after mitigations from {(dmgType == DamageType.Attack ? nameof(character.Armor) : nameof(character.MagicResistance))}"); - - if (incomingValue > 0) //avoid damage ultra mitigated turning into healing - incomingValue = 0; - } - } - protected void HandleAbsorbEffects() { if (incomingValue < 0) @@ -171,7 +106,48 @@ public class Health : Resource } } - + public void ApplyDamage(DamageArgs args) + { + if (isDead) return; + + broker.OnIncomingDamage.Invoke(args); + + UpdateValue(args.currentValue); + + CheckForDeath(args); + + broker.OnIncomingDamageProcessed.Invoke(args); + } + public void ApplyHeal(HealArgs args) + { + if (isDead) return; + + broker.OnIncomingHeal.Invoke(args); + + UpdateValue(args.currentValue); + + broker.OnIncomingHealProcessed.Invoke(args); + } + + private void UpdateValue(float incomingValue) + { + currentValue += incomingValue; + + currentValue = Mathf.Clamp(currentValue, 0, maxValue); + + //Debug.Log("CurrentHealth: " + currentValue); + onResourceChanged.Invoke(currentValue); + } + private void CheckForDeath(DamageArgs args) + { + if (currentValue == 0) + { + //dead; + isDead = true; + args.targetDead = true; + onDeath.Invoke(); + } + } public override void ChangeValue(float value) { @@ -233,12 +209,6 @@ public class Health : Resource if (invulnerable && incomingValue < 0) { - if (scrollingTextPrefab != null) - { - scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); - - scrollingText.Show("Invulnerable", Color.gray, 1.5f); - } return; } @@ -256,27 +226,9 @@ public class Health : Resource { if (incomingValue >= 0) return; - if (HasDodged()) - { - Debug.Log("Dodged!"); - - if (scrollingTextPrefab != null) - { - scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); - - scrollingText.ShowDodge("Dodge!"); - } - - OnDodgedSuccessfully.Invoke(); - return; - } HandleDamageIncomeModifierEffects(); - if (HasBlocked()) - HandleBlockMitigation(); - - HandleStatMitigation((DamageType)dmgType); HandleAbsorbEffects(); @@ -284,16 +236,7 @@ public class Health : Resource currentValue = Mathf.Clamp(currentValue, 0, maxValue); - if (scrollingTextPrefab != null) - { - scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); - - if (isCrit) - scrollingText.ShowCrit(incomingValue.ToString("0.0")); - else - scrollingText.ShowHit(incomingValue.ToString("0.0")); - - } + if (currentValue == 0) { @@ -310,12 +253,6 @@ public class Health : Resource currentValue = Mathf.Clamp(currentValue, 0, maxValue); - if (scrollingTextPrefab != null && incomingValue != 0) - { - scrollingText = GameObjectPoolManager.Instance.Get(scrollingTextPrefab.gameObject, this.transform.position + new Vector3(Random.Range(-0.5f, 0.5f), 2f, Random.Range(-0.5f, 0.5f)), Quaternion.identity).GetComponent(); - - scrollingText.ShowHeal(incomingValue.ToString("0.0")); - } if (currentValue == 0) { diff --git a/Assets/Scripts/Networking/NetworkedAreaOfEffect.cs b/Assets/Scripts/Networking/NetworkedAreaOfEffect.cs index 95a2dc94..7b799c96 100644 --- a/Assets/Scripts/Networking/NetworkedAreaOfEffect.cs +++ b/Assets/Scripts/Networking/NetworkedAreaOfEffect.cs @@ -122,7 +122,7 @@ public class NetworkedAreaOfEffect : MonoBehaviour foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } waitingForDestroy = true; diff --git a/Assets/Scripts/Networking/NetworkedAreaOfEffectOverTime.cs b/Assets/Scripts/Networking/NetworkedAreaOfEffectOverTime.cs index 47c3225d..3a002276 100644 --- a/Assets/Scripts/Networking/NetworkedAreaOfEffectOverTime.cs +++ b/Assets/Scripts/Networking/NetworkedAreaOfEffectOverTime.cs @@ -131,7 +131,7 @@ public class NetworkedAreaOfEffectOverTime : NetworkedAreaOfEffect foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } OnTickPerformed(); diff --git a/Assets/Scripts/Networking/NetworkedBaseAbility.cs b/Assets/Scripts/Networking/NetworkedBaseAbility.cs index 94a554cc..52bfc9de 100644 --- a/Assets/Scripts/Networking/NetworkedBaseAbility.cs +++ b/Assets/Scripts/Networking/NetworkedBaseAbility.cs @@ -74,7 +74,7 @@ public class NetworkedBaseAbility : MonoBehaviour { foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } } } diff --git a/Assets/Scripts/Networking/NetworkedChanneling.cs b/Assets/Scripts/Networking/NetworkedChanneling.cs index 4b688d74..c932ac30 100644 --- a/Assets/Scripts/Networking/NetworkedChanneling.cs +++ b/Assets/Scripts/Networking/NetworkedChanneling.cs @@ -165,7 +165,7 @@ public class NetworkedChanneling : MonoBehaviour foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } OnTickPerformed(); diff --git a/Assets/Scripts/Networking/NetworkedDrainProjectile.cs b/Assets/Scripts/Networking/NetworkedDrainProjectile.cs index 8b923159..53e5b71e 100644 --- a/Assets/Scripts/Networking/NetworkedDrainProjectile.cs +++ b/Assets/Scripts/Networking/NetworkedDrainProjectile.cs @@ -58,7 +58,7 @@ public class NetworkedDrainProjectile : MonoBehaviour foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, new List { target }); + effect.ApplyEffect(ownerTag, new List { target }, ability); } waitingForDestroy = true; diff --git a/Assets/Scripts/Networking/NetworkedProjectile.cs b/Assets/Scripts/Networking/NetworkedProjectile.cs index b949a5e8..acf2224e 100644 --- a/Assets/Scripts/Networking/NetworkedProjectile.cs +++ b/Assets/Scripts/Networking/NetworkedProjectile.cs @@ -132,7 +132,7 @@ public class NetworkedProjectile : MonoBehaviour foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, new List { target }); + effect.ApplyEffect(ownerTag, new List { target }, ability); } diff --git a/Assets/Scripts/Networking/NetworkedProjectileAreaOfEffectOverTimeWithTickEvent.cs b/Assets/Scripts/Networking/NetworkedProjectileAreaOfEffectOverTimeWithTickEvent.cs index be97448d..e09ee868 100644 --- a/Assets/Scripts/Networking/NetworkedProjectileAreaOfEffectOverTimeWithTickEvent.cs +++ b/Assets/Scripts/Networking/NetworkedProjectileAreaOfEffectOverTimeWithTickEvent.cs @@ -112,7 +112,7 @@ public class NetworkedProjectileAreaOfEffectOverTimeWithTickEvent : NetworkedAre foreach (BaseEffect effect in projectileAbility.abilityEffects) { //Debug.Log($"TT[{Time.frameCount}] Applying effect: {effect.name}"); - effect.ApplyEffect(ownerTag, projectileTargets); + effect.ApplyEffect(ownerTag, projectileTargets, ability); } if(projectileTargets.Count > 0) diff --git a/Assets/Scripts/Networking/NetworkedSlash.cs b/Assets/Scripts/Networking/NetworkedSlash.cs index 15fde2aa..976f51b5 100644 --- a/Assets/Scripts/Networking/NetworkedSlash.cs +++ b/Assets/Scripts/Networking/NetworkedSlash.cs @@ -118,7 +118,7 @@ public class NetworkedSlash : MonoBehaviour foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } if (regenHealthOnHit) diff --git a/Assets/Scripts/Networking/NetworkedSlashWithOnHitEvent.cs b/Assets/Scripts/Networking/NetworkedSlashWithOnHitEvent.cs index 3884d6a4..308ec792 100644 --- a/Assets/Scripts/Networking/NetworkedSlashWithOnHitEvent.cs +++ b/Assets/Scripts/Networking/NetworkedSlashWithOnHitEvent.cs @@ -32,7 +32,7 @@ public class NetworkedSlashWithOnHitEvent : NetworkedSlash foreach (BaseEffect effect in ability.abilityEffects) { - effect.ApplyEffect(ownerTag, targets); + effect.ApplyEffect(ownerTag, targets, ability); } if (regenHealthOnHit)