
cultist_brain
{
    subBrain: conditionPropertyRatioRange(CURRENT_HEALTH, 0.0, 0.5), cultist_use_health_potions
    subBrain: conditionPropertyRatioRange(CURRENT_MANA, 0.0, 0.2), cultist_use_mana_potions
    subBrain: conditionAlways(), cultist_combat

    subBrain: conditionPropertyRange(CURRENT_NUTRITION, 0, 5000), cultist_eat

    executeSelfTasks
    executeCityTasks

    subBrain: conditionPropertyRange(CURRENT_NUTRITION, 0, 2000), cultist_desperate_wander
    goToRoom
    idle: 500

    # self task creators
    manageLoadout
}

cultist_combat
{
    setTargetWhenAttacked
    #setTargetWhenFriendIsAttacked: human_friend_list
    subBrain: conditionHasTarget(), cultist_combat_abilities
    fleeOnLowHealth: 25
    moveOnTarget: 300
    followTarget
    fleeWhenAttacked
}

cultist_combat_abilities
{
    useRandomAbilities: 300
    faceTarget: 300
}

cultist_use_health_potions
{
    useItem: human_health_potions
}

cultist_use_mana_potions
{
    useItem: human_mana_potions
}

cultist_eat
{
    useItem: human_diet
    subBrain: conditionPropertyRatioRange(CURRENT_NUTRITION, 0.0, 0.05), cultist_eat_from_ground
}

cultist_eat_from_ground
{
    setItemGrabTarget: FOOD_TARGET, human_diet
    useItemTarget: FOOD_TARGET
    goToItemTarget: FOOD_TARGET
}

cultist_desperate_wander
{
    idleOnCity
}
