function init(hero) {
    hero.setName("Lucifer1");
    hero.setVersion("angry");
    hero.setTier(9);
    
    hero.setHelmet("item.superhero_armor.piece.head");
    hero.setChestplate("item.superhero_armor.piece.coat");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.shoes");
    hero.addPrimaryEquipment("fisktag:weapon{WeaponType:fan:apple}", true, item => item.nbt().getString("WeaponType") == 'fan:apple');

    hero.setKeyBindEnabled(isKeyBindEnabled);
    
    hero.addPowers("fan:luci","fan:angel", "fan:archangel","fan:extremis","fan:demon");
    hero.addAttribute("FALL_RESISTANCE", 1, 1);
    hero.addAttribute("PUNCH_DAMAGE", 13.0, 0);
    hero.addAttribute("MAX_HEALTH", 5.1, 0);
    hero.addAttribute("SPRINT_SPEED", 0.60, 1)
    hero.addAttribute("STEP_HEIGHT", 0.5, 0); 
    hero.addAttribute("JUMP_HEIGHT", 3.0, 0)
 

    hero.addKeyBind("BLADE", "Fire Arms", 1);
    hero.addKeyBind("TENTACLES", "Toggle Tentacles", 4);
    hero.addKeyBind("TENTACLE_GRAB", "key.tentacleGrab", 2);
    hero.addKeyBind("CHARGED_BEAM", "The fiery spit", 2);
    hero.addKeyBind("TELEPORT", "key.teleport", 3);
    hero.addKeyBind("TELEKINESIS", "Telekinesis", 5);
    hero.addKeyBind("SHADOWDOME", "circus", 4);
	
	hero.supplyFunction("canAim", canAim);
	hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setTierOverride(getTierOverride);
	hero.setAttributeProfile(getProfile);
    hero.addAttributeProfile("APOCALYPSE_ANGEL", activeProfile);
    hero.addAttributeProfile("BLADE", heatProfile);
    hero.setAttributeProfile(getProfile);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("FLAME_PUNCH", {
        "types": {
            "BLUNT": 1.0,
            "FIRE": 0.4
        },
        "properties": {
            "HEAT_TRANSFER": 40,
            "IGNITE": 2
        }
    });

}

function heatProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 5, 0);
}

function getTierOverride(entity) {
    return entity.getData("fan:dyn/archangel") ? 8 : 3;
}

function activeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 6.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 5.0, 0);
	profile.addAttribute("IMPACT_DAMAGE", 0.4, 1);
	profile.addAttribute("SPRINT_SPEED", 0.1, 1);
}


function getProfile(entity) {
    if (entity.getData("fan:dyn/archangel")) {
        return "APOCALYPSE_ANGEL";
    return entity.getData("fiskheroes:blade") ? "BLADE" : null;
    }
}

function isKeyBindEnabled(entity, keyBind) {  
	switch (keyBind) {
	case "AIM":
        return !entity.getData("fan:dyn/archangel");	
	case "SHIELD":
        return entity.getData("fan:dyn/archangel");
        case "CHARGED_BEAM":
        return entity.getData("fiskheroes:blade");
	case "TENTACLE_GRAB":
            return !entity.getData("fiskheroes:tentacles") == 0;
    default:
        return true;
    }
}

function isModifierEnabled(entity, modifier) {
	if (modifier.id() == "ang_3") {
        return !entity.getData("fan:dyn/archangel");
	}
	if (modifier.id() == "ang_2") {
        return !entity.getData("fan:dyn/archangel");
	}
	if (modifier.id() == "ang_1") {
        return !entity.getData("fan:dyn/archangel");
	}	
	if (modifier.id() == "arch_3") {
        return entity.getData("fan:dyn/archangel");
	}
	if (modifier.id() == "arch_2") {
        return entity.getData("fan:dyn/archangel");
	}
	if (modifier.id() == "arch_1") {
        return entity.getData("fan:dyn/archangel");
	}


	return true;

}

function canAim(entity) {
    return entity.getHeldItem().isEmpty();
}