function init(hero) {
    hero.setName("Lizard");
    hero.setTier(7);
    
    hero.setHelmet("Head");
    hero.setChestplate("Chest");
    hero.setLeggings("Legs");
    hero.setBoots("Feet");
    
    hero.addPowers("dlheroes:reptilian_physiology");
    hero.addAttribute("FALL_RESISTANCE", 12.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.5, 0);
    hero.addAttribute("PUNCH_DAMAGE", 8.5, 0);
    hero.addAttribute("SPRINT_SPEED", 0.45, 1);
    hero.addAttribute("STEP_HEIGHT", 0.5, 0);
    hero.addAttribute("IMPACT_DAMAGE", 0.5, 1);
    
	hero.addKeyBindFunc("func_GIANT_MODE", giantModeKey, "Lizard Transformation", 5);
    hero.addKeyBind("TENTACLE_JAB", "Tail Jab", 1);
    hero.addKeyBind("GROUND_SMASH", "Ground Smash", 2)
    hero.addKeyBind("SLOW_MOTION", "Animalistic Sense", 4);
    hero.addKeyBind("TENTACLES", "Lizard Transformation", 5);

    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
	hero.setTierOverride(getTierOverride);
    hero.addAttributeProfile("INACTIVE", inactiveProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
}

function giantModeKey(player, manager) {
    var flag = player.getData("fiskheroes:dyn/giant_mode");
    manager.setData(player, "fiskheroes:dyn/giant_mode", !flag);
    manager.setData(player, "fiskheroes:size_state", flag ? -1 : 1);
    return true;
}

function inactiveProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 4.0, 0);
    profile.addAttribute("PUNCH_DAMAGE", 4.5, 0);
}

function getProfile(entity) {
	if (entity.getData("fiskheroes:dyn/giant_mode_timer") < 1 ) {
        return "INACTIVE";
    }
    return null;
}

function getTierOverride(entity) {
    return entity.getData("fiskheroes:dyn/giant_mode") ? 7 : 0;
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:leaping":
        return modifier.id() == "springboard" == (entity.getData("fiskheroes:ticks_since_swinging") < 5) && entity.getData("fiskheroes:dyn/giant_mode");
	case "fiskheroes:water_breathing":
        return entity.getData("fiskheroes:dyn/giant_mode");
	case "fiskheroes:wall_crawling":
        return entity.getData("fiskheroes:dyn/giant_mode");
	case "fiskheroes:potion_immunity":
        return entity.getData("fiskheroes:dyn/giant_mode");
	case "fiskheroes:arrow_catching":
        return entity.getData("fiskheroes:dyn/giant_mode");
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "func_GIANT_MODE":
        var timer = entity.getData("fiskheroes:dyn/giant_mode_timer");
        return timer == 0 || timer == 1;
    case "TENTACLES":
        return keyBind == "TENTACLES" || entity.getData("fiskheroes:tentacles") != null;
    case "SLOW_MOTION":
        return entity.getData("fiskheroes:scale") > 1.0 && entity.getData("fiskheroes:size_state") == 0;
    case "GROUND_SMASH":
        return entity.getData("fiskheroes:scale") > 1.0 && entity.getData("fiskheroes:size_state") == 0;
    default:
        return true;
    }
}