function init(hero) {
    hero.setName("The Lucky One/\u00A7c\u00A7lWEB-WARRIORS\u00A7r");
    hero.setTier(10);
    hero.setAliases("tlo", "lo")
    
    hero.setHelmet("item.superhero_armor.piece.hood");
    hero.setChestplate("item.superhero_armor.piece.robes");
    hero.setLeggings("item.superhero_armor.piece.leggings");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("webwarriors:luckiestmagic");
    hero.addAttribute("PUNCH_DAMAGE", 8.25, 0);
    hero.addAttribute("WEAPON_DAMAGE", 1.75, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.15, 0);
    hero.addAttribute("FALL_RESISTANCE", 1.0, 1);
    hero.addAttribute("SPRINT_SPEED", 0.35, 1);
    
    hero.addKeyBind("CHARGED_BEAM", "Lucky Beam", 3);
    hero.addKeyBind("AIM", "Lucky Aim", -1);
    hero.addKeyBind("BLADE", "key.blade", 1);
    hero.addKeyBind("SHIELD", "key.shield", 1);
    hero.addKeyBind("SPELL_MENU", "Luckiest Spells", 4);
    hero.addKeyBind("SHADOWFORM", "Smoke Form", 5);
    hero.addKeyBind("TELEKINESIS", "Lucky Kidnap", 2);
    
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setModifierEnabled(isModifierEnabled);
    hero.supplyFunction("canAim", canAim);
    
    hero.addSoundEvent("AIM_START", "fiskheroes:mysterio_beam_aim");
	
	hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BLADE", {
        "types": {
            "SHARP": 1.0,
            "FIRE": 0.2
        }
    });
}
function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 7.0, 0);
}

function getProfile(entity) {
    return entity.getData("fiskheroes:blade") ? "BLADE" : null;
}

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

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

function isModifierEnabled(entity, modifier) {
    if (modifier.name() == "fiskheroes:leaping") {
        return (!entity.getData("fiskheroes:shadowform"));
    }
    else if (modifier.name() == "fiskheroes:shield") {
        return (!entity.getData("fiskheroes:blade"));
    }
    else if (modifier.name() == "fiskheroes:telekinesis") {
        return (entity.getHeldItem().isEmpty()) && (!entity.getData("fiskheroes:shadowform")) && (!entity.getData("fiskheroes:lightsout"));
    }
    return true;
}