function init(hero) {
    hero.setName("Atreus");
    hero.setAliases("Son_of_War", "Boy", "Loki");
    hero.setVersion("\u00A7b\u00A7lGOW \u00A7f\u00A7lRagnarok\u00A7r");
    hero.setTier(6);
    
    hero.setHelmet("Head");
    hero.setChestplate("Body");
    hero.setLeggings("Legs");
    hero.setBoots("Boots");
    hero.addPrimaryEquipment("fiskheroes:compound_bow{display:{Name:Talon Bow}}", true);
    hero.addEquipment("fiskheroes:quiver");
    
    hero.addPowers("fiskheroes:archery", "gowhp:runicsummon_ragnarok", "gowhp:wolfform", "gowhp:lokimagic");
    hero.addAttribute("PUNCH_DAMAGE", 4.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", 2.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.05, 0);
    hero.addAttribute("SPRINT_SPEED", 0.15, 1);
    hero.addAttribute("FALL_RESISTANCE", 10.0, 0);
    hero.addAttribute("BOW_DRAWBACK", 0.4, 1);

    hero.addKeyBind("WOLFFORM", "Unleash the Wolf", 2);
    hero.addKeyBind("CAGEWOLFFORM", "Cage the Wolf", 2);
    hero.addKeyBind("SHIELD", "Magical Shield", 3);
    hero.addKeyBind("SLOW_MOTION", "Eagle Eye", 3);
    hero.addKeyBind("HORIZONTAL_BOW", "key.horizontalBow", 4);
    hero.addKeyBind("CHARGED_BEAM", "Wrath of the Wolf", 5);

    hero.setDefaultScale((entity) => {
      if (entity.getData("gowhp:dyn/wolfform_timer") == 1) {
        return 0.4;
      }
      else {
        return 0.9
      }
    })
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.addAttributeProfile("ANIMALFORMTOGGLE", animalformtoggleProfile);
    hero.addAttributeProfile("ANIMALFORM", animalformProfile);
    hero.addAttributeProfile("RUNICSUMMON", runicsummonProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setHasProperty(hasProperty);
    hero.supplyFunction("canAim", canAim);

    hero.addSoundEvent("MASK_OPEN", "gowhp:atreus_voice_lines");
}

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

function canAim(entity) {
    return entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:shield_blocking_timer") == 0;
}

function animalformtoggleProfile(profile) {
    profile.revokeAugments();
    profile.addAttribute("BASE_SPEED", -1, 0);
    profile.addAttribute("JUMP_HEIGHT", -1, 0);
}

function animalformProfile(profile) {
    profile.addAttribute("PUNCH_DAMAGE", 7.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 1.2, 0);
    profile.addAttribute("SPRINT_SPEED", 2.25, 1);
    profile.addAttribute("FALL_RESISTANCE", 20.0, 0);
}

function runicsummonProfile(profile) {
    profile.revokeAugments();
    profile.addAttribute("BASE_SPEED", -1, 0);
    profile.addAttribute("JUMP_HEIGHT", -1, 0);
}

function getAttributeProfile(entity) {
    if (entity.getData("fiskheroes:beam_charging")) {
        return "RUNICSUMMON";
    }
    if (entity.getData("gowhp:dyn/wolfform_timer") > 0 && entity.getData("gowhp:dyn/wolfform_timer") < 1) {
        return "ANIMALFORMTOGGLE";
    }
    if (entity.getData("gowhp:dyn/wolfform")) {
        return "ANIMALFORM";
    }
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:charged_beam":
        return entity.getHeldItem().name() == 'fiskheroes:compound_bow';
    case "fiskheroes:leaping":
        return entity.getData("gowhp:dyn/wolfform");
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
        case "CAGEWOLFFORM":
            return entity.getData("gowhp:dyn/wolfform");
        case "CHARGED_BEAM":
            return entity.getHeldItem().name() == 'fiskheroes:compound_bow' && !entity.getData("gowhp:dyn/wolfform");
        case "SHIELD":
            return !entity.getData("gowhp:dyn/wolfform");
        case "SLOW_MOTION":
            return entity.isSneaking() && !entity.getData("gowhp:dyn/wolfform");
        case "HORIZONTAL_BOW":
            return !entity.getData("gowhp:dyn/wolfform");
        default:
            return true;
    }
}