function init(hero) {
    hero.setName("Asta/Black Clover Pre Timeskip");
    hero.setTier(6);
    
    hero.setHelmet("Headband");
    hero.setChestplate("Jacket");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("tmfp:anti_mahou");
    hero.addAttribute("FALL_RESISTANCE", 15.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.7, 0);
    hero.addAttribute("PUNCH_DAMAGE", 6.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.6, 1);
    
    hero.addKeyBind("SHIELD", "Danma no Tsurugi/Demon Slayer Sword", 1);
    hero.addKeyBind("BLADE", "Shukuma no Tsurugi/Demon Dweller Sword", 2);
    hero.addKeyBind("BLACKFORM", "Toggle Black Form", 4);
    hero.addKeyBind("OPEN_GRIMOIRE", "Open/Close Grimoire", 5);
    
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasProperty(hasProperty);
    hero.addAttributeProfile("SHIELD", shieldProfile);
    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.addAttributeProfile("BLACKSHIELD", blackshieldProfile);
    hero.addAttributeProfile("BLACKBLADE", blackbladeProfile);
    hero.setAttributeProfile(getProfile);
}
function shieldProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 20.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.3, 1);
    profile.addAttribute("JUMP_HEIGHT", 0.5, 0);
}
function blackshieldProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 35.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.5, 1);
    profile.addAttribute("JUMP_HEIGHT", 1.0, 0);
}
function blackbladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 30.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("JUMP_HEIGHT", 1.2, 0);
}
function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 15.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("JUMP_HEIGHT", 1.0, 0);
}
function getProfile(entity) {
    if (entity.getData("fiskheroes:blade") && !entity.getData("tmfp:dyn/blackform")) {
        return "BLADE";
    }
    else if (entity.getData("fiskheroes:shield") && !entity.getData("tmfp:dyn/blackform")) {
        return "SHIELD";
    }
    else if (entity.getData("tmfp:dyn/blackform") && entity.getData("fiskheroes:shield")) {
        return "BLACKSHIELD";
    }
    else if (entity.getData("tmfp:dyn/blackform") && entity.getData("fiskheroes:blade")) {
        return "BLACKBLADE";
    }
        return null;
}
function hasProperty(entity, property) {
    return property == "MASK_TOGGLE";
}
function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "SHIELD":
        return entity.getData("tmfp:dyn/grimoire_timer") == 1 && !entity.getData("fiskheroes:blade");
    case "BLADE":
        return entity.getData("tmfp:dyn/grimoire_timer") == 1 && !entity.getData("fiskheroes:shield");
    case "BLACKFORM":
        return entity.getData("fiskheroes:shield") || entity.getData("fiskheroes:blade");
    default:
        return true;
    }
}
function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:gliding":
        return entity.getData("tmfp:dyn/blackform");
    default:
        return true;
    }
}