function init(hero) {
    hero.setName("Green Ranger");
    hero.setTier(8);
    
    hero.setChestplate("Morpher");
	
    hero.addPowers("rangers:power_ranger_green");
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("PUNCH_DAMAGE", 4.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 7.0, 0);
    
    hero.addKeyBind("TRANSFORM", "Transform", 5);
    hero.addKeyBind("SONIC_WAVES", "key.canaryCry", 1);

    hero.supplyFunction("isInstant", true);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasProperty(hasProperty);
    hero.setTierOverride(getTierOverride);
    hero.addAttributeProfile("INACTIVE", inactiveProfile);

    hero.addSoundEvent("MASK_OPEN", "fiskheroes:mk50_mask_open");
    hero.addSoundEvent("MASK_CLOSE", "fiskheroes:mk50_mask_close");


}
function getTierOverride(entity) {
    return entity.getData("rangers:dyn/power_rangers") ? 8 : 0;
}

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

function isModifierEnabled(entity, modifier) {
    if (modifier.name() != "fiskheroes:transformation" && modifier.name() != "fiskheroes:cooldown" && (!entity.getData("rangers:dyn/power_rangers"))) {
        return false;
    }
  
    switch (modifier.name()) {    
    case "fiskheroes:water_breathing":
        return !entity.getData("fiskheroes:mask_open") && entity.getData("rangers:dyn/power_rangers");
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    if (keyBind == "TRANSFORM") {
        return entity.getData("fiskheroes:mask_open_timer") == 0;
    }
    else if (!entity.getData("rangers:dyn/power_rangers")) {
        return false;
    }
    
    switch (keyBind) {
    case "fiskheroes:invisibility":
        return entity.getData("rangers:dyn/power_rangers");
    default:
        return true;
    }
}

function hasProperty(entity, property) {
    switch (property) {
    case "MASK_TOGGLE":
        return entity.getData("rangers:dyn/power_rangers_timer") == 1;
    case "BREATHE_SPACE":
        return !entity.getData("fiskheroes:mask_open") && entity.getData("rangers:dyn/power_rangers");
    default:
        return false;
    }
}

