function init(hero) {
    hero.setName("Wolverine");
    hero.setVersion("item.superhero_armor.version.comics");
    hero.setAliases("wolvie");
    hero.setTier(6);
    
    hero.setHelmet("Cowl");
    hero.setChestplate("Chestpiece");
    hero.setLeggings("Pants");
    hero.setBoots("Boots");
    
    hero.addPowers("skarlet:adamantium_skeleton", "skarlet:x_gene_mutation_james_howlett");
    hero.addAttribute("PUNCH_DAMAGE", 6.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", 3.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 6.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.35, 1);
    
    hero.addKeyBind("BLADE", "key.claws", 1);
    
    hero.addAttributeProfile("CLAWS", clawsProfile);
    hero.addAttributeProfile("RAGE", rageProfile);
    hero.addAttributeProfile("RAGE_CLAWS", rageClawsProfile);
	hero.setModifierEnabled(isModifierEnabled);
    hero.setAttributeProfile(getProfile);
    hero.setTierOverride(getTierOverride);
    hero.setDamageProfile(getDamageProfile);
    hero.addDamageProfile("CLAWS", {"types": {"SHARP": 1.0, "ADAMANTIUM": 1.0}});

    hero.addSoundEvent("PUNCH", "skarlet:wolverine_claws_hit");

    hero.setTickHandler((entity, manager) => {
        //lunge
        if (entity.getData("fiskheroes:blade")) {
            if (entity.isSprinting() && entity.motionY() > 0.3 && !entity.isOnGround() && !entity.isInWater() && entity.getData("skarlet:dyn/lunge_timer") == 0) {
                manager.setDataWithNotify(entity, "skarlet:dyn/lunge", true);
            } else if (entity.isOnGround() || entity.isInWater()) {
                manager.setDataWithNotify(entity, "skarlet:dyn/lunge", false);
            }
        } else {
            manager.setDataWithNotify(entity, "skarlet:dyn/lunge", false);
        }

        manager.setData(entity, "fiskheroes:heat_vision", entity.getData("skarlet:dyn/lunge"));
        manager.incrementData(entity, "skarlet:dyn/lunge_timer", 12, entity.getData("skarlet:dyn/lunge"));

        var t = entity.getData("skarlet:dyn/landing_ticks");

        if (t == 0 && entity.world().blockAt(entity.pos().add(0, 4 * entity.motionY(), 0)).isSolid() && entity.getData("fiskheroes:blade") && entity.getData("skarlet:dyn/lunge") && !entity.isInWater()) {
            manager.setDataWithNotify(entity, "skarlet:dyn/landing_ticks", t = 8);
            entity.playSound("skarlet:wolverine.lunge.land", 1, 0.8 + Math.random() * 0.2);
        }
        else if (t > 0) {
            manager.setData(entity, "skarlet:dyn/landing_ticks", --t);
        }
    
        manager.incrementData(entity, "skarlet:dyn/landing_timer", 2, 8, t > 0);

        //damage randomizer
		if(PackLoader.getSide() === "SERVER") {
            if (!(entity.getAir == 0 && entity.isInWater) && entity.getHealth() < 12 && !entity.getData("skarlet:dyn/damage_lock")) {
                var randomRArm = Math.random() < 0.5;
                manager.setDataWithNotify(entity, "skarlet:dyn/rarm_damage", randomRArm);
                var randomLArm = Math.random() < 0.5;
                manager.setDataWithNotify(entity, "skarlet:dyn/larm_damage", randomLArm);
                var randomRLeg = Math.random() < 0.5;
                manager.setDataWithNotify(entity, "skarlet:dyn/rleg_damage", randomRLeg);
                var randomLLeg = Math.random() < 0.5;
                manager.setDataWithNotify(entity, "skarlet:dyn/lleg_damage", randomLLeg);

                manager.setDataWithNotify(entity, "skarlet:dyn/damage_lock", true);
            }

            if (entity.getHealth() > 11 && entity.getData("skarlet:dyn/damage_lock")) {
                manager.setDataWithNotify(entity, "skarlet:dyn/damage_lock", false);
            }
        }

        //rage
        if (entity.getHealth() < 6 && entity.getData("skarlet:dyn/rage_cooldown") == 0) {
            manager.setDataWithNotify(entity, "skarlet:dyn/rage", true)
        }
    });
}
function getTierOverride(entity) {
    return entity.getData("fiskheroes:dyn/steeled") ? 7 : 6;
}

function getDamageProfile(entity) {
    return entity.getData("fiskheroes:blade") ? "CLAWS" : null;
}

function clawsProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 11.0, 0);
}

function rageProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 7.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 2.5, 0);
    profile.addAttribute("FALL_RESISTANCE", 7.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.45, 1);
}

function rageClawsProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 12.0, 0);
    profile.addAttribute("JUMP_HEIGHT", 2.5, 0);
    profile.addAttribute("FALL_RESISTANCE", 7.0, 0);
    profile.addAttribute("SPRINT_SPEED", 0.45, 1);
}

function getProfile(entity) {
    if (entity.getData("fiskheroes:blade") && !entity.getData("skarlet:dyn/rage")) {
        return "CLAWS";
    } else if (entity.getData("fiskheroes:blade") && entity.getData("skarlet:dyn/rage")) {
        return "RAGE_CLAWS";
    } else if (!entity.getData("fiskheroes:blade") && entity.getData("skarlet:dyn/rage")) {
        return "RAGE";
    } else {
        return null;
    }
}

function isModifierEnabled(entity, modifier) {
	switch (modifier.name()) {
		case "fiskheroes:leaping":
			return modifier.id() == "lunge" == (entity.getData("skarlet:dyn/lunge_timer") == 0 && entity.getData("fiskheroes:blade"));
		default:
			return true;
	}
}
