

function init(hero) {
    hero.setName("IceDragonPro364/Special Gift Edition");
    hero.setTier(9);
    hero.setHelmet("Hood")
    hero.setChestplate("Cloak");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
    
    hero.addPowers("diminpack:dark_magic");
    hero.addAttribute("PUNCH_DAMAGE", 8.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", 1.5, 0);
    hero.addAttribute("SPRINT_SPEED", 0.1, 1);
    hero.addAttribute("JUMP_HEIGHT", 0.5, 0);
    hero.addAttribute("FALL_RESISTANCE", 100, 1);
    
    hero.addKeyBind("AIM", "key.aim", -1);
    hero.addKeyBind("ENERGY_PROJECTION", "Magic Ray", 1);
    hero.addKeyBind("CHARGED_BEAM", "Focal Ray", 1);
    hero.addKeyBind("BLADE", "key.blade", 2);
    hero.addKeyBind("SHIELD", "key.shield", 2);
    hero.addKeyBind("SPELL_MENU", "key.spellMenu", 3);
    hero.addKeyBind("TELEKINESIS", "Nether's Embrace", 4);
    hero.addKeyBind("SIZE_MANIPULATION", "key.sizeManipulation", 5);
    
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);
    
    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BLADE", {
        "types": {
            "SHARP": 1.0,
            "FIRE": 0.2
        }
    });

    hero.setTickHandler((entity, manager) => {
        if (!entity.isSneaking() && !entity.isOnGround() && entity.motionY() < -0.8) {
            manager.setData(entity, "fiskheroes:flying", true);
        }
    });
}
function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 10.0, 0);
}

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

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:shield" || !entity.getData("fiskheroes:blade");
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
        case "CHARGED_BEAM":
            return entity.getData("fiskheroes:shield_blocking");
        case "ENERGY_PROJECTION":
            return entity.getData("fiskheroes:aiming") && !entity.getData("fiskheroes:shield_blocking");
        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;
}



