Added ActiveEffect output and ContextData input support to Effect Nodes.#35
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Statescript’s effect-application nodes to operate on Effect instances (instead of EffectData), adds an optional EffectApplicationContext (“Context Data”) input that flows through the effect pipeline, and adds an ActiveEffectHandle output so graphs can capture handles for later use (e.g., inhibition/removal).
Changes:
- Refactored
ApplyEffectNodeandEffectNodeto acceptEffect/Effect[], addedContext Datainput, and addedActive Effectoutput. - Introduced new effect resolvers (
EffectFromDataResolver, variable resolvers, array variants) plus shared utilities for level/ownership defaults. - Added a provider-based authoring path for effect context data (
IEffectContextDataProvider+EffectContextDataResolver) and updated tests/docs accordingly.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Forge/Statescript/Properties/EffectVariableResolver.cs | New resolver to read a stored Effect instance from graph/shared variables. |
| Forge/Statescript/Properties/EffectArrayVariableResolver.cs | New resolver to read stored Effect instance arrays from variables. |
| Forge/Statescript/Properties/EffectFromDataResolver.cs | New resolver to build an Effect instance from EffectData + optional level/ownership resolvers. |
| Forge/Statescript/Properties/EffectArrayFromDataResolver.cs | New resolver to build Effect[] from EffectData[] with shared level/ownership. |
| Forge/Statescript/Properties/EffectResolverUtilities.cs | Shared helpers for resolving level/ownership defaults (ability context fallback). |
| Forge/Statescript/Properties/EffectContextDataResolver.cs | New resolver that produces EffectApplicationContext via an IEffectContextDataProvider. |
| Forge/Statescript/Properties/EffectDataResolver.cs | Removed: previous fixed EffectData resolver. |
| Forge/Statescript/Properties/EffectDataArrayResolver.cs | Removed: previous fixed EffectData[] resolver. |
| Forge/Statescript/Nodes/Action/ApplyEffectNode.cs | Updated node to apply Effect instances, accept optional context data, and output active-effect handles. |
| Forge/Statescript/Nodes/State/EffectNode.cs | Updated state node to apply Effect instances, accept optional context data, and output active-effect handles while managing lifetime. |
| Forge/Statescript/Nodes/EffectApplicationUtilities.cs | Updated application path to use Effect instances + context data; added handle-output writer helper. |
| Forge/Statescript/IEffectContextDataProvider.cs | New interface for building typed context data from graph state. |
| Forge/Statescript/EffectContextDataProvider.cs | New base class for strongly-typed context-data providers. |
| Forge/Statescript/EffectContextDataInputs.cs | New lazy input bag for provider-authored context-data inputs. |
| Forge/Statescript/EffectContextDataInput.cs | New record describing a provider-authored input (name + value type). |
| Forge/Effects/EffectsManager.cs | Exposed internal apply method that accepts an EffectApplicationContext? for Statescript integration. |
| Forge.Tests/Statescript/Resolvers/EffectVariableResolverTests.cs | Added coverage for effect variable resolver behavior (graph/shared/missing). |
| Forge.Tests/Statescript/Resolvers/EffectArrayVariableResolverTests.cs | Added coverage for effect array variable resolver behavior. |
| Forge.Tests/Statescript/Resolvers/EffectFromDataResolverTests.cs | Added coverage for effect construction, overrides, and ability-context fallback. |
| Forge.Tests/Statescript/Resolvers/EffectContextDataResolverTests.cs | Added coverage for provider-based context-data resolution and authored inputs. |
| Forge.Tests/Statescript/Resolvers/EffectDataResolverTests.cs | Removed: tests for removed EffectData resolvers. |
| Forge.Tests/Statescript/ObjectValueSupportTests.cs | Added round-trip test for storing Effect object variables/arrays. |
| Forge.Tests/Statescript/Nodes/State/EffectNodeTests.cs | Updated to new Effect resolver model; added tests for active-effect output and context data flow. |
| Forge.Tests/Statescript/Nodes/Action/ApplyEffectNodeTests.cs | Updated to new Effect resolver model; added tests for active-effect output and context data flow. |
| Forge.Tests/Statescript/Nodes/EffectInstanceReuseTests.cs | New test validating reuse of stored Effect instances and live updates via mutation. |
| Forge.Tests/Helpers/StatescriptTestHelpers.cs | Updated helper constructors to match new node inputs (removed level/ownership bindings). |
| docs/statescript/variables.md | Documented object-backed variable lane and effect instance reuse workflow. |
| docs/statescript/resolvers/README.md | Updated effect resolver listing to new Effect-instance-based resolvers. |
| docs/statescript/resolvers/effect-variable-resolver.md | New resolver documentation for reusing stored effect instances. |
| docs/statescript/resolvers/effect-array-variable-resolver.md | New resolver documentation for reusing stored effect instance arrays. |
| docs/statescript/resolvers/effect-from-data-resolver.md | New resolver documentation for constructing Effect instances from EffectData. |
| docs/statescript/resolvers/effect-array-from-data-resolver.md | New resolver documentation for constructing Effect[] from EffectData[]. |
| docs/statescript/resolvers/effect-context-data-resolver.md | New documentation for provider-built context data and authored inputs. |
| docs/statescript/resolvers/effect-data-resolver.md | Removed: documentation for deprecated EffectDataResolver. |
| docs/statescript/resolvers/effect-data-array-resolver.md | Removed: documentation for deprecated EffectDataArrayResolver. |
| docs/statescript/resolvers/ability-ownership-resolver.md | Updated composition example to configure ownership via EffectFromDataResolver. |
| docs/statescript/resolvers/ability-level-resolver.md | Updated “See Also” to include EffectFromDataResolver. |
| docs/statescript/nodes/action/apply-effect-node.md | Updated node docs for Effect inputs, context data, and active-effect output. |
| docs/statescript/nodes/state/effect-node.md | Updated node docs for Effect inputs, context data, and active-effect output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
Changed