function init(hero) {
    hero.setName("Tinkerer(ps5)");
    hero.setTier(2);
    
    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
	
    hero.addPowers("randomhero:tinkerer_turrets", "fiskheroes:metal_skin", "fiskheroes:retractable_blade", "fiskheroes:retractable_shield");
    hero.addAttribute("PUNCH_DAMAGE", 4.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 1.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 2.5, 0);
    hero.addAttribute("SPRINT_SPEED", 1.0, 0);
	
    hero.addKeyBind("BLADE", "tinkerer blade", 1);
    hero.addKeyBind("SHIELD", "tinkerer shield", 1);
    hero.addKeyBind("SPELL_MENU", "tinkerer turrets", 3);

    hero.setModifierEnabled(isModifierEnabled);
    hero.setHasProperty(hasProperty);
    hero.addAttributeProfile("INACTIVE", inactiveProfile);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getAttributeProfile);
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:water_breathing" || entity.getData("fiskheroes:mask_open");
}

function hasProperty(entity, property) {
    return property == "MASK_TOGGLE" || property == "BREATHE_SPACE" && entity.getData("fiskheroes:mask_open");
}

function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 10.0, 0);
}

function inactiveProfile(profile) {
    profile.revokeAugments();
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:blade":
        return !entity.getData("fiskheroes:shield");
    case "fiskheroes:water_breathing":
        return entity.getData("fiskheroes:mask_open") == 1;
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "SHIELD":
        return !entity.isSneaking() && !entity.getData("fiskheroes:blade");
    case "BLADE":
        return !entity.isSneaking() && !entity.getData("fiskheroes:shield");
    default:
        return true;
    }
}

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