Skip to content

Added ActiveEffect output and ContextData input support to Effect Nodes.#35

Merged
lextatic merged 11 commits into
mainfrom
task/effect-node-refactor
Jun 13, 2026
Merged

Added ActiveEffect output and ContextData input support to Effect Nodes.#35
lextatic merged 11 commits into
mainfrom
task/effect-node-refactor

Conversation

@lextatic

Copy link
Copy Markdown
Contributor

Added

  • Added ContextData input to Effect nodes.
  • Added ActiveEffect output to Effect nodes.

Changed

  • Refactored Effect nodes to use Effect instead of EffectData.

@lextatic lextatic added the added New features label Jun 13, 2026
@lextatic
lextatic requested a review from Copilot June 13, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ApplyEffectNode and EffectNode to accept Effect / Effect[], added Context Data input, and added Active Effect output.
  • 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.

Comment thread Forge/Statescript/Nodes/EffectApplicationUtilities.cs Outdated
Comment thread docs/statescript/resolvers/README.md Outdated
Comment thread docs/statescript/resolvers/effect-array-variable-resolver.md
@lextatic
lextatic merged commit b5076db into main Jun 13, 2026
1 check passed
@lextatic
lextatic deleted the task/effect-node-refactor branch June 13, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants