var utils = implement("fiskheroes:external/utils");

function init(hero) {
    hero.setName("Kitty Pryde");
    hero.setTier(3);
    
    hero.setHelmet("Hair");
    hero.setChestplate("Chestpiece");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
    
    hero.addPowers("tgheroes:xmen_shadowcat");
    hero.addAttribute("PUNCH_DAMAGE", 3.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.15, 1);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 2.0, 0);

    hero.addKeyBind("INTANGIBILITY", "Intangibility", 1);
    hero.setModifierEnabled(isModifierEnabled);

    hero.setTickHandler((entity, manager) => {
        utils.flightOnIntangibility(entity, manager);
    });
}

function isModifierEnabled(entity, modifier) {
	switch (modifier.name()) {
	case "fiskheroes:flight":
        return entity.getData("fiskheroes:intangible");

    default:
        return true;
    }
    return true;
}