@vttforge/core / CombatLike
Interface: CombatLike<System> ​
An encounter.
Extends ​
DocumentMembers<System>
Type Parameters ​
System ​
System = Record<string, unknown>
Properties ​
active ​
readonlyactive:boolean
combatant ​
readonlycombatant:CombatantLike<Record<string,unknown>> |null
combatants ​
readonlycombatants:EmbeddedCollection<CombatantLike<Record<string,unknown>>>
current ​
readonlycurrent:CombatHistoryData
documentName ​
readonlydocumentName:string
'Actor', 'Item', 'ActiveEffect', and so on.
Inherited from ​
flags ​
readonlyflags:DocumentFlags
Inherited from ​
id ​
readonlyid:string|null
Inherited from ​
img ​
readonlyimg:string|null
Inherited from ​
isActive ​
readonlyisActive:boolean
isOwner ​
readonlyisOwner:boolean
Whether the current user owns this document.
Inherited from ​
name ​
readonlyname:string
Inherited from ​
nextCombatant ​
readonlynextCombatant:CombatantLike<Record<string,unknown>> |null
parent ​
readonlyparent:DocumentMembers<Record<string,unknown>> |null
The document this one is embedded in, or null at the top level.
Inherited from ​
previous ​
readonlyprevious:CombatHistoryData
round ​
readonlyround:number
scene ​
readonlyscene:SceneLike<Record<string,unknown>> |null
started ​
readonlystarted:boolean
system ​
readonlysystem:System
The type data model instance. Its fields are the schema's fields.
Inherited from ​
turn ​
readonlyturn:number|null
turns ​
readonlyturns:CombatantLike<Record<string,unknown>>[]
type ​
readonlytype:string
The subtype, as declared under documentTypes in the manifest.
Inherited from ​
uuid ​
readonlyuuid:string
Inherited from ​
visible ​
readonlyvisible:boolean
Methods ​
delete() ​
delete(
operation?):Promise<CombatLike<System> |undefined>
Parameters ​
operation? ​
Record<string, unknown>
Returns ​
Promise<CombatLike<System> | undefined>
Inherited from ​
endCombat() ​
endCombat():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
getCombatantsByActor() ​
getCombatantsByActor(
actor):CombatantLike<Record<string,unknown>>[]
Both return arrays since v14. The singular pair is deprecated.
Parameters ​
actor ​
string | ActorLike<Record<string, unknown>, ItemLike<Record<string, unknown>>>
Returns ​
CombatantLike<Record<string, unknown>>[]
getCombatantsByToken() ​
getCombatantsByToken(
token):CombatantLike<Record<string,unknown>>[]
Parameters ​
token ​
string | TokenDocumentLike<Record<string, unknown>>
Returns ​
CombatantLike<Record<string, unknown>>[]
getFlag() ​
getFlag<
T>(scope,key):T|undefined
Type Parameters ​
T ​
T = unknown
Parameters ​
scope ​
string
key ​
string
Returns ​
T | undefined
Inherited from ​
nextRound() ​
nextRound():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
nextTurn() ​
nextTurn():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
previousRound() ​
previousRound():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
previousTurn() ​
previousTurn():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
resetAll() ​
resetAll(
options?):Promise<CombatLike<System>>
Parameters ​
options? ​
updateTurn? ​
boolean
Returns ​
Promise<CombatLike<System>>
rollAll() ​
rollAll(
options?):Promise<CombatLike<System>>
Parameters ​
options? ​
Record<string, unknown>
Returns ​
Promise<CombatLike<System>>
rollInitiative() ​
rollInitiative(
ids,options?):Promise<CombatLike<System>>
Roll initiative for the named combatants.
messageMode replaced messageOptions.rollMode in v14.
Parameters ​
ids ​
readonly string[]
options? ​
formula? ​
string | null
messageMode? ​
string
messageOptions? ​
Record<string, unknown>
updateTurn? ​
boolean
Returns ​
Promise<CombatLike<System>>
rollNPC() ​
rollNPC(
options?):Promise<CombatLike<System>>
Parameters ​
options? ​
Record<string, unknown>
Returns ​
Promise<CombatLike<System>>
setFlag() ​
setFlag(
scope,key,value):Promise<CombatLike<System>>
Parameters ​
scope ​
string
key ​
string
value ​
unknown
Returns ​
Promise<CombatLike<System>>
Inherited from ​
setInitiative() ​
setInitiative(
id,value):Promise<void>
Parameters ​
id ​
string
value ​
number
Returns ​
Promise<void>
setupTurns() ​
setupTurns():
CombatantLike<Record<string,unknown>>[]
Returns ​
CombatantLike<Record<string, unknown>>[]
startCombat() ​
startCombat():
Promise<CombatLike<System>>
Returns ​
Promise<CombatLike<System>>
toObject() ​
toObject(
source?):Record<string,unknown>
A plain-object copy. source reads the stored data instead of the prepared data.
Parameters ​
source? ​
boolean
Returns ​
Record<string, unknown>
Inherited from ​
unsetFlag() ​
unsetFlag(
scope,key):Promise<CombatLike<System>>
Parameters ​
scope ​
string
key ​
string
Returns ​
Promise<CombatLike<System>>
Inherited from ​
update() ​
update(
data,operation?):Promise<CombatLike<System> |undefined>
Parameters ​
data ​
Record<string, unknown>
operation? ​
Record<string, unknown>
Returns ​
Promise<CombatLike<System> | undefined>