Modify Resource (Bi-Entity Action Type)

Modifies a resource on one side of a bi-entity pair, optionally reading the incoming value from the other side.

Modifies a apoli:resource or apoli:cooldown on one side of a bi-entity pair, and can take the incoming value from the resource of the other side — the part that the entity-action apoli:modify_resource cannot do on its own.

Type ID: apoli:modify_resource (type-aliases: apoli:change_resource, origins:change_resource)

Every field of the entity actionresource, modifier, position, from, from_position — works here unchanged. Two fields choose which entity each half applies to.

Fields

FieldTypeDefaultDescription
sideString"target"Whose resource is written: "actor" or "target". Also aliased as recipient.
from_sideStringthe opposite of sideWhose resource from reads. Also aliased as from_entity. Only meaningful together with from.
resourceIdentifierThe resource or cooldown power to modify on side.
modifierAttribute Modifierset_base of 0Applied to the current value. With from set, only its operation is used and the incoming value is the source slot.
positionInteger OR ExpressionoptionalWhich slot of a table resource to write. Omit it on a table and every slot is written.
fromIdentifieroptionalRead the incoming value from this resource on from_side.
from_positionInteger OR ExpressionoptionalWhich slot of from to read.

Examples

"bientity_action": {
  "type": "apoli:modify_resource",
  "side": "target",
  "resource": "example:mana",
  "modifier": {
    "operation": "add_base_early",
    "value": -5
  }
}

Drains five mana from the target. With no from, this is the same as wrapping the entity action in apoli:target_action — reach for the wrapper when that is all you need.

"bientity_action": {
  "type": "apoli:modify_resource",
  "side": "actor",
  "resource": "example:stolen_charge",
  "from": "example:mana",
  "modifier": {
    "operation": "add_base_early"
  }
}

Adds the target’s current example:mana onto the actor’s example:stolen_charge. from_side defaults to the opposite of side, so the read comes from the target without being spelled out. Set it explicitly when both halves should come from the same entity.