| name | activated-ability |
| description | Build, edit, or debug ActivatedAbility objects for monsters, heroes, or items. Use when asked to "create an ability", "add a strike", "implement a monster ability", "build an activated ability", or work with ability behaviors. |
| metadata | {"author":"draw-steel-codex","version":"1.0.0","argument-hint":"<ability-description-or-monster-name>"} |
Activated Ability Builder
Create and edit ActivatedAbility objects for the Draw Steel Codex. Abilities appear in monster bestiary entries (innateActivatedAbilities), in CharacterModifier objects (behavior: "activated"), and in data tables.
Key References
Read these files as needed when building abilities:
| File | What it contains |
|---|
DMHub Game Rules/ActivatedAbility.lua | Base ActivatedAbility and ActivatedAbilityBehavior types, casting pipeline, RegisterType system |
Draw Steel Core Rules/MCDMAbilityRollBehavior.lua | ActivatedAbilityPowerRollBehavior -- power roll + tier resolution |
Draw Steel Core Rules/MCDMAbilityBehavior.lua | ActivatedAbilityDrawSteelCommandBehavior -- text-parsed rule commands |
Draw Steel Core Rules/MCDMAbilitySaveBehavior.lua | Saving throw behaviors |
Draw Steel Core Rules/MCDMActivatedAbility.lua | Draw Steel extensions to ActivatedAbility (keywords, rendering, targeting) |
DMHub Game Rules/AbilityInvokeAbility.lua | ActivatedAbilityInvokeAbilityBehavior -- invoke other abilities |
DMHub Game Rules/AbilityApplyRiders.lua | ActivatedAbilityApplyRidersBehavior -- condition riders |
DMHub Game Rules/AbilitySummon.lua | ActivatedAbilitySummonBehavior |
DMHub Game Rules/AbilityFloatText.lua | ActivatedAbilityFloatTextBehavior |
DMHub Game Rules/AbilityPurgeEffects.lua | ActivatedAbilityPurgeEffectsBehavior |
DMHub Game Rules/AbilityRelocateCreature.lua | Forced movement / teleportation |
Draw Steel Ability Behaviors/ | 22 additional behavior implementations |
userdata/bestiary/CLAUDE.md | Full bestiary YAML format documentation |
ActivatedAbility YAML Structure
Every ActivatedAbility object in YAML follows this structure. Only include fields that differ from defaults.
__typeName: ActivatedAbility
guid: "uuid"
name: "Slam"
description: "A powerful melee attack."
targetType: target
targetAllegiance: enemy
range: "5"
numTargets: "1"
objectTarget: false
selfTarget: false
repeatTargets: false
actionResourceId: "d19658a2-4d7b-4504-af9e-1a5410fb17fd"
resourceCost: "none"
resourceNumber: "1"
abilityType: none
categorization: "Signature Ability"
villainAction: ""
keywords:
Strike: true
Melee: true
Weapon: true
display:
bgcolor: "#ffffffff"
saturation: 1
brightness: 1
hueshift: 0
iconid: "uuid"
multipleModes: false
modeList:
- text: "Untyped"
- text: "Fire"
usageLimitOptions:
charges: "1"
resourceRefreshType: encounter
resourceid: "uuid"
behaviors: [ ... ]
persistence: []
modifiers: []
strain: []
displayOrder: 0
Behavior Types Reference
Behaviors are the core of what an ability does. They execute in order when the ability is cast. Each has __typeName and type-specific fields.
ActivatedAbilityPowerRollBehavior
The Draw Steel power roll. Rolls 2d10 + attribute, resolves into 3 tiers.
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 3"
tiers:
- "5 damage"
- "9 damage"
- "12 damage; slowed (save ends)"
modesSelected:
- 1
Tier strings are parsed by ActivatedAbilityDrawSteelCommandBehavior's rule engine. They support:
- Damage:
"5 damage", "9 fire damage", "2d6 + 3 damage"
- Conditions:
"slowed (save ends)", "restrained (EoT)", "dazed (save ends)"
- Forced movement:
"slide 3", "push 2", "pull 5", "vertical push 3"
- Combined:
"9 damage; slowed (save ends)" (semicolon-separated)
- Conditional on tier:
"M<2 restrained (EoT)" -- only if power roll >= tier 2 threshold
ActivatedAbilityDrawSteelCommandBehavior
Executes a text-parsed rule command. Used standalone or as part of power roll tiers.
- __typeName: ActivatedAbilityDrawSteelCommandBehavior
rule: "M<2 restrained (EoT)"
filterTarget: 'Target.Conditions has "Slowed"'
promptWhenResolving: false
Rule string patterns:
"N damage" or "NdM + X damage" or "N type damage" (e.g., "5 fire damage")
"conditionName (duration)" -- durations: (save ends), (EoT), (resistance ends)
"push N", "pull N", "slide N", "vertical push N", "vertical slide N"
"M<N ..." -- only apply if power roll met tier N threshold
"; " separates multiple effects
"taunted by caster (EoT)" -- condition with "by caster" qualifier
"teleport N" -- teleport the target
ActivatedAbilityDamageBehavior
Rolls damage dice via a dialog. Use for damage outside of power roll tiers.
- __typeName: ActivatedAbilityDamageBehavior
roll: "2d6 + 3"
damageType: "fire"
separateRolls: false
cannotBeReduced: false
doesNotTrigger: false
chatMessage: ""
titleText: ""
ActivatedAbilityApplyRidersBehavior
Adds condition riders that modify how conditions are applied by other behaviors.
- __typeName: ActivatedAbilityApplyRidersBehavior
conditionid: "uuid"
riderid: "uuid"
filterTarget: ""
ActivatedAbilityApplyOngoingEffectBehavior
Applies a persistent ongoing effect (condition, buff, etc.).
- __typeName: ActivatedAbilityApplyOngoingEffectBehavior
applyto: targets
ongoingEffect: "uuid"
ongoingEffectCustom: false
filterTarget: ""
ActivatedAbilityAuraBehavior
Creates an aura zone on the map.
- __typeName: ActivatedAbilityAuraBehavior
aura:
__typeName: Aura
guid: "uuid"
name: "Poison Cloud"
objectid: "uuid"
applyto: enemies
damage: 3
difficult_terrain: false
display: { bgcolor: "#ffffffff", saturation: 1, brightness: 1, hueshift: 0 }
modifiers: []
triggers: []
applyto: caster
duration: nextturn
aliveafterdeath: false
ActivatedAbilityInvokeAbilityBehavior
Invokes another ability as part of this one (e.g., forced movement that triggers a free strike).
- __typeName: ActivatedAbilityInvokeAbilityBehavior
abilityType: standard
standardAbility: "uuid"
namedAbility: "Ability Name"
standardAbilityParams:
distance: "3"
applyto: targets
invokeOnCaster: false
runOnController: false
ActivatedAbilitySummonBehavior
Summons creatures from the bestiary.
- __typeName: ActivatedAbilitySummonBehavior
monsterType: "uuid"
bestiaryFilter: 'beast.cr = 1'
numSummons: "1"
allCreaturesTheSame: false
casterControls: true
replaceCaster: false
ActivatedAbilityPurgeEffectsBehavior
Removes conditions or ongoing effects.
- __typeName: ActivatedAbilityPurgeEffectsBehavior
conditions: []
mode: conditions
purgeType: all
targetDuration: save
ActivatedAbilityFloatTextBehavior
Shows floating text above a creature.
- __typeName: ActivatedAbilityFloatTextBehavior
text: "Dwoemer Burst"
color: "#ff0000ff"
applyto: caster
ActivatedAbilityDestroyBehavior
Destroys (removes) the target creature.
- __typeName: ActivatedAbilityDestroyBehavior
applyto: caster
ActivatedAbilityMacroBehavior
Executes a DMHub macro command string.
- __typeName: ActivatedAbilityMacroBehavior
macro: "command string"
ActivatedAbilityRememberBehavior
Stores a computed value in the cast's memory for later behaviors to use.
- __typeName: ActivatedAbilityRememberBehavior
memoryName: "storedValue"
calculation: "2 * Level"
Other Behavior Types
These are less commonly needed but available:
ActivatedAbilityApplyAbilityDurationEffect (id: temporary_effect) -- temporary effect lasting for the ability's duration
ActivatedAbilityForcedMovementLocBehavior (id: forcedmovementloc) -- sets origin point for forced movement
ActivatedAbilityOpposedRollBehavior (id: opposed) -- opposed power roll checks
ActivatedAbilityPayAbilityCostBehavior (id: pay_ability_cost) -- consume resources
ActivatedAbilityChangeTerrainBehavior (id: terraform_terrain) -- modify terrain
ActivatedAbilityChangeElevationBehavior (id: terraform_elevation) -- modify elevation
ActivatedAbilityCreateObjectBehavior (id: create_object) -- spawn map objects
ActivatedAbilityDisguiseBehavior (id: disguise) -- disguise creatures
ActivatedAbilityFallBehavior (id: fall) -- trigger falling
ActivatedAbilityRaiseCorpseBehavior (id: raise_corpse) -- revive creatures
ActivatedAbilityRecastBehavior (id: recast) -- recast recently used abilities
ActivatedAbilityCharacterSpeechBehavior (id: character_speech) -- creature speech
ActivatedAbilityRevertLocBehavior (id: revertloc) -- revert to previous position
ActivatedAbilityManipulateTargetLocs (id: manipulate_target_locs) -- move between floors
TriggeredAbility Structure
TriggeredAbility extends ActivatedAbility and is used inside CharacterModifier objects (behavior: "trigger") for reactive abilities.
__typeName: TriggeredAbility
guid: "uuid"
name: "Acidic Retaliation"
description: "When this creature takes damage, adjacent enemies take 3 acid damage."
trigger: takedamage
targetType: all
range: 1
numTargets: "1"
mandatory: true
castImmediately: true
behaviors: [ ... ]
triggerFilter: ""
conditionFormula: ""
Trigger event types: takedamage, endturn, beginturn, creaturedeath, d20roll, onenter, losehitpoints, zerohitpoints, kill, attack, dealdamage, finishmove, custom
Common Patterns
Simple Strike (Melee, Single Target)
- __typeName: ActivatedAbility
name: "Claw"
targetType: target
range: "1"
numTargets: "1"
actionResourceId: "d19658a2-4d7b-4504-af9e-1a5410fb17fd"
categorization: "Signature Ability"
keywords: { Strike: true, Melee: true, Weapon: true }
behaviors:
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 3"
tiers:
- "5 damage"
- "9 damage"
- "12 damage"
Strike with Condition
behaviors:
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 2"
tiers:
- "4 damage"
- "7 damage; slowed (save ends)"
- "10 damage; restrained (save ends)"
Ranged Area Attack (Multiple Targets)
- __typeName: ActivatedAbility
name: "Flame Burst"
targetType: all
range: "10"
numTargets: "3"
keywords: { Magic: true, Ranged: true, Area: true }
behaviors:
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 4"
tiers:
- "3 fire damage"
- "6 fire damage"
- "8 fire damage; push 2"
Dual-Mode Ability (Melee or Ranged)
- __typeName: ActivatedAbility
name: "Strike"
multipleModes: true
modeList:
- text: "Melee"
- text: "Ranged"
keywords: { Strike: true, Melee: true, Ranged: true, Weapon: true }
behaviors:
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 3"
modesSelected: [1]
tiers: ["5 damage", "8 damage", "11 damage"]
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 3"
modesSelected: [2]
tiers: ["4 damage", "7 damage", "10 damage"]
Villain Action with Forced Movement
- __typeName: ActivatedAbility
name: "Tremor Slam"
villainAction: "Villain Action 1"
targetType: all
range: "3"
numTargets: "all"
behaviors:
- __typeName: ActivatedAbilityPowerRollBehavior
roll: "2d10 + 5"
tiers:
- "6 damage; push 1"
- "10 damage; push 3"
- "14 damage; push 5; prone (EoT)"
Passive Trait with Triggered Ability (in characterFeatures)
characterFeatures:
- __typeName: CharacterFeature
guid: "uuid"
name: "Acidic Blood"
source: Trait
description: "When this creature takes damage, adjacent enemies take 3 acid damage."
modifiers:
- __typeName: CharacterModifier
guid: "uuid"
behavior: trigger
triggeredAbility:
__typeName: TriggeredAbility
guid: "uuid"
name: "Acidic Blood"
trigger: takedamage
targetType: all
range: 1
mandatory: true
castImmediately: true
behaviors:
- __typeName: ActivatedAbilityDamageBehavior
roll: "3"
damageType: acid
FilterTarget Patterns
The filterTarget field on behaviors uses GoblinScript to conditionally apply effects:
Target.Conditions has "Slowed" # target has a specific condition
Target.Conditions has not "Slowed" # target does not have condition
Target.Stamina < Target.MaxStamina / 2 # target is bloodied
Target.Size <= 1 # target is size 1 or smaller
Creating New Lua Behavior Types
When an ability needs logic beyond what existing behaviors provide, create a new behavior in Draw Steel Ability Behaviors/:
local mod = dmhub.GetModLoading()
RegisterGameType("ActivatedAbilityMyNewBehavior", "ActivatedAbilityBehavior")
ActivatedAbility.RegisterType{
id = 'my_new',
text = 'My New Behavior',
createBehavior = function()
return ActivatedAbilityMyNewBehavior.new{
}
end
}
ActivatedAbilityMyNewBehavior.summary = 'My New Behavior'
function ActivatedAbilityMyNewBehavior:Cast(ability, casterToken, targets, options)
ability:CommitToPaying(casterToken, options)
for _, target in ipairs(targets) do
target.token:ModifyProperties{
description = "My Effect",
execute = function()
end,
}
end
end
function ActivatedAbilityMyNewBehavior:EditorItems(parentPanel)
local result = {}
self:ApplyToEditor(parentPanel, result)
self:FilterEditor(parentPanel, result)
return result
end
Then add a require for the new file in main.lua (after the other behavior requires).
Constraints
- All Lua files must be ASCII-only (no Unicode punctuation).
- New files must start with
local mod = dmhub.GetModLoading().
- RegisterGameType result must be assigned to a global:
Foo = RegisterGameType("Foo").
- New behavior files must be
required in main.lua after existing behavior files.