function init(hero) {
    hero.setName("Thor");
	hero.setVersion("Infinity War");
    hero.setTier(5);
    
    hero.setChestplate("Chestplate");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
	hero.addEquipment("minecraft:iron_axe");
    
    hero.addAbilities("fiskheroes:heat_resistance", "fiskheroes:healing_factor", "fiskheroes:steel_transformation", "fiskheroes:electrokinesis", "fiskheroes:superhuman_durability",  "fiskheroes:flight", "fiskheroes:leaping");
    hero.addAttribute("ATTACK_DAMAGE", 1.4, 1);
    hero.addAttribute("PUNCH_DAMAGE", 10, 0);
    hero.addAttribute("SWORD_DAMAGE", 1, 0);
	hero.addAttribute("JUMP_HEIGHT", 3, 0);
	hero.addAttribute("SPRINT_SPEED", 0.3, 1);
	hero.addAttribute("STEP_HEIGHT", 0.5, 0);
	
	hero.addKeyBind("STEEL_TRANSFORM", "key.steelTransform", 1);
	
	hero.setHasProperty(hasProperty);
	hero.addAttributeProfile("STEEL", steelProfile);
	hero.addAttributeProfile("AXE", axe);
    hero.setAttributeProfile(getAttributeProfile);
	hero.setModifierEnabled(isModifierEnabled);
	hero.setRuleValueModifier(ruleModifier);
}

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

function steelProfile(profile) {
	profile.addAttribute("ATTACK_DAMAGE", 2.0, 1);
    profile.addAttribute("PUNCH_DAMAGE", 14.5, 0);
    profile.addAttribute("SWORD_DAMAGE", 2, 0);
	profile.addAttribute("JUMP_HEIGHT", 4, 0);
	profile.addAttribute("SPRINT_SPEED", 0.3, 1);
	profile.addAttribute("STEP_HEIGHT", 0.5, 0);
}

function axe(profile) {
	profile.addAttribute("ATTACK_DAMAGE", 1.4, 1);
    profile.addAttribute("PUNCH_DAMAGE", 19.5, 0);
	profile.addAttribute("JUMP_HEIGHT", 3, 0);
	profile.addAttribute("SPRINT_SPEED", 0.3, 1);
	profile.addAttribute("STEP_HEIGHT", 0.5, 0);
}

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

function getAttributeProfile(entity) {
    return entity.getHeldItem().name() == "minecraft:iron_axe" ? "AXE" : null;
}

function isModifierEnabled(entity, modifier) {
    if (modifier == "fiskheroes:flight") {
        return entity.getHeldItem().name() == "minecraft:iron_axe";
    }
    return true;
}

function ruleModifier(entity, rule) {
    if (rule.name() == "fiskheroes:radius_lightningchain") {
        return 5.5;
    }
	else  if (rule.name() == "fiskheroes:dmg_lightningcast") {
        return 16.0;
    }
   return null;
}