{
  "format": "encounterra.homebrew",
  "schemaVersion": "0.1",
  "requires": {
    "ruleset": "dnd-2024",
    "srdCatalog": "5.2.1-encounterra.1"
  },
  "package": {
    "id": "272dcd06-a466-4c1c-ad41-f8ba3b7ead69",
    "name": "Cinderroot Warden — Living-Wood Guardian",
    "version": "0.1.2"
  },
  "definitions": [
    {
      "kind": "hero",
      "id": "cinderroot-warden",
      "name": "Cinderroot Warden",
      "stats": {
        "level": 8,
        "hitPoints": 84,
        "hitDice": { "count": 8, "size": 10 },
        "armorClass": 17,
        "speedFeet": 30,
        "burrowSpeedFeet": 10,
        "size": "medium",
        "creatureType": "humanoid",
        "abilityScores": {
          "strength": 18,
          "dexterity": 10,
          "constitution": 18,
          "intelligence": 10,
          "wisdom": 16,
          "charisma": 8
        },
        "savingThrows": {
          "strength": 7,
          "dexterity": 0,
          "constitution": 7,
          "intelligence": 0,
          "wisdom": 3,
          "charisma": -1
        },
        "difficultyClass": 15
      },
      "resources": [
        {
          "id": "sap",
          "maximum": 2,
          "refresh": "shortRest"
        },
        {
          "id": "heartseed",
          "maximum": 1,
          "refresh": "longRest"
        }
      ],
      "actions": [
        "#root-staff",
        "#sap-mending",
        "#heartseed-ward",
        "#briar-shell-form"
      ],
      "grants": [
        {
          "ref": "#regrowth",
          "args": {
            "amount": 6,
            "blocked-by": [
              "fire"
            ]
          }
        },
        "#heartwood-resolve"
      ]
    },
    {
      "kind": "ability",
      "id": "regrowth",
      "name": "Cinderroot Regrowth",
      "parameters": {
        "amount": {
          "valueType": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "blocked-by": {
          "valueType": "damageTypeList"
        }
      },
      "rules": [
        {
          "id": "living-bark",
          "event": "turn.start",
          "oncePer": "turn",
          "when": {
            "all": [
              {
                "hitPoints": {
                  "subject": "self",
                  "operator": "above",
                  "value": 0
                }
              },
              {
                "not": {
                  "eventOccurred": {
                    "event": "damage.received",
                    "subject": "self",
                    "since": "self.previousTurnStarted",
                    "where": {
                      "damageType": {
                        "inParam": "blocked-by"
                      }
                    }
                  }
                }
              }
            ]
          },
          "do": [
            {
              "op": "heal",
              "target": "self",
              "amount": {
                "param": "amount"
              }
            }
          ]
        }
      ]
    },
    {
      "kind": "effect",
      "id": "heartwood-resolve",
      "name": "Heartwood Resolve",
      "rule": {
        "event": "condition.applied",
        "limit": {
          "uses": 2,
          "scope": "encounter"
        },
        "when": {
          "any": [
            {
              "hasCondition": "poisoned"
            },
            {
              "hasCondition": "frightened"
            }
          ]
        },
        "do": [
          {
            "op": "removeCondition",
            "target": "self",
            "condition": "poisoned"
          },
          {
            "op": "removeCondition",
            "target": "self",
            "condition": "frightened"
          }
        ]
      }
    },
    {
      "kind": "action",
      "id": "root-staff",
      "name": "Root Staff",
      "activation": "action",
      "target": {
        "side": "enemy",
        "rangeFeet": 10
      },
      "resolution": {
        "kind": "attack",
        "attackType": "melee",
        "attackBonus": 7,
        "onHit": [
          {
            "op": "damage",
            "amount": {
              "dice": {
                "count": 2,
                "sides": 8
              },
              "bonus": 4
            },
            "damageType": "bludgeoning"
          },
          {
            "op": "push",
            "distanceFeet": 5,
            "maximumSize": "large"
          }
        ]
      }
    },
    {
      "kind": "action",
      "id": "sap-mending",
      "name": "Sap Mending",
      "activation": "bonusAction",
      "target": {
        "side": "self"
      },
      "resource": {
        "ref": "sap",
        "cost": 1
      },
      "resolution": {
        "op": "heal",
        "amount": {
          "kind": "add",
          "operands": [
            {
              "dice": {
                "count": 2,
                "sides": 6
              }
            },
            {
              "kind": "divide",
              "operands": [
                {
                  "kind": "multiply",
                  "operands": [
                    2,
                    8
                  ]
                },
                2
              ]
            }
          ]
        }
      }
    },
    {
      "kind": "action",
      "id": "heartseed-ward",
      "name": "Heartseed Ward",
      "activation": "bonusAction",
      "target": {
        "side": "self"
      },
      "resource": {
        "ref": "heartseed",
        "cost": 1
      },
      "resolution": {
        "op": "temporaryHitPoints",
        "amount": {
          "kind": "min",
          "operands": [
            20,
            {
              "kind": "max",
              "operands": [
                8,
                {
                  "dice": {
                    "count": 3,
                    "sides": 6
                  }
                }
              ]
            }
          ]
        }
      }
    },
    {
      "kind": "action", "id": "briar-shell-form", "name": "Briar Shell",
      "activation": "bonusAction", "magical": true,
      "target": { "side": "self" }, "resource": { "ref": "heartseed", "cost": 1 },
      "resolution": { "op": "transform", "ref": "#briar-shell-body", "durationRounds": 10,
        "temporaryHitPoints": 16, "retainMentalAbilities": true,
        "endWhenTemporaryHitPointsLost": true, "clearTemporaryHitPointsOnEnd": true }
    },
    {
      "kind": "monster", "id": "briar-shell-body", "name": "Briar Shell Body",
      "stats": { "hitPoints": 60, "armorClass": 18, "size": "large", "speedFeet": 30,
        "burrowSpeedFeet": 15, "abilityScores": { "strength": 20, "dexterity": 10, "constitution": 18 },
        "savingThrows": { "strength": 8, "dexterity": 0, "constitution": 7 }, "attacksPerAction": 2 },
      "actions": ["#briar-slam", "#shed-shell"]
    },
    {
      "kind": "action", "id": "briar-slam", "name": "Briar Slam", "delivery": "weapon",
      "weapon": { "category": "natural", "attackAbility": "strength", "opportunityAttack": true },
      "target": { "side": "enemy", "rangeFeet": 5, "includeDowned": true },
      "resolution": { "kind": "attack", "attackType": "melee", "attackBonus": 8,
        "damage": { "dice": { "count": 2, "sides": 8 }, "bonus": 5, "damageType": "bludgeoning" } }
    },
    {
      "kind": "action", "id": "shed-shell", "name": "Shed Shell", "activation": "freeAction",
      "target": { "side": "self" }, "resolution": { "op": "revertForm" }
    }
  ]
}
