function p.get_ment_has_health(inst_id)
    local ment_type = ga_ment_get_type(inst_id)
    return ga_ment_var_exists(ment_type, "health")
end

function p.init_maybe(inst_id)
    local max_health_curved = ga_ment_get_i(inst_id, "health_max_curved")
    if( max_health_curved == -1 ) then
        --Need to init.
        local ment_type = ga_ment_get_type(inst_id)
        local uncurved_max_health = ga_ment_get_static_i(ment_type, "health")
        local max_health_curved = game_difficulty_curve.curve_enemy_health(uncurved_max_health)
        local health_curved = max_health_curved
        ga_ment_set_i(inst_id, "health_max_curved", max_health_curved)
        ga_ment_set_i(inst_id, "health_curved", health_curved)
    end
end

--Returns the curved value
--if curving is in effect.
function p.get_ment_health(inst_id)
    if( ga_get_b("xar.difficulty.curve.enabled") ) then
        p.init_maybe(inst_id)
        return ga_ment_get_i(inst_id, "health_curved")
    else
        return ga_ment_get_i(inst_id, "health")
    end
end

--Sets the curved value
--if curving is in effect.
function p.set_ment_health(inst_id, amount)
    if( ga_get_b("xar.difficulty.curve.enabled") ) then
        p.init_maybe(inst_id)
        ga_ment_set_i(inst_id, "health_curved", amount)
    else
        ga_ment_set_i(inst_id, "health", amount)
    end

    if( amount <= 0 ) then
        game_kill_count.add_frag()
    end
end

--Returns the curved value
--if curving is in effect.
function p.get_ment_max_health(inst_id)
    if( ga_get_b("xar.difficulty.curve.enabled") ) then
        p.init_maybe(inst_id)
        return ga_ment_get_i(inst_id, "health_max_curved")
    else
        local ment_type = ga_ment_get_type(inst_id)
        return ga_ment_get_static_i(ment_type, "health")
    end
end
