function init(hero) {
    hero.setName("Spider-Man");
    hero.setVersion("Miles Morales");
    hero.setTier(4);
    
    hero.setHelmet("item.superhero_armor.piece.mask");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addAbilities("fiskheroes:propelled_flight", "fiskheroes:gliding", "fiskheroes:enhanced_reflexes", "fiskheroes:cellular_regeneration", "fiskheroes:accelerated_perception", "fiskheroes:electrokinesis", "fiskheroes:leaping", "fiskheroes:invisibility", "fiskheroes:steel_transformation");
    hero.addAttribute("ATTACK_DAMAGE", 0.25, 1);
    hero.addAttribute("FALL_RESISTANCE", 0.9, 1);
    hero.addAttribute("JUMP_HEIGHT", 2.75, 0);
    hero.addAttribute("PUNCH_DAMAGE", 8.5, 0);
    hero.addAttribute("SPRINT_SPEED", 0.55, 1);

    hero.addKeyBind("TRANSFORM", "Web Swing", 5);
    hero.addKeyBind("SLOW_MOTION", "Spidey Sense", 1);
    hero.addKeyBind("STEEL_TRANSFORM", "Toggle Invisibility", 2);

    hero.setDefaultScale(0.98);
    hero.supplyFunction("getTransformTimerTicks", 3);
    hero.supplyFunction("getTransformTimerRegen", 5.5);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setRuleValueModifier(ruleModifier);
}

function isModifierEnabled(entity, modifier) {
    switch (modifier) {
    case "fiskheroes:gliding":
        return entity.getData("fiskheroes:transform_cooldown") == 0;
    case "fiskheroes:propelled_flight":
        return entity.getData("fiskheroes:transformed");
    case "fiskheroes:electrokinesis":
        return entity.getData("fiskheroes:transform_timer") == 0;

    default:
        return true;
    }
}
function ruleModifier(entity, rule) {
    if (rule.name() == "fiskheroes:ticks_steeltimer") {
        return 5100.0;
    }
   return null;
}