function init(hero) {
    hero.setName("Human Torch");
    hero.setVersion("Fantastic 4");
    hero.setTier(4);
    
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("jmctheroes:cosmic_ray_enhanced_physiology_human_torch");
    hero.addAttribute("FALL_RESISTANCE", 1.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.75, 0);
    hero.addAttribute("PUNCH_DAMAGE", 5.4, 0);
    hero.addAttribute("SPRINT_SPEED", 0.15, 1);
    
    hero.addKeyBind("AIM", "key.aim", 1);
    hero.addKeyBind("FLAME_ON", "Flame On!", 2);

    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "AIM":
        return entity.getHeldItem().isEmpty() && entity.getData("jmctheroes:dyn/torch") && !entity.getData("fiskheroes:gliding");
    default:
        return true;
    }
}

function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:fireball") {
        return (entity.getData("jmctheroes:dyn/torch"));
    }
    else if (modifier.name() == "fiskheroes:flame_blast") {
        return (entity.getData("jmctheroes:dyn/torch"));
    }
    else if (modifier.name() == "fiskheroes:gliding") {
        return (entity.getData("jmctheroes:dyn/torch"));
    }
    else if (modifier.name() == "fiskheroes:fire_immunity") {
        return (entity.getData("jmctheroes:dyn/torch"));
    }
    else if (modifier.name() == "fiskheroes:damage_weakness") {
        return (entity.getData("jmctheroes:dyn/torch"));
    }
    return true;
}

function canAim(entity) {
    return entity.getHeldItem().isEmpty() && entity.getData("jmctheroes:dyn/torch") && !entity.getData("fiskheroes:gliding");
}