function init(hero) {
    hero.setName("Reality Stone/Aether");
    hero.setTier(3);
    
    hero.setChestplate("Container");

    hero.addPowers("jmctheroes:reality_stone");

    hero.addKeyBind("SHADOWFORM", "\u00A7cRearrange Atoms", 1);
    hero.addKeyBind("SHADOWDOME", "\u00A7cReality Warp", 2);
    hero.addKeyBind("SPELL_MENU", "\u00A7cDuplication", 3);
    hero.addKeyBind("SIZE_MANIPULATION", "\u00A7cSize Illusion", 4);
    hero.addKeyBind("REALITY_STONE", "Toggle Reality Stone", 5);

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

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

function realityProfile(profile) {
    profile.addAttribute("PUNCH_DAMAGE", 8.1, 0);
    profile.addAttribute("WEAPON_DAMAGE", -2.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 1.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 1.0, 1);
    profile.addAttribute("SPRINT_SPEED", 0.40, 1);
}

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

function isKeyBindEnabled(entity, keyBind) {
    
    switch (keyBind) {
    case "SHADOWFORM":
        return (entity.getData("jmctheroes:dyn/reality"));
    case "SHADOWDOME":
        return (entity.getData("jmctheroes:dyn/reality"));
    case "SPELL_MENU":
        return (entity.getData("jmctheroes:dyn/reality"));
    case "SIZE_MANIPULATION":
        return (entity.getData("jmctheroes:dyn/reality"));
    default:
        return true;
    }    
}

function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:shadowform") {
        return (entity.getData("jmctheroes:dyn/reality"));
    }
    else if (modifier.name() == "fiskheroes:shadowdome") {
        return (entity.getData("jmctheroes:dyn/reality"));
    }
    else if (modifier.name() == "fiskheroes:size_manipulation") {
        return (entity.getData("jmctheroes:dyn/reality"));
    }
    else if (modifier.name() == "fiskheroes:flight") {
        return (entity.getData("jmctheroes:dyn/reality")) && (entity.getData("fiskheroes:shadowform"));
    }
    return true;
}