function init(hero) {
    hero.setName("Space Stone");
    hero.setTier(3);
    
    hero.setChestplate("Tesseract");

    hero.addPowers("jmctheroes:space_stone");

    hero.addKeyBind("SHIELD", "\u00A7bForcefield", 1);
    hero.addKeyBind("TELEPORT", "\u00A7bTeleport", 2);
   	hero.addKeyBind("SPACE_STONE", "Toggle Space Stone", 5);

    hero.addAttributeProfile("SPACE", spaceProfile);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setAttributeProfile(getProfile);
    hero.setHasProperty(hasProperty);
    hero.setTierOverride(getTierOverride);
}

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

function spaceProfile(profile) {
    profile.addAttribute("PUNCH_DAMAGE", 7.5, 0);
    profile.addAttribute("WEAPON_DAMAGE", -2.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 1.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 12.0, 0);
}

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

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


function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:shield") {
        return (entity.getData("jmctheroes:dyn/space"));
    }
    else if (modifier.name() == "fiskheroes:teleportation") {
        return (entity.getData("jmctheroes:dyn/space"));
    }
    return true;
}

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