CombatSystem
JSON Format
{
"type": "CombatSystem",
"stats": ...,
"combatant_types": ...,
"encounter_resolution_message": ...,
"initiative_system": ...,
"difficulty_levels": ...,
"is_encounter_within_difficulty_level": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
stats | Map<String, Stat> | ✓ | NOTE: Even though this type shows in this documentation as Map<String, Stat>, it should be treated as List<Stat> instead. This is the list of stats that the combat system has access to. It mostly allows to define some logic in a common place to simplify expressions in the combat system definitions (e.g: encounter_resolution_message, is_encounter_within_difficulty_level, etc) |
combatant_types | List<Combatant> | ✓ | A list of all potential combatant types that the combat tracker should support. Normally this is just player, monster and (maybe) NPC. |
encounter_resolution_message | StatFormulaComponent | Optional. Defaults to null. A StatFormulaComponent that should compute the message to be displayed when the encounter is finished. The encounter will be considered finished if (and only if) this message returns a value different than null. Typically, this message should be implemented using a when StatFormulaComponent that returns a valid string when the encounter has ended and null otherwise.@type string? | |
initiative_system | InitiativeSystem | ✓ | The initiative system to be used by the combat tracker |
difficulty_levels | List<DifficultyLevel> | Optional. The difficulty levels supported by the encounter builder. If this property is omitted, the app will only rely on min/max constraints for encounter building. | |
is_encounter_within_difficulty_level | StatFormulaComponent | Optional. This StatFormulaComponent should return a boolean stating if the encounter is valid for the given selected difficulty level. The current selected difficulty level is available as a stat with the id $combat_difficulty. All included combatants are available under $combat.combatants. A particular combatant's type can be queried by using their $combatant_type property, which will return the combatant type ID of that combatant. The actual resources being used can be checked via $combatant.$template_resource_id or $combatant.$instance_resource_id. e.g: rpgs filter( $combatants, filter = ($combatant) => $combatant.$combatant_type == "monster" ) When creating an encounter, the app will choose monsters and query this formula to understand if the encounter it's creating is exceeding the threshold or if it should continue to add monsters. If this property is omitted, the app will only rely on min/max constraints for encounter building.@type bool |