
Hooks.once("init", async function() {

    CONFIG.DND5E.spellcasting.blood = {
    label: "Blood",
    type: "single",
    cantrips: true,
    prepares: true,
    order: 50,
    progression: {
        blood: {
        label: "Blood",
        divisor: 1,
        roundUp: true
        }
    },
    table: {
        1: { slots: 1, level: 1 },
        2: { slots: 2, level: 1 },
        3: { slots: 3, level: 1 },
        4: { slots: 4, level: 1 },
        5: { slots: 5, level: 1 },
        6: { slots: 6, level: 1 },
        7: { slots: 7, level: 1 },
        8: { slots: 8, level: 1 },
        9: { slots: 9, level: 1 },
        10: { slots: 10, level: 1 },
        11: { slots: 11, level: 1 },
        12: { slots: 12, level: 1 },
        13: { slots: 13, level: 1 },
        14: { slots: 14, level: 1 },
        15: { slots: 15, level: 1 },
        16: { slots: 16, level: 1 },
        17: { slots: 17, level: 1 },
        18: { slots: 18, level: 1 },
        19: { slots: 19, level: 1 },
        20: { slots: 20, level: 1 },
    }
    };
    CONFIG.DND5E.restTypes.short.recoverSpellSlotTypes.add("blood");
    CONFIG.DND5E.restTypes.long.recoverSpellSlotTypes.add("blood");

    class BloodSpellcasting extends dnd5e.dataModels.spellcasting.SingleLevelSpellcasting {
    /** @override */
    static get TYPE() {
        return "blood";
    }
    }

    dnd5e.dataModels.spellcasting.SpellcastingModel.TYPES.blood = BloodSpellcasting;
});