Similar to Pre-Update, but this occurs after the update. It is useful to respond to an update under certain conditions.
Key
update
Arguments
args.data - data with which to update the document
args.options - options used in this update, not generally used
args.user - ID of the user performing the update
Examples
Immune to the Broken Condition
Usage: Automatically removes any Broken conditions the Actor receives.
let broken = this.actor.hasCondition("broken")
if (broken)
{
broken.delete();
this.script.notification("Removed Broken")
}
Using Pre-Update Document to accomplish this is more complicated, but a better result.
Un-removable Fatigued Condition
Usage: Automatically add Fatigued conditions to the Actor if none exists.
let fatigued = this.actor.hasCondition("fatigued")
if (!fatigued)
{
this.actor.addCondition("fatigued");
this.script.notification("Added Fatigued")
}