function init(hero) {
    hero.setName("Time Stone/Eye Of Agamotto");
    hero.setTier(2);
    
    hero.setChestplate("Necklace");

    hero.addPowers("jmctheroes:time_stone");

    hero.addKeyBind("SUPER_SPEED", "\u00A7aTime-Speed", 1);
    hero.addKeyBind("SLOW_MOTION", "\u00A7aSlow Time", 2);
   	hero.addKeyBind("TIME_STONE", "Toggle Time Stone", 5);

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

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

function timeProfile(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);
    profile.addAttribute("SPRINT_SPEED", 0.75, 1);
    profile.addAttribute("BASE_SPEED_LEVELS", 3.0, 0);
}

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

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


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