effects to chat

@badideasbureau is the temporary flag you look for in Effects to Chat a convention from somewhere (core? midi?) or something you came up with?
5 Replies
BadIdeasBureau
Huh.... effect.isTemporary exists for everything I've poked (all in the 5e system) and I thought it was core. Doesn't seem to be documented though. IIRC it returns either true if there is a duration, or flags.core.statusId, and it's used to determine whether to show an effect on the token or not. Ah, yes it's core - foundry.js line 12998 (but not in the API docs for some reason)
/**
* Describe whether the ActiveEffect has a temporary duration based on combat turns or rounds.
* @type {boolean}
*/
get isTemporary() {
const duration = this.data.duration.seconds ?? (this.data.duration.rounds || this.data.duration.turns) ?? 0;
return (duration > 0) || this.getFlag("core", "statusId");
}
/**
* Describe whether the ActiveEffect has a temporary duration based on combat turns or rounds.
* @type {boolean}
*/
get isTemporary() {
const duration = this.data.duration.seconds ?? (this.data.duration.rounds || this.data.duration.turns) ?? 0;
return (duration > 0) || this.getFlag("core", "statusId");
}
Calego
Calego3y ago
Ahhhhh I saw this in your description and didn't look closer:
Only enabled temporary effects (i.e. those with a duration or with the "temporary" flag set in their data attribute) will be shown. If a token doesn't have any temporary effects, then no message is generated.
thought that "temporary" flag was something else
BadIdeasBureau
Oh, yeah, I should update the readme at some point 😛
Calego
Calego3y ago
thanks @badideasbureau
Leo The League Lion
@calego gave vote LeaguePoints™ to @badideasbureau (#7 • 288)