function init(hero) {

    hero.setName("War Machine (Mark 1)");

    hero.setVersion("\u00A7c\u00A7lMCU\u00A7r");

    hero.setTier(8);

    

    hero.setHelmet("Helmet");

    hero.setChestplate("Chestplate");

    hero.setLeggings("Leggings");

    hero.setBoots("Boots");

    

    hero.addPowers("ahhp:war_machine_suit");

    hero.addAttribute("PUNCH_DAMAGE", 8.5, 0);

    hero.addAttribute("WEAPON_DAMAGE", 1.5, 0);

    hero.addAttribute("FALL_RESISTANCE", 8.0, 0);

    hero.addAttribute("SPRINT_SPEED", 0.1, 1);

    

    hero.addKeyBind("AIM", "Aim", 1);

    hero.addKeyBind("SENTRY_MODE", "Sentry Mode", 3);

    hero.addKeyBind("CHARGED_BEAM", "Minigun", 4);

    

    hero.setHasProperty(hasProperty);

    hero.supplyFunction("canAim", canAim);

    hero.addSoundEvent("MASK_OPEN", "fiskheroes:iron_man_mk46_mask_open");

    hero.addSoundEvent("MASK_CLOSE", "fiskheroes:iron_man_mk46_mask_close");

    hero.addSoundEvent("AIM_START", "fiskheroes:repulsor_charge");

    hero.addSoundEvent("AIM_STOP", "fiskheroes:repulsor_powerdown");

    hero.addSoundEvent("STEP", "fiskheroes:iron_man_walk");



    hero.setTickHandler((entity, manager) => {
        var flying = entity.getData("fiskheroes:flying");
        manager.incrementData(entity, "fiskheroes:dyn/booster_timer", 2, flying);

        var item = entity.getHeldItem();
        flying &= !entity.as("PLAYER").isUsingItem();
        manager.incrementData(entity, "fiskheroes:dyn/booster_r_timer", 2, flying && item.isEmpty() && !entity.isPunching() && entity.getData("fiskheroes:aiming_timer") == 0);
        manager.incrementData(entity, "fiskheroes:dyn/booster_l_timer", 2, flying && !item.doesNeedTwoHands());

        var t = entity.getData("fiskheroes:dyn/superhero_landing_ticks");

    if (t == 0 && !entity.isSprinting() && !entity.isOnGround() && entity.motionY() < -1.25 && entity.getData("fiskheroes:flight_boost_timer") > 0 && entity.world().blockAt(entity.pos().add(0, -2, 0)).isSolid()) {
        manager.setDataWithNotify(entity, "fiskheroes:dyn/superhero_landing_ticks", t = 12);
        entity.playSound("fiskheroes:suit.ironman.landing", 1, 1.15 - Math.random() * 0.3);
    }
    else if (t > 0) {
        manager.setData(entity, "fiskheroes:dyn/superhero_landing_ticks", --t);
    }

    manager.incrementData(entity, "fiskheroes:dyn/superhero_landing_timer", 2, 8, t > 0);
    });

}



function hasProperty(entity, property) {

    switch (property) {

    case "BREATHE_SPACE":

        return entity.getData("fiskheroes:mask_open_timer2") == 0;

    case "MASK_TOGGLE":

        return true;

    default:

        return false;

    }

}



function canAim(entity) {

    return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:flight_boost_timer") == 0;

}