function init(hero) {
    hero.setName("Mister Negative");
    hero.setTier(6);
    
    hero.setHelmet("Head");
    hero.setChestplate("Chestpiece");
    hero.setLeggings("Pants");
    hero.setBoots("Shoes");
    hero.setPrimaryEquipment("fiskheroes:prometheus_sword");
    
    hero.addPowers("dlheroes:negative_alteration");
    hero.addAttribute("PUNCH_DAMAGE", 5.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 3.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 4.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.1, 1);
    
    hero.addKeyBind("SHADOWFORM", "Shadow Form", 1);
    hero.addKeyBind("AIM", "Negative Chain", 2);
    hero.addKeyBind("TELEKINESIS", "Negative Chain", 2);
    hero.addKeyBind("SHADOWDOME", "Negative Dome", 3);
    hero.addKeyBind("CHARGED_BEAM", "Negative Beam", 4);
    
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);
    hero.setHasProperty(hasProperty);
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:flight":
        return entity.getData("fiskheroes:shadowform");
    case "fiskheroes:telekinesis":
        return entity.getHeldItem().isEmpty() && !entity.getData("fiskheroes:shadowform") && !entity.getData("fiskheroes:lightsout");
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    if (entity.getData("fiskheroes:shadowform")) {
        return keyBind == "SHADOWFORM";
    }
    else if (entity.getData("fiskheroes:lightsout")) {
        return keyBind == "SHADOWDOME";
    }
    else if (entity.getData("fiskheroes:telekinesis")) {
        return keyBind == "TELEKINESIS" || keyBind == "AIM";
    }
    
    return keyBind != "TELEKINESIS" && keyBind != "AIM" || entity.getHeldItem().isEmpty();
}

function canAim(entity) {
    return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:grab_id") > -1;
}

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