function init(hero) {
    hero.setName("Power Stone/The Orb");
    hero.setTier(2);
    
    hero.setChestplate("Orb");

    hero.addPowers("jmctheroes:power_stone");

    hero.addKeyBind("CHARGED_BEAM", "\u00A75Charged Beam", 1);
    hero.addKeyBind("POWER_STONE", "Toggle Power Stone", 5);

    hero.addAttributeProfile("POWER", powerProfile);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setAttributeProfile(getProfile);
    hero.setTierOverride(getTierOverride);
}

function getTierOverride(entity) {
    return entity.getData("jmctheroes:dyn/power") ? 2 : 1;
}

function powerProfile(profile) {
    profile.addAttribute("PUNCH_DAMAGE", 9.7, 0);
    profile.addAttribute("WEAPON_DAMAGE", -1.0, 0);
    profile.addAttribute("JUMP_HEIGHT", 3.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 12.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.40, 1);
}

function getProfile(entity) {
    if (entity.getData("jmctheroes:dyn/power")) {
        return "POWER";
    }
}

function isKeyBindEnabled(entity, keyBind) {
    
    switch (keyBind) {
    case "CHARGED_BEAM":
        return (entity.getData("jmctheroes:dyn/power"));
    default:
        return true;
    }    
}


function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:charged_beam") {
        return (entity.getData("jmctheroes:dyn/power"));
    }
    else if (modifier.name() == "fiskheroes:lightning_cast") {
        return (entity.getData("jmctheroes:dyn/power"));
    }
    else if (modifier.name() == "fiskheroes:leaping") {
        return (entity.getData("jmctheroes:dyn/power"));
    }
    return true;
}