From 3f9a214cb07cb176ad54c74a290696c61d181fd9 Mon Sep 17 00:00:00 2001 From: Mod Documentation Updater Date: Fri, 14 Aug 2026 00:46:36 +0000 Subject: [PATCH] docs: update modding documentation --- docs/concepts/modapi.md | 35 +++++++++++++++++++++++++++++++++++ docs/concepts/scaling.md | 2 ++ 2 files changed, 37 insertions(+) diff --git a/docs/concepts/modapi.md b/docs/concepts/modapi.md index d6d4b49..665db1a 100644 --- a/docs/concepts/modapi.md +++ b/docs/concepts/modapi.md @@ -203,6 +203,41 @@ window.modAPI.actions.startCombat( ); ``` +### Technique Effect Reference + +The `technique.effects` array supports different effect kinds. This section documents notable fields on each kind. + +#### `buffTarget` + +Apply a buff to the enemy (or the current combat target): + +```typescript +{ + kind: 'buffTarget', + buff: myBuff, + amount: { value: 3 }, // stacks to apply + initialState?: Record, // seed buff internal state at application time +} +``` + +- **`initialState`** -- Seeds the created buff's internal state at application time. Each value is a Scaling expression evaluated in the applier's context, so values only known at apply-time (e.g. `absorbed` damage) can be captured into the debuff. The buff's `internalState` then uses these seed values as starting values rather than defaults. Both `CreateBuffTargetEffect` (in `buff.ts`) and `BuffTargetTechniqueEffect` (in `technique.ts`) expose this field. This mirrors the `initialState` already available on the `buffSelf` effect kind. + +**Example use case:** a debuff that stores the damage it absorbed so it can repay that amount when the buff expires: + +```typescript +const absorbedDamageTracker: Buff = { + name: 'Absorbed Damage Tracker', + internalState: { stored: { value: 0 } }, +}; + +{ + kind: 'buffTarget', + buff: absorbedDamageTracker, + amount: { value: 1 }, + initialState: { stored: { eqn: 'absorbed' } }, // capture absorbed damage at apply time +} +``` + ### Modifying Existing Locations Add content to locations that already exist in the game: diff --git a/docs/concepts/scaling.md b/docs/concepts/scaling.md index b093214..e2700c0 100644 --- a/docs/concepts/scaling.md +++ b/docs/concepts/scaling.md @@ -21,6 +21,8 @@ Every damage number, healing amount, buff strength, and stat modifier flows thro ```typescript interface Scaling { value: number; // Base multiplier + /** When false, this stat remains active but is omitted from buff tooltips. */ + tooltipCondition?: string; stat?: string; // Stat to multiply by (see valid stat names below) scaling?: string; // Special scaling mode (e.g. 'stacks', 'consumed', or a buff name) eqn?: string; // Expression MULTIPLIED onto the result