function init(hero) {
    hero.setName("Darkseid");
    hero.setVersion("\u00A76\u00A7lComics\u00A7r");
    hero.setTier(10);
    
    hero.setHelmet("Head");
    hero.setChestplate("Chestplate");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
    
    hero.addPowers("ahhp:omega_beam");
    hero.addAttribute("PUNCH_DAMAGE", 14.5, 0);
    hero.addAttribute("KNOCKBACK", 3.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", -2.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("SPRINT_SPEED", 5.0, 1);
    hero.addAttribute("FALL_RESISTANCE", 4.0, 1);
    
    hero.addKeyBind("CHARGED_BEAM", "Omega Beam", 1);
    hero.addKeyBind("EARTHQUAKE", "Omega Quake", 2);
    hero.addKeyBind("SHIELD", "Omega ForceField", 3);
    hero.addKeyBind("HOVER", "Levitate", 4);
    hero.addKeyBind("TELEPORT", "Boomtube", 4);
    hero.addKeyBindFunc("func_GIANT_MODE", giantModeKey, "Omega Form", 5);

    hero.setDefaultScale(1.2);
    hero.addAttributeProfile("SHIELD", shieldProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasProperty(hasProperty);
    
    hero.addSoundEvent("LAND", "fiskheroes:anti_land");
    hero.addSoundEvent("PUNCH", "fiskheroes:anti_punch");
    hero.addSoundEvent("STEP", "fiskheroes:anti_walk");
}

function giantModeKey(player, manager) {
    var flag = player.getData("fiskheroes:dyn/giant_mode");
    manager.setData(player, "fiskheroes:dyn/giant_mode", !flag);
    manager.setData(player, "fiskheroes:size_state", flag ? -1 : 1);
    return true;
}

function shieldProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("BASE_SPEED", -0.25, 1);
    profile.addAttribute("JUMP_HEIGHT", -1.0, 1);
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:shield_blocking") ? "SHIELD" : null;
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:arrow_catching":
        return entity.getData("fiskheroes:scale") <= 1.21 && !entity.getData("fiskheroes:shield_blocking");
    case "fiskheroes:tremor":
        return entity.getData("fiskheroes:scale") <= 1.21;
    case "fiskheroes:flight":
        return entity.getData("fiskheroes:scale") <= 1.21;
    case "fiskheroes:hover":
        return entity.getData("fiskheroes:scale") <= 1.21;
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "func_GIANT_MODE":
        var timer = entity.getData("fiskheroes:dyn/giant_mode_timer");
        return timer == 0 || timer == 1;
    case "EARTHQUAKE":
        return entity.getData("fiskheroes:scale") <= 1.21;
    case "HOVER":
        return entity.getData("fiskheroes:scale") <= 1.21;
    case "TELEPORT":
        return entity.getData("fiskheroes:scale") <= 1.21 && entity.isSneaking();
    case "SHIELD":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:scale") <= 1.21;
    default:
        return true;
    }
}

function hasProperty(entity, property) {
    return property == "BREATHE_SPACE";
}