Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/concepts/modapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Scaling>, // 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:
Expand Down
2 changes: 2 additions & 0 deletions docs/concepts/scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down