Resolve single-curly-brace actor variables in a string.
Handles {mh}, {oh} (weapon damage mods) and any {dot.path} resolvable via
foundry.utils.getProperty(actor, path) — e.g. {system.attributes.body.dex.total}.
When namedActors is supplied (e.g. { self, target, attacker, owner }), a first
pass resolves {self.foo}/{target.foo}/{attacker.foo}/{owner.foo} tokens against
the matching actor ("owner" is an alias for "self") BEFORE the generic single-actor
pass runs — this keeps {target.name} from falling through to getProperty(actor, "target.name").
Parameters
str: string
actor: any
Optional_subs: object[]|null = null
Optional array to push substitution records into
OptionalnamedActors: object|null = null
Optional map of namespace → actor, e.g. { self, target, attacker }
Resolve single-curly-brace actor variables in a string. Handles {mh}, {oh} (weapon damage mods) and any {dot.path} resolvable via foundry.utils.getProperty(actor, path) — e.g. {system.attributes.body.dex.total}.
When
namedActorsis supplied (e.g. { self, target, attacker, owner }), a first pass resolves {self.foo}/{target.foo}/{attacker.foo}/{owner.foo} tokens against the matching actor ("owner" is an alias for "self") BEFORE the generic single-actor pass runs — this keeps {target.name} from falling through to getProperty(actor, "target.name").