function init(hero) {
	hero.setName("The Mandalorian");
	hero.setTier(4);

	hero.setHelmet("Helmet");
	hero.setChestplate("Chestpeice");
	hero.setLeggings("Pants");
	hero.setBoots("Boots");
	hero.addEquipment("fiskheroes:rip_hunters_gun");
	hero.addEquipment("fiskheroes:chronos_rifle");
	hero.addEquipment("fiskheroes:grappling_gun");
	hero.addEquipment("fiskheroes:prometheus_sword");
	hero.addEquipment("fiskheroes:heat_gun");

	hero.addAbilities("fiskheroes:pyrokinesis", "fiskheroes:retractable_shield", "fiskheroes:throwing_stars", "fiskheroes:superhuman_durability", "fiskheroes:cold_resistance", "fiskheroes:fire_immunity", "fiskheroes:explosion_immunity");
	hero.addAttribute("ATTACK_DAMAGE", 0.9, 1);
	hero.addAttribute("FALL_RESISTANCE", 4.0, 0);
	hero.addAttribute("PUNCH_DAMAGE", 2.0, 0);

	hero.addKeyBind("AIM", "key.aim", 1);
	hero.addKeyBind("UTILITY_RESET", "key.utilityReset", 2);
	hero.addKeyBind("SHIELD", "Darksaber", 3);
	
	hero.setHasPermission(hasPermission);
    hero.supplyFunction("canAim", canAim);
	hero.addAttributeProfile("SABER", saber);
    hero.setAttributeProfile(getAttributeProfile);
	hero.setRuleValueModifier(ruleModifier);
	hero.setModifierEnabled(isModifierEnabled);
}

function hasPermission(entity, permission) {
    return permission == "USE_RIPS_GUN" || permission == "USE_CHRONOS_RIFLE" || permission == "USE_GRAPPLING_GUN" || permission == "USE_HEAT_GUN";
}
    
function canAim(entity) {
    return entity.getHeldItem().isEmpty() || entity.getHeldItem().name() == "fiskheroes:rip_hunters_gun" || entity.getHeldItem().name() == "fiskheroes:chronos_rifle" || entity.getHeldItem().name() == "fiskheroes:heat_gun";
}

function saber(profile) {
	profile.addAttribute("ATTACK_DAMAGE", 1.0, 1);
    profile.addAttribute("PUNCH_DAMAGE", 14.5, 0);
	profile.addAttribute("FALL_RESISTANCE", 4.0, 0);
}

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

function ruleModifier(entity, rule) {
    if (entity.isSneaking() && entity.getHeldItem().name() == "fiskheroes:chronos_rifle" && rule.name() == "fiskheroes:dmg_laserbolt") {
        return 20.0;
    }
	else if (rule.name() == "fiskheroes:range_flameblast") {
        return 8.0;
    }
   return null;
}

function isModifierEnabled(entity, modifier) {
    if (modifier == "fiskheroes:pyrokinesis") {
		return entity.getData("fiskheroes:aiming") && entity.getHeldItem().isEmpty();
	}
	return true;
}