function init(hero) {
    hero.setName("Scarlet Witch");
    hero.setTier(6);
    
    hero.addPowers("pack:chaosmagic","fiskheroes:hover", "fiskheroes:flight");
	   hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.robes");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
	hero.addAttribute("WEAPON_DAMAGE", 1.5, 0);
    hero.addAttribute("PUNCH_DAMAGE", 6, 0);
    hero.addAttribute("FALL_RESISTANCE", 15.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.35, 1);
    hero.addAttribute("SPRINT_SPEED", 0.3, 1);
	
    hero.addKeyBind("AIM", "key.aim", -1);

    hero.addKeyBind("ENERGY_PROJECTION", "Chaos Beam", 4);
    hero.addKeyBind("SHIELD", "Chaos Shield", 1);
    hero.addKeyBind("SPELL_MENU", "Chaos Magic", 2);
    hero.addKeyBind("TELEKINESIS", "Chaos Telekinesis", 3);
	hero.addKeyBind("HOVER", "Hover", 5);
 
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);
    
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    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:telekinesis")) {
        return keyBind == "TELEKINESIS" || keyBind == "AIM";
    }
    
    return keyBind != "TELEKINESIS" && keyBind != "AIM" || entity.getHeldItem().isEmpty();
}
function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:shield" || !entity.getData("fiskheroes:blade");
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "SHIELD":
        return !entity.getData("fiskheroes:shield") || !(entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:aiming"));
case "SPELL_MENU":
        return !entity.getData("fiskheroes:shield");
 case "ENERGY_PROJECTION":
        return  !entity.getData("fiskheroes:shield");
    default:
        return true;
    }
}

function canAim(entity) {
    return entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:shield_blocking_timer") == 0;
}
