function init(hero) {
    hero.setName("Spartan CW");
    hero.setTier(2);
    
    hero.setHelmet("Helmet");
    hero.setChestplate("Jacket");
    hero.setLeggings("Pants");
    hero.setBoots("Boots");
    hero.addEquipment("fiskheroes:rip_hunters_gun");
    hero.addEquipment("fiskheroes:chronos_rifle");
    hero.addEquipment("fiskheroes:grappling_gun");

    hero.addAbilities("fiskheroes:enhanced_reflexes", "fiskheroes:energy_blast");
    hero.addAttribute("ATTACK_DAMAGE", 0.72, 1);
    hero.addAttribute("FALL_RESISTANCE", 0.65, 1);
    hero.addAttribute("PUNCH_DAMAGE", 6.70, 0);
    hero.addAttribute("SPRINT_SPEED", 0.35, 1);
    
    hero.addKeyBind("AIM", "Aim", 1);
    
    hero.setRuleValueModifier(ruleModifier);
    hero.setModifierEnabled(isModifierEnabled);
    hero.supplyFunction("canAim", canAim);
}

function ruleModifier(entity, rule) {
    if (rule.name() == "fiskheroes:cooldown_energyblast") {
        return 7.0;
    }
    return null;
}

function isModifierEnabled(entity, modifier) {
	if (modifier == "fiskheroes:energy_blast") {
        return entity.getData("fiskheroes:aimed_timer") >= 1;
	}
	return true;
}

function canAim(entity) {
    return entity.getHeldItem().name() == "fiskheroes:rip_hunters_gun" || entity.getHeldItem().name() == "fiskheroes:chronos_rifle" || entity.getHeldItem().isEmpty();
}