function init(hero) {
    hero.setName("Mysterio");
    hero.setTier(3);
    
    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestplate");
    hero.setLeggings("item.superhero_armor.piece.leggings");
    hero.setBoots("item.superhero_armor.piece.boots");
	hero.addEquipment("fiskheroes:rip_hunters_gun");
    
    hero.addAbilities( "fiskheroes:spellcasting", "fiskheroes:steel_transformation", "fiskheroes:intangibility", "fiskheroes:invisibility", "fiskheroes:propelled_flight", "fiskheroes:hover", "fiskheroes:electrokinesis");
    hero.addAttribute("PUNCH_DAMAGE", 1.5, 0);
    hero.addAttribute("SWORD_DAMAGE", 0.0, 0);
    
    hero.addKeyBind("AIM", "key.aim", 1);
	hero.addKeyBind("HOVER", "key.hover", 1);
	hero.addKeyBind("INTANGIBILITY", "key.intangibility", 2);
	hero.addKeyBind("INVISIBILITY", "key.invisibility", 3);
	hero.addKeyBind("SPELL_MENU", "key.spellMenu", 4);
	hero.addKeyBind("STEEL_TRANSFORM", "Last Stand", 5);
    
    hero.setHasProperty(hasProperty);
    hero.supplyFunction("canAim", canAim);
	hero.setHasPermission(hasPermission);
	hero.setModifierEnabled(isModifierEnabled);
	hero.addAttributeProfile("STEEL", steelProfile);
    hero.setAttributeProfile(getAttributeProfile);
	hero.supplyFunction("getSpells", getSpells);
}
// This is just Duvain saying hello :)
function hasProperty(entity, property) {
    switch (property) {
    case "MASK_TOGGLE":
        return true;
    case "BREATHE_UNDERWATER":
        return entity.getData("fiskheroes:mask_open");
    case "BREATHE_SPACE":
        return entity.getData("fiskheroes:mask_open");
    default:
        return false;
    }
}

function canAim(entity) {
    return entity.getHeldItem().isEmpty() && !entity.getData("fiskheroes:mask_open") || entity.getHeldItem().name() == "fiskheroes:rip_hunters_gun" && !entity.getData("fiskheroes:mask_open");
}

function hasPermission(entity, permission) {
    return permission == "USE_RIPS_GUN";
}

function steelProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 0.9, 1);
    profile.addAttribute("PUNCH_DAMAGE", 9.5, 0);
    profile.addAttribute("SWORD_DAMAGE", -0.4, 1);
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:mask_open") ? "STEEL" : null;
}

function isModifierEnabled(entity, modifier) {
    if (modifier != "fiskheroes:steel_transformation" || modifier != "fiskheroes:invisibility" || modifier != "fiskheroes:intangibility" || modifier != "fiskheroes:propelled_flight" || modifier != "fiskheroes:hover" || modifier != "fiskheroes:electrokinesis" || modifier != "fiskheroes:umbrakinesis") {
		return entity.getData("fiskheroes:mask_open");
	}
	return true;
}

function getSpells(entity) {
    return ["fiskheroes:duplication"];
}
