
function init(hero) {
    hero.setName("Captain Marvel");	
    hero.setTier(10);
    
	hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.shirt");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.shoes");
    
    hero.addPowers("pack:binary", "fiskheroes:water_breathing", "fiskheroes:fire_immunity","fiskheroes:superhuman_durability", "fiskheroes:cold_resistance");
    
    hero.addAttribute("WEAPON_DAMAGE", 26, 0);
    hero.addAttribute("PUNCH_DAMAGE", 31.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 100.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 1);
    hero.addAttribute("SPRINT_SPEED", 0.55, 1);

	
       hero.addKeyBind("CHARGED_BEAM", "Binary Blast", 1);

    hero.addKeyBind("ENERGY_PROJECTION", "Binary Beam", 2);


    hero.setHasProperty((entity, property) => property == "MASK_TOGGLE");
    hero.supplyFunction("canAim", canAim);

    hero.setHasProperty(hasProperty);
    hero.addSoundEvent("MASK_OPEN", "fiskheroes:mysterio_mask_open");
    hero.addSoundEvent("MASK_CLOSE", "fiskheroes:mysterio_mask_close");
    hero.addSoundEvent("AIM_START", "fiskheroes:mysterio_beam_aim");

   
}



function canAim(entity) {
    return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:beam_charge") == 0 && entity.getData('fiskheroes:time_since_damaged') > 10;
}

function hasProperty(entity, property) {
   return property == "BREATHE_SPACE";
}

function hasProperty(entity, property) {
    return property == "MASK_TOGGLE" || !entity.getData("fiskheroes:mask_open");
}


