function init(hero) {
    hero.setName("Doctor Doom");
    hero.setAliases("doom");
    hero.setTier(5);

    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");

    hero.addPowers("soulhp:doctor_doom_power");
    hero.addAttribute("PUNCH_DAMAGE", 8, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.5, 0);
    hero.addAttribute("FALL_RESISTANCE", 5.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.5, 1);

    hero.addKeyBind("SHIELD", "ForceField", 4);
    hero.addKeyBind("AIM", "Laser Aim", 1);
    hero.addKeyBind("CHARGED_BEAM", "Force Blast", 2);

    hero.setModifierEnabled(isModifierEnabled);

    hero.supplyFunction("canAim", canAim);

    hero.setTickHandler((entity, manager) => {
        var flying = entity.getData("fiskheroes:flying");
        manager.incrementData(entity, "fiskheroes:dyn/booster_timer", 2, flying);
    });

}

function isModifierEnabled(entity, modifier) {
    var flight = (!entity.getData("fiskheroes:flying") || entity.getData("fiskheroes:flying") && !entity.isSprinting() )
    switch (modifier.name()) {
    case "fiskheroes:shield":
        return flight;
    case "fiskheroes:charged_beam":
        return flight && entity.getData("fiskheroes:aiming_timer") == 0;
    default:
        return true;
    }
}

function canAim(entity) {
    return entity.getData("fiskheroes:flying") && entity.isSprinting() ? false : entity.getHeldItem().isEmpty() && !entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:beam_charge") == 0;
}
